CN116775155A - Method and device for accessing executable file by application program - Google Patents
Method and device for accessing executable file by application program Download PDFInfo
- Publication number
- CN116775155A CN116775155A CN202310750798.0A CN202310750798A CN116775155A CN 116775155 A CN116775155 A CN 116775155A CN 202310750798 A CN202310750798 A CN 202310750798A CN 116775155 A CN116775155 A CN 116775155A
- Authority
- CN
- China
- Prior art keywords
- function
- interface
- executable file
- class
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 230000006870 function Effects 0.000 claims abstract description 172
- 238000004806 packaging method and process Methods 0.000 claims abstract description 19
- 238000004590 computer program Methods 0.000 claims description 11
- 230000008569 process Effects 0.000 claims description 6
- 238000005538 encapsulation Methods 0.000 claims description 2
- 230000003068 static effect Effects 0.000 abstract description 16
- 238000002054 transplantation Methods 0.000 abstract description 3
- 239000011800 void material Substances 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000007723 transport mechanism Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a method and a device for accessing an executable file by an application program, and relates to the field of application program configuration. The method comprises the following steps: encapsulating function class function information of the same class into 1 function interface, wherein the function class function information comprises interface numbers of the function class functions; packaging all the functional interfaces to form an executable file; when the application program accesses the executable file, the corresponding function interface is called according to the interface number of the function class function which is required to be used. Compared with the executable file containing the static library in the prior art, the executable file is separated from the static library, so that the memory of the executable file is obviously reduced; meanwhile, compared with the function class function required by searching in the static library in the prior art, the method directly calls the function interface according to the interface number, thereby improving the working efficiency and facilitating the transplantation and the interface expansion.
Description
Technical Field
The application relates to the field of application program configuration, in particular to a method and a device for accessing an executable file by an application program.
Background
When embedded development is performed, the application program needs to link some static libraries which are not updated frequently, so that the finally compiled executable file containing the static libraries is too large. Meanwhile, when the application program accesses the executable file, the application program needs to search the static library for the required function class function, and the working efficiency is low.
Disclosure of Invention
Aiming at the defects in the prior art, the application solves the technical problems as follows: after the functions needed to be used in the static library are repackaged, the static library is separated from the application program, so that the memory of executable files is reduced, and the working efficiency of the application program during access is improved.
In order to achieve the above object, the method for accessing an executable file by an application program provided by the present application includes the following steps: encapsulating function class function information of the same class into 1 function interface, wherein the function class function information comprises interface numbers of the function class functions; packaging all the functional interfaces to form an executable file; when the application program accesses the executable file, the corresponding function interface is called according to the interface number of the function class function which is required to be used.
Based on the above technical solution, the specific process of encapsulating the function class function of the same class into 1 function interface includes: storing function class function information of the same class into a designated space of the RAM, and packaging the function class function information into 1 function interface; the function class function information includes a function address, a function class, and an interface number.
Based on the technical scheme, the process of accessing the executable file by the application program comprises the following steps: a path access interface is predefined for providing access to the application program call, and the application program accesses the executable file through the access interface.
The present application provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1 to 3.
The application provides an electronic device comprising a memory and a processor, the memory having stored thereon a computer program running on the processor, the processor implementing the method of any of claims 1 to 3 when executing the computer program.
The device for accessing the executable file by the application program comprises a functional interface packaging module, an executable file creating module and an application program accessing module;
the functional interface packaging module is used for: encapsulating function class function information of the same class into 1 function interface, wherein the function class function information comprises interface numbers of the function class functions;
the executable file creation module is used for: packaging all the functional interfaces to form an executable file;
the application program access module is used for: when the application program accesses the executable file, the corresponding function interface is called according to the interface number of the function class function which is required to be used.
On the basis of the technical scheme, the workflow of the functional interface packaging module comprises the following steps: storing function class function information of the same class into a designated space of the RAM, and packaging the function class function information into 1 function interface; the function class function information includes a function address, a function class, and an interface number.
Based on the technical scheme, the workflow of the application program access module comprises the following steps: defining an interface number of a function class function used according to needs through the access interface when the application program accesses the executable file, and calling a corresponding function interface.
Compared with the prior art, the application has the advantages that:
the executable file comprises a plurality of function interfaces encapsulated with function class function information, and when an application program accesses the executable file, the application program can call the corresponding function interfaces according to the interface numbers, thereby realizing the function of a static library in the prior art. Therefore, compared with the executable file containing the static library in the prior art, the executable file is separated from the static library, so that the memory of the executable file is obviously reduced; meanwhile, compared with the function class function required by searching in the static library in the prior art, the method directly calls the function interface according to the interface number, thereby improving the working efficiency and facilitating the transplantation and the interface expansion.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of the format of function class function information stored in RAM according to an embodiment of the application;
fig. 2 is a connection block diagram of an electronic device in an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
The method for accessing the executable file by the application program in the embodiment of the application comprises the following steps: encapsulating function class function information of the same class into 1 function interface, wherein the function class function information comprises interface numbers of the function class functions; and packaging all the function interfaces to form an executable file, and calling the corresponding function interface according to the interface number of the function class function required to be used when the application program accesses the executable file.
Therefore, the executable file comprises the function interfaces encapsulated with function class function information, and when an application program accesses the executable file, the application program can call the corresponding function interfaces according to the interface numbers, so that the function of a static library in the prior art is realized. Therefore, compared with the executable file containing the static library in the prior art, the executable file is separated from the static library, so that the memory of the executable file is obviously reduced; meanwhile, compared with the function class function required by searching in the static library in the prior art, the method directly calls the function interface according to the interface number, thereby improving the working efficiency and facilitating the transplantation and the interface expansion.
Preferably, the specific process of encapsulating the function class function of the same class into 1 function interface includes: storing function class function information of the same class into a designated space of a RAM (Random Access Memory ), and packaging the function class function information into 1 function interface; referring to fig. 1, the function class function information includes a function address, a function class, an interface number, and several parameters (parameter 1 to parameter n in the figure).
For example: the function is named void api_list (void);
the functional interface is as follows:
the method comprises the steps of (1) assigning a function class of 0x01 to a void api_fun1 (void), assigning an interface number of 0x01 to the function class, and then accessing a function stored in an address interval;
the method comprises the steps of (1) assigning 0x02 to function types, 0x01 to interface numbers, writing 'parameter 1' to parameter para, and accessing functions stored in address intervals.
Preferably, the process of accessing the executable file by the application program in the method comprises the following steps: a path access interface is predefined for providing access to the application program call, and the application program accesses the executable file through the access interface.
The embodiment of the application also provides a storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for accessing the executable file by the application program is realized. The storage medium includes various media capable of storing program codes, such as a usb disk, a removable hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic disk, or an optical disk.
Referring to fig. 2, an embodiment of the present application further provides an electronic device, including a memory and a processor, where the memory stores a computer program running on the processor, and the processor implements a method for accessing an executable file by using the application program when executing the computer program.
The device for accessing the executable file by the application program in the embodiment of the application is characterized in that: the device comprises a functional interface encapsulation module, an executable file creation module and an application program access module;
the functional interface packaging module is used for: encapsulating function class function information of the same class into 1 function interface, wherein the function class function information comprises interface numbers of the function class functions; the specific workflow comprises: storing function class function information of the same class into a designated space of the RAM, and packaging the function class function information into 1 function interface; the function class function information includes a function address, a function class, and an interface number.
The executable file creation module is used for: packaging all the functional interfaces to form an executable file;
the application program access module is used for: defining an interface number of a function class function used according to needs through the access interface when the application program accesses the executable file, and calling a corresponding function interface.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer-readable storage media, which may include computer-readable storage media (or non-transitory media) and communication media (or transitory media).
The term computer-readable storage medium includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer-readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer-readable storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, 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.
By way of example, the computer readable storage medium may be an internal storage unit of the electronic device of the foregoing embodiments, such as a hard disk or a memory of the electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device.
The foregoing is merely a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any person skilled in the art may easily think of various equivalent modifications or substitutions within the technical scope of the embodiment of the present application, and these modifications or substitutions should be covered in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.
Claims (8)
1. A method for an application to access an executable file, the method comprising the steps of: encapsulating function class function information of the same class into 1 function interface, wherein the function class function information comprises interface numbers of the function class functions; packaging all the functional interfaces to form an executable file; when the application program accesses the executable file, the corresponding function interface is called according to the interface number of the function class function which is required to be used.
2. The method for an application program to access an executable file according to claim 1, wherein: the specific process of encapsulating the function class function of the same class into 1 function interface comprises the following steps: storing function class function information of the same class into a designated space of the RAM, and packaging the function class function information into 1 function interface; the function class function information includes a function address, a function class, and an interface number.
3. A method for an application to access an executable file as claimed in claim 1 or 2, wherein: the process of accessing the executable file by the application program comprises the following steps: a path access interface is predefined for providing access to the application program call, and the application program accesses the executable file through the access interface.
4. A storage medium having a computer program stored thereon, characterized by: the computer program, when executed by a processor, implements the method of any of claims 1 to 3.
5. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program that runs on the processor, characterized in that: a processor, when executing a computer program, implements the method of any one of claims 1 to 3.
6. An apparatus for an application to access an executable file, characterized by: the device comprises a functional interface encapsulation module, an executable file creation module and an application program access module;
the functional interface packaging module is used for: encapsulating function class function information of the same class into 1 function interface, wherein the function class function information comprises interface numbers of the function class functions;
the executable file creation module is used for: packaging all the functional interfaces to form an executable file;
the application program access module is used for: when the application program accesses the executable file, the corresponding function interface is called according to the interface number of the function class function which is required to be used.
7. The apparatus for accessing an executable file by an application program as recited in claim 6, wherein: the workflow of the functional interface packaging module comprises: storing function class function information of the same class into a designated space of the RAM, and packaging the function class function information into 1 function interface; the function class function information includes a function address, a function class, and an interface number.
8. An apparatus for an application to access an executable file as claimed in claim 6 or 7, wherein: the workflow of the application program access module comprises the following steps: defining an interface number of a function class function used according to needs through the access interface when the application program accesses the executable file, and calling a corresponding function interface.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310750798.0A CN116775155A (en) | 2023-06-21 | 2023-06-21 | Method and device for accessing executable file by application program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310750798.0A CN116775155A (en) | 2023-06-21 | 2023-06-21 | Method and device for accessing executable file by application program |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116775155A true CN116775155A (en) | 2023-09-19 |
Family
ID=87989126
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310750798.0A Pending CN116775155A (en) | 2023-06-21 | 2023-06-21 | Method and device for accessing executable file by application program |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116775155A (en) |
-
2023
- 2023-06-21 CN CN202310750798.0A patent/CN116775155A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111723079A (en) | Data migration method and device, computer equipment and storage medium | |
CN105760199B (en) | A kind of application resource loading method and its equipment | |
CN108717374B (en) | Method and device for preheating during starting of Java virtual machine and computer equipment | |
CN109710286B (en) | System upgrading method, device, equipment and storage medium | |
CN110032568B (en) | Data structure reading and updating method and device, and electronic equipment | |
CN108228077B (en) | Storage area management method, operation method, device, equipment and readable medium | |
WO2018006721A1 (en) | Method and apparatus for storing log file | |
CN111625225A (en) | Program specified data output method and device | |
CN113190325A (en) | Container creation method and device | |
CN110716845A (en) | Method for reading log information of Android system | |
CN113221048A (en) | Page jump method, device, computer equipment and storage medium | |
CN115357940A (en) | Data processing method and device, storage medium and electronic equipment | |
CN101827158A (en) | Method and system for uniformly processing picture resources in cellphone | |
CN116680014B (en) | Data processing method and device | |
CN110968333A (en) | Configuration information replacement method and device, machine-readable storage medium and processor | |
CN116775155A (en) | Method and device for accessing executable file by application program | |
CN111367577A (en) | Method, device and terminal for loading plug-in of application | |
CN113835748B (en) | Packaging method, system and readable medium for application program based on HTML5 | |
CN111488282B (en) | Service function processing method and device, electronic equipment and storage medium | |
CN114064323A (en) | Resource sharing method, terminal, and computer-readable medium | |
CN114217710A (en) | Bullet frame control method, device, storage medium and system | |
CN111061699B (en) | Method and device for updating version of electric energy meter database | |
CN108415814B (en) | Method for automatically recording field change, application server and computer readable storage medium | |
CN112463042A (en) | Data volume import data verification method, device, terminal and storage medium | |
CN116700841B (en) | Method and device for calling native API (application program interface) |
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 |