CN113821273B - Application program running method, computing device and storage medium - Google Patents
Application program running method, computing device and storage medium Download PDFInfo
- Publication number
- CN113821273B CN113821273B CN202111117069.9A CN202111117069A CN113821273B CN 113821273 B CN113821273 B CN 113821273B CN 202111117069 A CN202111117069 A CN 202111117069A CN 113821273 B CN113821273 B CN 113821273B
- Authority
- CN
- China
- Prior art keywords
- section
- information
- file
- module
- application program
- 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.)
- Active
Links
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
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
-
- 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
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
The invention discloses an application program running method, a computing device and a storage medium, wherein the application program running method is suitable for being executed in the computing device and comprises the following steps: generating an executable file of the application program according to the application file; determining first storage information stored in an internal memory by an application program according to an executable file of the application program; generating second section information of the initialization data section according to the first section information and the module file; generating second storage information according to the second section information and the first storage information; loading the executable file and the module file of the application program into an internal memory according to the second storage information; and running the application program according to the executable file and the module file in the internal memory, and constructing the functional module in the application program. The present invention can insert the module file into the initialization data section when the module file inserted in the application program needs to be used to a new data, which needs to be given an initial value.
Description
Technical Field
The present invention relates to the field of operating systems, and in particular, to an application program running method, a computing device, and a storage medium.
Background
With the continued development of computer technology, more and more applications are being developed. Accordingly, more and more data are applied, and the data structure is more and more complex. In the process of using an application program, it is sometimes necessary to implement additional functions on the basis of the application program, or to know the running condition of the application, etc.
In the prior art, when an application program is loaded, a binary file is obtained through some column operations such as compiling, and the binary file cannot be processed. Therefore, additional functions to be implemented in an application must be compiled again after the required functions are added to the source code of the application, which has not yet been compiled. This approach is not only complex but is not suitable for special scenarios, such as when there is no source code file or no source code modification is possible, the addition of additional functionality in the application cannot be achieved.
For this reason, a new application running method is required.
Disclosure of Invention
To this end, the present invention provides an application running method in an effort to solve or at least alleviate the above-presented problems.
According to one aspect of the present invention, there is provided an application program running method adapted to be executed in a computing device including an internal memory and an external memory, the external memory storing an application file and a module file, the method comprising the steps of: generating an executable file of the application program according to the application file; determining first storage information stored in an internal memory by the application program according to an executable file of the application program, wherein the first storage information comprises first section information of an initialization data section distributed in the internal memory; generating second section information of the initialization data section according to the first section information and the module file; generating second storage information according to the second section information and the first storage information; loading the executable file and the module file of the application program into an internal memory according to the second storage information; and running the application program according to the executable file and the module file in the internal memory, and constructing a functional module in the application program to realize the additional function of the application program.
Optionally, in the method according to the present invention, determining the first stored information stored in the internal memory of the application program according to the executable file of the application program comprises the steps of: determining a first section size and first alignment information of an initialization data section allocated in an internal memory according to an executable file; generating first section information of the initialization data section according to the first section size and the first alignment information; first storage information is generated from the first section information.
Optionally, in the method according to the present invention, generating the second section information from the first section information and the module file includes the steps of: generating a second section size according to the first section size and the module file; generating second alignment information according to the first alignment information and the module file; generating preset section information of the initialization data section according to the second section size and the second alignment information; determining whether the module file is stored across page boundaries when stored in the internal memory according to the generated preset section information; and if the module file is not stored across the page boundary, taking the preset section information as second section information.
Optionally, in the method according to the present invention, if the module file is stored across a page boundary, adding a space occupying section before the storage location of the module file, so that the module file is not stored across the page boundary; and generating second section information according to the added occupied section and preset section information.
Optionally, in the method according to the present invention, generating the second section size from the first section size and the module file comprises the steps of: and adding the first section size and the file size of the module file to obtain a second section size.
Optionally, in the method according to the present invention, generating the second section size from the first section size and the module file comprises the steps of: and adding the first section size and the file size of the module file to obtain a second section size.
Optionally, in the method according to the present invention, loading the executable file and the module file of the application program into the internal memory according to the second storage information includes the steps of: allocating an initialization data section in the internal memory according to the second storage information; loading the executable file into the internal memory according to the second storage information; and loading the module file into the initialization data section according to the second section information of the initialization data section of the second storage information.
Optionally, in the method according to the invention, allocating the initialization data section in the internal memory according to the second stored information comprises the steps of: determining a starting address of the module file storage according to the second storage information; and adding an initialization identifier at the starting address stored in the module file so as to insert the module file according to the initialization identifier.
Optionally, in the method according to the present invention, adding an initialization identifier at a start position of the module file storage includes the steps of: constructing a data address table, wherein the data address table comprises data address rows; and adding a memory page head address of an internal memory storage module file, a start bit address stored in the module file and a section type in a data address row, wherein the section type is an initialized data section.
Optionally, in the method according to the present invention, the computing device further includes a processor, and loading the executable file into the internal memory according to the second storage information includes the steps of: when the processor generates page fault due to the fact that the initialization data section does not store relevant data, the initialization data of the executable file is written into the initialization data section.
Optionally, in the method according to the present invention, loading the module file into the initialization data section according to the second section information of the initialization data section of the second storage information includes the steps of: inquiring whether a data address row comprising the memory page head address exists in a data address table according to the memory page head address stored in the internal memory by the module file; if the data address line comprising the memory page head address is queried, determining the section type of the data address line; if the section type is the initialization data section, initializing the data of the module file to obtain initialization data of the module file; and storing the initialization data of the module file in an initialization data section according to the initial address stored by the module file.
Optionally, in the method according to the present invention, storing the initialization data of the module file in the initialization data section comprises the steps of: determining a module alignment mode according to a second alignment mode of the second section information; and storing the initialization data of the module file in the initialization data section according to the module alignment mode.
Optionally, in the method according to the present invention, storing the initialization data of the module file in the initialization data section comprises the steps of: determining a module alignment mode according to a second alignment mode of the second section information; and storing the initialization data of the module file in the initialization data section according to the module alignment mode.
According to another aspect of the present invention, there is provided a computing device comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing an application program execution method according to the present invention.
According to yet another aspect of the present invention, there is provided a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform a method of an application program execution method according to the present invention.
The application program running method is suitable for being executed in a computing device, and the computing device comprises an external memory and an internal memory, wherein the external memory stores application files and module files. Firstly, generating an executable file of an application program according to an application file, and when the application program is loaded, processing the application file in an external memory to obtain the executable file of a binary type file, wherein the executable file can be stored in an internal memory. Then, first storage information stored in the internal memory by the application program is determined based on the executable file of the application program, the first storage information including first section information of the initialization data section allocated in the internal memory. When an executable file of an application program is loaded in the internal memory, a plurality of sections are divided in the internal memory, and corresponding data of the executable file is loaded in each section. One of the sections of the internal memory is an initialization data section, and if a module file to be inserted in an application program needs to use a new data, which needs to be given an initial value, the new data needs to be inserted into the initialization data section. In order to load the module file into the initialization data section, the second section information of the initialization data section needs to be regenerated from the first section information of the initialization data section and the module file. And generating second storage information according to the second section information and the first storage information so as to load the executable file and the module file of the application program into the internal memory according to the second storage information. After the executable file and the module file of the application program are loaded into the internal memory together, the functional module can be built in the application program to realize the additional functions of the application program.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which set forth the various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to fall within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Like reference numerals generally refer to like parts or elements throughout the present disclosure.
FIG. 1 illustrates a schematic diagram of the structure of an external memory and an internal memory according to an exemplary embodiment of the present invention;
FIG. 2 illustrates a block diagram of a computing device 200 according to an exemplary embodiment of the invention;
FIG. 3 illustrates a flow diagram of an application running method 300 according to an exemplary embodiment of the invention;
FIG. 4 illustrates a schematic diagram of inserting a module file into an initialization data segment in accordance with one exemplary embodiment of the present invention;
fig. 5 illustrates a flowchart of generating second section information according to an exemplary embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art. Like reference numerals generally refer to like parts or elements.
Fig. 1 illustrates a schematic structure of an external memory and an internal memory according to an exemplary embodiment of the present invention. As shown in FIG. 1, computing device 200 includes internal memory 230 and external memory 210, and is running an operating system 220. The invention is not limited in the nature of the operating system 220. The external memory 210 stores therein an application file 211 and a module file 212. The manner in which the external memory 210 stores the application files 211 and the module files 212 shown in fig. 1 is merely exemplary, and the present invention does not limit the number of application files and module files stored in the external memory 210.
The application file 211 may be implemented as an application file of any kind of application program, and the kind of application program and the type of application file are not limited in the present invention. According to one embodiment of the present invention, the application file 211 is compiled, assembled, linked, etc. by the operating system 220 to obtain an executable file of the application program, and finally loaded into the internal memory 230.
The module file 212 may be implemented as a module file of any kind of function module, and the function module may implement additional functions of an application program, and the present invention is not limited to the file type of the module file 212 and the kind of the additional functions of the implemented application program. The module file 212 may be an uncompiled file that is processed in advance when loaded into the internal memory 230, resulting in an executable file of the functional module that may be loaded into the internal memory 230. The module file 212 may also be implemented as a binary type file that is convenient to load directly into the corresponding location in the internal memory 230.
The module file 212 is previously constructed by a developer, and in order to implement additional functions in the application program, the module file 212 needs to be loaded into the internal memory 230, and in particular, needs to be stored in the internal memory 230 at a corresponding location where an executable file of the application program is stored. After the module file 212 is deployed to the corresponding position, the module file 212 is transparent to the application program, the application program does not sense and use the module file 212, and the operating system 220 directly calls the module file 212 to construct a function module, so that the additional function of the application program is realized.
When storing an executable file of an application, the internal memory 230 allocates memory space for the executable file. The memory space allocated by the internal memory 230 includes a plurality of different memory segments, and the executable files are stored in the internal memory 230 in the form of the memory segments. The internal memory 230 divides the storage space into memory sections including a heap section, a stack section, an initialized data section, and an uninitialized data section. The memory segment is divided in the internal memory 230 according to the first memory information by determining the first memory information according to the file information of the application executable file when the operating system creates the process.
The initialized data section is used for storing initialized global variables in the application program, and is static memory allocation. If the module file to be inserted into the application program needs to be used for a new data, and the data needs to be given an initial value, the module file needs to be inserted into the initialization data section, so that the data to be initialized in the module file can be initialized, the module file can be normally loaded, and the additional function of the application program can be realized.
The specific structure of computing device 200 in fig. 1 is shown in fig. 2. FIG. 2 illustrates a block diagram of a computing device 200 according to an exemplary embodiment of the invention. As shown in FIG. 2, in a basic configuration 202, computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between the processor 204 and the system memory 206.
Depending on the desired configuration, the processor 204 may be any type of processing including, but not limited to: microprocessor (μp), microcontroller (μc), digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache, such as a level one cache 271 and a level two cache 272, a processor core 214, and registers 216. The example processor core 214 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 218 may be used with the processor 204, or in some implementations, the memory controller 218 may be an internal part of the processor 204.
Depending on the desired configuration, system memory 206 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 206 may include an operating system 220, one or more programs 222, and program data 228. In some implementations, the program 222 may be arranged to execute instructions 223 of the method 300 according to the present invention on an operating system by the one or more processors 204 using the program data 228.
Computing device 200 may also include a storage interface bus 234. Storage interface bus 234 enables communication from storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to base configuration 202 via bus/interface controller 273. At least a portion of operating system 220, programs 222, and data 224 may be stored on removable storage 236 and/or non-removable storage 238, and when the program 222 is powered up or is to be executed by the computing device 200, loaded into the system memory 206 via storage interface bus 234 and executed by the one or more processors 204.
Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to basic configuration 202 via a bus/interface controller 273. The example output device 242 includes a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communications with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 258. The example communication device 246 may include a network controller 260 that may be arranged to communicate with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
The network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media in a modulated data signal, such as a carrier wave or other transport mechanism. A "modulated data signal" may be a signal that has one or more of its data set or changed in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or special purpose network, and wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In computing device 200 according to the present invention, program 222 includes program instructions of application execution method 300 that may instruct processor 204 to perform some of the steps of application execution method 300 that are executed in computing device 200 according to the present invention, so that portions of computing device 200 execute the application by executing application execution method 300 according to the present invention.
Computing device 200 may be implemented as a server, such as a file server, database, server, application server, etc., such as a Personal Digital Assistant (PDA), wireless web-watch device, application-specific device, or a hybrid device that may include any of the above functions. May be implemented as a personal computer including desktop and notebook computer configurations, and in some embodiments, computing device 200 is configured to apply method 300.
Fig. 3 shows a flow diagram of an application running method 300 according to an exemplary embodiment of the invention. The application running method 300 of the present invention is executed in a computing device and is further adapted to be executed in a computing device 200 as shown in fig. 1. As shown in fig. 3, the instruction execution method 300 starts with step S310, and an executable file of an application program is generated according to the application file 211.
The application file 211 stored in the external memory 210 cannot be directly loaded into the internal memory 230 without being preprocessed. According to one embodiment of the invention, application file 211 requires steps such as compiling, assembling, and linking it by operating system 220 to obtain an executable file for the application program. The steps and methods by which the operating system 220 pre-processes the application file 211 are not limited by the present invention.
Subsequently, step S320 is performed to determine, according to the executable file of the application program, first storage information stored in the internal memory 230 by the application program, the first storage information including first section information of the initialization data section allocated in the internal memory 230.
The first storage information stored in the internal memory 230 by the application program includes section information of a plurality of memory sections. The divided memory sections in the internal memory 230 include a heap section, a stack section, a code section, an initialized data section, and an uninitialized data section. The memory segment is divided in the internal memory 230 according to the first memory information by the operating system 220 when creating a process, which determines the first memory information according to the file information of the application executable file. The initialization data section stores initialized initialization data in the executable file, including initialized global variables in the application program.
When determining the first storage information stored in the internal memory 230 by the application program according to the executable file of the application program, the first section size and the first alignment information of the initialization data section allocated in the internal memory 230 are determined according to the executable file. Specifically, determining the size of a first section according to initialization data in an executable file, namely how many initialized global variables exist in an application program; the application alignment of the executable file stored in the internal memory 230 is then determined as the first alignment information based on the processor's pointing pattern decision. The first alignment information indicates from which alignment boundary the start address of the initialization data segment should start (e.g., 2, 4, 8, 32 byte alignment, etc.) it determines the start position of the initialization data segment, and is specifically determined by the instruction of the processor.
First section information of the initialization data section is then generated according to the first section size and the first alignment information, the first section information including the first section size and the first alignment information.
And generating first storage information according to the first section information, and taking the first section information of the initialized data section and the section information of other data sections as the first storage information. Other data sections include heap sections, stack sections, code sections, and uninitialized data sections.
Subsequently, step S330 is performed to generate second section information of the initialization data section according to the first section information and the module file 212.
Fig. 4 illustrates a schematic diagram of inserting a module file into an initialization data section according to an exemplary embodiment of the present invention. As shown in fig. 4, the module file 415 is inserted into the initialization data section 416, and the section information of the initialization data section 416 is the first section information calculated according to steps S310 and S320. When loading the executable file in the internal memory 230, the storage space required for storing the executable file is increased; specifically, memory space is reserved for module file 415 in initialization data field 416. The insertion of the module file 415 in the initialization data segment 416 can be achieved by adding reserved storage space, which is not itself in the storage space required for storing the executable file. The module file 415 is the same as the module file 212 in fig. 1, but if the module file 212 cannot be directly stored in the internal memory 230, the module file 212 needs to be preprocessed to obtain the module file 415.
After inserting the module file 415 into the initialization data section 416, an initialization data section 426 is obtained. Initialization data segment 426 changes in size and starting position from initialization data segment 416, and the segment information of initialization data segment 426 needs to be recalculated to obtain the second segment information.
Fig. 5 illustrates a flowchart of generating second section information according to an exemplary embodiment of the present invention. As shown in fig. 5, first section information is acquired, a second section size is generated according to the first section size and the module file 212, and when the second section size is generated, the first section size and the file size of the module file 212 are added to obtain the second section size.
Next, second alignment information is generated according to the first alignment information and the module file 212, wherein the first alignment information includes an application alignment manner, and the application alignment manner refers to which alignment boundary the start address of the initialization data section should start, and determines the start position of the initialization data section. When generating the second alignment information, the module alignment is generated according to the application alignment, from which alignment boundary the initialization data segment starts, and from which alignment boundary the module file 212 starts, so as to ensure that the module alignment of the module file 212 in the internal memory 230 is the same as the application alignment of the executable file in the internal memory 230.
According to one embodiment of the invention, the initialization data segments are aligned in 32-bit bytes, and then the module file 212 is also aligned in 32-bit bytes.
And then generating second alignment information according to the application alignment mode and the module alignment mode. The second alignment information includes an application alignment mode and a module alignment mode.
And generating preset section information of the initialization data section according to the second section size and the second alignment information. The preset section information includes a second section size and second alignment information.
Then, whether the module file is stored across page boundaries or not is determined when the module file is stored in the internal memory according to the generated preset section information. The internal memory uses a memory paging mechanism when storing data, and stores the data in a memory page mode. And if the module file is not stored across the page boundary, taking the preset section information as second section information. If the module file is stored across the page boundary, the occupied section is added before the storage position of the module file, so that the module file is not stored across the page boundary, and the processor can conveniently read and process transparent data from the internal memory. And finally generating second section information according to the added occupied section and preset section information. And storing the module file after the occupied zone, and then re-determining the second zone size and second alignment information according to the size of the occupied zone, and generating second zone information according to the modified second zone size and second alignment information.
Subsequently, step S340 is performed to generate second storage information from the second section information and the first storage information. And when the second storage information is generated, combining the second section information of the initialized data section with the section information of other data sections in the first storage information to obtain the second storage information. Other data sections include heap sections, stack sections, code sections, and uninitialized data sections.
Subsequently, step S350 is performed to load the executable file of the application program and the module file 212 into the internal memory 230 according to the second storage information. When the executable file of the application program and the module file 212 are loaded into the internal memory 230, the initialization data section is first allocated in the internal memory according to the second storage information.
When the initialization data section is allocated, the size of the initialization data section is determined according to the size of the second section, and the memory page head address for storing the initialization data section, the starting address for storing the module file in the memory page where the initialization data section is located and the starting address for storing the application file are determined according to the second alignment information.
As shown in fig. 4, the allocated initialization data segment 426 is increased in size relative to the calculated initialization data segment 416, and the increased reserved memory space is used for storing the module file 415. Initialization data for the application to be stored by the original initialization data section 416 is still stored in the initialization data section 426.
Then, an initialization flag is added to the start address stored in the module file, so that the module file is inserted according to the initialization flag. When the initialization identifier is added, a data address table is constructed, and the data address table stores one or more data address rows. The data address table is used for determining whether the data needs to be initialized and retrieving the initial position of the initialized data storage so as to store the initialized data in the corresponding initial position.
And then adding the memory page head address of the internal memory storage module file, the initial bit address stored by the module file and the section type in the data address row, wherein the section type is an initialized data section. And judging whether the initialization of the data is needed in the memory page according to whether the memory page head address and the section type of the data address line storage module file exist. If the data is initialized, the initialization data is stored according to the initial bit address stored in the module file.
Also included in the computing device is a processor (not shown in fig. 1). The processor reads and processes data from the internal memory. When the data section is allocated, only the section for data storage is allocated, the initialization identification of the module file is set, and the storage of the application file and the module file is not completed. The processor accesses and acquires the module file and the application file according to the starting address stored in the module file and the starting address stored in the application file. The processor checks whether the corresponding file is stored in the corresponding position according to the storage address of the file, the corresponding file has actual memory, and if the corresponding file is not stored in the corresponding position, the page fault abnormality can be thrown out.
The step of loading the executable file into the internal memory according to the second storage information includes the step of writing the initialization data of the executable file into the initialization data section when the processor generates a page fault due to the fact that the initialization data section does not store the relevant data. When an executable file of the application program is generated, initializing data which is needed to be initialized by the application program to obtain initialization data in the executable file.
And then, when the module file is loaded into the initialized data section according to the second section information of the initialized data section of the second storage information, firstly, inquiring whether a data address row comprising the memory page head address exists in a data address table according to the memory page head address stored in the internal memory of the module file. One or more rows of data addresses are stored in the data address table. And if the data address line comprising the memory header address is queried, determining the sector type of the data address line so as to determine whether the data initialization operation is required.
If the section type is the initialization data section, initializing the data of the module file to obtain the initialization data of the module file, and storing the initialization data of the module file in the initialization data section according to the initial address stored by the module file, thereby realizing the insertion of the module file into the application program. When the initialization data of the module file 212 is loaded into the initialization data section, a module alignment mode is determined according to the second alignment mode of the second section information, and the module file 212 is stored in the initialization data section according to the module alignment mode.
According to one embodiment of the present invention, the module alignment is such that when aligned in 32-bit bytes, module file 212 is stored in initialization data section 425 with the 32-bit bytes as alignment boundaries.
Finally, step S360 is executed to run the application program according to the executable file and the module file 212 in the internal memory 230, and construct a function module in the application program to implement the additional functions of the application program. Included in internal memory 230 are executable files and module files 212 that can be directly called for execution, which can be directly called by operating system 220 to run applications. And, the operating system 220 retrieves the module file according to the calculated starting position of the module file 212 stored in the initialization data section, and constructs a function module to realize the additional function of the application program.
The application program running method is suitable for being executed in a computing device, and the computing device comprises an external memory and an internal memory, wherein the external memory stores application files and module files. Firstly, generating an executable file of an application program according to an application file, and when the application program is loaded, processing the application file in an external memory to obtain the executable file of a binary type file, wherein the executable file can be stored in an internal memory. Then, first storage information stored in the internal memory by the application program is determined based on the executable file of the application program, the first storage information including first section information of the initialization data section allocated in the internal memory. When an executable file of an application program is loaded in the internal memory, a plurality of sections are divided in the internal memory, and corresponding data of the executable file is loaded in each section. One of the sections of the internal memory is an initialization data section, and if a module file to be inserted in an application program needs to use a new data, which needs to be given an initial value, the new data needs to be inserted into the initialization data section. In order to load the module file into the initialization data section, the second section information of the initialization data section needs to be regenerated from the first section information of the initialization data section and the module file. And generating second storage information according to the second section information and the first storage information so as to load the executable file and the module file of the application program into the internal memory according to the second storage information. After the executable file and the module file of the application program are loaded into the internal memory together, the functional module can be built in the application program to realize the additional functions of the application program.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
A9, the method of A8, wherein the step of adding an initialization identifier at the starting position of the module file storage comprises the steps of:
constructing a data address table, wherein the data address table comprises data address rows;
and adding the memory page head address of the internal memory for storing the module file, the starting bit address of the module file storage and a section type in the data address row, wherein the section type is an initialized data section.
A10, the method of any of A7-A9, wherein the computing device further comprises a processor therein, the loading the executable file into the internal memory according to the second stored information comprising the steps of:
when the processor generates a page fault abnormality because the initialization data section does not store related data, the initialization data of the executable file is written into the initialization data section.
A11, the method of a10, wherein the loading the module file into the initialization data section according to the second section information of the initialization data section of the second storage information includes the steps of:
inquiring whether a data address row comprising the memory page head address exists in the data address table according to the memory page head address stored in the internal memory by the module file;
if a data address row comprising the memory page head address is queried, determining the section type of the data address row;
if the section type is an initialization data section, initializing the data of the module file to obtain initialization data of the module file;
and storing the initialization data of the module file in the initialization data section according to the starting address stored by the module file.
A12, the method of A11, wherein storing the initialization data of the module file in the initialization data section comprises the steps of:
determining a module alignment mode according to a second alignment mode of the second section information;
and storing the initialization data of the module file in the initialization data section according to the module alignment mode.
A13, the method of a12, wherein building a functional module in the application program includes the steps of:
and according to the initial position of the module file stored in the initialization data section, retrieving the module file to construct the functional module.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or groups of devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or groups of embodiments may be combined into one module or unit or group, and furthermore they may be divided into a plurality of sub-modules or sub-units or groups. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element. Furthermore, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is for carrying out the functions performed by the elements for carrying out the objects of the invention.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the application running method of the present invention according to instructions in said program code stored in the memory.
By way of example, and not limitation, computer readable media comprise computer storage media and communication media. Computer-readable media include computer storage media and communication media. Computer storage media stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of computer readable media.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.
Claims (8)
1. An application running method adapted to be executed in a computing device comprising an internal memory and an external memory, the external memory having stored therein application files and module files, the method comprising the steps of:
generating an executable file of the application program according to the application file;
determining first storage information stored in the internal memory by the application program according to the executable file of the application program, wherein the first storage information comprises first section information of an initialization data section distributed in the internal memory;
generating second section information of the initialization data section according to the first section information and the module file;
generating second storage information according to the second section information and the first storage information;
loading executable files and module files of the application program into the internal memory according to the second storage information;
running the application program according to the executable file and the module file in the internal memory, and constructing a function module in the application program to realize the additional function of the application program;
wherein the generating the second section information of the initialization data section according to the first section information and the module file includes the steps of:
Generating a second section size according to the first section size and the module file;
generating second alignment information according to the first alignment information and the module file;
generating preset section information of the initialization data section according to the second section size and second alignment information;
determining whether the module file is stored across page boundaries when the module file is stored in the internal memory according to the generated preset section information;
if the module file is not stored across the page boundary, the preset section information is used as second section information;
the method further comprises the steps of:
if the module file is stored across the page boundary, adding a space occupying section before the storage position of the module file, so that the module file is not stored across the page boundary;
and generating second section information according to the added occupied section and the preset section information.
2. The method of claim 1, wherein the determining the first storage information stored in the internal memory by the application program according to the executable file of the application program comprises the steps of:
determining a first section size and first alignment information of an initialization data section allocated in the internal memory according to the executable file;
Generating first section information of the initialization data section according to the first section size and first alignment information;
and generating first storage information according to the first section information.
3. The method of claim 1, wherein the generating a second section size from the first section size and the module file comprises the steps of:
and adding the first section size and the file size of the module file to obtain the second section size.
4. The method of claim 3, wherein the first alignment information includes an application alignment, and the generating the second alignment information according to the first alignment information and the module file includes the steps of:
generating a module alignment mode according to the application alignment mode;
and generating second alignment information according to the application alignment mode and the module alignment mode to ensure that the module alignment mode of the module file in the internal memory is the same as the application alignment mode of the executable file in the internal memory.
5. The method of claim 4, wherein the loading the executable file and the module file of the application program into the internal memory according to the second storage information comprises the steps of:
Allocating an initialization data section in the internal memory according to the second storage information;
loading the executable file into the internal memory according to the second storage information;
and loading the module file into the initialization data section according to second section information of the initialization data section of the second storage information.
6. The method of claim 5, wherein said allocating an initialization data segment in said internal memory according to said second stored information comprises the steps of:
determining a starting address of the module file storage according to the second storage information;
and adding an initialization identifier at the starting address stored in the module file so as to insert the module file according to the initialization identifier.
7. A computing device, comprising:
one or more processors;
a memory; and
one or more apparatuses comprising instructions for performing the method of any of claims 1-6.
8. A computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computing device, cause the computing device to perform the method of any of claims 1-6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111117069.9A CN113821273B (en) | 2021-09-23 | 2021-09-23 | Application program running method, computing device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111117069.9A CN113821273B (en) | 2021-09-23 | 2021-09-23 | Application program running method, computing device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113821273A CN113821273A (en) | 2021-12-21 |
| CN113821273B true CN113821273B (en) | 2023-10-13 |
Family
ID=78920994
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111117069.9A Active CN113821273B (en) | 2021-09-23 | 2021-09-23 | Application program running method, computing device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113821273B (en) |
Citations (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1329309A (en) * | 2000-06-13 | 2002-01-02 | 微软公司 | Multi-languages user interface for operating system |
| CN101452402A (en) * | 2008-11-28 | 2009-06-10 | 珠海金山软件股份有限公司 | Software operation system and software operation method |
| CN103473059A (en) * | 2013-09-11 | 2013-12-25 | 江苏中科梦兰电子科技有限公司 | General purpose operating system capable of supporting multiple system structures |
| CN103677937A (en) * | 2013-12-23 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Method and device for upgrading and running software |
| CN104572224A (en) * | 2015-02-04 | 2015-04-29 | 南车株洲电力机车研究所有限公司 | Method, device and system for loading out file |
| CN105005491A (en) * | 2015-08-11 | 2015-10-28 | 上海斐讯数据通信技术有限公司 | Linux kernel and application program upgrading method and system |
| CN105068832A (en) * | 2015-07-30 | 2015-11-18 | 北京奇虎科技有限公司 | Method and apparatus for generating executable file |
| US9974492B1 (en) * | 2015-06-05 | 2018-05-22 | Life365, Inc. | Health monitoring and communications device |
| CN110069459A (en) * | 2019-03-14 | 2019-07-30 | 北京字节跳动网络技术有限公司 | File monitor method, apparatus and electronic equipment |
| CN110457870A (en) * | 2019-08-01 | 2019-11-15 | 浙江大华技术股份有限公司 | Processing method and processing device, embedded device and the storage medium of executable file |
| CN111290952A (en) * | 2020-01-22 | 2020-06-16 | 北京深之度科技有限公司 | Tracking method and device for dynamic link library function |
| CN111930467A (en) * | 2020-07-02 | 2020-11-13 | 联想(北京)有限公司 | Virtual machine starting method, device, equipment and computer readable storage medium |
| CN113377370A (en) * | 2021-05-18 | 2021-09-10 | 龙芯中科(西安)科技有限公司 | File processing method and device, electronic equipment and storage medium |
| CN113805971A (en) * | 2021-09-23 | 2021-12-17 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
| CN113821272A (en) * | 2021-09-23 | 2021-12-21 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
| CN113849245A (en) * | 2021-09-23 | 2021-12-28 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
| CN114003289A (en) * | 2021-11-02 | 2022-02-01 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10185513B1 (en) * | 2015-06-05 | 2019-01-22 | Life365, Inc. | Device configured for dynamic software change |
-
2021
- 2021-09-23 CN CN202111117069.9A patent/CN113821273B/en active Active
Patent Citations (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1329309A (en) * | 2000-06-13 | 2002-01-02 | 微软公司 | Multi-languages user interface for operating system |
| CN101452402A (en) * | 2008-11-28 | 2009-06-10 | 珠海金山软件股份有限公司 | Software operation system and software operation method |
| CN103473059A (en) * | 2013-09-11 | 2013-12-25 | 江苏中科梦兰电子科技有限公司 | General purpose operating system capable of supporting multiple system structures |
| CN103677937A (en) * | 2013-12-23 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Method and device for upgrading and running software |
| CN104572224A (en) * | 2015-02-04 | 2015-04-29 | 南车株洲电力机车研究所有限公司 | Method, device and system for loading out file |
| US9974492B1 (en) * | 2015-06-05 | 2018-05-22 | Life365, Inc. | Health monitoring and communications device |
| CN105068832A (en) * | 2015-07-30 | 2015-11-18 | 北京奇虎科技有限公司 | Method and apparatus for generating executable file |
| CN105005491A (en) * | 2015-08-11 | 2015-10-28 | 上海斐讯数据通信技术有限公司 | Linux kernel and application program upgrading method and system |
| CN110069459A (en) * | 2019-03-14 | 2019-07-30 | 北京字节跳动网络技术有限公司 | File monitor method, apparatus and electronic equipment |
| CN110457870A (en) * | 2019-08-01 | 2019-11-15 | 浙江大华技术股份有限公司 | Processing method and processing device, embedded device and the storage medium of executable file |
| CN111290952A (en) * | 2020-01-22 | 2020-06-16 | 北京深之度科技有限公司 | Tracking method and device for dynamic link library function |
| CN111930467A (en) * | 2020-07-02 | 2020-11-13 | 联想(北京)有限公司 | Virtual machine starting method, device, equipment and computer readable storage medium |
| CN113377370A (en) * | 2021-05-18 | 2021-09-10 | 龙芯中科(西安)科技有限公司 | File processing method and device, electronic equipment and storage medium |
| CN113805971A (en) * | 2021-09-23 | 2021-12-17 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
| CN113821272A (en) * | 2021-09-23 | 2021-12-21 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
| CN113849245A (en) * | 2021-09-23 | 2021-12-28 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
| CN114003289A (en) * | 2021-11-02 | 2022-02-01 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
Non-Patent Citations (2)
| Title |
|---|
| "C语言多模块文件的处理";高永惠;《湖南科技学院学报》;第141-142页 * |
| "Enabling efficient reprogramming through reduction of executable modules in networked embedded systems";Wei Dong等;《Ad Hoc Networks》;全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113821273A (en) | 2021-12-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102722387B (en) | Dynamic patching method and device | |
| JP2005032259A (en) | Shared library system and system construction method | |
| CN112860473B (en) | Method, device and computing device for locating source code when program runs incorrectly | |
| CN114003289B (en) | Application program running method, computing device and storage medium | |
| CN114610337B (en) | A multi-system installation method, computing device and storage medium | |
| CN114780173A (en) | Method for loading plug-in application, computing equipment and storage medium | |
| US8762976B2 (en) | Static extensibility models with dynamic languages and scripts | |
| CN113849245B (en) | Application program running method, computing device and storage medium | |
| CN113821273B (en) | Application program running method, computing device and storage medium | |
| CN113805971B (en) | Application program running method, computing device and storage medium | |
| CN113821272B (en) | Application program running method, computing device and storage medium | |
| CN111752620B (en) | Processing method and loading method of kernel module | |
| CN114217904A (en) | A multi-version application running method, computing device and storage medium | |
| JPH10254709A (en) | Method for indexing memory address | |
| CN101256499A (en) | Method and system for downloading target file | |
| CN107480479B (en) | Application program reinforcement method and device, computing device, and computer storage medium | |
| CN114706828A (en) | A file loading method, computing device and storage medium | |
| CN114003281B (en) | A method for executing instructions based on hash values, computing equipment and storage medium | |
| CN114003285B (en) | Instruction execution method, computing device and storage medium | |
| CN113835927B (en) | Instruction execution method, computing device and storage medium | |
| CN119536843B (en) | Method and device for self-moving decompression of linked script of hong Mongolian system | |
| JP5195690B2 (en) | Information processing apparatus, ROM image generation apparatus for the apparatus, and transfer apparatus | |
| CN114168489B (en) | Function information acquisition method, computing device and storage medium | |
| JP2006113935A (en) | Dynamic link library call code generation method, program, and apparatus | |
| JP6103972B2 (en) | Program generation method, program execution method, program execution device, and program execution program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |