CN102193847B - 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 PDF

Info

Publication number
CN102193847B
CN102193847B CN 201110174449 CN201110174449A CN102193847B CN 102193847 B CN102193847 B CN 102193847B CN 201110174449 CN201110174449 CN 201110174449 CN 201110174449 A CN201110174449 A CN 201110174449A CN 102193847 B CN102193847 B CN 102193847B
Authority
CN
China
Prior art keywords
memory
data
reserved memory
reserved
common
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
Application number
CN 201110174449
Other languages
Chinese (zh)
Other versions
CN102193847A (en
Inventor
胡小龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN 201110174449 priority Critical patent/CN102193847B/en
Publication of CN102193847A publication Critical patent/CN102193847A/en
Application granted granted Critical
Publication of CN102193847B publication Critical patent/CN102193847B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)

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

Restart data not loss method and reserved memory administration module
Technical field
The present invention relates to technical field of data storage, be specifically related to restart data not loss 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 the non-volatile memory devices such as disk, data card to finish above-mentioned functions.But, in embedded system, not necessarily possess the devices such as disk, data card.And the access rate of disk, data card is lower, and scene that data volume larger 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 finish above-mentioned functions with reserved memory.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, and can be used for preserving some and restart the data that front hope keeps, reads when supplying to start next time, as: restarting information etc.
With respect to disk, data card, the access speed of internal memory is many soon.But for the larger scene of data volume, require more reserved memory, probably cause 30%~40% of the Installed System Memory will be as reserved memory.In a single day internal memory becomes reserved memory, just can not be used for storing 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 not loss method and reserved memory administration module, to improve memory usage.
Technical scheme of the present invention is achieved in that
A kind ofly restart not loss method of data, be applied to computer system, the method comprises:
Before system restarted, the reservation data of self-application module write common memory in the future, according to the total length that keeps data, applied for that is used for preserving the high memory of above-mentioned reservation data;
Reservation data in the common memory are 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 record and keeps 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 is 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 reservation data in the reserved memory are moved in the common memory, so that each application module reads the reservation data from common memory.
Described high memory is continuous.
Described reservation data in the reserved memory are moved in the common memory is: according to keeping page table, will keep data and move in the former common memory.
Described reservation data in the reserved memory are moved in the common memory further comprises afterwards:
System restarts and finishes, and discharges reserved memory.
Described total length according to keeping data, apply for further comprising before the high memory:
According to the common memory address of the reservation data of storing all application modules, calculate the total length that keeps data.
A kind of reserved memory administration module is arranged in computer system, comprising:
Keep the data writing module: before system restarts, when the reservation data of finding all application modules all have been written into common memory, according to the total length that keeps data, apply for a high memory, reservation data in the common memory are 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 record and keeps 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 is recorded on the non-volatile equipment;
Keep 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 reservation data in the reserved memory are moved in the common memory, so that each application module reads the reservation data from common memory.
The high memory of described reservation data writing module application is continuous.
Described reservation data read module will keep data and move in the former common memory according to keeping page table.
Described reservation data read module is further used for, and system restarts and finishes, and discharges reserved memory.
Described reservation data writing module is further used for, receive the common memory address that stores the reservation data that each application module is sent, according to the common memory address that stores the reservation data that all application modules are sent, calculate the total length of described reservation data.
Compared with prior art, the present invention only when the needs storage keeps data, just according to the length application high memory that keeps data, need not the reserved memory of advance reservation regular length, has improved memory usage; And the change of application modules is very little, only needs to increase the function that will store the common memory address notification reserved memory administration module that keeps data and gets final product.
Description of drawings
Fig. 1 is restarted not loss method process flow diagram of data for what the embodiment of the invention provided;
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 the reservation data.
Fig. 1 is restarted not loss method process flow diagram of data for what the embodiment of the invention provided, 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 reservation data of this module are saved in common memory, records the common memory address that this has stored the reservation data of 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 reservation data of all application modules.
Keep data and 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 reservation 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, p=kmalloc (size, flag) is used for applying for that size is the common memory of size; Memcpy (p, data, size) is used for keeping data data and writes the common memory that application is arrived, and p is the common memory address; Setpreservememory (p, size) is used for storing common memory address p and the big or small size notice reserved memory administration module that keeps data.
Step 102: the reserved memory administration module finds that all application modules all will keep data and write common memory, then according to the storage of record the common memory address of reservation data of all application modules, calculate the total length len that keeps data, to continuous length of high memory administration module application high memory that is len, all reservation data in the common memory are moved in the high memory of applying for, this high memory becomes reserved memory, writes the reservation page table simultaneously in reserved memory.
After high memory writes the reservation data, just become reserved memory.
Keeping page table is used for record reservation data in the address of former common memory and keeps the address of data in reserved memory.Like this, reserved memory is comprised of two parts, and a part is to keep page table; Another part is to keep 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 is recorded to first physical address, reservation 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, reservation 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 processes, and make to keep mark at reserved memory.
Make to keep mark at 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 reservation 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 reservation data of this module, from common memory, read the reservation 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: keep data writing module 21 and keep data read module 22, wherein:
Keep data writing module 21: system is about to restart, when finding that all application modules all will keep data and write common memory, store the common memory address that keeps data according to what each application module was sent, calculate the total length that keeps data, apply for that a block length is for keeping the continuous high memory of data total length, reservation data in the common memory are moved in this high memory, high memory becomes reserved memory, in reserved memory, safeguard simultaneously and keep page table, be used for record and keep data in the address of former common memory and the address in reserved memory, with the first physical address of reserved memory, keep the data total length, the reserved memory total length is recorded on the non-volatile equipment of high speed.
Keep data read module 22: system restarts, read first physical address, reservation 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 process, and make to keep mark at reserved memory; According to the reservation page table in the reserved memory, the reservation data in the reserved memory are moved in the common memory, so that each application module reads the reservation 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 limit the present invention, within the spirit and principles in the present invention not all, any modification of making, is equal to replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (10)

1. restart not loss method of data for one kind, be applied to computer system, it is characterized in that the method comprises:
Before system restarted, the reservation data of self-application module write common memory in the future, according to the total length that keeps data, applied for that is used for preserving the high memory of above-mentioned reservation data;
Reservation data in the common memory are 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 record and keeps 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 is 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 reservation data in the reserved memory are moved in the common memory, so that each application module reads the reservation data from common memory, wherein, 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.
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 reservation data in the reserved memory are moved in the common memory is: according to keeping page table, will keep data and move in the former common memory.
4. method according to claim 1 and 2 is characterized in that, described reservation data in the reserved memory are 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 keeping data is applied for further comprising before the high memory:
According to the common memory address of the reservation data of storing all application modules, calculate the total length that keeps data.
6. a reserved memory administration module is arranged in computer system, it is characterized in that, comprising:
Keep the data writing module: before system restarts, when the reservation data of finding all application modules all have been written into common memory, according to the total length that keeps data, apply for a high memory, reservation data in the common memory are 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 record and keeps 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 is recorded on the non-volatile equipment;
Keep 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, reservation data in the reserved memory are moved in the common memory, so that each application module reads the reservation data from common memory, wherein, during system initialization, data in the common memory are carried out initialization, and the data in the high memory are not carried out initialization.
7. reserved memory administration module according to claim 6 is characterized in that, the high memory of described reservation data writing module application is continuous.
8. according to claim 6 or 7 described reserved memory administration modules, it is characterized in that described reservation data read module will keep data and move 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 reservation 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 reservation data writing module is further used for, receive the common memory address that stores the reservation data that each application module is sent, according to the common memory address that stores the reservation data that all application modules are sent, calculate the total length of described reservation data.
CN 201110174449 2011-06-24 2011-06-24 No-lose method of restart data and reserved memory management module Active CN102193847B (en)

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 CN102193847A (en) 2011-09-21
CN102193847B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN111581018B (en) * 2020-04-20 2023-08-01 深圳震有科技股份有限公司 Data recovery method, intelligent terminal and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0308991D0 (en) * 2003-04-17 2003-05-28 Psion Digital Ltd A data access replication or communication system comprising a distributed software application

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN102193847A (en) 2011-09-21

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
US8650379B2 (en) Data processing method for nonvolatile memory system
US8214581B2 (en) System and method for cache synchronization
CN102622309B (en) Data security erase method and device
US7937522B2 (en) Method for flash memory data management
US20110191523A1 (en) Priority Ordered Multi-Medium Solid-State Storage System and Methods for Use
CN102043687B (en) Copy on first write device for realizing data snapshot and control method
CN101645043B (en) Methods for reading and writing data and memory device
CN106055431A (en) Data backup and recovery method and data backup and recovery device based on snapshot online rollback
CN102184145B (en) Zero restart-data loss method and device
CN101627373A (en) Memory device performance enhancement through pre-erase mechanism
CN105718530A (en) File storage system and file storage control method thereof
US8332575B2 (en) Data management systems, methods and computer program products using a phase-change random access memory for selective data maintenance
CN103713973B (en) A kind of mixing storage backup method and system based on HDD and SSD
CN103049349A (en) Snapshot method and system based on tiered storage
US10635346B2 (en) Self-trimming of data stored in non-volatile memory using data storage controller
CN103309820A (en) Implementation method for disk array cache
CN103996412A (en) Power-fail protection method applied to intelligent-card nonvolatile memories
CN105630701B (en) Data storage device and the reading/writing method for using unavailable page table or unavailable piece of table
CN104850355A (en) Storage device, storage system, address information processing method of storage device
CN105630408A (en) Solid-state drive control chip integrating MRAM (Magnetic Random Access Memory) and solid-state drive
CN102193847B (en) No-lose method of restart data and reserved memory management module
CN104615383A (en) Software operation method and device based on virtual disk
JP2010086009A (en) Storage device and memory control method

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