CN103617060B - Method for accelerating starting procedure of embedded software by using super state storage - Google Patents
Method for accelerating starting procedure of embedded software by using super state storage Download PDFInfo
- Publication number
- CN103617060B CN103617060B CN201310643663.0A CN201310643663A CN103617060B CN 103617060 B CN103617060 B CN 103617060B CN 201310643663 A CN201310643663 A CN 201310643663A CN 103617060 B CN103617060 B CN 103617060B
- Authority
- CN
- China
- Prior art keywords
- static
- memory
- function
- program
- course
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of embedded software, in particular to a method for accelerating the starting procedure of embedded software by using super state storage. The method includes the steps that an area is marked off in a static internal storage zone to be used as a dynamic allocation internal storage, a dynamic allocation function in the procedure is modified, an internal storage function is released to be in a customized version, so that dynamic allocation and memory release movement are conducted in the area, dynamic data and static data generated in the starting process of the procedure can both be stored to the static internal storage zone, then, the data in the static internal storage are all stored into an external memory in the state file mode when starting is completed, the state file can be directly called when the procedure is started again, the state file is recovered to the static internal storage zone, and one-step starting can be achieved. By the aid of the method, the procedure starting speed can be greatly increased.
Description
Technical field
The present invention relates to embedded software technology field, more particularly, to one kind accelerate embedded software using super state storage
The method of part start-up course.
Background technology
In some cases, there is very high requirement for the starting time of embedded device.Starting time mentioned here,
Refer to that electricity can be with the time required for the state of normal work to function from device.For example, the equipment for monitoring, protecting exists
It is desirable to enter working condition as early as possible after barrier is restarted for some reason.
The start-up course of embedded device is broadly divided into hardware initialization, os starting and business software and starts three
Individual step.In general, hardware initialization and os starting expend the time very short (typically in 1 second), and business software opens
The dynamic time has been largely fixed the starting time of whole embedded system.
At present, the means accelerating embedded software startup mainly have:
1) improve hardware performance
To improve overall speed by using the more preferable hardware of performance, the time that software starts also can accordingly shorten.Example
As: using faster processor, access ram of faster storage chip or bigger etc..This mode typically can be proved effective, but
It is the hardware cost that can dramatically increase embedded device, and the shortening of the lifting of hardware performance and final starting time is linear
Relation, it is difficult to realize and significantly lifted.
2) cutting software function
Cutting is carried out to embedded software according to specifically used situation, only retains necessary part.In embedded software
Function is more complicated, and is all using in the case of one of part under various application scenarios, by customized
Cutting, can save the speed not lifting software startup using the starting time of function.The limitation of this method is, such as
Most of function of fruit software all can not then not use in cutting.On the other hand, customized in a large number cutting can be to software
Or configuration file release maintenance brings very big difficulty.
3) preserve intermediate data
Some embedded softwares, in start-up course, need to read more complicated configuration file, and according to configuration file
Generate corresponding internal storage structure to use for follow-up function.General configuration file is all text formatting, compares typically xml literary composition
Part.Because the form of text is more complicated, during parsing, need to carry out substantial amounts of false judgment, therefore resolving is suitable
Slowly.In order to improve the speed of parsing, can be saved in the form of binary file with the internal storage structure that parsing is generated.In journey
When sequence starts, first check whether binary file version current is consistent with configuration file version, inconsistent, again solve
Analyse and preserve, unanimously, just directly parse binary file.Because binary file is consistent with memory data structure,
The parsing time can greatly shorten with respect to the configuration file of direct parsing text.The application at present of this mode is than wide.
4) internal memory complete dump
This mode is before device power-off, and the hardware states such as the data of whole internal memory and cpu are all dumped to forever
Long on the equipment of storage, on next device, internal storage data is directly recovered by electricity, and then setting cpu and hardware state continue by device
A kind of method that state when power-off is run.The feature of this method is not need software program to make any modification, but needs
Preserve the complete mirror image of whole internal memory, in memory size ratio in the case of larger, need to take the space of External memory equipment
Ratio is larger, and the time preserving and reading is also long.Typically provide these functions on scale is than larger operating system, for example
Embedded windows, embedded Linux etc..
Above-mentioned several means substantially all there are some problems it is impossible to the quick software that improves starts in the case of lower-cost
Speed.
Content of the invention
For the problems referred to above, the present invention passes through Dram static, provides a kind of storage using super state to accelerate
The method of embedded software start-up course.
The region of memory that one program is used, is broadly divided into four parts: static zones, constant area, heap area, stack area,
Wherein static zones are used for depositing global variable and the static variable of program, and the constant data defined in program, heap are deposited by constant area
Dynamic therefrom storage allocation when area is used for running, stack area then preserves parameter and return value and local variable etc. of function call.
Start to start to startup in program and complete this two states, the data changing is all in static zones, heap area, several area of stack area
Domain.The startup of variable in static zones every secondary program all can be placed on identical position, and only value can change;In heap area, distribution is dynamic
Internal memory, each run all can have news, and therefore its position data is all it may happen that change;Its entity of data in stack area
Existing is call relation and the internal state of function, does not have much relations with the overall operation state of program.Therefore, affect program
Dram in the static memory that it is critical only that in static zones and heap area of toggle speed.
For static memory, start from program and start to starting the state completing, in the only internal memory changing
The overall situation or static data value and program execution position.Therefore, as long as the overall situation or static data preservation when completing will be started
To external memory storage, when program starts every time, directly read in the static memory area internal memory from external memory storage and be saved in
Position originally, and by program skip to last time start complete position execution it is possible to a step complete start.It starts required
Time is only, from external storage, with static variable region, its overall situation is read the required time internal memory.Because program uses
The overall situation and static variable limited amount, the time that whole start-up course needs is very short.
For the internal memory of dynamically distributes, even if the address each run existing in dynamically distributes in internal memory all can have change
Change, but it is always directly or indirectly used by certain pointer in program static memory area, when we are retouched using previous step
When the preservation scheme stated is to store and to recover to start the state completing, this pointer equally also can be saved, but it refers to
To Dram be but difficult to preserve, the method here of above-mentioned preservation static data can not directly use.Therefore, the present invention considers
To by the method for Dram static, use for reference the allocation algorithm in c language standard storehouse, dynamically distributes switched to static allocation,
The memory block of all dynamically distributes is transferred in static memory area, when carrying out state preservation, can be by dynamic data and static state
Data is stored to static memory area together, so, points to the pointer of Dram, is also pointing exactly in static memory area after recovery
" dynamic " data (actual have turned into static data), thus directly invoke this state when program starts, improves program and starts speed
Degree.
The present invention realizes above-mentioned imagination using following steps:
A kind of method that embedded software start-up course is accelerated in use super state storage, comprises the steps:
Step 1, determine that the startup of software program completes a little;This startup completes to be exactly a little that program runs to a certain moment, it
The execution point that program function can normally use afterwards.According to the difference of application software, start and complete a little to be slightly different, programmer can
Rule of thumb judge that the startup of specific procedure completes a little.
Step 2, judge external memory storage whether there is status file, if not existing, carry out by step 3, otherwise, by step
Rapid 4 are carried out;Open mode file can be attempted using program, according to opening whether successfully judge whether status file is deposited during judgement
?.
Step 3, carry out software start-up course and by start complete when internal memory in data be saved in external memory storage:
(3-1) go out one piece for the region as dynamic assigning memory in static memory zoning, dynamic in modification program
Partition function and releasing memory function are to customized version so that dynamically distributes and releasing memory action are carried out in this region;
(3-2) enter line program start-up course, until program performing completes a little to startup;
(3-3) creation state file in external memory storage, will complete the number of storage in Dian Shi static memory area to startup
According to being stored in status file;Have been modified by dynamically distributes function due in (3-1), in program start-up course, in static memory
Area is dynamically distributes specified memory region, stores dynamic data, and therefore, now in static memory area, the data of storage is existing former dynamic
State data, also has former static data, is herein collectively referred to as static data, does not repartition, and all unifies to be stored in status file.
(3-4) original behavior of Restoration dynamics partition function and releasing memory function;Complete due to starting, follow-up work(
In energy need not again by dynamic memory distribution to static memory region, so recovering original dynamically distributes function and releasing memory
Function.
(3-5) skip to startup to complete a little to continue executing with program follow-up function;After having preserved status file, continue from having started
Point is become to start configuration processor.
Step 4, read data to static memory area from status file, then skip to startup and complete a little, to continue executing with journey
Sequence follow-up function;If existence file in external memory storage, can directly invoke, need not make any adjustments to can reach and open
The dynamic state completing.
Further, in step (3-1), realized using macro substitution by during compiling during Modification growth function, also can be by during operation
The mode that dynamic Modification growth function machine code is redirected is realized.According to said method, by dynamically distributes function and releasing memory
Function is changed to customized version, and the feature of this customized version is all distribution and release movement Dou Budui area is carried out, but
Carry out in ready-portioned one piece of static memory area (commonly referred to " memory pool ") in advance.
Wherein, it is used as memory pool by defining the form headspace of a big static array in step (3-1).
Status file described in the above includes at least one static memory data block, preserves content and includes static data
The address of block, the size of static data block, the content of static data block.
The present invention, compared with the method for existing raising embedded software toggle speed at present, has the advantage that
1) little to hardware performance dependence
Even if hardware without any changes in the case of it is also possible to obtain the lifting of significant toggle speed.
2) without cutting software function
In the case of using the solution of the present invention, whether software function cutting is to influential effect very little.
3) performance boost is notable
Due to complicated initialization procedure being reduced to reading and the storage of memory block, and memory block is permissible in access
Only operate the region part used, and there is no any parsing action therebetween, therefore can be significantly improved.
4) software development workload estimate is little
The mode being redirected using macro substitution or dynamic modification machine code, almost need not change to original code.
Brief description
Fig. 1 is the flow chart of the present invention.
Specific embodiment
A kind of method that embedded software start-up course is accelerated in use super state storage, comprises the steps:
Step 1, determine that the startup of software program completes a little.
Step 2, using program attempt open mode file, whether successfully judge that external memory storage whether there is according to opening
Status file, if not existing, is carried out by step 3, otherwise, carries out by step 4.
Step 3, carry out software start-up course and by start complete when internal memory in data be saved in external memory storage:
(3-1) go out one piece for the region as dynamic assigning memory in static memory zoning, dynamic in modification program
Partition function and releasing memory function are to customized version so that dynamically distributes and releasing memory action are carried out in this region;?
When dividing Dram region, it is used as memory pool storage dynamic number by defining the form headspace of a big static array
According to.Realized using macro substitution by during compiling during Modification growth function, also can be carried out by dynamic Modification growth function machine code when running
The mode redirecting is realized.
(3-2) enter line program start-up course, until program performing completes a little to startup.
(3-3) creation state file in external memory storage, will complete the number of storage in Dian Shi static memory area to startup
According to being stored in status file.Described status file includes at least one static memory data block, preserves content and includes static number
According to the address of block, the size of static data block, static data block content.
(3-4) original behavior of Restoration dynamics partition function and releasing memory function.
(3-5) skip to startup to complete a little to continue executing with program follow-up function.
Step 4, read data to static memory area from status file, then skip to startup and complete a little, to continue executing with journey
Sequence follow-up function.
This method needs to carry out complex operation, the especially situation of mass data parsing in program start-up course
Under, the reason effect is the most obvious, and this situation exactly leads to start-up course slowly most commonly seen.Therefore, by this
Method can greatly promote program toggle speed.
Claims (4)
1. a kind of use super state storage accelerates the method for embedded software start-up course it is characterised in that including following walking
Rapid:
Step 1, determine that the startup of software program completes a little;
Step 2, judge that external memory storage whether there is status file, described status file includes at least one static memory number
According to block, preserve content and include the address of static data block, the size of static data block, the content of static data block;If not existing,
Then carry out by step 3, otherwise, carry out by step 4;
Step 3, carry out software start-up course and by start complete when internal memory in data be saved in external memory storage: (3-1) exists
Static memory zoning goes out one piece for the region as dynamic assigning memory, in the dynamically distributes function in modification program and release
Store function is to customized version so that dynamically distributes and releasing memory action are carried out in this region;
(3-2) enter line program start-up course, until program performing completes a little to startup;
(3-3) creation state file in external memory storage, the data completing storage in Dian Shi static memory area to startup is deposited
To in status file;
(3-4) original behavior of Restoration dynamics partition function and releasing memory function;
(3-5) skip to startup to complete a little to continue executing with program follow-up function;
Step 4, read data to static memory area from status file, then skip to startup and complete a little, after continuing executing with program
Continuous function.
2. the method that embedded software start-up course is accelerated in use super state storage according to claim 1, its feature
It is: in step (3-1), realized using macro substitution by during compiling during Modification growth function.
3. the method that embedded software start-up course is accelerated in use super state storage according to claim 1, its feature
It is: in step (3-1), Modification growth function is that dynamic Modification growth function machine code is realized by way of being redirected when running.
4. the method that embedded software start-up course is accelerated in the use super state storage according to claim 1 or 2 or 3,
It is characterized in that: it is used as memory pool by defining the form headspace of a big static array in step (3-1).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310643663.0A CN103617060B (en) | 2013-12-05 | 2013-12-05 | Method for accelerating starting procedure of embedded software by using super state storage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310643663.0A CN103617060B (en) | 2013-12-05 | 2013-12-05 | Method for accelerating starting procedure of embedded software by using super state storage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103617060A CN103617060A (en) | 2014-03-05 |
CN103617060B true CN103617060B (en) | 2017-01-18 |
Family
ID=50167763
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310643663.0A Active CN103617060B (en) | 2013-12-05 | 2013-12-05 | Method for accelerating starting procedure of embedded software by using super state storage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103617060B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105988823B (en) * | 2015-01-27 | 2019-10-22 | 阿里巴巴集团控股有限公司 | Memory allocation method and its system when in terminal using starting |
CN105939219A (en) * | 2016-04-15 | 2016-09-14 | 杭州迪普科技有限公司 | Configuration recovery method and device |
CN110109703A (en) * | 2019-05-27 | 2019-08-09 | 烟台万泉数字科技有限公司 | The subprogram with static data function is realized in small PLC |
CN110851171B (en) * | 2019-11-09 | 2023-08-11 | 许继集团有限公司 | Function configuration method, tool and system for embedded platform |
CN114116222A (en) * | 2021-11-30 | 2022-03-01 | 翱捷智能科技(上海)有限公司 | Method and device for dynamically planning memory layout during startup of embedded system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101814020A (en) * | 2010-04-15 | 2010-08-25 | 长沙理工大学 | Rapid implementation method based on embedded program and system thereof |
CN102096591A (en) * | 2011-03-01 | 2011-06-15 | 云浮南风数字科技有限公司 | Method for quickening start of embedded Linux system |
-
2013
- 2013-12-05 CN CN201310643663.0A patent/CN103617060B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101814020A (en) * | 2010-04-15 | 2010-08-25 | 长沙理工大学 | Rapid implementation method based on embedded program and system thereof |
CN102096591A (en) * | 2011-03-01 | 2011-06-15 | 云浮南风数字科技有限公司 | Method for quickening start of embedded Linux system |
Also Published As
Publication number | Publication date |
---|---|
CN103617060A (en) | 2014-03-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103617060B (en) | Method for accelerating starting procedure of embedded software by using super state storage | |
CN104102506B (en) | A kind of Android Acceleration of starting methods based on ARM platforms | |
CN108459898B (en) | Resource recovery method and device | |
CN110955431B (en) | Processing method and device of compiling environment | |
CN113872948A (en) | Method for executing intelligent contract, block chain node and node equipment | |
US9286108B2 (en) | Method to track application context and application identification | |
WO2016101503A1 (en) | Hot patching realization method and apparatus | |
TW201502764A (en) | Specialized boot path for speeding up resume from sleep state | |
WO2020238245A1 (en) | Function jump implementation method, device, and computer storage medium | |
US20110197193A1 (en) | Device and method for controlling communication between bios and bmc | |
CN111770116B (en) | Method for executing intelligent contract, block chain node and storage medium | |
CN103324582A (en) | Memory migration method, memory migration device and equipment | |
US20170147330A1 (en) | Dynamically applying a patch to a computer application | |
CN103577212A (en) | System starting preloading method and device | |
CN111814202A (en) | Method for executing intelligent contract, block chain node and storage medium | |
CN111770204B (en) | Method for executing intelligent contract, block chain node and storage medium | |
CN106777345B (en) | Data extraction loading method based on mass data migration | |
CN105589729A (en) | Dynamic compiling method and device based on embedded virtual machine | |
WO2015105486A1 (en) | Dynamically applying a software patch to a computer program | |
CN111768183B (en) | Method for executing intelligent contract, block chain node and storage medium | |
US8966212B2 (en) | Memory management method, computer system and computer readable medium | |
CN111190692A (en) | Monitoring method and system based on Roc processor and readable medium | |
CN111770202A (en) | Method for executing intelligent contract, block chain node and storage medium | |
CN100549958C (en) | A kind of class file stowage and system | |
CN109144708B (en) | Electronic computing device and method for adjusting trigger mechanism of memory recovery function |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |