WO2017107415A1 - 应用加载方法和装置 - Google Patents
应用加载方法和装置 Download PDFInfo
- Publication number
- WO2017107415A1 WO2017107415A1 PCT/CN2016/086217 CN2016086217W WO2017107415A1 WO 2017107415 A1 WO2017107415 A1 WO 2017107415A1 CN 2016086217 W CN2016086217 W CN 2016086217W WO 2017107415 A1 WO2017107415 A1 WO 2017107415A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data segment
- memory
- address
- storage space
- application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
- G06F12/0246—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/54—Link editing before load time
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44557—Code layout in executable memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
- G06F9/44578—Preparing or optimising for loading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/17—Embedded application
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/20—Employing a main memory using a specific memory technology
- G06F2212/202—Non-volatile memory
- G06F2212/2022—Flash memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/72—Details relating to flash memory management
- G06F2212/7211—Wear leveling
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present application relates to the field of computers, and in particular to an application field, and in particular, to an application loading method and apparatus.
- the usual way is to store the binary code of the executable file in flash memory and run the instruction directly on the flash memory.
- the symbols in the application's assembly code need to be relocated so that the symbols have absolute addresses to load the application.
- each relocation of the symbol corresponds to an erasing operation of the entire memory block of the memory in which the symbol is located, thereby greatly increasing system overhead and increasing the loss of the flash memory.
- the present application provides an application loading method and apparatus for solving the technical problems existing in the above background art.
- the application provides an application loading method, which includes: selecting, in a programmable read-only memory, a storage space for storing a preset data segment in an executable file of an application, where the preset data segment is an application.
- the preset data segment is an application.
- the preset data segment is copied to the memory, and the preset data segment is relocated based on the starting address of the storage space; the relocated pre- Copy the data segment to the storage space to load the application.
- the application provides an application loading device, the device includes: a selecting unit configured to select, in a programmable read only memory, a storage space for storing a preset data segment in an executable file of the application, where The preset data segment is a data segment that is loaded in the programmable read-only memory when the application is loaded; the relocation unit is configured to copy the preset data segment to the memory, and based on the starting address of the storage space The data segment is relocated; the loading unit is configured to copy the relocated preset data segment to the storage space to load the application.
- the application loading method and apparatus provided by the present application selects, by using a programmable read-only memory, a storage space for storing preset data segments in an executable file of an application; copying the preset data segment to the memory, and based on the storage space
- the starting address relocates the preset data segment; the relocated preset data segment is copied to the storage space.
- the relocation reduces the overhead of the application's loading process and reduces the loss to the programmable read-only memory.
- FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;
- FIG. 2 shows a flow chart of one embodiment of an application loading method in accordance with the present application
- FIG. 3 shows an exemplary schematic diagram of loading an application in the embodiment
- FIG. 4 shows an exemplary flowchart of an application loading method in the present application
- Figure 5 is a block diagram showing the structure of an embodiment of an application loading device according to the present application.
- FIG. 6 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server of an embodiment of the present application.
- FIG. 1 illustrates an exemplary system architecture 100 in which an application loading method or application loading device of the present application may be applied.
- system architecture 100 can include terminal devices 101, 102, 103, network 104, and server 105.
- the network 104 is used to provide a medium for the transmission link between the terminal devices 101, 102, 103 and the server 105.
- Network 104 may include various types of connections, such as wired, wireless transmission links, or fiber optic cables, to name a few.
- the user can interact with the server 105 over the network 104 using the terminal devices 101, 102, 103 to receive or transmit messages and the like.
- Various communication applications such as network security applications, instant communication tools, and the like, can be installed on the terminal devices 101, 102, and 103.
- the terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting network communication, including but not limited to smart phones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic The video specialist compresses the standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV) player, laptop portable computer and desktop computer, and the like.
- MP3 players Motion Picture Experts Group Audio Layer III, dynamic The video specialist compresses the standard audio layer 3
- MP4 Moving Picture Experts Group Audio Layer IV
- the server 105 may be a server that provides various services, such as a server that provides data support for applications on the terminal devices 101, 102, 103.
- the server 105 can receive the query request sent by the terminal device 101, 102, 103 and process the query request.
- the processing result (relocation information of the executable file of the application) is fed back to the terminal device.
- terminal devices, networks, and servers in Figure 1 is merely illustrative. Depending on the implementation needs, there can be any number of terminal devices, networks, and servers.
- FIG. 2 illustrates a flow 200 of one embodiment of an application loading method in accordance with the present application.
- the application loading method provided by this embodiment can be performed by the terminal devices 101, 102, and 103 in FIG.
- the method includes the following steps:
- Step 201 Select a storage space for storing a preset data segment in an executable file of the application in the programmable read-only memory.
- the executable file of the application can be stored in a programmable read only memory.
- the executable file contains a plurality of data segments.
- the preset data segment is a data segment that is loaded and executed in the programmable read-only memory.
- a storage space for storing a preset data segment may be selected in the programmable read-only memory, and the storage space is used to store the relocated preset data segment.
- the programmable read only memory is a flash memory.
- the executable file of the application may be stored in the flash memory, and the storage space for storing the relocated preset data segment may be selected in advance in the flash memory.
- Step 202 Copy the preset data segment to the memory, and reposition the preset data segment based on the starting address of the storage space.
- the preset data segment when the application is loaded, the preset data segment may be first copied to the memory, and then the preset data segment may be weighted based on the starting address of the pre-selected storage space in the programmable read-only memory. Positioning, which determines the loading address of the symbol in the preset data segment.
- the assembly instructions jmp exp and exp:push are taken as an example to illustrate the principle of relocation:
- the assembly instruction exp:push indicates that the push instruction corresponding to the symbol exp stores a push instruction, that is, a push instruction.
- the assembly instruction jmp exp functions to jump to the address corresponding to the symbol exp and execute the push instruction at the address.
- the compile address of the symbol exp at compile time is 1000h.
- jmp exp is converted to jmp 1000h.
- the assembly instruction is compiled with the address 0 as the starting address at compile time, and may be loaded at any position during the loading. Therefore, the symbol needs to be relocated to re-determine the assembly instruction.
- the symbol corresponding to the load address also referred to as an absolute address
- the symbol in the assembly instruction, that is, the address corresponding to the exp symbol is modified to the determined load address, thereby executing the instruction.
- the executable file is an ELF file
- the preset data segment includes: a machine instruction data segment, a read-only data data segment; and a preset data segment based on a starting address of the storage space.
- Relocation includes: machine pointing in ELF file Locating the address offset corresponding to the operand of the machine instruction in the machine instruction data segment in the address offset data segment; calculating the load address corresponding to the operand according to the start address and the address offset, to the machine instruction data segment Perform relocation; look up the address offset corresponding to the read-only data in the read-only data segment in the read-only data address offset data segment of the ELF file; calculate the read-only data corresponding to the start address and the address offset Load address to relocate read-only data segments.
- the executable file may be a relocatable file format ELF format file (which may be simply referred to as an ELF file).
- ELF file contains the following data segments: the machine instruction data segment (.text), and the data in the machine instruction data segment is the machine code of the compiled application.
- Read-only data data segment (.rodata) the data in the read-only data segment is read-only data.
- the global variable data segment (.data) has been initialized, and the data in the initialized global variable data segment is the initialized global variable.
- the global variable data segment (.bss) is not initialized.
- the executable file of the application is an ELF file
- the application when the application is loaded, that is, when the ELF file of the application is loaded, the machine instruction data segment (.text) and the read-only data segment (.rodata) in the ELF file are loaded. It can be loaded into flash memory, and the initialized global variable data segment (.data) and uninitialized global variable data segment (.bss) in the ELF file can be loaded in memory.
- the machine instruction data segment (.text) and the read-only data data segment (.rodata) may be collectively referred to as a code portion.
- the initialized global variable data segment (.data) and the uninitialized global variable data segment (.bss) can be collectively referred to as a data portion (data).
- the method further includes: copying the uninitialized global variable data segment and the initialized global variable data segment in the ELF file to the memory;
- the stored value in the storage space corresponding to the uninitialized global variable data segment is set to 0; the address offset corresponding to the initialized global variable in the initialized global variable data segment is found from the initialized global variable address offset data segment of the ELF file.
- the amount of shifting based on the starting address of the initialized global variable in memory and the address offset, calculate the load address of the initialized global variable to relocate the initialized global variable data segment.
- the code portion of the ELF file can be relocated in the following manner: first, in the flash memory, the code portion, ie, the machine instruction data segment (.text) and the read-only data segment. (.rodata) allocates the storage space of the size of the storage space occupied by the code portion (code), and records the starting address of the storage space. Then, a memory space equal to the size of the above-mentioned storage space is allocated in the memory, and the machine instruction data segment (.text) and the read-only data data segment (.rodata) are copied into the memory.
- the address offset corresponding to the read-only data of the read-only data segment can be looked up from the read-only data address offset data segment (.rel.rodata).
- the load address corresponding to the read-only data is calculated according to the start address and the address offset, thereby relocating the read-only data segment.
- the data portion (data) in the ELF file can be relocated in the following manner: the initialized global variable data segment (.data) and the uninitialized global variable data segment (.bss) are allocated in the memory.
- the storage space of the size of the storage space occupied by the two data segments, and the initialized global variable data segment (.data) and the uninitialized global variable data segment (.bss) are copied into the allocated memory.
- the values in the memory space in the memory occupied by the uninitialized global variable data segment (.bss) are all initialized to zero.
- Step 203 Copy the relocated preset data segment to the storage space to load the application.
- the relocated preset data segment may be copied back to the pre-programmable only Reading memory (for example, flash memory) for storing the relocated preset data segment, so that the relocated preset data segment is loaded on the programmable read only memory, and at the same time, the memory can be
- the initialized global variable data segment (.data) and the uninitialized global variable data segment (.bss) are relocated and loaded, thereby completing the loading of the application.
- the method further includes: storing a starting address of the storage space in the programmable read-only memory, so as to When the application is loaded, the relocated initial data segment already stored in the programmable read only memory is searched by the starting address and the preset data segment is loaded.
- the offset and size of each data segment in the ELF file in the ELF file during the relocation process can also be recorded at the same time. Then, the offset, size and relocation of each data segment in the ELF file can be recorded.
- the code portion of the ELF code is stored in the flash memory together with the start address of the ELF file and the name of the ELF file, which may be referred to as a relocation information file.
- the relocation information file is found by the name of the applied ELF file.
- the data portion (data) recorded in the relocation information file that is, the offset and the size of the initialized global variable data segment (.data) and the uninitialized global variable data segment (.bss) in the ELF file, can be directly read. Take the data in the data part (data) of the ELF file, and reload the data part (data) and load it.
- FIG. 3 shows an exemplary schematic diagram of loading an application in this embodiment.
- machine instructions in an ELF file stored in flash memory are shown Data segment (.text), machine instruction address offset data segment (.rel.text), read-only data segment (.rodata), initialized global variable data segment (.data), initialized global variable address offset data Segment (.rel.data), uninitialized global variable data segment (.bss).
- Machine instruction data segment (.text), read-only data segment (.rodata), initialized global variable data segment (.data), uninitialized global variable data segment (.bss) are first copied to memory, and at the same time, in flash memory
- the storage space for storing the machine instruction data segment (.text) and the read-only data segment (.rodata) after relocation is selected.
- the storage space is different from the storage space in the flash memory currently storing the preset data segment, and the storage space functions to store the relocated preset data segment.
- the memory based on the starting address of the storage space, combined with the machine instruction address offset data segment (.rel.text) and the read-only data address offset data segment (.rel.rodata) for the machine instruction data segment ( .text), read-only data segment (.rodata) for relocation, and finally, after one copy, write back to the flash to select the machine instruction data segment (.text) and read-only data segment for relocation. (.rodata) in the storage space.
- the uninitialized global variable data segment .bss is initialized to 0, and the initialized global variable data segment (.data) is relocated in conjunction with the initialized global variable address offset data segment (.rel.data).
- FIG. 4 shows an exemplary flowchart of the application loading method in the present application. Contains the following steps:
- Step 401 The system starts loading the application.
- Step 402 Pre-allocate the storage space of the size of the storage space occupied by the code portion on the flash memory.
- Step 403 Allocate the same amount of memory for the code portion in the memory.
- Step 404 Relocate the code portion in the memory by using the relocation segment and the starting address of the code segment in the pre-allocated storage space in the flash memory.
- the relocation segment includes: a machine instruction address offset data segment, and a read-only data address offset data segment.
- Step 405 Copy the relocated code portion back into the pre-allocated storage space in the flash memory.
- Step 406 Allocate a memory of a required size for the data portion in the memory.
- Step 407 Store the relocation information, the application name, and the address of the relocation code segment on the flash memory in the flash memory, and name it as a relocation information file.
- the relocation information includes: the starting address of the pre-allocated storage space in the flash memory
- the code part of the relocated ELF file can be directly run, and the code part of the ELF is loaded, and the code part of the ELF file does not need to be relocated again.
- the data portion of the ELF file is relocated and loaded, and the application is loaded, thereby reducing the loss of the flash during the loading process of the application and increasing the loading speed of the application.
- the data in the data portion (data) in the ELF file can be directly read according to the offset and size of the data portion recorded in the relocation information file in the ELF file, without reacquiring the auxiliary relocation information, Further increase the loading speed of the application.
- FIG. 5 shows a schematic structural diagram of an embodiment of an application loading device according to the present application.
- the apparatus 500 includes: a selecting unit 501, a relocating unit 502, and a loading unit 503.
- the selecting unit 501 is configured to select, in the programmable read only memory, a storage space for storing a preset data segment in the executable file of the application, wherein the preset data segment is loaded in the programmable only when the application is loaded.
- Reading a data segment executed in the memory is configured to copy the preset data segment to the memory, and relocating the preset data segment based on the starting address of the storage space; the loading unit 503 is configured to use the weight The preset preset data segment is copied to the storage space to load the application.
- the selecting unit 501 may select a storage space for storing a preset data segment in the programmable read-only memory, where the address of the storage space is different from the programmable read-only memory in which the current preset data segment is located.
- the address of the storage space which is used to store the relocated default data segment.
- the relocation unit 502 can copy the preset data segment stored in the programmable read-only memory to the memory, and then can be based on the programmable read-only memory.
- the preset address of the pre-selected storage space relocates the preset data segment, that is, determines the loading address of the symbol in the instruction in the preset data segment and the loading address of the data in the preset data segment.
- the loading unit 503 may copy the relocated preset data segment back into the storage space selected in the programmable read-only memory for storing the relocated preset data segment, thereby The relocated preset data segment is loaded on the programmable read-only memory.
- the initialized global variable data segment and the uninitialized global variable data segment in the memory can be relocated and then loaded, thereby completing the loading of the application. .
- the programmable read only memory is a flash memory.
- the relocation unit 502 includes: a first lookup subunit (not shown) configured to: when the executable file is an ELF file, the preset data segment includes: machine instruction data In the segment, read-only data segment, the address offset corresponding to the operand of the machine instruction in the machine instruction data segment is searched in the machine instruction address offset data segment of the ELF file; the first calculation subunit (not shown) Configuring to calculate a load address corresponding to the operand according to the start address and the address offset to relocate the machine instruction data segment; a second lookup subunit (not shown) configured for use in the ELF file Finding an address offset corresponding to the read-only data in the read-only data segment in the read-only data address offset data segment; a second calculation sub-unit (not shown) configured to be based on the start address and the address offset Calculate the load address corresponding to the read-only data to relocate the read-only data segment.
- a first lookup subunit (not shown) configured to: when the executable file is an ELF file, the preset data segment
- the apparatus 500 further includes: a copy unit (not shown) configured to copy the uninitialized global variable data segment and the initialized global variable data segment in the ELF file to the memory a setting unit (not shown) configured to set a storage value in a storage space corresponding to the uninitialized global variable data segment to 0; an offset searching unit (not shown) configured to be used from the ELF file Initializing a global variable address offset data segment to find an address offset corresponding to the initialized global variable in the initialized global variable data segment; a load address calculation unit (not shown) configured to initialize the global variable data segment The starting address in memory and the address offset, calculate the load address of the initialized global variable to weight the initialized global variable data segment Positioning.
- a copy unit (not shown) configured to copy the uninitialized global variable data segment and the initialized global variable data segment in the ELF file to the memory
- a setting unit (not shown) configured to set a storage value in a storage space corresponding to the uninitialized global variable data segment
- the apparatus 500 further includes: a storage unit (not shown) configured to be programmable read-only after copying the relocated preset data segment to the storage space.
- the start address of the storage space is saved in the memory, so that when the application is loaded again, the relocated initial data segment stored in the programmable read only memory is searched by the starting address and the preset data segment is performed. load.
- FIG. 6 is a block diagram showing the structure of a computer system suitable for implementing a terminal device or a server of an embodiment of the present application.
- computer system 600 includes a central processing unit (CPU) 601 that can be loaded into a program in random access memory (RAM) 603 according to a program stored in read only memory (ROM) 602 or from storage portion 608. And perform various appropriate actions and processes.
- RAM random access memory
- ROM read only memory
- RAM random access memory
- various programs and data required for the operation of the system 600 are also stored.
- the CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
- An input/output (I/O) interface 605 is also coupled to bus 604.
- the following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a storage portion 608 including a hard disk or the like. And a communication portion 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the Internet.
- Driver 610 is also coupled to I/O interface 605 as needed.
- a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like, is mounted on the drive 610 as needed so that a computer program read therefrom is installed into the storage portion 608 as needed.
- an embodiment of the present disclosure includes a computer program product comprising a computer program tangibly embodied on a machine readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
- the computer program can be downloaded and installed from the network via communication portion 609, and/or installed from removable media 611.
- Each block in the flowchart or block diagram may represent a module, a program segment, or a portion of code, the module, the program segment, or a portion of code comprising one or more components for implementing the specified logical functions. Execute the instruction. It should also be noted that in some alternative implementations, the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.
- the present application further provides a non-volatile computer storage medium, which may be a non-volatile computer storage medium included in the apparatus described in the foregoing embodiments; It may be a non-volatile computer storage medium that exists alone and is not assembled into the terminal.
- the non-volatile computer storage medium stores one or more programs, when the one or more programs are executed by a device, causing the device to: select an executable for storing an application in a programmable read-only memory a storage space of the preset data segment in the file, wherein the preset data segment is a data segment that is loaded in the programmable read-only memory when the application is loaded; and the preset data segment is copied to the memory, And relocating the preset data segment based on a starting address of the storage space; copying the relocated first preset data segment to the storage space to load an application.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Description
Claims (12)
- 一种应用加载方法,其特征在于,所述方法包括:在可编程只读存储器中选取用于存储应用的可执行文件中的预设数据段的存储空间,其中,预设数据段为应用被加载时,被加载在所述可编程只读存储器中执行的数据段;将所述预设数据段拷贝至内存,以及基于所述存储空间的起始地址对所述预设数据段进行重定位;将经重定位的所述预设数据段拷贝至所述存储空间,以对应用进行加载。
- 根据权利要求1所述的方法,其特征在于,所述可编程只读存储器为闪存存储器。
- 根据权利要求1-2之一所述的方法,其特征在于,所述可执行文件为ELF文件,所述预设数据段包括:机器指令数据段、只读数据数据段;以及基于所述存储空间的起始地址对所述预设数据段进行重定位包括:在所述ELF文件的机器指令地址偏移数据段中查找机器指令数据段中的机器指令的操作数对应的地址偏移量;根据所述起始地址和所述地址偏移量,计算所述操作数对应的加载地址,以对机器指令数据段进行重定位;在所述ELF文件的只读数据地址偏移数据段中查找只读数据数据段中的只读数据对应的地址偏移量;根据所述起始地址和所述地址偏移量,计算所述只读数据对应的加载地址,以对只读数据数据段进行重定位。
- 根据权利要求3所述的方法,其特征在于,所述方法还包括:将所述ELF文件中的未初始化全局变量数据段和已初始化全局变 量数据段拷贝至内存;将未初始化全局变量数据段对应的存储空间中的存储值设置为0;从所述ELF文件的已初始化全局变量地址偏移数据段中查找出已初始化全局变量数据段中的已初始化全局变量对应的地址偏移量;根据已初始化全局变量数据段在内存中的起始地址以及所述地址偏移量,计算已初始化全局变量的加载地址,以对已初始化全局变量数据段进行重定位。
- 根据权利要求4所述的方法,其特征在于,在将经重定位的所述预设数据段拷贝至所述存储空间之后,所述方法还包括:在可编程只读存储器中存储所述存储空间的起始地址,以使得再次对应用进行加载时,利用所述起始地址查找出已存储在可编程只读存储器中的经重定位的预设数据段并对预设数据段进行加载。
- 一种应用加载装置,其特征在于,所述装置包括:选取单元,配置用于在可编程只读存储器中选取用于存储应用的可执行文件中的预设数据段的存储空间,其中,预设数据段为应用被加载时,被加载在所述可编程只读存储器中执行的数据段;重定位单元,配置用于将所述预设数据段拷贝至内存,以及基于所述存储空间的起始地址对所述预设数据段进行重定位;加载单元,配置用于将经重定位的所述预设数据段拷贝至所述存储空间,以对应用进行加载。
- 根据权利要求6所述的装置,其特征在于,所述可编程只读存储器为闪存存储器。
- 根据权利要求6-7之一所述的装置,其特征在于,所述重定位单元包括:第一查找子单元,配置用于当所述可执行文件为ELF文件,所述 预设数据段包括:机器指令数据段、只读数据数据段时,在所述ELF文件的机器指令地址偏移数据段中查找机器指令数据段中的机器指令的操作数对应的地址偏移量;第一计算子单元,配置用于根据所述起始地址和所述地址偏移量,计算所述操作数对应的加载地址,以对机器指令数据段进行重定位;第二查找子单元,配置用于在所述ELF文件的只读数据地址偏移数据段中查找只读数据数据段中的只读数据对应的地址偏移量;第二计算子单元,配置用于根据所述起始地址和所述地址偏移量,计算所述只读数据对应的加载地址,以对只读数据数据段进行重定位。
- 根据权利要求8所述的装置,其特征在于,所述装置还包括:拷贝单元,配置用于将所述ELF文件中的未初始化全局变量数据段和已初始化全局变量数据段拷贝至内存;设置单元,配置用于将未初始化全局变量数据段对应的存储空间中的存储值设置为0;偏移量查找单元,配置用于从所述ELF文件的已初始化全局变量地址偏移数据段中查找出已初始化全局变量数据段中的已初始化全局变量对应的地址偏移量;加载地址计算单元,配置用于根据已初始化全局变量数据段在内存中的起始地址以及所述地址偏移量,计算已初始化全局变量的加载地址,以对已初始化全局变量数据段进行重定位。
- 根据权利要求9所述的装置,其特征在于,所述装置还包括:存储单元,配置用于在将经重定位的所述预设数据段拷贝至所述存储空间之后,在可编程只读存储器中存储所述存储空间的起始地址,以使得再次对应用进行加载时,利用所述起始地址查找出已存储在可编程只读存储器中的经重定位的预设数据段并对预设数据段进行加载。
- 一种设备,包括:处理器;和存储器,所述存储器中存储有能够被所述处理器执行的计算机可读指令,在所述计算机可读指令被执行时,所述处理器执行应用加载方法,所述方法包括:在可编程只读存储器中选取用于存储应用的可执行文件中的预设数据段的存储空间,其中,预设数据段为应用被加载时,被加载在所述可编程只读存储器中执行的数据段;将所述预设数据段拷贝至内存,以及基于所述存储空间的起始地址对所述预设数据段进行重定位;将经重定位的所述预设数据段拷贝至所述存储空间,以对应用进行加载。
- 一种非易失性计算机存储介质,所述计算机存储介质存储有能够被处理器执行的计算机可读指令,当所述计算机可读指令被处理器执行时,所述处理器执行应用加载方法,所述方法包括:在可编程只读存储器中选取用于存储应用的可执行文件中的预设数据段的存储空间,其中,预设数据段为应用被加载时,被加载在所述可编程只读存储器中执行的数据段;将所述预设数据段拷贝至内存,以及基于所述存储空间的起始地址对所述预设数据段进行重定位;将经重定位的所述预设数据段拷贝至所述存储空间,以对应用进行加载。
Priority Applications (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020177027992A KR101955145B1 (ko) | 2015-12-25 | 2016-06-17 | 애플리케이션 로딩 방법 및 장치 |
| JP2017552148A JP6506412B2 (ja) | 2015-12-25 | 2016-06-17 | アプリケーションロード方法及び装置 |
| US15/564,412 US11086638B2 (en) | 2015-12-25 | 2016-06-17 | Method and apparatus for loading application |
| EP16877228.3A EP3267308B1 (en) | 2015-12-25 | 2016-06-17 | Application loading method and device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510994261.4 | 2015-12-25 | ||
| CN201510994261.4A CN105426223B (zh) | 2015-12-25 | 2015-12-25 | 应用加载方法和装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017107415A1 true WO2017107415A1 (zh) | 2017-06-29 |
Family
ID=55504451
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/086217 Ceased WO2017107415A1 (zh) | 2015-12-25 | 2016-06-17 | 应用加载方法和装置 |
Country Status (6)
| Country | Link |
|---|---|
| US (1) | US11086638B2 (zh) |
| EP (1) | EP3267308B1 (zh) |
| JP (1) | JP6506412B2 (zh) |
| KR (1) | KR101955145B1 (zh) |
| CN (1) | CN105426223B (zh) |
| WO (1) | WO2017107415A1 (zh) |
Families Citing this family (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105426223B (zh) | 2015-12-25 | 2019-01-04 | 百度在线网络技术(北京)有限公司 | 应用加载方法和装置 |
| CN106598674A (zh) * | 2016-12-16 | 2017-04-26 | 中南大学 | 一种基于可重定位elf文件的软件快速加载方法 |
| CN107450960A (zh) * | 2017-09-18 | 2017-12-08 | 珠海亿智电子科技有限公司 | 一种对可执行elf文件重新链接和加载的方法 |
| CN108241516B (zh) * | 2018-02-09 | 2021-06-18 | 深圳科立讯通信有限公司 | 嵌入式系统程序加载方法、装置、计算机设备和存储介质 |
| CN108874468B (zh) * | 2018-06-20 | 2021-03-26 | 深圳市腾讯网络信息技术有限公司 | 应用程序的加载方法、装置、计算机设备及存储介质 |
| CN109901891B (zh) * | 2019-03-19 | 2022-06-14 | 北京智游网安科技有限公司 | 一种elf程序里添加数据的方法、存储介质及智能终端 |
| CN110765027B (zh) * | 2019-12-27 | 2020-04-10 | 中国人民解放军国防科技大学 | 一种pe文件地址定位系统 |
| CN114090099B (zh) * | 2020-08-03 | 2025-11-18 | 北京三六零智领科技有限公司 | 加固elf文件的加载方法、设备、存储介质及装置 |
| CN116097218B (zh) * | 2020-08-03 | 2025-08-22 | 华为技术有限公司 | 应用服务元数据编码和初始化 |
| CN114692213B (zh) * | 2020-12-30 | 2025-09-09 | 深圳Tcl新技术有限公司 | 数据防篡改方法、装置、智能终端及计算机可读存储介质 |
| CN113032737B (zh) * | 2021-03-15 | 2021-11-30 | 清华大学 | 软件的保护方法、装置、电子设备及存储介质 |
| CN113821458B (zh) * | 2021-09-18 | 2023-09-05 | 日立楼宇技术(广州)有限公司 | 一种数据操作方法、装置、计算机设备和存储介质 |
| CN113849245B (zh) * | 2021-09-23 | 2023-09-12 | 武汉深之度科技有限公司 | 一种应用程序运行方法、计算设备及存储介质 |
| CN116107644B (zh) * | 2022-12-08 | 2026-03-31 | 中船凌久电子(武汉)有限责任公司 | 一种基于dsp的实时操作系统启动时间优化方法 |
| CN115934213A (zh) * | 2022-12-28 | 2023-04-07 | 杭州和利时自动化有限公司 | 一种控制器栈调用方法、装置、设备及存储介质 |
| CN117435257B (zh) * | 2023-12-18 | 2024-02-27 | 美智纵横科技有限责任公司 | 系统加载方法及装置、存储介质、计算机程序产品和芯片 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5581768A (en) * | 1995-02-27 | 1996-12-03 | Intel Corporation | Method and apparatus for executing applications in place from write once/seldom memories |
| CN101246427A (zh) * | 2007-02-15 | 2008-08-20 | 凌阳科技股份有限公司 | 应用程序可重定位加载的方法及地址重定位装置 |
| CN101470619A (zh) * | 2007-12-29 | 2009-07-01 | 安凯(广州)软件技术有限公司 | 一种基于微核操作系统的应用程序动态加载方法 |
| CN101661397A (zh) * | 2008-08-29 | 2010-03-03 | 宇龙计算机通信科技(深圳)有限公司 | 实现程序动态加载的方法和生成映射文件的方法及设备 |
| CN103377131A (zh) * | 2012-04-13 | 2013-10-30 | 索尼公司 | 数据处理装置和方法 |
| CN105426223A (zh) * | 2015-12-25 | 2016-03-23 | 百度在线网络技术(北京)有限公司 | 应用加载方法和装置 |
Family Cites Families (20)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5379398A (en) | 1992-04-20 | 1995-01-03 | International Business Machines Corporation | Method and system for concurrent access during backup copying of data |
| JPH103385A (ja) * | 1996-06-18 | 1998-01-06 | Dainippon Printing Co Ltd | Icカード及びアプリケーション・プログラム導入方法 |
| US5923878A (en) * | 1996-11-13 | 1999-07-13 | Sun Microsystems, Inc. | System, method and apparatus of directly executing an architecture-independent binary program |
| US6505297B1 (en) * | 1998-09-09 | 2003-01-07 | Hitachi, Ltd. | IC card terminal device and installation of application program into IC card terminal device |
| JP3976106B2 (ja) * | 1998-09-09 | 2007-09-12 | 株式会社日立製作所 | アプリケーション登録端末システムおよび登録方法 |
| TWI240864B (en) * | 2001-06-13 | 2005-10-01 | Hitachi Ltd | Memory device |
| KR100518584B1 (ko) * | 2003-07-12 | 2005-10-04 | 삼성전자주식회사 | 공유 라이브러리 시스템 및 상기 시스템 구축 방법 |
| US7415703B2 (en) * | 2003-09-25 | 2008-08-19 | International Business Machines Corporation | Loading software on a plurality of processors |
| JP2005284963A (ja) * | 2004-03-30 | 2005-10-13 | Toshiba Corp | プログラムローディング装置およびプログラムローディング方法 |
| JP2006048431A (ja) * | 2004-08-05 | 2006-02-16 | Matsushita Electric Ind Co Ltd | 動的リンクライブラリ処理装置 |
| US7987158B2 (en) * | 2005-02-09 | 2011-07-26 | International Business Machines Corporation | Method, system and article of manufacture for metadata replication and restoration |
| US20060277541A1 (en) * | 2005-06-07 | 2006-12-07 | Sony Computer Entertainment America Inc. | Relocatable component file format |
| CN101484878B (zh) * | 2006-07-18 | 2012-11-28 | 英特尔公司 | 为基于efi的固件中的预efi初始化模块使用全局变量的方法 |
| US8082385B2 (en) * | 2008-05-02 | 2011-12-20 | Sony Corporation | Systematic memory shift for pre-segmented memory |
| CN101277265B (zh) * | 2008-05-07 | 2011-05-04 | 浙江大学 | 一种无线传感网络中加速加载elf文件的方法 |
| CN101697131B (zh) * | 2009-11-04 | 2013-07-03 | 中兴通讯股份有限公司 | 一种可重定位文件动态加载的方法及装置 |
| CN101706725B (zh) * | 2009-11-20 | 2014-03-19 | 中兴通讯股份有限公司 | 一种可重定位程序的加载及调试方法及系统 |
| US20150332043A1 (en) * | 2014-05-15 | 2015-11-19 | Auckland Uniservices Limited | Application analysis system for electronic devices |
| US9974492B1 (en) * | 2015-06-05 | 2018-05-22 | Life365, Inc. | Health monitoring and communications device |
| TWI588742B (zh) * | 2015-07-27 | 2017-06-21 | 晨星半導體股份有限公司 | 應用程式的程式碼載入方法及應用其方法的電腦系統 |
-
2015
- 2015-12-25 CN CN201510994261.4A patent/CN105426223B/zh active Active
-
2016
- 2016-06-17 US US15/564,412 patent/US11086638B2/en not_active Expired - Fee Related
- 2016-06-17 KR KR1020177027992A patent/KR101955145B1/ko not_active Expired - Fee Related
- 2016-06-17 EP EP16877228.3A patent/EP3267308B1/en active Active
- 2016-06-17 WO PCT/CN2016/086217 patent/WO2017107415A1/zh not_active Ceased
- 2016-06-17 JP JP2017552148A patent/JP6506412B2/ja not_active Expired - Fee Related
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5581768A (en) * | 1995-02-27 | 1996-12-03 | Intel Corporation | Method and apparatus for executing applications in place from write once/seldom memories |
| CN101246427A (zh) * | 2007-02-15 | 2008-08-20 | 凌阳科技股份有限公司 | 应用程序可重定位加载的方法及地址重定位装置 |
| CN101470619A (zh) * | 2007-12-29 | 2009-07-01 | 安凯(广州)软件技术有限公司 | 一种基于微核操作系统的应用程序动态加载方法 |
| CN101661397A (zh) * | 2008-08-29 | 2010-03-03 | 宇龙计算机通信科技(深圳)有限公司 | 实现程序动态加载的方法和生成映射文件的方法及设备 |
| CN103377131A (zh) * | 2012-04-13 | 2013-10-30 | 索尼公司 | 数据处理装置和方法 |
| CN105426223A (zh) * | 2015-12-25 | 2016-03-23 | 百度在线网络技术(北京)有限公司 | 应用加载方法和装置 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP3267308A4 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105426223B (zh) | 2019-01-04 |
| CN105426223A (zh) | 2016-03-23 |
| JP2018511132A (ja) | 2018-04-19 |
| US11086638B2 (en) | 2021-08-10 |
| KR20170123337A (ko) | 2017-11-07 |
| EP3267308A1 (en) | 2018-01-10 |
| EP3267308B1 (en) | 2022-07-27 |
| JP6506412B2 (ja) | 2019-04-24 |
| EP3267308A4 (en) | 2018-07-25 |
| KR101955145B1 (ko) | 2019-03-06 |
| US20180329725A1 (en) | 2018-11-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2017107415A1 (zh) | 应用加载方法和装置 | |
| US20140324873A1 (en) | Method, device and recording medium for managing application icon | |
| US20150032690A1 (en) | Virtual synchronization with on-demand data delivery | |
| EP3260993A1 (en) | File operation method and device | |
| US9164919B2 (en) | Method and apparatus for inputting/outputting virtual operating system from removable storage device on a host using virtualization technique | |
| CN105760201A (zh) | 一种嵌入式装置的启动方法和装置 | |
| US20070011674A1 (en) | Computer system and method for selectively installing one operating system among a plurality of operating systems | |
| US20190050423A1 (en) | Integrating virtual machine file system into a native file explorer | |
| CN107646102B (zh) | 引导设备及其操作方法 | |
| US11176089B2 (en) | Systems and methods for implementing dynamic file systems | |
| CN106293963B (zh) | 一种用于windows系统中应用层和驱动层通讯的方法及系统 | |
| US10341852B2 (en) | Informational articles in response to detection of devices or software | |
| CN107402749B (zh) | 实现图片加载库的方法及装置 | |
| US8667485B2 (en) | Method and system for executing a file stored in a hidden storage area of a storage device | |
| JP7522775B2 (ja) | 不揮発性記憶区画識別子 | |
| US8719498B2 (en) | Data storage device and data providing method therein | |
| US7702890B2 (en) | Information processing apparatus and program | |
| CN101944034B (zh) | 文件执行方法及系统 | |
| US20110106861A1 (en) | Interface Techniques Providing Contiguous Storage For Files | |
| CN104461636A (zh) | 一种皮肤资源加载方法及电子设备 | |
| JP2015138272A (ja) | 情報処理装置、情報処理方法、および情報処理プログラム | |
| CN119884031A (zh) | 一种通过文件拷贝的方式迁移Windows系统的方法 | |
| US20090037667A1 (en) | Electronic device data access system and method | |
| US10067945B2 (en) | File and move data to shrink datafiles | |
| HK1247324B (zh) | 实现图片加载库的方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16877228 Country of ref document: EP Kind code of ref document: A1 |
|
| ENP | Entry into the national phase |
Ref document number: 20177027992 Country of ref document: KR Kind code of ref document: A |
|
| ENP | Entry into the national phase |
Ref document number: 2017552148 Country of ref document: JP Kind code of ref document: A |
|
| REEP | Request for entry into the european phase |
Ref document number: 2016877228 Country of ref document: EP |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 15564412 Country of ref document: US |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |