CN105320614A - Storage processing method and device capable of protecting consumption data - Google Patents

Storage processing method and device capable of protecting consumption data Download PDF

Info

Publication number
CN105320614A
CN105320614A CN201410363256.9A CN201410363256A CN105320614A CN 105320614 A CN105320614 A CN 105320614A CN 201410363256 A CN201410363256 A CN 201410363256A CN 105320614 A CN105320614 A CN 105320614A
Authority
CN
China
Prior art keywords
usage data
data
value
motion control
control word
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
Application number
CN201410363256.9A
Other languages
Chinese (zh)
Other versions
CN105320614B (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.)
State Grid Corp of China SGCC
Beijing Nanrui Zhixin Micro Electronics Technology Co Ltd
Original Assignee
State Grid Corp of China SGCC
Beijing Nanrui Zhixin Micro Electronics Technology 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 State Grid Corp of China SGCC, Beijing Nanrui Zhixin Micro Electronics Technology Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201410363256.9A priority Critical patent/CN105320614B/en
Publication of CN105320614A publication Critical patent/CN105320614A/en
Application granted granted Critical
Publication of CN105320614B publication Critical patent/CN105320614B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a storage processing method and device capable of protecting consumption data. The method comprises steps as follows: when the consumption data are stored in a storage zone, a stepping control character is set for each procedure for storage of the consumption data; when the consumption data are recovered to a buffer cache, the stepping control character is read, whether interruption occurs when consumption data are stored in the storage zone is judged according to the read stepping control character, and the consumption data are recovered according to the judged result. The method and device are mainly used for facilitating recovery of the stored data when interruption occurs during storage.

Description

A kind of storage processing method and device protecting usage data
Technical field
The present invention relates to data field of instrumentation technology, particularly a kind of storage processing method and device protecting usage data.
Background technology
Under intelligent electronic metering (as water meter, ammeter and gas meter, flow meter etc.) product mostly works in severe unattended operation environment, metering user usage data or collection user usage data, and carry out statistics charging according to the usage data stored, therefore, reliably, metering accurately or collection usage data are more subject to the attention of user.
Intelligent electronic measuring instrument is reliability and the accuracy of guaranteeing the usage data gathered, drop into a large amount of manpower and materials to study, realize dropping into great cost only according to hardware measure, and all impulsive disturbance situations cannot be stoped, and only carry out the anti-interference situation that there is loss of data too with many Backup Datas of software.
For guaranteeing usage data or gathering usage data reliability and accuracy, prior art have employed such as " getting two in three ", " getting three in five ", the data such as " voting by a show of hands " store means; But often data all suffer external interference when reading or store, as: power surges, magnetic field, electrostatic, power down etc. affect and are destroyed.When being attacked when Refresh Data stores or hinder and damage, when adopting the Backup Data approach of error correction that the minority is subordinate to the majority, effective new data will be lost.Bring huge economic loss to charge user.
It can thus be appreciated that at least there is following shortcoming in the storage scheme to usage data provided in prior art:
1, adopt the minority is subordinate to the majority means, by multiple Backup Data error correction when Refresh Data, very easily lose new refresh data, cause to gather usage data for according to the economic loss of carrying out adding up charge;
2, adopt the Backup Data error correction method that the minority is subordinate to the majority when design of electronic products is researched and developed, single-chip microprocessor MCU resource occupation is comparatively large, and storage unit increases, and hsrdware requirements strengthen, and make cost of products increase;
3, the read-write process time of a large amount of Backup Data lengthens, and increases the probability that external interference is destroyed.
Summary of the invention
In order to solve the easy loss refresh data existed the stores processor of usage data in prior art, the technical matters that MCU resource occupation is comparatively large, external interference probability is large etc., the present invention proposes a kind of storage processing method and the device of protecting usage data.
Protect a storage processing method for usage data, comprising:
When storing usage data to memory block, for storing each flow setting step motion control word of usage data;
When recovering usage data to buffer area, read step motion control word, and judge whether usage data has interruption stored in the process of memory block according to the step motion control word read, then recover usage data according to the result judged.
Preferably, for storing each flow setting step motion control word of usage data, specifically comprise:
During original state, the value arranging step motion control word is the first state value;
When starting to store source usage data, the value arranging step motion control word is the second state value;
When source usage data stores verification, the value arranging step motion control word is third state value;
When starting the Backup Data storing source usage data, the value arranging step motion control word is the 4th state value;
During Backup Data verification, the value arranging step motion control word is the 5th state value.
Preferably, the step motion control word according to reading judges whether usage data has interruption stored in the process of memory block, then recovers usage data according to the result judged, specifically comprises:
If the value of the step motion control word read is the first state value, then judges that usage data is not interrupted stored in the process of memory block, recover usage data to buffer area;
If the value of step motion control word arranged is not the first state value, then judge that usage data has interruption stored in the process of memory block, and according to the value of the step motion control word read legitimacy process is carried out to recover usage data to buffer area to usage data.
Preferably, according to the value of step motion control word read legitimacy process is carried out to recover usage data to buffer area to usage data, specifically comprises:
When the value of the step motion control word read is the second state value, identify according to the source data district of source usage data, Backup Data, source usage data, the value of the Backup Data district of Backup Data mark and minimum resolution determines legal usage data, and this legal usage data is returned to buffer area;
When the value of the step motion control word read is third state value, determines legal usage data according to the value of source usage data, Backup Data and minimum resolution, and this legal usage data is returned to buffer area;
When the value of the step motion control word read is the 4th state value, the source usage data of getting is legal usage data, and this source usage data is returned to buffer area;
When the value of step motion control word read is the 5th state value, according to getting source usage data to the check results of Backup Data or Backup Data returns to buffer area.
Preferably, the method also comprises:
Judge that whether the storage area writing data is legal according to the write frequency threshold value preset;
The storage area of data is write as illegal, then the storage area of amendment write data if judge.
Protect a stores processor device for usage data, comprising:
Stepping arranges module, for when storing usage data to memory block, for storing each flow setting step motion control word of usage data;
Recover module, for when recovering usage data to buffer area, read step motion control word, and judge whether usage data has interruption stored in the process of memory block according to the step motion control word read, then recover usage data according to the result judged.
Preferably, stepping arranges module, and during specifically for original state, the value arranging step motion control word is the first state value; When starting to store source usage data, the value arranging step motion control word is the second state value; When source usage data stores verification, the value arranging step motion control word is third state value; When starting the Backup Data storing source usage data, the value arranging step motion control word is the 4th state value; During Backup Data verification, the value arranging step motion control word is the 5th state value.
Preferably, recover module to comprise:
Initial recovery unit, for when the value of the step motion control word read is the first state value, judges that usage data is not interrupted stored in the process of memory block, recovers usage data to buffer area;
Error correction recovery unit, for when the value of the step motion control word arranged is not the first state value, judge that usage data has interruption stored in the process of memory block, and according to the value of the step motion control word read legitimacy process is carried out to recover usage data to buffer area to usage data.
Preferably, error correction recovery unit, specifically for when the value of the step motion control word arranged is not the first state value, judge that usage data has interruption stored in the process of memory block, and when the value of the step motion control word read is the second state value, identify according to the source data district of source usage data, Backup Data, source usage data, the value of the Backup Data district of Backup Data mark and minimum resolution determines legal usage data, and this legal usage data is returned to buffer area; When the value of the step motion control word read is third state value, determines legal usage data according to the value of source usage data, Backup Data and minimum resolution, and this legal usage data is returned to buffer area; When the value of the step motion control word read is the 4th state value, the source usage data of getting is legal usage data, and this source usage data is returned to buffer area; When the value of step motion control word read is the 5th state value, according to getting source usage data to the check results of Backup Data or Backup Data returns to buffer area.
Preferably, this device also comprises:
Storage area detection module, whether legal for judging the storage area writing data according to the write frequency threshold value preset; The storage area of data is write as illegal, then the storage area of amendment write data if judge.
In the scheme that the present embodiment provides, by adopting the mode record Stored Procedure each flow process stored in data procedures all being arranged to step motion control word, so that when running into interruption in storage, follow-uply can navigate to the flow process storing and interrupt accurately when recovering usage data, and recover according to the feature of each interruption flow process, therefore state, step that data are residing in storage operation can intuitively be known, obtain and can store step motion control word according to data error correction and recovery are carried out to data, the technique effect that the usage data refreshed is not lost can be ensured.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and forms a part for instructions, together with embodiments of the present invention for explaining the present invention, is not construed as limiting the invention.In the accompanying drawings:
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
A kind of original block diagram protecting the storage processing method of usage data that Fig. 1 provides for the embodiment of the present invention 1;
A kind of process flow diagram protecting the storage processing method of usage data that Fig. 2 provides for the embodiment of the present invention 1;
Fig. 3 for the embodiment of the present invention 1 provide a kind of protect in the storage processing method of usage data storage usage data to process flow diagram during memory block;
A kind of structural representation protecting the stores processor device of usage data that Fig. 4 provides for the embodiment of the present invention 1.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.Further, following embodiment is possibility of the present invention, embodiment put in order and the numbering of embodiment and its order preferably performed have nothing to do.
Embodiment 1
The method that the present embodiment provides is applicable to being deployed on intelligent electronic measuring instrument; particularly in single-chip microprocessor MCU wherein; as shown in Figure 1; MCU on this measuring instrument gathers the usage data (in the present embodiment, this usage data comprises the data of measuring instrument collection and arrangement) of consumption metering circuit; when usage data changes; MCU opens the read-write stored and allows; the storage processing method of the protection usage data using the present embodiment to provide, is saved in new usage data in storer.
For guaranteeing reliability and the accuracy of usage data; reduce the read-write operation of data-carrier store; reduce the probability that data-carrier store is destroyed; data-carrier store is in guard mode or off-position at ordinary times, only occur usage data upgrade need to carry out storing or recover data that MCU buffer zone is destroyed time turn-on data storer read-write operation allow.
Intelligent electronic measuring instrument is when normally working, carry out alternately according to the protected data of buffer zone and the external world, wherein, MCU is added up by the usage data gathering consumption metering circuit, when usage data generation minimum resolution or agreement stepping-in amount, (each intelligent electronic measuring instrument has minimum resolution, Ye Cheng unit stepping-in amount, if water meter minimum resolution is 0.01kWh) unit data change, when needing to carry out data storage, turn-on data memory read/write allows, use stepper control method, protection operation is carried out to the usage data that need preserve or significant data storage.
Specifically describe a kind of storage processing method protecting usage data that this enforcement provides below, as shown in Figure 2, the method mainly comprises two stages.
101, when usage data upgrades, need the usage data upgrading/refresh to be stored into memory block (being positioned at storer) upper time, namely when storing usage data to memory block, this stage mainly comprises: each the flow setting step motion control word being storage usage data;
102, when needing the usage data on this memory block to return on buffer area (being positioned at MCU), namely when recovering usage data to buffer area, this stage mainly comprises: read step motion control word, and judge whether usage data has interruption stored in the process of memory block according to the step motion control word read, then recover usage data according to the result judged.
Specifically, after the storage completing usage data completely, the value of step motion control word can be set to 0 in the method that the present embodiment provides, before the source usage data that will refresh is stored in memory block, first step motion control word can be set to 1, and often an execution flow process all will add 1 to step motion control word.The Stored Procedure performed is respectively sequentially and starts to store source data, and source data stores verification, starts store backup data, and Backup Data verifies.Correspondingly, each the flow setting step motion control word for storing usage data in above-mentioned 101, specifically comprises:
During original state, the value arranging step motion control word is the first state value, as 0;
When starting to store source usage data, the value arranging step motion control word is the second state value, as 1;
When source usage data stores verification, the value arranging step motion control word is third state value;
When starting the Backup Data storing source usage data, the value arranging step motion control word is the 4th state value;
During Backup Data verification, the value arranging step motion control word is the 5th state value.
Such as: set rStep_state as step motion control word, then have:
RStep_state=0: without storing data manipulation;
RStep_state=1: start to store source data;
RStep_state=2: source data stores verification;
RStep_state=3: start store backup data;
RStep_state=4: Backup Data verifies.
So, usage data is stored into the process of memory block in 101 stages, as shown in Figure 3, comprises:
201, original state, i.e. step motion control word rStep_state=0, illustrate that current storer does not carry out data storage operations;
202, step motion control word rStep_state=1, illustrates that measuring instrument generation usage data refreshes, and starts to enter the storage operation refreshing usage data; First step motion control word state is saved in storer, and record data store the step of carrying out at present; Start to enter the storage operation refreshing usage data;
203, step motion control word+1, i.e. rStep_state=2, illustrates that whether accurately, reliably the flow process of carrying out at present is to refreshing usage data in source data area stores, the need of the operation re-starting write preservation;
204, step motion control word+1, i.e. rStep_state=3, the flow process of now carrying out is after the source usage data completing source data region is preserved, back-up storage is carried out to source usage data, guarantee after source data region is destroyed, reliably can also recover usage data accurately, reduce the economic loss caused because usage data is lost;
205, step motion control word continues+1, i.e. rStep_state=4, represents and is carrying out the verification of correctness that Backup Data operates in Backup Data area stores, and to preserve verification operation treatment scheme consistent with source usage data;
206, after backup data store operation demonstration terminates, step motion control word returns to original state, proves that the usage data this time refreshed stores the complete end of operation, closes memory read/write simultaneously and allow.
Preserve process due to usage data in the said method that the present embodiment provides to be controlled by step motion control word, when suffering external interference accidental interruption in the arbitrary process of storage of subscriber data, as program fleet or power down, when recovering MCU buffer data, can according to the value of control word rStep_state, the step occurred is interrupted in accurate location, to take corresponding consumption number recovery ways, and can continue the complete operation of storage.
Specifically, in 102 according to read step motion control word judge whether usage data has interruption stored in the process of memory block, then according to judge result recovery usage data, specifically comprise:
If the value of the step motion control word read is the first state value, then judges that usage data is not interrupted stored in the process of memory block, recover usage data to buffer area;
Re-power or MCU reset at intelligent electronic measuring instrument, when the usage data of buffer zone needs again to recover, by reading the value of step motion control word, whether understanding is taken notice of is gone out to there is data storage operations now, if do not have data manipulation to be interrupted or disturb, when the value of the step motion control word namely read is 0, then only need complete the validity checking of the usage data in storer, return to MCU buffer zone
If the value of step motion control word arranged is not the first state value, then judge that usage data has interruption stored in the process of memory block, and according to the value of the step motion control word read legitimacy process is carried out to recover usage data to buffer area to usage data.
That is, the operation stored when stored is interrupted, and according to the value of step motion control word, can re-execute data storage operations, and recover the data of buffer zone.
Wherein, the above-mentioned value of step motion control word according to reading carries out legitimacy process to recover usage data to buffer area to usage data, specifically comprises:
When the value of the step motion control word read is the second state value, identify according to the source data district of described source usage data, described Backup Data, described source usage data, the value of the Backup Data district of described Backup Data mark and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area, instantiation can refer to lower 1-4;
When the value of the step motion control word read is third state value, value according to described source usage data, described Backup Data and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area, instantiation can refer to down 6;
When the value of the step motion control word read is the 4th state value, the source usage data of getting is legal usage data, and this source usage data is returned to described buffer area, and instantiation can refer to down 7;
When the value of step motion control word read is the 5th state value, according to getting source usage data to the check results of Backup Data or Backup Data returns to described buffer area, instantiation can refer to down 8.
Such as: 1, i.e. rStep_state=1 is just interrupted accidentally when storage operates in the first step, and when needing to carry out usage data refreshing, if prior art, most identical data then can be selected to refresh, thus lose new usage data, and the present embodiment is according to step motion control status word rStep_state, directly can know and occur to occur surprisingly when usage data refreshes storage, when source usage data to differ the value of minimum resolution with Backup Data, then prove that source usage data correctly writes storer, control flow can be stored according to normal stepping and complete Stored Procedure (this Stored Procedure comprise usage data is returned to buffer area), thus reach the object that refresh data do not lose,
2, source usage data is equal with Backup Data, then source usage data completes whole Stored Procedure after adding the value of minimum resolution again, avoid losing and refresh usage data;
3, when the source usage data in source data district and the Backup Data difference of backup area are greater than minimum resolution, and when being illegal to the check results of source usage data, then Backup Data is verified.If the check results of Backup Data is valid data, then again complete step motion control Stored Procedure as the usage data refreshed after Backup Data being added the value of minimum resolution; If the check results of Backup Data is also invalid data, namely whole memory data is destroyed, should and alarm retain scene and exit;
4, be legal to the check results of the source usage data in source data district, and Backup Data district mark is normal, then verify Backup Data.If the check results of Backup Data is legal, then again completes step motion control Stored Procedure as the usage data refreshed after Backup Data being added minimum resolution value, and according to Stored Procedure order, be valid data depending on Backup Data; If the check results of Backup Data is illegal, and source data district mark is normal, then continued storage write operation, the source usage data depending on source data district is valid data;
5, be legal to the check results of the source usage data in source data district, and Backup Data district mark is abnormal, then continued storage write operation, the source usage data depending on source data district is valid data;
The above-mentioned restoration methods that the present embodiment provides combines source data district mark, Backup Data district mark, according to the checksum validation means of source data and Backup Data, realize usage data recover accurately, reliably or preserve, not because new refresh data is lost in unexpected interference.
6, when interrupting appearing at rStep_state=2, needing verification source usage data whether to be in reliable preservation state, can determine according to whether source usage data School Affairs comparison is legal.As legal in source usage data, then whether differ the value of minimum resolution with Backup Data comparison, i.e. unit stepping-in amount, if difference exceeds unit stepping-in amount, then get Backup Data and add that unit stepping-in amount is saved in usage data region, source again, and continue Stored Procedure; If difference is unit stepping-in amount, then continue storing process.If source usage data is illegal, then get Backup Data verification legal after add that unit stepping-in amount is saved in usage data region, source again, and continued storing process.According to Stored Procedure, usage data preservation operation in source is prior to Backup Data, and Backup Data and source data be not on the same area or the same page, so visual Backup Data is reliable valid data.
7, when interrupting appearing at rStep_state=3, namely Stored Procedure is in backup data store operation, directly can get source usage data and backup to Backup Data region, and continue storage operating process.
8, when interrupting appearing at rStep_statee=4, namely verify Backup Data whether reliable preservation state, according to source usage data comparison, equally namely complete last Stored Procedure; Do not wait and then complete Stored Procedure from rStep_state=3 flow process from the usage data to Backup Data region of new preservation source.
In addition, when the storage of source usage data and usage data recovery operation, need the hardware state paying close attention to storer, according to the memory state mark in source data district and Backup Data district, the data of source region or backup area in rational use storer, and judge according to memory state and data validation, as early as possible be reported to management system, reduce the factor data likely caused because storer damages cannot be stored in storer, when unexpected appearance, the economic loss that usage data is lost and brought and dispute.Therefore, in a preferred approach, the method that the present embodiment provides also comprises: judge that whether the storage area writing data is legal according to the write frequency threshold value preset; The storage area of data is write as illegal, then the storage area of amendment write data if judge.
For making full use of storer as far as possible, extend using life of storage, the embodiment of the present invention employs data pointer when data storage operations, when certain unit or certain block storage area damage, the storage unit more renewed and or storage area, make the utilization factor of storer reach maximum.Such as: presetting write frequency threshold value is 3.Storage area can be gone out according to the first address of source usage data and the address computation of destination data pointer storing data, and when the number of times that data storage operations writes this storage area is judged to be illegal more than 3 times, the pointer of amendment storage area, and be saved in suitable place, judge whether this data storage areas overflows simultaneously, and provide corresponding error condition mark.
In the method that the present embodiment provides, by adopting the mode record Stored Procedure each flow process stored in data procedures all being arranged to step motion control word, so that when running into interruption in storage, follow-uply can navigate to the flow process storing and interrupt accurately when recovering usage data, and recover according to the feature of each interruption flow process, therefore state, step that data are residing in storage operation can intuitively be known, obtain and can store step motion control word according to data error correction and recovery are carried out to data, the technique effect that the usage data refreshed is not lost can be ensured.
Embodiment 2
Realize for the ease of the method in embodiment 1, the present embodiment provides a kind of stores processor device protecting usage data, and this device can be arranged in MCU on intelligent electronic measuring instrument or wherein, or this device can be exactly a measuring instrument or MCU.As shown in Figure 4, comprising: stepping arranges module 21 and recovers module 22.
Stepping arranges module 21, for when storing usage data to memory block, for storing each flow setting step motion control word of usage data; Recover module 22, for when recovering usage data to buffer area, read step motion control word, and judge whether usage data has interruption stored in the process of memory block according to the step motion control word read, then recover usage data according to the result judged.
Particularly, stepping arranges module 21, and during specifically for original state, the value arranging step motion control word is the first state value; When starting to store source usage data, the value arranging step motion control word is the second state value; When source usage data stores verification, the value arranging step motion control word is third state value; When starting the Backup Data storing source usage data, the value arranging step motion control word is the 4th state value; During Backup Data verification, the value arranging step motion control word is the 5th state value.
Recover module 22 to comprise:
Initial recovery unit, for when the value of the step motion control word read is the first state value, judges that usage data is not interrupted stored in the process of memory block, recovers usage data to buffer area;
Error correction recovery unit, for when the value of the step motion control word arranged is not the first state value, judge that usage data has interruption stored in the process of memory block, and according to the value of the step motion control word read legitimacy process is carried out to recover usage data to buffer area to usage data.
Wherein, error correction recovery unit, specifically for when the value of the step motion control word arranged is not the first state value, judge that usage data has interruption stored in the process of memory block, and when the value of the step motion control word read is the second state value, identify according to the source data district of described source usage data, described Backup Data, described source usage data, the value of the Backup Data district of described Backup Data mark and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area; When the value of the step motion control word read is third state value, the value according to described source usage data, described Backup Data and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area; When the value of the step motion control word read is the 4th state value, the source usage data of getting is legal usage data, and this source usage data is returned to described buffer area; When the value of step motion control word read is the 5th state value, according to getting source usage data to the check results of Backup Data or Backup Data returns to described buffer area.
Preferably, this device also comprises:
Storage area detection module, whether legal for judging the storage area writing data according to the write frequency threshold value preset; The storage area of data is write as illegal, then the storage area of amendment write data if judge.
The device that the present embodiment provides, in data storage operations process, can arrange step motion control word, and according to the state recording supervising data storage process steps of step motion control word, thus when monitoring data storage operations, corrupt data is in which step operating process; Therefore, according to step motion control word process, restart to carry out date restoring in the place of makeing mistakes, avoid because interference or accidental interruption cause loss or the destruction of data.
The part that technical scheme of the present invention contributes to prior art in essence is in other words the function embodied with the form of software product, in other words: even if the function body of the method for each equipment of device of the present invention, equipment or composition system performed by it or realization is hardware, but the part in fact realizing above-mentioned functions of the present invention is but module or the unit of computer software product.And this computer software product can be stored in the storage medium that can read, as the floppy disk of computing machine, hard disk or CD etc., comprise some instructions and perform method described in each embodiment of the present invention in order to make an equipment.
The above, be only the specific embodiment of the present invention, but the present invention can have multiple multi-form embodiment, by reference to the accompanying drawings the present invention is illustrated above, this does not also mean that the embodiment that the present invention applies can only be confined in these specific embodiments, those skilled in the art should understand, embodiment provided above is some examples in multiple preferred implementation, and the embodiment of any embodiment the claims in the present invention all should within the claims in the present invention scope required for protection; Those skilled in the art can modify to technical scheme described in each embodiment above, or carries out equivalent replacement to wherein portion of techniques feature.Within the spirit and principles in the present invention all, any amendment done, equivalent to replace or improvement etc., within the protection domain that all should be included in the claims in the present invention.

Claims (10)

1. protect a storage processing method for usage data, it is characterized in that, comprising:
When storing usage data to memory block, for storing each flow setting step motion control word of usage data;
When recovering usage data to buffer area, read step motion control word, and judge whether usage data has interruption stored in the process of memory block according to the step motion control word read, then recover usage data according to the result judged.
2. method according to claim 1, is characterized in that, described each flow setting step motion control word for storing usage data, specifically comprises:
During original state, the value arranging step motion control word is the first state value;
When starting to store source usage data, the value arranging step motion control word is the second state value;
When source usage data stores verification, the value arranging step motion control word is third state value;
When starting the Backup Data storing source usage data, the value arranging step motion control word is the 4th state value;
During Backup Data verification, the value arranging step motion control word is the 5th state value.
3. method according to claim 2, is characterized in that, the described step motion control word according to reading judges whether usage data has interruption stored in the process of memory block, then recovers usage data according to the result judged, specifically comprises:
If the value of the step motion control word read is the first state value, then judges that usage data is not interrupted stored in the process of memory block, recover usage data to buffer area;
If the value of step motion control word arranged is not the first state value, then judge that usage data has interruption stored in the process of memory block, and according to the value of the step motion control word read legitimacy process is carried out to recover usage data to buffer area to usage data.
4. method according to claim 3, is characterized in that, the described value of step motion control word according to reading carries out legitimacy process to recover usage data to buffer area to usage data, specifically comprises:
When the value of the step motion control word read is the second state value, identify according to the source data district of described source usage data, described Backup Data, described source usage data, the value of the Backup Data district of described Backup Data mark and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area;
When the value of the step motion control word read is third state value, the value according to described source usage data, described Backup Data and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area;
When the value of the step motion control word read is the 4th state value, the source usage data of getting is legal usage data, and this source usage data is returned to described buffer area;
When the value of step motion control word read is the 5th state value, according to getting source usage data to the check results of Backup Data or Backup Data returns to described buffer area.
5. the method according to claim 1-4, is characterized in that, the method also comprises:
Judge that whether the storage area writing data is legal according to the write frequency threshold value preset;
The storage area of data is write as illegal, then the storage area of amendment write data if judge.
6. protect a stores processor device for usage data, it is characterized in that, comprising:
Stepping arranges module, for when storing usage data to memory block, for storing each flow setting step motion control word of usage data;
Recover module, for when recovering usage data to buffer area, read step motion control word, and judge whether usage data has interruption stored in the process of memory block according to the step motion control word read, then recover usage data according to the result judged.
7. device according to claim 6, is characterized in that,
Described stepping arranges module, and during specifically for original state, the value arranging step motion control word is the first state value; When starting to store source usage data, the value arranging step motion control word is the second state value; When source usage data stores verification, the value arranging step motion control word is third state value; When starting the Backup Data storing source usage data, the value arranging step motion control word is the 4th state value; During Backup Data verification, the value arranging step motion control word is the 5th state value.
8. device according to claim 7, is characterized in that, described recovery module comprises:
Initial recovery unit, for when the value of the step motion control word read is the first state value, judges that usage data is not interrupted stored in the process of memory block, recovers usage data to buffer area;
Error correction recovery unit, for when the value of the step motion control word arranged is not the first state value, judge that usage data has interruption stored in the process of memory block, and according to the value of the step motion control word read legitimacy process is carried out to recover usage data to buffer area to usage data.
9. device according to claim 8, is characterized in that,
Described error correction recovery unit, specifically for when the value of the step motion control word arranged is not the first state value, judge that usage data has interruption stored in the process of memory block, and when the value of the step motion control word read is the second state value, identify according to the source data district of described source usage data, described Backup Data, described source usage data, the value of the Backup Data district of described Backup Data mark and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area; When the value of the step motion control word read is third state value, the value according to described source usage data, described Backup Data and minimum resolution determines legal usage data, and this legal usage data is returned to described buffer area; When the value of the step motion control word read is the 4th state value, the source usage data of getting is legal usage data, and this source usage data is returned to described buffer area; When the value of step motion control word read is the 5th state value, according to getting source usage data to the check results of Backup Data or Backup Data returns to described buffer area.
10. the device according to claim 6-9, is characterized in that, this device also comprises:
Storage area detection module, whether legal for judging the storage area writing data according to the write frequency threshold value preset; The storage area of data is write as illegal, then the storage area of amendment write data if judge.
CN201410363256.9A 2014-07-28 2014-07-28 A kind of storage processing method and device of protection usage data Active CN105320614B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410363256.9A CN105320614B (en) 2014-07-28 2014-07-28 A kind of storage processing method and device of protection usage data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410363256.9A CN105320614B (en) 2014-07-28 2014-07-28 A kind of storage processing method and device of protection usage data

Publications (2)

Publication Number Publication Date
CN105320614A true CN105320614A (en) 2016-02-10
CN105320614B CN105320614B (en) 2018-09-07

Family

ID=55248025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410363256.9A Active CN105320614B (en) 2014-07-28 2014-07-28 A kind of storage processing method and device of protection usage data

Country Status (1)

Country Link
CN (1) CN105320614B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527566A (en) * 2020-12-24 2021-03-19 广东芬尼科技股份有限公司 Equipment power-down operation parameter read-write abnormity protection method, system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070233950A1 (en) * 2006-03-28 2007-10-04 Hitachi, Ltd. Storage system and power source control method thereof, storage apparatus and data processing method
CN102929806A (en) * 2012-10-24 2013-02-13 威盛电子股份有限公司 Progress recording method and restoration method suitable for encoding operation of storage device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070233950A1 (en) * 2006-03-28 2007-10-04 Hitachi, Ltd. Storage system and power source control method thereof, storage apparatus and data processing method
CN102929806A (en) * 2012-10-24 2013-02-13 威盛电子股份有限公司 Progress recording method and restoration method suitable for encoding operation of storage device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527566A (en) * 2020-12-24 2021-03-19 广东芬尼科技股份有限公司 Equipment power-down operation parameter read-write abnormity protection method, system and storage medium
CN112527566B (en) * 2020-12-24 2023-11-21 广东芬尼科技股份有限公司 Method, system and storage medium for protecting read-write abnormality of equipment power-down operation parameters

