The EMS memory management process that is used for field data-protection
Technical field
The present invention relates to the management method of memory source, particularly system stability is required to be used for than higher system the EMS memory management process of field data-protection.
Background technology
At present, the EMS memory management process of operating system mainly is by optimizing internal storage data structure or algorithm, and the virtual mechanism of perhaps sampling enlarges method such as memory headroom and reduces memory fragmentation, improves Memory Allocation and release rate, with the elevator system performance etc.For example:
A. number of patent application: 01139150.2 publication number: CN 1427342A
Patent name: a kind of internal storage management system and distribution method thereof
Main contents: it provides a kind of internal storage management system and distribution method thereof, adapting to the application program of frequent use Dram, thereby has significantly reduced the fragment of system's generation in service.
B. number of patent application: 02151120.9 publication number: CN 1505330A
Patent name: a kind of EMS memory management process
Main contents: it is will repeatedly apply for internal memory in order to solve communication apparatus in the transmission course of message, the copy low problem of transfer efficiency that causes of message and take a kind of management method of internal memory optimization.
C. number of patent application: 200310110344.X publication number: CN 1635482A
Patent name: a kind of method of managing embedded system memory
Main contents: it provides a kind of memory pool data structure, reduces the Installed System Memory fragment by the optimization to the internal memory pool structure.
From top technical situation, the pattern of memory management is based on the computer organization of Fig. 1 in view of logic, and system comprises CPU (central processing unit), internal memory (RAM) and hard disk or FLASH memory devices such as (flash memories).
Analyze roughly on the internal memory operating characteristic, internal memory divides two kinds, and one is the internal memory that needs the periodic refresh content: dynamic ram, i.e. and DRAM (as SDRAM, DDR etc.), another kind is not need content refresh: static RAM (SRAM), i.e. SRAM.For SRAM, as long as power supply, the information in the internal memory can not lost.And if dynamic ram does not carry out the periodic refresh content, being kept at internal memory the inside information will lose.
In stability requirement than higher system, such as the base station equipment of wireless telecommunications.Because the fault of the fault of system software itself or long-time back system hardware may cause collapse.After the system crash, if reset again, the information that is kept among the DRAM will be lost, cause some fault not reappear, this has stayed very big hidden danger for the operation of equipment, particularly a new system initial stage, because software and hardware is all unreliable, this situation has been brought very big trouble to localization of fault.
Summary of the invention
In order to overcome above-mentioned defective; the object of the present invention is to provide a kind of in memory management technology; after the system crash; the EMS memory management process of the field data-protection that the data that system need preserve when resetting are not destroyed; this method is according to the field data of preserving, reason that can the Precise Position System collapse.
In order to achieve the above object, a kind of EMS memory management process that is used for field data-protection of the present invention may further comprise the steps:
A) after system start-up, CPU loading field protection handling procedure is to non-protection area or the Dram and the operation of static memory;
B) the scene protection handling procedure is protected processing to the field data-protection district of static memory;
C) system runs application;
Described step B) specifically be divided into following steps:
Step B1) whether the scene protection handling procedure is effective according to effective detection zone detection static memory of static memory, if invalid, then enters step B2); If effectively, enter step B3);
Step B2) system carries out entering step C after the initialization to whole static memory);
Step B3) the scene protection handling procedure is judged according to the data message of effective detection zone of static memory, if the scene protection data field only comprises data field 2, enters step C); If only comprise data field 1, or not only comprise data field 1 but also comprise data field 2, then, the scene protection data are protected processing according to the configuration of system, enter step C).
Wherein, described step B2) be specially: system carries out initialization to whole static memory, rewrites effective detection zone of static memory, the address space of designation data district 1, data field 2 and non-protection area.
Wherein, the data in the described data field 1 are can be by the data of system initialization, and the data in the described data field 2 are can not be by the data of system initialization.
Wherein, described step B3) in, protect processing to be specially to the scene protection data: data are moved on to the another one memory headroom; read field data with order Deng system start-up after finishing; perhaps write hard disk or flash memory device, perhaps print to serial ports, perhaps abandon.
System architecture of the present invention and EMS memory management process have solved the problem that the system for field data can not be recovered after the system reset, by the recovery of field data, help the system equipment failure location.
Description of drawings
Fig. 1 is the system logic illustraton of model of memory management of the prior art.
Fig. 2 is the system logic illustraton of model of the present invention's memory management of being used for field data-protection.
Fig. 3 is the division figure of memory headroom of the system of the present invention's memory management of being used for field data-protection.
Fig. 4 is a data topology example figure of the data field 1 divided of memory headroom shown in Figure 3.
Fig. 5 is that the application system of the present invention's EMS memory management process of being used for field data-protection starts process flow diagram.
Embodiment
As shown in Figure 2, the applied system of EMS memory management process of the present invention includes: memory devices such as CPU and SRAM, DRAM, hard disk or FLASH, for the field data after the collapse of energy saved system, must there be SRAM in this system.If the memory headroom that system software needs is little, can be as long as a SRAM.
For the data that keep the scene intact, need divide the sram memory space, as shown in Figure 3.As can be seen from Figure 3, SRAM is divided into validity detection zone, field data-protection district and non-protection area, and wherein the validity surveyed area comprises the information of Magic sign and each data field of SRAM.The memory headroom of the non-protection area of DRAM memory headroom and SRAM uses for operating system or upper level applications.The field data-protection district needs data recovered after the system crash; can ruined characteristic divide after system starts once more according to data; comprise two class data; one class is can be by the data of system initialization; (for example progress information piece, mission bit stream piece, system resource allocation situation etc.); these information can be covered (below can be called for short data field 1 by the data field of system initialization, the structure of data field 1 as shown in Figure 4) by new data after system starts once more.Another kind of is can not be by the data of system initialization (such as abnormal log, as long as not initialization should the zone after system started once more, system journal can not be modified, and can not be called for short data field 2 by the data of system initialization below).
According to system configuration, three kinds of situations of scene protection data separation:
First kind situation: include only data field 2;
The second class situation: include only data field 1;
The 3rd class situation: comprise data field 1 and data field 2.
Detailed step following (as shown in Figure 5):
Step 501: after the system reset, the CPU loading field is protected the non-protection area memory headroom of handling procedure to DRAM memory headroom or SRAM, and carries out this program;
Step 502: whether the scene protection handling procedure is effective according to effective detection zone detection SRAM of SRAM, if effectively, information according to effective detection zone, if judge first kind situation in the scene protection data field, not initialization SRAM then, directly enter step 505, if second class and the 3rd class situation then enter step 504; If invalid, then enter step 503;
Step 504:, the scene protection data are protected processing according to system configuration.The difference of system configuration, processing mode are also different; For example, can move on to the another one memory headroom to data, read field data with order after waiting system start-up to finish, perhaps write hard disk or Flash equipment, perhaps print to serial ports or other output devices, perhaps abandon or the like, and then enter step 505;
Step 503: system data may be destroyed or system cut-off restart, the initialization sram memory, according to system configuration information, the whole sram memory of initialization is write the effective surveyed area of SRAM, the address space of designation data district 1, data field 2 and non-protection area;
Step 505: start the operating system and application program.
In the startup of operating system and application program; requirement is according to the configuration of system; the field data that configuration needs protection; with the address of each data structure in internal memory; such as 1 form (as shown in Figure 4) in the data field; the data that need protection have the mission bit stream piece, progress information piece and system resource utilize the situation record sheet.After system reset started, in the step 504 of Fig. 5, these data will take appropriate measures according to the requirement of protection.
Except data field 1 and data field 2, other all physical memories of system can be supplied with program and operating system and call, and total size comprises the non-protection area of DRAM internal memory and SRAM.The management method of these internal memories common management method of can sampling is such as memory pool or chained list management etc.
As can be seen from the above, this method for designing of sampling, after system crash, when resetting again, the data in the time of can obtaining system crash, the problem that field data is lost when having solved system reset helps the location of the system failure.