CN102193847A - No-lose method of restart data and reserved memory management module - Google Patents
No-lose method of restart data and reserved memory management module Download PDFInfo
- Publication number
- CN102193847A CN102193847A CN2011101744496A CN201110174449A CN102193847A CN 102193847 A CN102193847 A CN 102193847A CN 2011101744496 A CN2011101744496 A CN 2011101744496A CN 201110174449 A CN201110174449 A CN 201110174449A CN 102193847 A CN102193847 A CN 102193847A
- Authority
- CN
- China
- Prior art keywords
- memory
- reserved memory
- retention data
- reserved
- data
- 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.)
- Granted
Links
Images
Abstract
The invention discloses a no-lose method of restart data and a reserved memory management module. The no-lose method of restart data and the reserved memory management module are applied to a computer system. The method comprises the following steps of: before system restart, writing reserved data from an application module into an ordinary memory, and according to the total length of the reserved data, applying for a high memory for storing the reserved data; removing the reserved data in the ordinary memory to the high memory, wherein the high memory becomes a reserved memory, a reserved page table is maintained in the reserved memory, and the reserved page table is used for recording the address of the reserved data in the original ordinary memory and the address in the reserved memory, and recording an initial physical address and the total length of the reserved memory on a nonvolatile device; in the process of system restart, reading the initial physical address and the total length of the reserved memory from the nonvolatile device; and according to the reserved page table, removing the reserved data in the reserved memory to the ordinary memory to ensure that each application module reads the reserved data from the ordinary memory. The no-lose method of the restart data and the reserved memory management module improve the memory utilization ratio.
Description
Technical field
The present invention relates to technical field of data storage, be specifically related to restart data and do not lose method and reserved memory administration module.
Background technology
Be accompanied by the raising of high reliability request, upper layer software (applications) can require system can store some data before restarting, and can read these data after restarting, with the fast quick-recovery of realization service data, thus the shut down time of minimizing system.
In common computer system, can use non-volatile memory devices such as disk, data card to finish above-mentioned functions.But, in embedded system, not necessarily possess devices such as disk, data card.And the access rate of disk, data card is lower, and scene that data volume bigger very high for some reliability requirements if use disk, data card to finish above-mentioned functions, can prolong system shut down time significantly.
In common embedded system, can use reserved memory to finish above-mentioned functions.Reserved memory is common in embedded device, is the internal memory that equipment keeps for some purpose.In system initialisation phase, reserved memory can not be included into internal storage management system.Reserved memory possesses restarts the characteristic that data are not lost, can be used to preserve wish reservation, the data that read when supplying next time to start before some are restarted, as: restarting information etc.
With respect to disk, data card, the access speed of internal memory is many soon.But for the bigger scene of data volume, require more reserved memory, cause 30%~40% of the Installed System Memory will be probably as reserved memory.In a single day internal memory becomes reserved memory, just can not be used to store common data at ordinary times.In a single day this just causes will supporting fast quick-recovery that the specification of system will decline to a great extent, and perhaps will increase extra internal memory.
Summary of the invention
The invention provides and restart data and do not lose method and reserved memory administration module, to improve memory usage.
Technical scheme of the present invention is achieved in that
A kind ofly restart data and do not lose method, be applied to computer system, this method comprises:
Before system restarted, the retention data of self-application module write common memory in the future, according to the total length of retention data, applies for a high memory that is used to preserve above-mentioned retention data;
Retention data in the common memory is moved in this high memory, this high memory becomes reserved memory, and maintenance keeps page table in reserved memory, described reservation page table is used for writing down retention data in the address of former common memory and the address in reserved memory, and first physical address, the reserved memory total length of reserved memory recorded on the non-volatile equipment;
In system's restarting process, read first physical address, the reserved memory total length of reserved memory from non-volatile equipment; According to described reservation page table, the retention data in the reserved memory is moved in the common memory, so that each application module reads retention data from common memory.
Described high memory is continuous.
Described retention data in the reserved memory is moved in the common memory is: according to keeping page table, retention data is moved in the former common memory.
Described retention data in the reserved memory is moved in the common memory further comprises afterwards:
System restarts and finishes, and discharges reserved memory.
Described total length according to retention data, apply for further comprising before the high memory:
According to the common memory address of the retention data of storing all application modules, calculate the total length of retention data.
A kind of reserved memory administration module is arranged in computer system, comprising:
Retention data writing module: before system restarts, when the retention data of finding all application modules all has been written into common memory, total length according to retention data, apply for a high memory, retention data in the common memory is moved in this high memory, this high memory becomes reserved memory, in reserved memory, safeguard simultaneously and keep page table, described reservation page table is used for writing down retention data in the address of former common memory and the address in reserved memory, and first physical address, the reserved memory total length of reserved memory recorded on the non-volatile equipment;
Retention data read module: in system's restarting process, read first physical address, the reserved memory total length of reserved memory from non-volatile equipment; According to the reservation page table in the reserved memory, the retention data in the reserved memory is moved in the common memory, so that each application module reads retention data from common memory.
The high memory of described retention data writing module application is continuous.
Described retention data read module is moved retention data in the former common memory according to keeping page table.
Described retention data read module is further used for, and system restarts and finishes, and discharges reserved memory.
Described retention data writing module is further used for, receive the common memory address that stores retention data that each application module is sent, according to the common memory address that stores retention data that all application modules are sent, calculate the total length of described retention data.
Compared with prior art, the present invention only when needs storage retention data, just according to the length application high memory of retention data, need not to reserve in advance the reserved memory of regular length, has improved memory usage; And the change of application modules is very little, and the function that only needs to increase the common memory address notification reserved memory administration module that will store retention data gets final product.
Description of drawings
Fig. 1 does not lose method flow diagram for the data of restarting that the embodiment of the invention provides;
The composition synoptic diagram of the reserved memory administration module that Fig. 2 provides for the embodiment of the invention.
Embodiment
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
For convenience of description, the data with application module reserved memory to be written are called retention data.
Fig. 1 does not lose method flow diagram for the data of restarting that the embodiment of the invention provides, and as shown in Figure 1, its concrete steps are as follows:
Step 101: arbitrary application module discovery system is about to restart, and the retention data of this module is saved in common memory, writes down the common memory address of this retention data of having stored this module, and with this common memory address notification reserved memory administration module; The reserved memory management module records has been stored the common memory address of the retention data of all application modules.
Retention data may be saved in the contiguous memory, also may be saved in the discontinuous memory pages.
Application module is saved in common memory with the retention data of this module, and this common memory address notification reserved memory administration module can be realized by following pseudo-code:
p=kmalloc(size,flag);
memcpy(p,data,size);
setpreservememory(p,size);
Kmalloc in the above-mentioned pseudo-code, memcpy etc. are exemplary description, and under different system, the varying environment, the title of interface may be different with parameter.Wherein, (size flag) is used to apply for that size is the common memory of size to p=kmalloc; (p, data size) are used for retention data data is write the common memory of applying for memcpy, and p is the common memory address; (p size) is used for and will stores the common memory address p and the big or small size notice reserved memory administration module of retention data setpreservememory.
Step 102: the reserved memory administration module finds that all application modules all write common memory with retention data, then according to the storage of record the common memory address of retention data of all application modules, calculate the total length len of retention data, to continuous length of high memory administration module application high memory that is len, in the high memory that all retention data resettlements in the common memory are applied for, this high memory becomes reserved memory, writes the reservation page table simultaneously in reserved memory.
After high memory writes retention data, just become reserved memory.
Keep page table and be used for writing down address and retention data the address in reserved memory of retention data in former common memory.Like this, reserved memory is made up of two parts, and a part is to keep page table; Another part is a retention data.
The difference of high memory and common memory is: during system initialization, the data in the common memory are carried out initialization, and the data in the high memory are not carried out initialization.
Step 103: the reserved memory administration module records first physical address, retention data total length, the reserved memory total length of reserved memory on the non-volatile equipment of high speed.
The non-volatile equipment of high speed is for example: nonvolatile random access memory (NVRAM, Non-Volatile Random Access Memory).
Step 104: system restarts, and the reserved memory administration module reads first physical address, retention data total length, the reserved memory total length of reserved memory from the non-volatile equipment of high speed.
Step 105: the reserved memory administration module is determined the scope of reserved memory according to first physical address, the reserved memory total length of reserved memory, reserved memory is not done zero clearing and handles, and make to keep mark on reserved memory.
Make to keep mark on reserved memory, the data in the reserved memory just can not be modified like this.
Step 106: the reserved memory administration module is moved the retention data in the reserved memory in the common memory according to keeping page table.
Step 107: each application module according to the storage of record the common memory address of retention data of this module, from common memory, read retention data.
Step 108: system restarts and finishes, and the reserved memory administration module discharges reserved memory.
The composition synoptic diagram of the reserved memory administration module that Fig. 2 provides for the embodiment of the invention, as shown in Figure 2, it mainly comprises: retention data writing module 21 and retention data read module 22, wherein:
Retention data writing module 21: system is about to restart, when finding that all application modules have all write common memory with retention data, the common memory address that stores retention data of sending according to each application module, calculate the total length of retention data, apply for that a block length is the continuous high memory of retention data total length, retention data in the common memory is moved in this high memory, high memory becomes reserved memory, in reserved memory, safeguard simultaneously and keep page table, be used for writing down retention data in the address of former common memory and the address in reserved memory, with the first physical address of reserved memory, the retention data total length, the reserved memory total length records on the non-volatile equipment of high speed.
Retention data read module 22: system restarts, read first physical address, retention data total length, the reserved memory total length of reserved memory from the non-volatile equipment of high speed, determine the scope of reserved memory, reserved memory is not done zero clearing and handle, and on reserved memory, make to keep mark; According to the reservation page table in the reserved memory, the retention data in the reserved memory is moved in the common memory, so that each application module reads retention data from common memory; Restart when finishing when system, discharge reserved memory.
The embodiment of the invention is applied in the computer system.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope of protection of the invention.
Claims (10)
1. restart data and do not lose method for one kind, be applied to computer system, it is characterized in that this method comprises:
Before system restarted, the retention data of self-application module write common memory in the future, according to the total length of retention data, applies for a high memory that is used to preserve above-mentioned retention data;
Retention data in the common memory is moved in this high memory, this high memory becomes reserved memory, and maintenance keeps page table in reserved memory, described reservation page table is used for writing down retention data in the address of former common memory and the address in reserved memory, and first physical address, the reserved memory total length of reserved memory recorded on the non-volatile equipment;
In system's restarting process, read first physical address, the reserved memory total length of reserved memory from non-volatile equipment; According to described reservation page table, the retention data in the reserved memory is moved in the common memory, so that each application module reads retention data from common memory.
2. method according to claim 1 is characterized in that described high memory is continuous.
3. method according to claim 1 and 2 is characterized in that, described retention data in the reserved memory is moved in the common memory is: according to keeping page table, retention data is moved in the former common memory.
4. method according to claim 1 and 2 is characterized in that, described retention data in the reserved memory is moved in the common memory further comprises afterwards:
System restarts and finishes, and discharges reserved memory.
5. method according to claim 1 and 2 is characterized in that, described total length according to retention data is applied for further comprising before the high memory:
According to the common memory address of the retention data of storing all application modules, calculate the total length of retention data.
6. a reserved memory administration module is arranged in computer system, it is characterized in that, comprising:
Retention data writing module: before system restarts, when the retention data of finding all application modules all has been written into common memory, total length according to retention data, apply for a high memory, retention data in the common memory is moved in this high memory, this high memory becomes reserved memory, in reserved memory, safeguard simultaneously and keep page table, described reservation page table is used for writing down retention data in the address of former common memory and the address in reserved memory, and first physical address, the reserved memory total length of reserved memory recorded on the non-volatile equipment;
Retention data read module: in system's restarting process, read first physical address, the reserved memory total length of reserved memory from non-volatile equipment; According to the reservation page table in the reserved memory, the retention data in the reserved memory is moved in the common memory, so that each application module reads retention data from common memory.
7. reserved memory administration module according to claim 6 is characterized in that, the high memory of described retention data writing module application is continuous.
8. according to claim 6 or 7 described reserved memory administration modules, it is characterized in that described retention data read module is moved retention data in the former common memory according to keeping page table.
9. according to claim 6 or 7 described reserved memory administration modules, it is characterized in that described retention data read module is further used for, system restarts and finishes, and discharges reserved memory.
10. according to claim 6 or 7 described reserved memory administration modules, it is characterized in that, described retention data writing module is further used for, receive the common memory address that stores retention data that each application module is sent, according to the common memory address that stores retention data that all application modules are sent, calculate the total length of described retention data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110174449 CN102193847B (en) | 2011-06-24 | 2011-06-24 | No-lose method of restart data and reserved memory management module |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110174449 CN102193847B (en) | 2011-06-24 | 2011-06-24 | No-lose method of restart data and reserved memory management module |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102193847A true CN102193847A (en) | 2011-09-21 |
CN102193847B CN102193847B (en) | 2013-04-10 |
Family
ID=44601950
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201110174449 Active CN102193847B (en) | 2011-06-24 | 2011-06-24 | No-lose method of restart data and reserved memory management module |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102193847B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104809013A (en) * | 2015-04-21 | 2015-07-29 | 北京创毅视讯科技有限公司 | Embedded system starting method and device |
CN107894932A (en) * | 2016-09-29 | 2018-04-10 | 厦门雅迅网络股份有限公司 | The method and its system of data consistency before and after holding system reboot |
CN111581018A (en) * | 2020-04-20 | 2020-08-25 | 深圳震有科技股份有限公司 | Data recovery method, intelligent terminal and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070130255A1 (en) * | 2003-04-17 | 2007-06-07 | Lionel Wolovitz | Data access, replication or communication system comprising a distributed software application |
CN101710253A (en) * | 2009-11-25 | 2010-05-19 | 安凯(广州)微电子技术有限公司 | Deep-sleep method of embedded system |
CN102033823A (en) * | 2009-09-27 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for storing data |
-
2011
- 2011-06-24 CN CN 201110174449 patent/CN102193847B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070130255A1 (en) * | 2003-04-17 | 2007-06-07 | Lionel Wolovitz | Data access, replication or communication system comprising a distributed software application |
CN102033823A (en) * | 2009-09-27 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for storing data |
CN101710253A (en) * | 2009-11-25 | 2010-05-19 | 安凯(广州)微电子技术有限公司 | Deep-sleep method of embedded system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104809013A (en) * | 2015-04-21 | 2015-07-29 | 北京创毅视讯科技有限公司 | Embedded system starting method and device |
CN104809013B (en) * | 2015-04-21 | 2018-08-14 | 北京创毅视讯科技有限公司 | A kind of embedded system start method and device |
CN107894932A (en) * | 2016-09-29 | 2018-04-10 | 厦门雅迅网络股份有限公司 | The method and its system of data consistency before and after holding system reboot |
CN111581018A (en) * | 2020-04-20 | 2020-08-25 | 深圳震有科技股份有限公司 | Data recovery method, intelligent terminal and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102193847B (en) | 2013-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9940261B2 (en) | Zoning of logical to physical data address translation tables with parallelized log list replay | |
CN104350477B (en) | For solid-state drive device(SSD)Optimization context remove | |
US8838903B2 (en) | Priority ordered multi-medium solid-state storage system and methods for use | |
US8214581B2 (en) | System and method for cache synchronization | |
US7937522B2 (en) | Method for flash memory data management | |
US20120151125A1 (en) | Data processing method for nonvolatile memory system | |
CN103049349B (en) | Based on Snapshot Method and the system of Bedding storage | |
CN102043687B (en) | Copy on first write device for realizing data snapshot and control method | |
TW200947440A (en) | Memory system | |
US9208101B2 (en) | Virtual NAND capacity extension in a hybrid drive | |
CN102841851A (en) | Flash memory management method and flash memory device | |
CN102184145B (en) | Zero restart-data loss method and device | |
CN105718530A (en) | File storage system and file storage control method thereof | |
US10635346B2 (en) | Self-trimming of data stored in non-volatile memory using data storage controller | |
CN101702139B (en) | Method and device for accessing data of Nand flash memory | |
CN103514249A (en) | Method and system for automatic data reduction and storage device | |
CN102033793A (en) | Snapshot method and solid-state hard disk | |
CN103996412A (en) | Power-fail protection method applied to intelligent-card nonvolatile memories | |
US20080320210A1 (en) | Data management systems, methods and computer program products using a phase-change random access memory for selective data maintenance | |
CN110515550B (en) | Method and device for separating cold data and hot data of SATA solid state disk | |
CN104850355A (en) | Storage device, storage system, address information processing method of storage device | |
CN102193847B (en) | No-lose method of restart data and reserved memory management module | |
CN104615383A (en) | Software operation method and device based on virtual disk | |
JP4988054B2 (en) | Memory system | |
WO2012113872A1 (en) | A device controller for a memory device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 | ||
CP03 | Change of name, title or address |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Patentee after: Xinhua three Technology Co., Ltd. Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base Patentee before: Huasan Communication Technology Co., Ltd. |
|
CP03 | Change of name, title or address |