Also Published As

Publication number Publication date
CN105320614B (en) 2018-09-07

Similar Documents

Publication Publication Date Title
CN105164657B (en) Program data to nonvolatile memory selective backup system and method
EP1974272B1 (en) Method and apparatus for detecting a fault condition and restoration thereafter using user context information
US10481998B2 (en) Protecting sensitive information in time travel trace debugging
US9690642B2 (en) Salvaging event trace information in power loss interruption scenarios
CN106325773B (en) A kind of consistency ensuring method of memory system data, system and buffer storage
CN103140841A (en) Methods and apparatus to protect segments of memory
CN103793651B (en) Based on the virtualized kernel integrity detection method of Xen
CN103003799A (en) Methods and system for verifying memory device integrity
CN103226499B (en) A kind of method of the abnormal data recovered in internal storage and device
KR20170023735A (en) Methods and systems for improving storage journaling
CN108089971B (en) Log service method and system based on embedded real-time system
CN107731262A (en) A kind of storage disk bad block management method, device, equipment and readable storage medium storing program for executing
CN103026342A (en) Methods and system for verifying memory device integrity
US11836070B2 (en) Reducing trace recording overheads with targeted recording via partial snapshots
CN101901174B (en) Method for enhancing reliability of program of multi-replica contrast mechanism based on code segment
CN105549985A (en) Method and system for enhancing reliability of Linux application system
CN113987507A (en) Heap memory vulnerability detection method and device, storage medium and electronic equipment
CN108108271B (en) Method and device for realizing unified management of affairs and power failure protection
CN109324765A (en) A kind of Disk State detection method, device, equipment and storage medium
CN105320614A (en) Storage processing method and device capable of protecting consumption data
CN107894900A (en) A kind of method and system of MCU upgradings
CN107704333A (en) Failure store method, device and the readable storage medium storing program for executing of SAN storage system
CN109086162B (en) Memory diagnosis method and device
CN104461759B (en) A kind of processing method and processing device of memory multi-bit error
CN109144766B (en) Data storage and reconstruction method and device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant