CN111984299A - Data loading method and equipment - Google Patents
Data loading method and equipment Download PDFInfo
- Publication number
- CN111984299A CN111984299A CN201910429191.6A CN201910429191A CN111984299A CN 111984299 A CN111984299 A CN 111984299A CN 201910429191 A CN201910429191 A CN 201910429191A CN 111984299 A CN111984299 A CN 111984299A
- Authority
- CN
- China
- Prior art keywords
- plug
- library
- dynamic
- memory
- image file
- 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.)
- Withdrawn
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 69
- 238000003860 storage Methods 0.000 claims abstract description 119
- 238000000034 method Methods 0.000 claims description 30
- 230000009191 jumping Effects 0.000 claims description 7
- 238000005192 partition Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 9
- 238000012217 deletion Methods 0.000 description 7
- 230000037430 deletion Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000004590 computer program Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/658—Incremental updates; Differential updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a data loading method and data loading equipment, which are used for solving the problems that DDR resources of existing intelligent equipment cannot be reasonably utilized, and resource loading and allocation modes are not flexible enough. After a plug-in meets the idle condition, deleting the plug-in dynamic library corresponding to the plug-in from the running memory, loading an upgrade data packet required to be downloaded for system upgrade by using running memory resources released by deleting the plug-in dynamic library, deleting the upgrade data packet in the running memory after the plug-in meets the running condition, such as after the system upgrade is completed, and reloading the deleted plug-in dynamic library from the storage memory according to storage address parameters of the plug-in dynamic library placed in the storage memory so as to realize resource reuse of the running memory, so that the idle of the running memory resources reserved for loading the upgrade data packet is avoided when no system upgrade task exists, and the resources of the running memory are reasonably and effectively distributed and utilized.
Description
Technical Field
The invention relates to the technical field of intelligent equipment, in particular to a data loading method and equipment.
Background
With the rapid development of science and technology, people have higher and higher requirements for the functions of intelligent devices, for example, compared with a common gateway, the current intelligent gateway has various plug-in functions such as "checking networking users", "restricting user from surfing the internet", and the like, so that a large number of plug-ins are usually integrated on the intelligent devices, various plug-in libraries need to be loaded during operation, and more DDR (Double Data Rate, Double Data synchronous dynamic random access memory) resources of the intelligent devices are occupied.
Taking the intelligent gateway as an example, the intelligent gateway consumes more than ten and several million DDR resources than the common gateway, and because the common gateway adopts more 128M DDR, the memory resource of the intelligent gateway needs to be increased by multiple, namely 256M DDR, which increases the cost.
Before leaving the factory, the intelligent gateway is programmed according to a system image file which is manufactured in advance, a physical memory (namely a storage memory) of the intelligent gateway is used for storing a programmed system program file, the programmed intelligent gateway can be used, and the system file is loaded from the storage memory to an operating memory (namely DDR) after the intelligent gateway is started. In the existing intelligent gateway, all the dynamic libraries of the plug-ins are all loaded on the DDR at one time along with the system file, because the positions of the dynamic libraries of the plug-ins in the system image file are random when the system image file is generated, and in order to improve the safety, the system program file containing the dynamic libraries of the plug-ins is of a read-only type, the dynamic libraries of the plug-ins on the DDR can not be deleted or repeatedly loaded and the like.
On the other hand, the intelligent gateway generally has a remote upgrade function, and even if there is no upgrade task currently, sufficient DDR resources are reserved for caching upgrade files, and this space is completely used when the intelligent gateway is in normal operation.
In summary, the DDR resources of the existing smart devices cannot be reasonably utilized, and the resource loading and allocating manner is not flexible.
Disclosure of Invention
The invention provides a data loading method and data loading equipment, which are used for solving the problems that DDR resources of existing intelligent equipment cannot be reasonably utilized, and resource loading and allocation modes are not flexible enough.
In a first aspect, a method for loading data provided in an embodiment of the present invention includes:
deleting the plug-in dynamic library of the plug-in meeting the idle condition from the running memory after the plug-in meets the idle condition and needs to be upgraded;
loading an upgrade data packet into the operating memory;
deleting the upgrading data packet in the running memory after the plug-in meets the running condition;
and acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
According to the method, after a plug-in meets an idle condition, a plug-in dynamic library corresponding to the plug-in is deleted from an operating memory, an upgrade data packet required to be downloaded for system upgrade is loaded by using operating memory resources released by deleting the plug-in dynamic library, when the plug-in meets the operating condition, for example, after the system upgrade is completed, the upgrade data packet in the operating memory is deleted, the deleted plug-in dynamic library is reloaded from the storage memory according to storage address parameters of the plug-in dynamic library placed in the storage memory, so that resource reuse of the operating memory is realized, and the idle of the operating memory resources reserved for loading the upgrade data packet is avoided when no system upgrade task exists, so that the resources of the operating memory are reasonably and effectively distributed and utilized.
In an optional implementation manner, obtaining the deleted dynamic plug-in library from the storage memory according to a storage address parameter of the dynamic plug-in library in the storage memory includes:
acquiring a mirror image file containing the dynamic plug-in library from a storage memory according to the storage address parameter of the dynamic plug-in library in the storage memory;
and acquiring the deleted dynamic plug-in library from the dynamic plug-in library mirror image file, and loading the deleted dynamic plug-in library into the operating memory.
According to the method, the initial storage position of the dynamic plug-in library in the storage memory is fixed and is not a random storage position any more, so that the file of the dynamic plug-in library can be determined according to the storage address parameter of the dynamic plug-in library in the storage memory, and the repeated loading of the dynamic plug-in library is realized.
In an alternative embodiment, the plug-in dynamic library image file is generated by:
generating a mirror image file of the plug-in dynamic library according to a temporary file for storing the plug-in dynamic library; wherein the temporary file is of a readable and writable type;
and placing the dynamic library mirror image file of the plug-in into the storage memory at the storage position specified by the storage address parameter according to the storage address parameter.
According to the method, the temporary file is of a readable and writable type, so that operations such as deletion and repeated loading of the plug-in dynamic library can be realized, and conditions are created for resource reuse of the running memory.
In an optional implementation manner, before deleting the plug-in dynamic library of the plug-in satisfying the idle condition from the running memory after the plug-in satisfies the idle condition and needs to perform system upgrade, the method further includes:
and loading the system image file in the storage memory into the operating memory, and operating the system program in the operating memory.
In an alternative embodiment, the system image file is generated by:
removing a plug-in dynamic library located in a subfile of a system file, and setting a jump link for jumping from the subfile to the plug-in dynamic library in the subfile;
and generating a system image file according to the system file with the plug-in dynamic library removed.
According to the method, because the system image file is read-only, when the system image file is generated, the plug-in dynamic library in the subfile in the system file is removed, a jump link for jumping to the plug-in dynamic library is set in the subfile, and the read-write performance of the plug-in dynamic library is realized while the integrity and the safety of the system file are realized.
In an optional implementation manner, the storage memory further includes a filling image file for filling a storage area between the system image file and the plug-in dynamic library image file.
In an alternative embodiment, the idle plug-in condition comprises:
the plug-in state is a closed state; or
And the non-running time of the plug-in reaches the preset time.
In an alternative embodiment, the run plug-in condition comprises:
The system upgrading is finished; or
And receiving a plug-in starting instruction.
In a second aspect, an embodiment of the present invention further provides a device for loading data, where the device includes: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the apparatus to perform the following:
deleting the plug-in dynamic library of the plug-in meeting the idle condition from the running memory after the plug-in meets the idle condition and needs to be upgraded;
loading an upgrade data packet into the operating memory;
deleting the upgrading data packet in the running memory after the plug-in meets the running condition;
and acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
In one possible implementation, the processor is specifically configured to:
acquiring a mirror image file containing the dynamic plug-in library from a storage memory according to the storage address parameter of the dynamic plug-in library in the storage memory;
and acquiring the deleted dynamic plug-in library from the dynamic plug-in library mirror image file, and loading the deleted dynamic plug-in library into the operating memory.
In one possible implementation, the processor generates the plug-in dynamic library image file by:
generating a mirror image file of the plug-in dynamic library according to a temporary file for storing the plug-in dynamic library; wherein the temporary file is of a readable and writable type;
and placing the dynamic library mirror image file of the plug-in into the storage memory at the storage position specified by the storage address parameter according to the storage address parameter.
In one possible implementation, the processor is further configured to:
and loading the system image file in the storage memory into the operating memory, and operating the system program in the operating memory.
In one possible implementation, the processor generates the system image file by:
removing a plug-in dynamic library located in a subfile of a system file, and setting a jump link for jumping from the subfile to the plug-in dynamic library in the subfile;
and generating a system image file according to the system file with the plug-in dynamic library removed.
In a possible implementation manner, the storage memory further includes a filling image file for filling a storage area between the system image file and the plug-in dynamic library image file.
In one possible implementation, the idle plug-in condition includes:
the plug-in state is a closed state; or
And the non-running time of the plug-in reaches the preset time.
In one possible implementation, the run plug-in condition includes:
the system upgrading is finished; or
And receiving a plug-in starting instruction.
In a third aspect, an embodiment of the present invention further provides an apparatus for loading data, where the apparatus includes:
a first deletion module: the plug-in dynamic library is used for deleting the plug-ins meeting the idle conditions from the running memory after the plug-ins meet the idle conditions and the system needs to be upgraded;
loading a module: the upgrading device is used for loading the upgrading data packet into the running memory;
a second deletion module: the upgrading data package is used for deleting the upgrading data package in the running memory after the plug-in meets the running condition;
a processing module: and the dynamic plug-in library management module is used for acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
In a fourth aspect, the present application also provides a computer storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of the method of the first aspect.
In addition, for technical effects brought by any one implementation manner of the second aspect to the fourth aspect, reference may be made to technical effects brought by different implementation manners of the first aspect, and details are not described here.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a diagram illustrating a method for loading data according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a Flash (Flash Memory, a non-volatile Memory, that is, a storage Memory in the present invention) partition according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another Flash partition structure according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for loading data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another apparatus for loading data according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Some of the words that appear in the text are explained below:
1. the term "and/or" in the embodiments of the present invention describes an association relationship of associated objects, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
2. The term "dynamic library of plug-ins" in the embodiment of the present invention refers to a dynamic library of plug-ins, and the libraries to be called when compiling a program include two types: static libraries, which can be understood as being called when compiling a program, and dynamic libraries; the dynamic library can be understood as a library called in runtime, and the plug-in dynamic library can be understood as a library which needs to be called in runtime of the plug-in.
3. The term "storage memory", which may also be referred to as FLASH in the embodiments of the present invention, refers to a physical memory of an intelligent device, such as: sim (Subscriber identity Module) card in mobile phone, and hard disk in computer.
4. In the embodiment of the invention, the term "DDR" refers to a running memory.
The application scenario described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not form a limitation on the technical solution provided in the embodiment of the present invention, and it can be known by a person skilled in the art that with the occurrence of a new application scenario, the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems. In the description of the present invention, the term "plurality" means two or more unless otherwise specified.
The following describes a data loading method provided by the embodiment of the present invention, taking an intelligent gateway as an example for data loading:
after the intelligent gateway is started, the mirror image file in the storage memory is decompressed through boot and loaded into the operating memory DDR, and file copying from FLASH to DDR is achieved. The embodiment of the invention deletes the plug-in dynamic library in DDR when the system upgrading task is performed, stores the vacant DDR resource after the plug-in dynamic library is deleted into the system upgrading data package, deletes the system upgrading data package after the system upgrading is completed, and reloads the deleted plug-in dynamic library from the mirror image file of the memory onto the DDR resource originally used for storing the plug-in dynamic library so as to realize DDR resource reuse.
The embodiments of the present invention will be described in further detail with reference to the drawings attached hereto.
As shown in fig. 1, an embodiment of the present invention provides a method for loading data, which specifically includes the following steps:
step 100: deleting the plug-in dynamic library of the plug-in meeting the idle condition from the running memory after the plug-in meets the idle condition and needs to be upgraded;
step 101: loading an upgrade data packet into the operating memory;
step 102: deleting the upgrading data packet in the running memory after the plug-in meets the running condition;
step 103: and acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
According to the scheme, after a plug-in meets an idle condition, a plug-in dynamic library corresponding to the plug-in is deleted from an operating memory, an upgrade data packet required to be downloaded for system upgrade is loaded by using operating memory resources released by deleting the plug-in dynamic library, when the plug-in meets the operating condition, for example, after the system upgrade is completed, the upgrade data packet in the operating memory is deleted, the deleted plug-in dynamic library is reloaded from the storage memory according to storage address parameters of the plug-in dynamic library placed in the storage memory, so that resource reuse of the operating memory is realized, idle of the operating memory resources reserved for loading the upgrade data packet is avoided when no system upgrade task exists, and the resources of the operating memory are reasonably and effectively distributed and utilized.
First, the intelligent gateway is briefly introduced from two aspects:
in a first aspect: burning process of the intelligent gateway;
the intelligent gateway burns according to the manufactured image file, and can be understood as copying the image file into the storage memory. The mirror image file is a plug-in dynamic library which comprises an embedded system program operated by the intelligent gateway and various plug-ins, and can be started to use after burning is finished.
After the intelligent gateway is started, all the image files in the storage memory are loaded into the DDR (double data rate) of the operation memory at one time, and after the loading of the intelligent gateway is completed, various functions and plug-ins are operated, namely, the image files directly determine the working mode of the intelligent gateway. The following introduces the relevant contents of the image file produced by the embodiment of the present invention:
as shown in fig. 2, which is a schematic view of a partition architecture of an image file provided in an embodiment of the present invention, a system program is placed in a Flash partition 1, and a plug-in is placed in a Flash partition 2, in the present invention, the content of the Flash partition 2 is not involved, the function of the Flash partition 2 is generally two independent manufacturing parts with the system program, and finally, an integration process is performed, so the following description focuses on a complete flow of generating an image file by the Flash partition 1:
Dividing the Flash partition 1 into a system program area, a filling area and a plug-in LIB (LIB, a file name suffix) area according to preset address parameters, wherein an embedded system file of an intelligent gateway is stored in the system program area; a plug-in dynamic library is stored in the plug-in LIB area; the filling area is obtained by calculation according to the set storage address of the plug-in LIB area and the memory size of the system program area, and is used for filling between the system program area and the plug-in LIB area to ensure that the initial storage address of the plug-in LIB area is fixed.
And respectively manufacturing files in the system program area, the filling area and the plug-in LIB area into a system image file, a filling image file and a plug-in dynamic library image file.
For example, the following steps are carried out:
creating a folder named filesystem in a system program area, storing an embedded system used by an intelligent gateway into a filesystem directory of the system program area according to a preset directory structure, removing a plug-in dynamic library in subfolders/LIBs/glib used for storing a plug-in dynamic library in the filesystem directory, cutting the plug-in dynamic library into a temporary folder temp/glib in the filesystem1 of a plug-in LIB area, establishing a soft link pointing to the temporary folder temp/glib in the filesystem1 at the original/LIB/glib position in the filesystem, and making the filesystem into a system mirror image file system.bin by using a mirror image tool;
As shown in fig. 3, the offset of the LIB area of the plug-in the Flash partition 1 is set to 16M, and the filesysem 1 in the LIB area of the plug-in is made into a plug-in dynamic library image file glib.
Because the offset of the LIB area of the plug-in is 16M, assuming that the memory occupied by the system image file is calculated to be 12.3M, the size of the filling area can be calculated to be 3.7M according to the offset of the system image file and the LIB area of the plug-in, that is, 3.7M of memory space is left between the system image file system.bin and the plug-in dynamic library image file glib.bin, and a mirror image tool is used to generate a 3.7M empty file as the filling image file pad.bin.
The system image file system.bin, the filling image file pad.bin and the plug-in dynamic library image file glib.bin are used for generating a total image file packet clinux.bin by using a command cat system.bin pad.bin glib.bin > tclinux.bin, and the offset of the plug-in dynamic library image file glib.bin in the total image file packet tclinux.bin is 16M.
Note that the temporary folder temp/glib in filesystems 1 is of a read-write type. Due to the limitation of authority, the system program file is read-only, the content in the system program cannot be modified such as increased, decreased or moved, the dynamic library file of the plug-in is contained in the original system program file, but the position of the dynamic library of the plug-in the system program file is not fixed, so that the deletion and the repeated loading of the dynamic library of the plug-in cannot be realized if the original system program file is used. The embodiment of the invention respectively packs the system program file and the plug-in dynamic library based on the content of the original system program file to generate the mirror image file, and realizes the deletion and repeated loading of the plug-in dynamic library in the temporary folder because the temporary folder is of a readable and writable type.
The process is a complete process for manufacturing the image file, the total image file package is used for burning the intelligent gateway, and the intelligent gateway can be started to use after burning is completed. The operation of the intelligent gateway is described in the second aspect.
In a second aspect: the operation process of the intelligent gateway;
1, starting up and loading:
after starting up, loading tclinux.bin in a memory into a DDR, firstly, reading a partition header of a system partition by a boot (loading operating system) according to a traditional Flash loading mode, wherein the partition header comprises memory size information and offset information of kernel and rootfs, dividing tclinux.bin into kernel and rootfs (file system) according to related information in the partition header, and loading 12.3M system.bin into the DDR according to the traditional loading mode because the header of the system partition is also the header of the system.bin; bin is the data from the offset 16M of the system area to the end of the system program area, and before the plug-in is started, bin needs to be loaded into/temp/glib in DDR.
2, system upgrading process:
in the system upgrading task, the plug-in is required to be closed, then the plug-in dynamic library in the temporary folder temp on the DDR is deleted, and the released DDR resource is used for storing the upgrading data packet required by the system upgrading.
It should be noted that the temporary folder on the DDR is compatible with the security and the read-write function, the dynamic library of the plug-in can be released quickly, and the plug-in function is stopped in advance, so that the embedded system will not crash even after the dynamic library of the plug-in is deleted, and the released DDR resources can be used to download the upgrade data packet, thereby realizing the multiplexing of the DDR resources.
For example, the following steps are carried out:
and the/temp/glib on the DDR is a plug-in dynamic library loaded from glib.
After determining that the plug-in meets the idle condition, the intelligent network can delete the plug-in dynamic library, and store the upgrade data packet or cache for other functions by using the released DDR resource, for example, using the released DDR resource as the cache of Wi-Fi. Among them, there are many possibilities to satisfy the idle condition of the plug-in, which are described below:
The first idle condition is as follows: the plug-in state is a closed state;
and when the intelligent gateway detects that the plug-in is in a closed state, determining that the idle condition of the plug-in is met.
And (2) idle condition two: the non-operation time of the plug-in reaches the preset time;
such as: and setting the non-operation time of the plug-in unit meeting the idle condition to be 10min (minutes), and after the non-operation time of the plug-in unit is checked to reach 10min, determining that the plug-in unit meets the idle condition.
It should be noted that, if there is one plug-in the intelligent gateway, it is only necessary to determine whether the plug-in meets the idle condition, and if there are multiple plug-ins in the intelligent gateway, after detecting which plug-in meets the idle condition, the dynamic library of the plug-in corresponding to the plug-in is deleted.
For example, the following steps are carried out: assume that there are 3 plug-in dynamic libraries: the plug-in dynamic library 1, the plug-in dynamic library 2 and the plug-in dynamic library 3 are respectively loaded into a/temp/glib 1,/temp/glib 2 and/temp/glib 3 of the DDR, and if the plug-in dynamic library 1 is detected to meet an idle condition, the/temp/glib 1 of the DDR is deleted; and deleting the DDR/temp/glib 2 if the plug-in dynamic library 2 is detected to meet the idle condition, and the like.
It should be noted that, in addition to system upgrade, after determining that a plug-in meets an idle condition, the intelligent network may use the removed dynamic library of plug-ins to use the released DDR resources as a cache of other functions, for example, the more DDR the Wi-Fi function in the intelligent gateway runs, the better the performance is, therefore, the embodiment of the present invention may also allocate the removed dynamic library of plug-ins to the Wi-Fi function using the released DDR resources as a cache of Wi-Fi.
3, reloading the plug-in dynamic library:
when the condition of running the plug-in is detected to be met, the running environment of the plug-in needs to be recovered because the plug-in dynamic library is deleted, and the method comprises the following specific steps: deleting the upgrade data packet on the DDR, and reloading the deleted plug-in dynamic library to the DDR according to the storage address parameter of the plug-in dynamic library in the storage memory.
For example, the following steps are carried out: after the condition that the plug-in meets the plug-in operation condition is checked, firstly deleting a/temp/packet folder for storing an upgrading data packet on the DDR, determining a glib.bin file according to the offset 16M of the LIB partition of the plug-in the Flash partition 1, reloading the glib.bin into the/temp/glib of the DDR, and at the moment, restarting the plug-in. Among them, there are many possibilities to satisfy the operation condition of the plug-in, which are described below:
the operating conditions are as follows: the system upgrading is finished;
after the upgrade data packet is downloaded, the upgrade data packet is not verified, and olt (optical line terminal) does not issue an upgrade implementation instruction; or
After downloading the upgrading data packet, receiving a system upgrading cancelling instruction; or after the system upgrading is finished by using the downloaded upgrading data packet, the system upgrading is considered to be finished.
And (2) operating conditions are as follows: receiving a plug-in starting instruction;
for example, after receiving the plug-in starting instruction, the operating condition of the plug-in is considered to be satisfied.
In a general situation, the library file is released and reloaded, which can only be used in an operating system with complete memory management, such as a server and a PC, and is equivalent to a SWAP cache of the operating system, and an embedded system does not have a SWAP cache, but in an intelligent gateway, a plug-in dynamic library file is characterized in that a plug-in dynamic library is not changed in the running process of the intelligent gateway, so that setting a fixed offset of the plug-in dynamic library in a storage memory to load the plug-in dynamic library file is equivalent to realizing a SWAP cache function of a large operating system.
Based on the same concept, as shown in fig. 4, an embodiment of the present invention provides an apparatus for loading data, including: a processor 400 and a memory 401, wherein the memory 401 stores program code, and wherein one or more computer programs stored in the memory 401, when executed by the processor 400, cause the apparatus to perform the following:
deleting the plug-in dynamic library of the plug-in meeting the idle condition from the running memory after the plug-in meets the idle condition and needs to be upgraded; loading an upgrade data packet into the operating memory; deleting the upgrading data packet in the running memory after the plug-in meets the running condition; and acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
Optionally, the processor 400 is specifically configured to:
acquiring a mirror image file containing the dynamic plug-in library from a storage memory according to the storage address parameter of the dynamic plug-in library in the storage memory;
and acquiring the deleted dynamic plug-in library from the dynamic plug-in library mirror image file, and loading the deleted dynamic plug-in library into the operating memory.
Optionally, the processor 400 generates the plug-in dynamic library image file by the following method:
generating a mirror image file of the plug-in dynamic library according to a temporary file for storing the plug-in dynamic library; wherein the temporary file is of a readable and writable type;
and placing the dynamic library mirror image file of the plug-in into the storage memory at the storage position specified by the storage address parameter according to the storage address parameter.
Optionally, the processor 400 is further configured to:
and loading the system image file in the storage memory into the operating memory, and operating the system program in the operating memory.
Optionally, the processor 400 generates the system image file by:
removing a plug-in dynamic library located in a subfile of a system file, and setting a jump link for jumping from the subfile to the plug-in dynamic library in the subfile;
And generating a system image file according to the system file with the plug-in dynamic library removed.
Optionally, the storage memory further includes a filling image file for filling a storage area between the system image file and the plug-in dynamic library image file.
Optionally, the idle plug-in condition includes:
the plug-in state is a closed state; or
And the non-running time of the plug-in reaches the preset time.
Optionally, the running plug-in condition includes:
the system upgrading is finished; or
And receiving a plug-in starting instruction.
Based on the same concept, as shown in fig. 5, an embodiment of the present invention provides another apparatus for loading data, including:
the first deletion module 500: the plug-in dynamic library is used for deleting the plug-ins meeting the idle conditions from the running memory after the plug-ins meet the idle conditions and the system needs to be upgraded;
the loading module 501: the upgrading device is used for loading the upgrading data packet into the running memory;
the second deletion module 502: the upgrading data package is used for deleting the upgrading data package in the running memory after the plug-in meets the running condition;
the processing module 503: and the dynamic plug-in library management module is used for acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
Optionally, the processing module 503 is specifically configured to:
acquiring a mirror image file containing the dynamic plug-in library from a storage memory according to the storage address parameter of the dynamic plug-in library in the storage memory;
and acquiring the deleted dynamic plug-in library from the dynamic plug-in library mirror image file, and loading the deleted dynamic plug-in library into the operating memory.
Optionally, the apparatus further includes an image file generating module 504, where the image file generating module 504 generates the plug-in dynamic library image file in the following manner:
generating a mirror image file of the plug-in dynamic library according to a temporary file for storing the plug-in dynamic library; wherein the temporary file is of a readable and writable type;
and placing the dynamic library mirror image file of the plug-in into the storage memory at the storage position specified by the storage address parameter according to the storage address parameter.
Optionally, the loading module 501 is further configured to:
and loading the system image file in the storage memory into the operating memory, and operating the system program in the operating memory.
Optionally, the apparatus further includes an image file generating module 504, where the image file generating module 504 generates the system image file by:
Removing a plug-in dynamic library located in a subfile of a system file, and setting a jump link for jumping from the subfile to the plug-in dynamic library in the subfile;
and generating a system image file according to the system file with the plug-in dynamic library removed.
Optionally, the storage memory further includes a filling image file for filling a storage area between the system image file and the plug-in dynamic library image file.
Optionally, the idle plug-in condition includes:
the plug-in state is a closed state; or
And the non-running time of the plug-in reaches the preset time.
Optionally, the running plug-in condition includes:
the system upgrading is finished; or
And receiving a plug-in starting instruction.
An embodiment of the present invention further provides a computer-readable non-volatile storage medium, which includes a program code, and when the program code runs on a computing terminal, the program code is configured to enable the computing terminal to execute the steps of the method for task allocation according to the embodiment of the present invention.
The present application is described above with reference to block diagrams and/or flowchart illustrations of methods, apparatus (systems) and/or computer program products according to embodiments of the application. It will be understood that one block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, and/or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer and/or other programmable data processing apparatus, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the subject application may also be embodied in hardware and/or in software (including firmware, resident software, micro-code, etc.). Furthermore, the present application may take the form of a computer program product on a computer-usable or computer-readable storage medium having computer-usable or computer-readable program code embodied in the medium for use by or in connection with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (16)
1. A method for data loading, the method comprising:
deleting the plug-in dynamic library of the plug-in meeting the idle condition from the running memory after the plug-in meets the idle condition and needs to be upgraded;
Loading an upgrade data packet into the operating memory;
deleting the upgrading data packet in the running memory after the plug-in meets the running condition;
and acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
2. The method according to claim 1, wherein obtaining the deleted dynamic plug-in library from the storage memory according to the storage address parameter of the dynamic plug-in library in the storage memory comprises:
acquiring a mirror image file containing the dynamic plug-in library from a storage memory according to the storage address parameter of the dynamic plug-in library in the storage memory;
and acquiring the deleted dynamic plug-in library from the dynamic plug-in library mirror image file, and loading the deleted dynamic plug-in library into the operating memory.
3. The method of claim 2, wherein the plug-in dynamic library image file is generated by:
generating a mirror image file of the plug-in dynamic library according to a temporary file for storing the plug-in dynamic library; wherein the temporary file is of a readable and writable type;
And placing the dynamic library mirror image file of the plug-in into the storage memory at the storage position specified by the storage address parameter according to the storage address parameter.
4. The method of claim 2, wherein before deleting the plug-in dynamic library of the plug-in satisfying the idle condition from the running memory after the plug-in satisfying the idle condition and requiring the system upgrade, the method further comprises:
and loading the system image file in the storage memory into the operating memory, and operating the system program in the operating memory.
5. The method of claim 4, wherein the system image file is generated by:
removing a plug-in dynamic library located in a subfile of a system file, and setting a jump link for jumping from the subfile to the plug-in dynamic library in the subfile;
and generating a system image file according to the system file with the plug-in dynamic library removed.
6. The method of claim 5, wherein the storage memory further comprises a fill image file for filling a storage area between the system image file and the plug-in dynamic library image file.
7. The method of claim 1, wherein the idle plug-in condition comprises:
the plug-in state is a closed state; or
And the non-running time of the plug-in reaches the preset time.
8. The method of claim 1, wherein the run-in conditions comprise:
the system upgrading is finished; or
And receiving a plug-in starting instruction.
9. An apparatus for data loading, the apparatus comprising: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the apparatus to perform the following:
deleting the plug-in dynamic library of the plug-in meeting the idle condition from the running memory after the plug-in meets the idle condition and needs to be upgraded;
loading an upgrade data packet into the operating memory;
deleting the upgrading data packet in the running memory after the plug-in meets the running condition;
and acquiring the deleted dynamic plug-in library from the storage memory and loading the deleted dynamic plug-in library into the running memory according to the storage address parameter of the dynamic plug-in library in the storage memory.
10. The device of claim 9, wherein the processor is specifically configured to:
acquiring a mirror image file containing the dynamic plug-in library from a storage memory according to the storage address parameter of the dynamic plug-in library in the storage memory;
and acquiring the deleted dynamic plug-in library from the dynamic plug-in library mirror image file, and loading the deleted dynamic plug-in library into the operating memory.
11. The apparatus of claim 10, wherein the processor generates the plug-in dynamic library image file by:
generating a mirror image file of the plug-in dynamic library according to a temporary file for storing the plug-in dynamic library; wherein the temporary file is of a readable and writable type;
and placing the dynamic library mirror image file of the plug-in into the storage memory at the storage position specified by the storage address parameter according to the storage address parameter.
12. The device of claim 9, wherein the processor is further configured to:
and loading the system image file in the storage memory into the operating memory, and operating the system program in the operating memory.
13. The apparatus of claim 12, wherein the processor generates the system image file by:
Removing a plug-in dynamic library located in a subfile of a system file, and setting a jump link for jumping from the subfile to the plug-in dynamic library in the subfile;
and generating a system image file according to the system file with the plug-in dynamic library removed.
14. The apparatus of claim 13, wherein the storage memory further comprises a fill image file for filling a storage area between the system image file and the plug-in dynamic library image file.
15. The apparatus of claim 9, wherein the idle plug-in condition comprises:
the plug-in state is a closed state; or
And the non-running time of the plug-in reaches the preset time.
16. The apparatus of claim 9, wherein the run-in conditions comprise:
the system upgrading is finished; or
And receiving a plug-in starting instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910429191.6A CN111984299A (en) | 2019-05-22 | 2019-05-22 | Data loading method and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910429191.6A CN111984299A (en) | 2019-05-22 | 2019-05-22 | Data loading method and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111984299A true CN111984299A (en) | 2020-11-24 |
Family
ID=73435953
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910429191.6A Withdrawn CN111984299A (en) | 2019-05-22 | 2019-05-22 | Data loading method and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111984299A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113704180A (en) * | 2021-07-10 | 2021-11-26 | 国网浙江省电力有限公司信息通信分公司 | Lossless firmware extraction method based on embedded equipment firmware file information feature library |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101464805A (en) * | 2008-12-24 | 2009-06-24 | 中兴通讯股份有限公司 | Plug-in management method and system thereof |
CN102073520A (en) * | 2010-12-30 | 2011-05-25 | 中国民航信息网络股份有限公司 | Dynamic management system and method for C++ application program version |
CN105893094A (en) * | 2016-03-31 | 2016-08-24 | 百度在线网络技术(北京)有限公司 | Achieving method and device for application program plug-in |
CN107493336A (en) * | 2017-08-21 | 2017-12-19 | 北京北信源软件股份有限公司 | Realize method and apparatus, computer-readable recording medium and the storage control of client plug-in |
CN108595192A (en) * | 2018-05-08 | 2018-09-28 | 青岛海信宽带多媒体技术有限公司 | A kind of installation method and terminal device of application program |
CN109491648A (en) * | 2018-11-19 | 2019-03-19 | 上海新时达电气股份有限公司 | The method and system and equipment of library function independent partitions in embedded software |
-
2019
- 2019-05-22 CN CN201910429191.6A patent/CN111984299A/en not_active Withdrawn
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101464805A (en) * | 2008-12-24 | 2009-06-24 | 中兴通讯股份有限公司 | Plug-in management method and system thereof |
CN102073520A (en) * | 2010-12-30 | 2011-05-25 | 中国民航信息网络股份有限公司 | Dynamic management system and method for C++ application program version |
CN105893094A (en) * | 2016-03-31 | 2016-08-24 | 百度在线网络技术(北京)有限公司 | Achieving method and device for application program plug-in |
CN107493336A (en) * | 2017-08-21 | 2017-12-19 | 北京北信源软件股份有限公司 | Realize method and apparatus, computer-readable recording medium and the storage control of client plug-in |
CN108595192A (en) * | 2018-05-08 | 2018-09-28 | 青岛海信宽带多媒体技术有限公司 | A kind of installation method and terminal device of application program |
CN109491648A (en) * | 2018-11-19 | 2019-03-19 | 上海新时达电气股份有限公司 | The method and system and equipment of library function independent partitions in embedded software |
Non-Patent Citations (2)
Title |
---|
SZWM1010: "Linux下动态库(.so)和静态库(.a)", pages 1 - 5, Retrieved from the Internet <URL:《https://blog.csdn.net/felixit0120/article/details/7652907》> * |
程和侠等: "《Linux操作系统》", 31 January 2017, 中国科学技术大学出版社, pages: 221 - 225 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113704180A (en) * | 2021-07-10 | 2021-11-26 | 国网浙江省电力有限公司信息通信分公司 | Lossless firmware extraction method based on embedded equipment firmware file information feature library |
CN113704180B (en) * | 2021-07-10 | 2024-03-15 | 国网浙江省电力有限公司信息通信分公司 | Lossless firmware extraction method based on embedded device firmware file information feature library |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105867947B (en) | Data processing method and device after preset application program updating | |
CN107506221B (en) | Application program upgrading method, device and equipment | |
US11818224B2 (en) | On demand resources | |
CN105843656B (en) | System upgrading method for insufficient disk space, terminal equipment and server | |
CN108121594B (en) | Process management method and device | |
US9880824B2 (en) | On demand resources | |
CN107832100B (en) | APK plug-in loading method and terminal thereof | |
CN105490860A (en) | Method, device and system for deploying application program operation environment | |
CN113126893B (en) | Method, device, storage medium and computer equipment for expanding system partition | |
CN115048149A (en) | Application cache scalable processing method, device, equipment and medium | |
CN115729673A (en) | Cluster management method, management module, electronic device and medium | |
CN109939441B (en) | Application multi-disk verification processing method and system | |
CN111984299A (en) | Data loading method and equipment | |
CN107667343B (en) | System and method for loading on-demand resources | |
CN112564956A (en) | Remote upgrading method, equipment and device for client and storage medium | |
CN112860297A (en) | Storage system based on automobile binocular camera and system updating method | |
CN107783837B (en) | Method and device for performing storage expansion and electronic equipment | |
CN109656611A (en) | Three-dimensional visualization applies hot update method, device and terminal | |
CN106815301B (en) | Method and device for storing dex file | |
CN111078257A (en) | Loading method and related device of H5 application package | |
CN113268266B (en) | Multi-version coexistence management method, system and medium for applet rendering framework | |
CN109542588B (en) | Method and device for managing virtual equipment in cloud environment | |
CN118426814A (en) | Method, device, equipment and storage medium for updating data of smart card | |
KR100753277B1 (en) | Program File Parallel Download Method Of Mobile Communication Terminal | |
CN111142915B (en) | Updating method, device and equipment |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20201124 |