CN115756663A - Method, system, device, medium and chip for initializing program module - Google Patents
Method, system, device, medium and chip for initializing program module Download PDFInfo
- Publication number
- CN115756663A CN115756663A CN202211626692.1A CN202211626692A CN115756663A CN 115756663 A CN115756663 A CN 115756663A CN 202211626692 A CN202211626692 A CN 202211626692A CN 115756663 A CN115756663 A CN 115756663A
- Authority
- CN
- China
- Prior art keywords
- module
- program
- software
- program module
- started
- 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
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses an initialization method, a system, equipment, a medium and a chip of a program module, wherein the initialization method comprises the following steps: acquiring a plurality of program modules to be initialized; the control program module is mounted during compiling; flattening the mounted program modules to obtain a plurality of corresponding module flattened catalogs; and integrating each program module required by the software through a module flattening directory in the software to be started according to a preset integration rule. The invention advances the step of mounting the program module to the compiling stage, carries out flattening processing on the mounted program module, accesses the related program in a soft link mode when the software is started, can save the maintenance cost of the source code, can shorten the time for mounting the program module, improves the efficiency of initializing the program module and further accelerates the software starting speed.
Description
Technical Field
The present invention relates to the field of program module initialization technologies, and in particular, to a method, a system, a device, a medium, and a chip for initializing a program module.
Background
Common core components such as program modules based on a file system, sdk (a software development suite) and the like need to be mounted and activated when a device is started, and then the common core components can be used by the system. For example, in order to solve the fragmentation problem, google introduces mainline (a module) which is published in an APEX (a compressed format, which is a publishing mode of the mainline module and contains a file system image to be mounted) format, and adds a daemon process of APEX to complete the mounting of the program module. Currently, the android system usually executes the mount of program modules based on a file system in a manner of creating a loop (ring device) when software is started.
However, due to hardware and other reasons, it usually takes 50 milliseconds to complete the mounting of an APEX module, currently, 25 APEX modules exist in an android platform, and the number of the APEX modules increases with the iteration of versions, and the above-mentioned manner of performing mounting by creating a loop may cause a problem that the initialization of a program module takes a long time, and further, the startup time of a related product may be affected.
Disclosure of Invention
The invention provides a method, a system, equipment, a medium and a chip for initializing a program module, aiming at overcoming the defect that the time consumed for initializing the program module is long because the mounting of the program module is executed in a loop creating mode in the prior art.
The invention solves the technical problems through the following technical scheme:
the invention provides an initialization method of a program module, which comprises the following steps:
acquiring a plurality of program modules to be initialized;
controlling the program module to be mounted during compiling;
flattening the mounted program modules to obtain a plurality of corresponding module flattened catalogs;
and integrating each program module required by the software through the module flattening directory in the software to be started according to a preset integration rule.
Preferably, the step of integrating, according to a preset integration rule, each of the program modules required by the software to be started through the module flattened directory includes:
acquiring a plurality of target program modules required by the software according to the preset integration rule;
and copying the module flattening directory of each target program module into a software directory.
Preferably, according to the preset integration rule, after the step of integrating each program module required by the software to be started through the module flat directory, the method further includes:
and packaging and downloading the software to be started.
Preferably, the step of packaging and downloading the software to be started further includes:
and starting the software to be started, and linking the program module through the module flat directory in the starting process so as to finish the initialization of the program module.
Preferably, the initialization method further includes:
creating a daemon process;
initializing the program module in the daemon process.
Preferably, the program module is in APEX format.
The present invention also provides an initialization system of a program module, the initialization system including:
the device comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring a plurality of program modules to be initialized;
the mounting control module is used for controlling the program module to be mounted during compiling;
the flattening processing module is used for flattening the mounted program module to obtain a plurality of corresponding module flattening catalogues;
and the integration module is used for integrating all the program modules required by the software through the module flat directory in the software to be started according to a preset integration rule.
Preferably, the flattening processing module is further configured to:
acquiring a plurality of target program modules required by the software according to the preset integration rule;
and copying the module flattening directory of each target program module into a software directory.
Preferably, the initialization system further comprises:
and the packaging and downloading module is used for packaging and downloading the software to be started.
Preferably, the initialization system further comprises:
and the starting module is used for starting the software to be started, and linking the program module through the module flat directory in the starting process so as to finish the initialization of the program module.
Preferably, the initialization system further comprises:
the process creation module is used for creating a daemon process; the daemon process is used for initializing the program module.
Preferably, the program module is in APEX format.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and configured to run on the processor, wherein the processor implements the initialization method of the program module when executing the computer program.
The invention also provides a chip applied to the electronic equipment, and the chip is used for executing the initialization method of the program module.
The invention also provides a chip module which is applied to the electronic equipment and comprises a transceiving component and a chip, wherein the chip is used for executing the initialization method of the program module.
The invention also provides a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method for initializing the program module described above.
On the basis of the common knowledge in the field, the preferred conditions can be combined randomly to obtain the preferred embodiments of the invention.
The positive progress effects of the invention are as follows: by advancing the step of mounting the program module to the compiling stage, flattening the mounted program module and accessing the related program in a soft link mode when the software is started, the maintenance cost of the source code can be saved, the mounting time of the program module can be shortened, the initialization efficiency of the program module is improved, and the software starting speed is accelerated.
Drawings
Fig. 1 is a flowchart of an initialization method of a program module according to embodiment 1 of the present invention.
Fig. 2 is a flowchart of a prior art program module initialization.
Fig. 3 is a detailed flowchart of the method for initializing the program module according to embodiment 1 of the present invention.
Fig. 4 is a first block diagram of an initialization system of program modules according to embodiment 2 of the present invention.
Fig. 5 is a second block diagram of the initialization system of the program module according to embodiment 2 of the present invention.
Fig. 6 is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
The present embodiment provides an initialization method of a program module, referring to fig. 1, the initialization method includes:
s1, acquiring a plurality of program modules to be initialized;
s2, controlling the program module to mount during compiling;
s3, flattening the mounted program modules to obtain a plurality of corresponding module flattened catalogs;
and S4, integrating all program modules required by the software through a module flattening directory in the software to be started according to a preset integration rule.
Specifically, step S1 obtains program modules required for starting up each software on a device such as a mobile phone when the device is powered on; step S2, controlling the program module to be mounted on a Host (compiling manager); s3, performing flatting treatment on the mounted program module to obtain a corresponding module flat directory, wherein the flatting treatment refers to that the file in the file system format is mounted and then the sub-file or the library file in the file system format is extracted, for example, the file in the APEX format is subjected to the flatting treatment to obtain flatting APEX, and the sub-file and the library file are arranged into the flat directory to be stored in a source code path; and S4, integrating the required program modules in each piece of software to be started according to a preset integration rule, wherein the preset integration rule comprises the program modules depended on when each piece of software is started.
After the steps are completed, when the software is started, the initialization of each program module can be completed only by completing the link through the module flat directory, so that the corresponding program module can access the relevant program, and the software can be ensured to be compatible with the program in the form of a file system.
For the program modules which are issued by three parties and packaged into a file system format, the mode is used for preprocessing preferentially during software integration, namely mounting is executed during compiling, and program modules in APEX (advanced extensible exchange) and other formats are integrated after being flattened, so that the program can be directly upgraded along with the three parties, source codes are not required to be maintained, and the maintenance cost is saved.
According to the scheme, the link of mounting the program module is executed in advance when compiling is carried out, and the initialization of the program module is directly completed in a linking mode when software is started, so that the time for creating a loop and executing mounting can be saved, the efficiency of initializing the program module is improved, and the time consumed by starting related software and equipment is further saved.
In an implementation scenario, step S4 includes:
acquiring a plurality of target program modules required by software according to a preset integration rule;
and copying the module flattening directory of each target program module into the software directory.
Specifically, when software is started, a plurality of object program modules need to be relied on, the module flat directories corresponding to the object program modules are copied to any paths capable of being identified by a compiling system in the software directories, and then the contents of the mounted program modules can be integrated into the corresponding software versions.
In the scheme, the program module is subjected to flattening processing, corresponding soft connection is carried out when software is started, related programs can be normally accessed, the program can be directly upgraded by following three parties, source codes do not need to be maintained, the maintenance cost of the program module in the software can be saved, and the initialization efficiency of the program module can be improved.
In an implementation scenario, step S4 is further followed by:
and packaging and downloading the software to be started.
According to the scheme, the software to be started is packaged and downloaded, so that the software can be started smoothly, and the normal startup of related equipment is ensured.
In an implementation scheme, the step of packaging and downloading the software to be started further includes:
starting the software to be started, and linking the program module through the module flat directory in the starting process so as to finish the initialization of the program module.
In the scheme, the initialization of the program module is completed in a soft link mode, so that the maintenance cost of the related program can be saved, and the time consumption for the initialization of the program module can be saved.
In one practical implementation, the initialization method further includes:
creating a daemon process;
initialization of the program module is performed in the daemon process.
In the scheme, the stability of the initialization method of the program module can be ensured by creating the daemon process, sequentially completing the steps of mounting each program module in the daemon process and the like.
In one implementable approach, the program modules are in the APEX format.
The following describes, in a specific implementation manner, an implementation process of the initialization method for the program module provided in this embodiment:
referring to fig. 2, in the conventional scheme, for a program module based on a file system, such as an APEX module, software is directly integrated through a daemon process, and the steps of packaging and downloading are sequentially completed; when the software boots, the related program modules are activated and mounted by creating a loop so as to complete the initialization of the program modules. The time consumption of the method is mainly in the steps of loop creation, mounting and the like.
Referring to fig. 3, for a program module based on a file system, mount is first performed by Host (compilation manager) at compilation time; then, performing flattening processing, copying the mounted content to a source code path, and generating the above module flattened directory, such as a vendor/flatten _ program/("a source code path example, where" a "is a program module name); integrating corresponding program modules in each software in a mode of copying the module flat directory into the software directory according to preset integration rules; after the preprocessing is completed, packaging and downloading the software; when the software is started, the relevant program can be called through the soft link, and the initialization of the program module is completed.
According to the method for initializing the program module, the step of mounting the program module is advanced to the compiling stage, the mounted program module is subjected to flattening processing, and the related program is accessed in a soft link mode when the software is started, so that the maintenance cost of a source code can be saved, meanwhile, the mounting time of the program module can be shortened, the efficiency of initializing the program module is improved, and the software starting speed is accelerated.
Example 2
The present embodiment provides an initialization system of a program module, referring to fig. 4, the initialization system includes:
the system comprises an acquisition module 1, a storage module and a control module, wherein the acquisition module is used for acquiring a plurality of program modules to be initialized;
the mounting control module 2 is used for controlling the program module to be mounted during compiling;
the flattening processing module 3 is used for flattening the mounted program modules to obtain a plurality of corresponding module flattening catalogs;
and the integration module 4 is used for integrating all program modules required by the software through a module flattening directory in the software to be started according to a preset integration rule.
According to the scheme, the link of mounting the program module is executed in advance when compiling is carried out, initialization of the program module is directly completed in a link mode when software is started, the time for creating a loop and executing mounting can be saved, the efficiency of initializing the program module is improved, and further the starting time of relevant software and equipment is saved.
In an implementable aspect, the flattening processing module 3 is further configured to:
acquiring a plurality of target program modules required by software according to a preset integration rule;
and copying the module flattening directory of each target program module into the software directory.
In the scheme, the program module is subjected to flattening processing, corresponding soft connection is carried out when software is started, related programs can be normally accessed, the program can be directly upgraded by following three parties, source codes do not need to be maintained, the maintenance cost of the program module in the software can be saved, and the initialization efficiency of the program module can be improved.
In one implementable aspect, referring to fig. 5, initializing the system further comprises:
and the packaging and downloading module 5 is used for packaging and downloading the software to be started.
According to the scheme, the software to be started is packaged and downloaded, so that the software can be started smoothly, and the normal startup of related equipment is ensured.
In one implementable aspect, referring to fig. 5, initializing the system further comprises:
and the starting module 6 is used for starting the software to be started, and linking the program module through the module flat directory in the starting process so as to finish the initialization of the program module.
In the scheme, the initialization of the program module is completed in a soft link mode, so that the maintenance cost of the related program can be saved, and the time consumption for the initialization of the program module can be saved.
In one implementable aspect, referring to fig. 5, initializing the system further comprises:
the process creation module 7 is used for creating a daemon process; the daemon process is used for initializing the program module.
In the scheme, the stability of the initialization method of the program module can be ensured by creating the daemon process, sequentially completing the steps of mounting each program module in the daemon process and the like.
In one implementable approach, the program modules are in the APEX format.
Since the initialization system of the program module provided in this embodiment has the same principle as the initialization method of the program module provided in embodiment 1, further description is omitted here.
According to the initialization system of the program module, the step of mounting the program module is advanced to the compiling stage, the mounted program module is subjected to flattening processing, and the related program is accessed in a soft link mode when the software is started, so that the maintenance cost of a source code can be saved, meanwhile, the mounting time of the program module can be shortened, the initialization efficiency of the program module is improved, and further the software starting speed is accelerated.
Example 3
The embodiment provides an electronic device, and fig. 6 is a schematic block diagram of the electronic device. The electronic device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the initialization method of the program module of embodiment 1 is realized when the processor executes the program. The electronic device 30 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the electronic device 30 may take the form of a general-purpose computing device, which may be, for example, a server device. The components of the electronic device 30 may include, but are not limited to: the at least one processor 31, the at least one memory 32, and a bus 33 that couples various system components including the memory 32 and the processor 31.
The bus 33 includes a data bus, an address bus, and a control bus.
The memory 32 may include volatile memory, such as Random Access Memory (RAM) 321 and/or cache memory 322, and may further include Read Only Memory (ROM) 323.
The processor 31 executes various functional applications and data processing, such as an initialization method of the program module of embodiment 1 of the present disclosure, by running the computer program stored in the memory 32.
The electronic device 30 may also communicate with one or more external devices 34 (e.g., a keyboard, a pointing device, etc.). Such communication may be through input/output (I/O) interfaces 35. Also, model-generating device 30 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via network adapter 36. As shown in FIG. 6, network adapter 36 communicates with the other modules of model-generating device 30 via bus 33. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the model-generating device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 4
A chip, applied to the electronic device of embodiment 3, for executing the initialization method of the program module as in embodiment 1.
Example 5
A chip module, applied to the electronic device of embodiment 3, for executing the initialization method of the program module as in embodiment 1.
Example 6
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the initialization method of the program module of embodiment 1.
More specific examples that may be employed by the readable storage medium include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible embodiment, the invention can also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the initialization method for the program modules implementing embodiment 1 when the program product is run on the terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may execute entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes or modifications to these embodiments may be made by those skilled in the art without departing from the principle and spirit of this invention, and these changes and modifications are within the scope of this invention.
Claims (16)
1. A method for initializing a program module, the method comprising:
acquiring a plurality of program modules to be initialized;
controlling the program module to be mounted during compiling;
flattening the mounted program modules to obtain a plurality of corresponding module flattened catalogs;
and integrating each program module required by the software through the module flattening directory in the software to be started according to a preset integration rule.
2. The method for initializing program modules according to claim 1, wherein the step of integrating each of the program modules required for the software by the module flattening directory in the software to be started according to a preset integration rule comprises:
acquiring a plurality of target program modules required by the software according to the preset integration rule;
and copying the module flattening directory of each target program module into a software directory.
3. The method for initializing program modules according to claim 1, wherein the step of integrating each of the program modules required for the software by the module flat directory in the software to be started according to the preset integration rule further comprises:
and packaging and downloading the software to be started.
4. The method for initializing program modules according to claim 3, wherein said step of packaging and downloading the software to be started further comprises:
and starting the software to be started, and linking the program module through the module flat directory in the starting process so as to finish the initialization of the program module.
5. The method for initializing a program module according to claim 1, further comprising:
creating a daemon process;
initializing the program module in the daemon process.
6. Method for initializing a program module according to one of claims 1 to 5, characterized in that the program module is in APEX format.
7. An initialization system for a program module, the initialization system comprising:
the acquisition module is used for acquiring a plurality of program modules to be initialized;
the mounting control module is used for controlling the program module to be mounted during compiling;
the flattening processing module is used for flattening the mounted program module to obtain a plurality of corresponding module flattening catalogues;
and the integration module is used for integrating all the program modules required by the software through the module flat directory in the software to be started according to a preset integration rule.
8. The program module initialization system of claim 7, wherein the flattening processing module is further to:
acquiring a plurality of target program modules required by the software according to the preset integration rule;
and copying the module flattening directory of each target program module into a software directory.
9. The program module initialization system of claim 7, further comprising:
and the packaging and downloading module is used for packaging and downloading the software to be started.
10. The program module initialization system of claim 9, further comprising:
and the starting module is used for starting the software to be started, and linking the program module through the module flat directory in the starting process so as to finish the initialization of the program module.
11. The program module initialization system of claim 7, further comprising:
the process creation module is used for creating a daemon process; the daemon process is used for initializing the program module.
12. The system for initializing program modules according to any of claims 7 to 11, wherein the program modules are in APEX format.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and adapted to run on the processor, wherein the processor when executing the computer program implements the initialization method for the program module of any of claims 1-6.
14. A chip for an electronic device, characterized in that it is adapted to perform the method of initializing a program module according to any one of claims 1 to 6.
15. A chip module applied to an electronic device, comprising a transceiver component and a chip, wherein the chip is used for executing the initialization method of the program module according to any one of claims 1 to 6.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the initialization method of the program module of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211626692.1A CN115756663A (en) | 2022-12-16 | 2022-12-16 | Method, system, device, medium and chip for initializing program module |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211626692.1A CN115756663A (en) | 2022-12-16 | 2022-12-16 | Method, system, device, medium and chip for initializing program module |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115756663A true CN115756663A (en) | 2023-03-07 |
Family
ID=85346455
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211626692.1A Pending CN115756663A (en) | 2022-12-16 | 2022-12-16 | Method, system, device, medium and chip for initializing program module |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115756663A (en) |
-
2022
- 2022-12-16 CN CN202211626692.1A patent/CN115756663A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9301164B2 (en) | Method, system, and terminal for performing system update between mobile communication terminals | |
US7934209B2 (en) | Method for firmware variable storage with eager compression, fail-safe extraction and restart time compression scan | |
KR101143112B1 (en) | Applying custom software image updates to non-volatile storage in a failsafe manner | |
US7181610B2 (en) | Method and system to encapsulate a driver written for an operating system (OS) runtime environment in an OS independent environment firmware extension | |
CN103324498B (en) | Method and equipment for booting bare metal computing device | |
US6876996B2 (en) | Method and apparatus for using a shared library mechanism to facilitate sharing of metadata | |
US10929149B2 (en) | Method and system for updating firmware | |
CN112068892A (en) | Diskless workstation starting method based on UEFI technology | |
CN110297726B (en) | Computer system with serial presence detection data and memory module control method | |
CN115291946A (en) | Hongmong system transplanting method, device, electronic equipment and readable medium | |
CN114756290A (en) | Operating system installation method, device and readable storage medium | |
CN116643778B (en) | Application program optimization method and electronic equipment | |
CN117369840A (en) | Method for constructing embedded operating system based on customized software source | |
CN114416031B (en) | Operating system for supporting RISC-V processor facing AIoT scene | |
CN107911816B (en) | Starting method for multi-mode IoT device, multi-mode IoT device and storage medium | |
CN115756663A (en) | Method, system, device, medium and chip for initializing program module | |
US11928214B2 (en) | Enabling SPI firmware updates at runtime | |
CN111694600B (en) | Mirror image file design, chip operation method, system, device and medium | |
US7103767B2 (en) | Method and apparatus to support legacy master boot record (MBR) partitions | |
CN115878197A (en) | Starting optimization method, system, chip, device and medium based on device tree | |
US7694301B1 (en) | Method and system for supporting input/output for a virtual machine | |
CN114443582B (en) | File system mounting method, device, equipment and medium on operating system | |
CN113448639B (en) | Access method, device, equipment and storage medium for user configuration variable area | |
CN115840682B (en) | Operation and maintenance monitoring method and device for BIOS (basic input output system) level sampling based on SW64 instruction set | |
CN113448644B (en) | Operating system ring3 mode OC hard disk configuration method, device, terminal 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 |