CN113805971B - Application program running method, computing device and storage medium - Google Patents

Application program running method, computing device and storage medium Download PDF

Info

Publication number
CN113805971B
CN113805971B CN202111115278.XA CN202111115278A CN113805971B CN 113805971 B CN113805971 B CN 113805971B CN 202111115278 A CN202111115278 A CN 202111115278A CN 113805971 B CN113805971 B CN 113805971B
Authority
CN
China
Prior art keywords
file
section
module
stack
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
Application number
CN202111115278.XA
Other languages
Chinese (zh)
Other versions
CN113805971A (en
Inventor
钟俊
柏鑫
罗攀登
杨洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Deepin Technology Co ltd
Original Assignee
Wuhan Deepin Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Deepin Technology Co ltd filed Critical Wuhan Deepin Technology Co ltd
Priority to CN202111115278.XA priority Critical patent/CN113805971B/en
Publication of CN113805971A publication Critical patent/CN113805971A/en
Application granted granted Critical
Publication of CN113805971B publication Critical patent/CN113805971B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44557Code 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 stack 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. The invention can insert the module file into the stack section when the module file inserted in the application program needs to use a new data which is related to the thread where the module file is located and needs to be given an initial value.

Description

Application program running method, computing device and storage medium
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 the executable file of the application program, wherein the first storage information comprises first section information of stack sections distributed in the internal memory; generating second section information of the stack 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 of a stack section allocated in the internal memory according to the data size of the executable file, the first section size being larger than the data size of the executable file; generating first section information of the stack section according to a first section size; first storage information is generated from the first section information.
Optionally, in the method according to the present invention, generating the preset section size according to the data size of the executable file and the module file includes the steps of: and adding the data size of the executable file and the file size of the module file to obtain the preset 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 a stack section in the internal memory according to the second storage information; acquiring a stack bottom pointer of the allocated stack section; loading the module file to the stack section according to the stack bottom pointer; calculating the initial position of executable file storage according to the trestle bottom pointer and the module file; and loading the executable file into the internal memory according to the starting position of the executable file storage.
Optionally, in the method according to the present invention, loading the module file into the stack section according to the stack bottom pointer includes the steps of: initializing data of a module file to obtain initialization data of the module file; and storing the initialization data of the module file in a stack section according to the stack bottom pointer.
Optionally, in the method according to the present invention, calculating the start position of the executable file storage according to the stack bottom pointer and the module file comprises the steps of: and subtracting the size of the stack bottom pointer from the size of the module file to obtain the starting position of executable file storage.
Optionally, in the method according to the invention, the building of the functional module in the application comprises the steps of: calculating a starting position of reading the module file according to the stack bottom pointer of the allocated stack section and the module file; and according to the starting position of the reading of the module file, the module file is called, and the functional module is constructed.
Optionally, in the method according to the present invention, calculating the start position of module file reading according to the stack bottom pointer of the allocated stack section and the module file includes the steps of: and subtracting the size of the stack bottom pointer from the size of the module file to obtain the starting position of reading the module file.
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. The first storage information stored in the internal memory by the application program is then determined from the executable file of the application program, the first storage information including first section information of the stack 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. If a module file to be inserted in an application program needs to use new data, which is related to the thread where the module file is located, and is to be given an initial value, new data needs to be inserted into the stack section, because the stack sections of each thread are independent of each other. In order to load the module file into the stack section, the second section information of the stack section needs to be regenerated from the first section information of the stack 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 a stack section 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 invention, the application file 211 is adapted to be compiled, assembled, linked, etc. by the operating system 220 to obtain an executable file of the application program, which is 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 stack section is used for storing the temporarily created local variable in the application program. If the module file 212 to be inserted in the application program needs to be used to a new data, the data is related to the thread where the data is located, and needs to be given an initial value; for example, new data is used to count the number of processing signals per thread, and then a module file needs to be inserted into the stack section because the stack sections of each thread are independent of each other; thus, the initialization of the data to be initialized in the module file 212 can be ensured, the module file 212 is normally loaded, the related data of the thread where the module file 212 is located is called and processed, and the additional function of the application program is 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: a microprocessor (μp), a microcontroller (μc), a 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 suitable for execution in a computing device and is further suitable for execution 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 stack 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. Wherein the stack section stores a temporarily created local variable in the application.
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 of the stack section allocated in the internal memory 230 is determined according to the data size of the executable file. Specifically, the first section size is determined according to the number of local variables in the executable file, i.e. the number of temporarily created global variables in the application program, and the memory space that can be allocated. The first section size needs to be larger than the data size of the executable file in order to reserve memory space for the module file 212.
First section information for initializing the data section is then generated based on the first section size and other information, including a data storage format in the first section, etc.
And generating first storage information according to the first section information, and taking the first section information of the stack section and the section information of other data sections as the first storage information. Other data sections include heap sections, code sections, initialized data sections, and uninitialized data sections.
Subsequently, step S330 is performed to generate second section information of the stack section according to the first section information and the module file 212.
FIG. 4 illustrates a schematic diagram of inserting a module file into a stack section according to an exemplary embodiment of the present invention. As shown in fig. 4, the module file 212 is inserted into the stack section 413, and the section information of the stack section 413 is the first section information calculated according to steps S310 and S320. When the executable file is loaded in the internal memory 230, memory space is reserved for the module file 212. Reserved memory space in the stack section 413, and insertion of the module file 212 in the stack section 413 can be achieved by reserving memory space. The module file 422 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 422.
After inserting the module file 212 into the stack section 413, a stack section 423 in which the executable file is actually stored is obtained, but since the module file 422 is not perceived by the application program, the application program still uses the storage space occupied by the module file 422 and the stack section 423 together as the stack section. The size and the start position of the stack section 423 of the actually stored executable file are changed compared with those of the stack section 413, and when the executable file is stored later, the start position of the stored executable file needs to be recalculated.
When generating the second section information according to the first section information and the module file 212, a preset section size is first generated according to the data size of the executable file and the module file 212. When the preset section size is generated, the data size of the executable file and the file size of the module file 212 are added to obtain the preset section size. So as to judge whether the first section size is larger than the preset section size according to the preset section size. If the first section size is larger than the second section size, the first section size is taken as the second section size. Avoiding insufficient space in stack section 413 when storing module files 212 and executable files, resulting in stack overflow. Second section information is then generated based on the second section size.
If the first segment size is less than or equal to the predetermined segment size, stack overflow may result when storing module files 212 and executable files. At this time, the first section size needs to be recalculated and set so that the first section size is larger than the preset section size, so that the module file 212 and the executable file can be normally stored.
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 stack 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, code sections, initialized data 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 and the module file 212 are loaded into the internal memory 230, the stack section is first allocated in the internal memory according to the second storage information. When the stack section is allocated, the size of the stack section is determined according to the second section size.
As shown in fig. 4, the allocated stack section has a section size of the stack section 413. The stack section 423 actually used to store the initialization file is reduced in size relative to the calculated stack section 413, the reduced storage space being used to store the module file 422. The local variables of the application program that were originally to be stored by stack segment 413 are still stored in stack segment 423.
Then, the bottom pointer of the allocated stack segment is obtained. After the stack section is allocated in the memory, a stack bottom pointer is automatically generated for locating the stack bottom of the stack section.
Then, the module file 212 is loaded to the stack section according to the stack bottom pointer, and the storage area pointed by the stack bottom pointer is used as the starting position of the module file 212. When loading the module file 212, since the module file 212 needs to be initialized, the data of the module file 212 needs to be initialized to obtain the initialized data of the module file 212, and the initialized data of the module file 212 is stored in the stack section according to the stack bottom pointer.
The start location of the executable file store is then calculated from the bottom pointer and the module file 212. When calculating the starting position of the executable file, subtracting the size of the stack bottom pointer from the size of the module file 212 to obtain the starting position of the executable file storage. When the module file 212 is inserted into the stack section, the position of the stack bottom of the stack section is reduced, and the size of the module file 212 needs to be subtracted from the value of the stack bottom pointer to obtain the starting position of executable file storage.
The executable file is then loaded into the internal memory according to the starting location of the executable file store. The module file 212 is loaded first, and then the executable file is loaded, completing the storage of the application data.
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. When the executable file is called, the size of the module file 212 and the data size of the executable file are subtracted according to the stack pointer of the stack section, so that the starting position for reading the executable file is obtained, and the executable file is read.
When the module file 212 is stored in the internal memory, the file size of the module file 212 is also recorded. If the module file 212 is stored with an offset from the register of the internal memory, then an access vector is constructed that includes the offset, the file size, and the bottom pointer. The structure of the access vector is:
< offset, file size, bottom pointer >)
Without an offset, the offset is zero.
When a functional module is built in an application program, a starting position read by the module file 212 is calculated according to a stack bottom pointer of a stack section allocated in the functional module and the module file 212. When the starting position of the module file 212 is calculated, an access vector is obtained, and the stack bottom pointer is subtracted from the size of the module file 212 to obtain the starting position of the module file 212. And then, according to the starting position read by the module file 212, the module file 212 is called to construct a functional module.
If the offset exists, the starting position read by the module file 212 is modified according to the offset, and the modified starting position read by the module file 212 is obtained. And then, according to the read starting position of the modified module file 212, the module file 212 is called to construct a functional module.
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. The first storage information stored in the internal memory by the application program is then determined from the executable file of the application program, the first storage information including first section information of the stack 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. If a module file to be inserted in an application program needs to use new data, which is related to the thread where the module file is located, and is to be given an initial value, new data needs to be inserted into the stack section, because the stack sections of each thread are independent of each other. In order to load the module file into the stack section, the second section information of the stack section needs to be regenerated from the first section information of the stack 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 calculating the starting position of the module file reading according to the stack bottom pointer of the allocated stack section and the module file comprises the following steps:
and subtracting the size of the stack bottom pointer from the size of the module file to obtain the starting position of reading the module file.
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 (7)

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 by an application program in the internal memory according to an executable file of the application program, wherein the first storage information comprises first section information of stack sections distributed in the internal memory;
generating second section information of the stack 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, according to the executable file of the application program, determining the first storage information stored in the internal memory by the application program includes the steps of:
determining a first section size of a stack section allocated in the internal memory according to the data size of the executable file, wherein the first section size is larger than the data size of the executable file;
generating first section information of the stack section according to the first section size;
generating first storage information according to the first section information;
the generating the second section information of the stack section according to the first section information and the module file includes the steps of:
generating a preset section size according to the data size of the executable file and the module file;
judging whether the first section size is larger than the preset section size or not;
if the first section size is larger than the second section size, the first section size is taken as a second section size;
generating second section information according to the second section size;
the step of generating a preset section size according to the data size of the executable file and the module file comprises the following steps:
and adding the data size of the executable file and the file size of the module file to obtain the preset section size.
2. The method of claim 1, 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 a stack section in the internal memory according to the second storage information;
acquiring a stack bottom pointer of the allocated stack section;
loading the module file to the stack section according to the stack bottom pointer;
calculating the initial position of the executable file storage according to the stack bottom pointer and the module file;
and loading the executable file into the internal memory according to the starting position of the executable file storage.
3. The method of claim 2, wherein said loading said module file into said stack segment according to said bottom pointer comprises the steps of:
initializing the data of the module file to obtain the initialized data of the module file;
and storing the initialization data of the module file in the stack section according to the stack bottom pointer.
4. A method as claimed in claim 2 or 3, wherein said calculating a starting position of said executable file storage from said stack bottom pointer and said module file comprises the steps of:
and subtracting the size of the stack bottom pointer from the size of the module file to obtain the starting position of the executable file storage.
5. The method of claim 4, wherein building a functional module in the application comprises the steps of:
calculating the reading starting position of the module file according to the stack bottom pointer of the allocated stack section and the module file;
and according to the starting position of the reading of the module file, the module file is called, and the functional module is constructed.
6. 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-5.
7. 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-5.
CN202111115278.XA 2021-09-23 2021-09-23 Application program running method, computing device and storage medium Active CN113805971B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111115278.XA CN113805971B (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
CN202111115278.XA CN113805971B (en) 2021-09-23 2021-09-23 Application program running method, computing device and storage medium

Publications (2)

Publication Number Publication Date
CN113805971A CN113805971A (en) 2021-12-17
CN113805971B true CN113805971B (en) 2023-10-13

Family

ID=78940295

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111115278.XA Active CN113805971B (en) 2021-09-23 2021-09-23 Application program running method, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN113805971B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821273B (en) * 2021-09-23 2023-10-13 武汉深之度科技有限公司 Application program running method, computing device and storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728106A (en) * 2004-07-26 2006-02-01 中兴通讯股份有限公司 Method for positioning malfunction of application program
CN102855440A (en) * 2012-09-13 2013-01-02 北京奇虎科技有限公司 Method, device and system for detecting packed executable files
CN102929662A (en) * 2012-10-12 2013-02-13 浪潮电子信息产业股份有限公司 Network-based method for partitioning in batch
CN103034484A (en) * 2011-10-10 2013-04-10 微软公司 Runtime type identification of native heap allocations
CN104714824A (en) * 2015-01-09 2015-06-17 青岛海信电器股份有限公司 Starting method of application programs
CN106708554A (en) * 2016-06-29 2017-05-24 腾讯科技(深圳)有限公司 Program running method and device
CN108228077A (en) * 2016-12-14 2018-06-29 阿里巴巴集团控股有限公司 The management method of memory block, operation method, device, equipment, readable medium
CN109154908A (en) * 2016-05-13 2019-01-04 微软技术许可有限责任公司 The part of dynamic size with accurate garbage collection report
CN110035322A (en) * 2018-01-11 2019-07-19 中兴通讯股份有限公司 A kind of method, apparatus and computer readable storage medium of activation system
CN110084042A (en) * 2019-05-11 2019-08-02 肖银皓 A kind of application heap Static Analysis Method and system
CN110244971A (en) * 2019-05-28 2019-09-17 湖北三江航天险峰电子信息有限公司 A kind of On-line Product upgrade-system and method based on multiple load
CN110647451A (en) * 2019-08-30 2020-01-03 深圳壹账通智能科技有限公司 Application program abnormity analysis method and generation method
CN111240720A (en) * 2020-03-27 2020-06-05 武汉光谷信息光电子创新中心有限公司 Boot program upgrading method and device and storage medium
CN111290871A (en) * 2018-12-10 2020-06-16 北京京东尚科信息技术有限公司 Method and device for acquiring crash information of application program
CN111338884A (en) * 2018-12-19 2020-06-26 北京嘀嘀无限科技发展有限公司 Cache miss rate monitoring method and device, electronic equipment and readable storage medium
CN112650692A (en) * 2019-10-12 2021-04-13 北京华为数字技术有限公司 Heap memory allocation method, device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11068393B2 (en) * 2019-10-17 2021-07-20 Microsoft Technology Licensing, Llc Enhanced concurrency garbage collection stack scanning

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728106A (en) * 2004-07-26 2006-02-01 中兴通讯股份有限公司 Method for positioning malfunction of application program
CN103034484A (en) * 2011-10-10 2013-04-10 微软公司 Runtime type identification of native heap allocations
CN102855440A (en) * 2012-09-13 2013-01-02 北京奇虎科技有限公司 Method, device and system for detecting packed executable files
CN102929662A (en) * 2012-10-12 2013-02-13 浪潮电子信息产业股份有限公司 Network-based method for partitioning in batch
CN104714824A (en) * 2015-01-09 2015-06-17 青岛海信电器股份有限公司 Starting method of application programs
CN109154908A (en) * 2016-05-13 2019-01-04 微软技术许可有限责任公司 The part of dynamic size with accurate garbage collection report
CN106708554A (en) * 2016-06-29 2017-05-24 腾讯科技(深圳)有限公司 Program running method and device
CN108228077A (en) * 2016-12-14 2018-06-29 阿里巴巴集团控股有限公司 The management method of memory block, operation method, device, equipment, readable medium
CN110035322A (en) * 2018-01-11 2019-07-19 中兴通讯股份有限公司 A kind of method, apparatus and computer readable storage medium of activation system
CN111290871A (en) * 2018-12-10 2020-06-16 北京京东尚科信息技术有限公司 Method and device for acquiring crash information of application program
CN111338884A (en) * 2018-12-19 2020-06-26 北京嘀嘀无限科技发展有限公司 Cache miss rate monitoring method and device, electronic equipment and readable storage medium
CN110084042A (en) * 2019-05-11 2019-08-02 肖银皓 A kind of application heap Static Analysis Method and system
CN110244971A (en) * 2019-05-28 2019-09-17 湖北三江航天险峰电子信息有限公司 A kind of On-line Product upgrade-system and method based on multiple load
CN110647451A (en) * 2019-08-30 2020-01-03 深圳壹账通智能科技有限公司 Application program abnormity analysis method and generation method
CN112650692A (en) * 2019-10-12 2021-04-13 北京华为数字技术有限公司 Heap memory allocation method, device and storage medium
CN111240720A (en) * 2020-03-27 2020-06-05 武汉光谷信息光电子创新中心有限公司 Boot program upgrading method and device and storage medium

Also Published As

Publication number Publication date
CN113805971A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN112988252B (en) Operating system starting method and computing device
JP2000347872A (en) Method and device for processing exception as regular control flow
CN114691240A (en) Drive hardware configuration information loading method, device and system and computing equipment
CN106462426B (en) Combined computational tasks for a graphics processing unit
CN113157290B (en) Multi-system installation method, computing equipment and storage medium
CN112860473B (en) Method and device for positioning source code during program operation error and computing equipment
CN113805971B (en) Application program running method, computing device and storage medium
CN113821272B (en) Application program running method, computing device and storage medium
CN113238760B (en) Software migration method, device, computing equipment and readable storage medium
US8762976B2 (en) Static extensibility models with dynamic languages and scripts
CN113849245B (en) Application program running method, computing device and storage medium
CN113485712B (en) Kernel clipping method and computing device
CN114003289A (en) Application program running method, computing device and storage medium
CN114780173B (en) Method for loading plug-in application, computing device and storage medium
JP4870956B2 (en) Embedded program generation method, embedded program development system, and information table section
EP0790555A2 (en) Compile apparatus and method
CN113821273B (en) Application program running method, computing device and storage medium
CN113867825B (en) Multi-system operation method, computing equipment and storage medium
US11327758B2 (en) Non-transitory computer-readable recording medium, assembly instruction conversion method and information processing apparatus
US20170357558A1 (en) Apparatus and method to enable a corrected program to take over data used before correction thereof
JP6295914B2 (en) Programmable controller system, its support device, programmable controller
CN111752620A (en) Processing method and loading method of kernel module
CN113031908B (en) Ordered data processing method and computing device
CN114879987A (en) Kernel upgrading and using method, computing device and storage medium
CN114706828A (en) File loading method, computing device and storage medium

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