CN1570879A - A method for storing abnormal information - Google Patents

A method for storing abnormal information Download PDF

Info

Publication number
CN1570879A
CN1570879A CN 03144002 CN03144002A CN1570879A CN 1570879 A CN1570879 A CN 1570879A CN 03144002 CN03144002 CN 03144002 CN 03144002 A CN03144002 A CN 03144002A CN 1570879 A CN1570879 A CN 1570879A
Authority
CN
China
Prior art keywords
storage
abnormal information
memory device
record
information
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
CN 03144002
Other languages
Chinese (zh)
Other versions
CN1318978C (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB031440029A priority Critical patent/CN1318978C/en
Publication of CN1570879A publication Critical patent/CN1570879A/en
Application granted granted Critical
Publication of CN1318978C publication Critical patent/CN1318978C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

It's a kind of method to store the abnormal information. Its storage adopts flash storing device. This method comprises: initializing the storing device; dividing the storing device to at least two storage sectors, and dividing each storage sector to several records, setting maximum record repeat time; storing the captured abnormal information to the storage sector of this storing device. If all records in the storage sector is full, it erases the next storage sector firstly and continues to store. By adopting the method of writing by sequence and sector erasing by turns, this invention makes full use of the feature of flash storing device. And by proper flash operating method, it realizes capture and storage the abnormal, alert and other useful information effectively and in time.

Description

A kind of method of storing abnormal information
Technical field
The invention belongs to technical field of information storage, relate to a kind of method of storing abnormal information specifically.
Background technology
At present, embedded system is used more and more widely, this system is that a kind of software and hardware is combined closely, finish the computer system of specific function, it extensively uses in various fields such as communication, instrument, aviation, Medical Devices, military affairs, and the software size that is used for embedded system also becomes increasingly complex with huge, thereby because the loss that imperfection caused of its software has caused people's attention gradually.
May cause in the embedded system at present software occur unusual reason conclude roughly have following some:
1, the hardware fault that can't catch in the software running process, thus the unusual or deadlock of running software caused, as: strong ray causes EMS memory error etc.
2, CPU internal hardware fault, this fault generally can be captured, and as bus error, the finger mistake or the like of looking ahead, when this class mistake appears in CPU, generally produces not maskable interruption, is handled by this interruption then.
3, software BUG causes unusually, as jumps to 0 address and carry out, do not line up access errors, cross the border and visit protection etc., and software enters unusual branch and flow process etc.
4, general alarm, outside exception condition triggers.
The software of embedded system is the same with general software, and a long-term perfecting process is gradually also arranged, and generally speaking, this process can be divided into pre-salesly to be improved and improve two stages after sale.Before product is sold, find that by the lab investigation of strengthening product defective as much as possible (BUG) is to find the important means of software issue, but there is very big difference in the laboratory with actual application environment after all, long lab investigation not only cause testing efficiency to reduce, and cost of products also can sharply rise, even may miss the best opportunity of launch.Therefore, software product is in actual motion, and catching also, the abnormal information of safety reservation running software seems particularly important.
Solution general in the prior art is summarized as follows:
1, the abnormal information of catching is not stored.
Generally speaking, because embedded system all is compact, unlikely connection standard output device during actual motion as computing machine etc., is not stored link so abandon the abnormal information of catching at any time.
2, the abnormal information of catching is stored in the random access memory ram.
To be divided into some memory blocks as the RAM of this purposes, branch records abnormal information in the memory block at software anomaly, if the memory block of this purposes that is useful on all uses, then begins to cover the content of original record in the place of first piece.Because RAM is a volatile memory, contents lost after the power down; Even not power down also is difficult to read the data of internal memory after the system reset.
3, the abnormal information of catching is stored among the storer NVRAM.
Its storage means and above-mentioned 2 similar.Because content was not lost after NVRAM had, but its capacity is often also very little, can not satisfy requirement than the multiple data quantity record.
Summary of the invention
At said circumstances, the present invention proposes a kind of method of storing abnormal information, the abnormal information of catching that exists in the prior art easily is dropped to solve, recorded content is easily lost, is difficult to hold than problems such as multiple data quantities after the power down.
For addressing the above problem, solution of the present invention is:
A kind of method of storing abnormal information, it stores the abnormal information of catching in the memory device into, it is characterized in that, comprises the steps:
A, with the memory device initialization;
B, this memory device is divided at least two storage blocks, each storage block is divided into some records, and the record maximum number of repetitions is set;
C, the abnormal information of being caught is stored in the storage block of this memory device,,, continue storage more then earlier with behind the next memory block erasing if all records have all been stored fullly in to be stored.
Wherein, described memory device is FLASH.
The storage block of described memory device and record count can set in advance.
Described step B also further comprises: searching storage spare, the home record position of definite storage abnormal information.
Described step B also further comprises: the posting field of marker stores device local anomaly.
Described step C also further comprises: judge nearest canned data, if after identical information reaches predetermined number, then no longer store the identical information of catching thereafter.
The present invention is by adopting the flash memory device, and by distinctive flash method of operating, given full play to the characteristic of fash memory device, Useful Information before destroying when both having avoided wiping the flash memory device, avoid again under the situation of storage bulk information, frequently wiping the flash memory device, thereby greatly prolong flash memory device serviceable life.Simultaneously, effectively realized in time catching and the storing software operational process in unusual, alarm and other useful informations, be used for analysis software ruuning situation and orientation problem, accelerate the stabilization process of software, have power down after recorded content be difficult for losing, holding than advantages such as multiple data quantities.
Describe the present invention in detail below in conjunction with the drawings and specific embodiments.
Description of drawings
Fig. 1 is the described method block diagram of the embodiment of the invention;
Fig. 2 is the initialization step specific implementation process flow diagram of the described method of the embodiment of the invention;
Fig. 3 is the described memory device structures distribution diagram of the embodiment of the invention;
Fig. 4 is the structural drawing of the described stored record of the embodiment of the invention;
Fig. 5 is the canned data step specific implementation process flow diagram of the described method of the embodiment of the invention.
Embodiment
The embodiment of the invention has been introduced a kind of method of storing abnormal information, the abnormal information permanent storage is arrived the flash memory device, Useful Information before destroying when both having avoided wiping the flash memory device, avoid again under the situation of storage bulk information, frequently wiping the flash memory device, thereby greatly prolong flash memory device serviceable life.
A kind of method of storing abnormal information of the embodiment of the invention, specifically be in the built-in system software system code, to unify to call the function that is used to store abnormal information in any possible abnormality processing function, thereby catch unusual, alarm and other useful information in the software running process, and be stored in the flash memory device.
Describe the specific implementation process of the embodiment of the invention below in detail, as shown in Figure 1, this process is divided into three steps:
One, with the memory device initialization.
This initialization step mainly realizes that by call voidlog_flash_init (void) function in system initialization code structure is as follows:
void?sys_init(void)
{
log_flash_init();
}
The major function of this function is a setup code, and search flash content finds the current record position, the global variable that initialization is relevant.
Two, this memory device is divided at least two storage blocks, each storage block is divided into some records, and the record maximum number of repetitions is set.
Its specific implementation process, as shown in Figure 2:
At first, the flash memory device is carried out initialization, and the number that sets in advance storage block and record is respectively n and m, the storage organization of its flash memory device, as shown in Figure 3, this memory device is divided into n storage block, and each storage block is divided into m bar record, and wherein the size of institute's distributed store blocks and record equates.
Wherein, the arrangement architecture in each territory in every record, as shown in Figure 4, the implication in its each territory is described below:
Record attribute 1: indicate whether this position is effective record, or null record, if other value then is illegal, software is attempted to write down all positions at this and is write 0.
Record number 2: this numbering increases progressively forever, though because of write down too much will be former the record covering, this value remains and increases progressively.
Writing time 3: if veneer is supported real-time clock, then this territory record produces date and time.
Filename 4: the filename that writes down this unusual code that takes place.
Row numbers 5: the row number that writes down this unusual code that produces.
Current tick6: general embedded system has a regularly interrupt counter, current tick when this territory is write down these abnormal conditions and taken place, and can learn thus that this system has produced after the operation how long continuously should be unusually.
Out of Memory 7: write down other information, as the value of some variablees in the code, version number etc.
Then, search flash memory device is determined the home record position of storage abnormal information, the continuity of record number and position when guaranteeing that being stored in veneer restarts; Also the posting field of flash memory device local anomaly is all write 0 and come mark in addition.
At last, in order to prevent that same information from repeatedly repeating, the storage space utilization that guarantees the flash memory device is more abundant, as find that the record of storage is identical recently, when its quantity surpassed certain value, identical thereafter record was left in the basket, and covered useful information to prevent a large amount of same records, so the maximal value that also is provided with the continuous storage of identical record is 10.
Three, the abnormal information of being caught is stored in the storage block of this memory device,,, continue storage more then earlier with behind the next memory block erasing if all records have all been stored completely in to be stored
This step is to call void login_flash (char in the abort branch of system software *File_name, unsigned int line, char *Fmt ...) function, the abnormal information of being caught is stored in the storage block of this flash memory device, its structure is as follows:
    void app_task(void)    {         int ret_val;         …         ret_val=function1();         if(ret_val!=OK)         {        <!-- SIPO <DP n="5"> -->        <dp n="d5"/>            login_flash(_FILE_,_LINE_,″Err!ret_val=%x″,ret_val);          }          …    }
Like this, if all records have all been stored completely in to be stored, still need continue storage, this function can be wiped next storage block automatically, continues record; If all storage blocks all use, can wipe first piece once more, continue record.
As shown in Figure 5, introduce the concrete storing process of the embodiment of the invention below to abnormal information.
At first, prepare to need the data of storage, such as the current file name, row number, and the current tick of system and the user abnormal information of adding etc., prepare storage;
Then, judge whether information to be stored is the record of repeated storage, if, further judge whether again to reach maximum duplicate record number of times 10, if then abandon this record, otherwise continue storage;
When write record, if not success, then write once this record attribute sign again, this is recorded valid flag all put 0, show this protocol failure, continue this record of storage in next position, up to storing successfully this moment, if all records have all been stored full in to be stored, but still have abnormal information to need storage, then need stride piece and handle, behind earlier that its storage is the full storage block memory block erasing subsequently, the abnormal information that will need again to store continues to store in first the record of the storage block of having wiped;
If it is full that last storage block of distributing is also stored, first piece that then will distribute is wiped again, continues aforesaid way and stores ..., the storage space of the flash memory device of recycling distribution like this.
In addition, in storing process, be labeled as 0 unusual posting field,, then can skip this unusual part, continue storage as the posting field that has damaged if run into.
Canned data inquiry: if some equipment has moved (as one month or longer time) after a long period in actual environment, by checking the content of storing in the flash memory device, promptly call void print_log (int entry_num) function, the record of the abnormal information by printing nearest storage, check whether unusual generation is arranged, thereby judge the state of running software.If abnormal information is arranged, can diagnose and locate software issue, thereby learn the actual operating state of software.Such as, during this period of time our equipment whether positive return, have those unusual or the like.
Present embodiment distributes n piece as this purposes, has at least n-1 piece can preserve effective information so.Therefore, not deleted in order to guarantee effective information, need distribute two storage blocks at least.When the information of such piece was wiped free of, the another one piece can be preserved enough useful informations.
Present embodiment writes the method for wiping in turn with piece by adopting said sequence, makes full use of the characteristic of flash memory device, and promptly each bit can only be written as 0 by 1, and any one bit will be rewritten as 1 by 0, then needs the piece at this bit place is all wiped.Thereby reduced the chance of wiping the flash memory device to greatest extent, guaranteed that the life-span of this device enough uses.Suppose that distributing the flash memory device is n piece, the size of each piece is 64kbyte, and the size of every record is 64byte in the storage block, but the erasing times of flash memory device is 100000 times, so maximum storable information are: n*100000*64k/64=n*10e8, if n=3, produce 100 records average every day, then can use 3 * 10e8/100/365=8129.
In sum, the embodiment of the invention is by adopting the flash memory device, and by distinctive flash method of operating, thereby given full play to the characteristic of flash memory device, built-in system software unusual, alarm and other useful informations in operational process have effectively been realized in time catching and store, be used for analysis software ruuning situation and orientation problem, accelerate the stabilization process of software.Adopt the method for the described storage abnormal information of present embodiment, have power down after recorded content be difficult for losing, holding than advantages such as multiple data quantities.

Claims (6)

1, a kind of method of storing abnormal information, it stores the abnormal information of catching in the memory device into, it is characterized in that, comprises the steps:
A, with the memory device initialization;
B, this memory device is divided at least two storage blocks, each storage block is divided into some records, and the record maximum number of repetitions is set;
C, the abnormal information of being caught is stored in the storage block of this memory device,,, continue storage more then earlier with behind the next memory block erasing if all records have all been stored fullly in to be stored.
2, a kind of method of storing abnormal information as claimed in claim 1, wherein, described memory device is FLASH.
3, a kind of method of storing abnormal information as claimed in claim 1, wherein, the storage block of described memory device and record count can set in advance.
4, a kind of method of storing abnormal information as claimed in claim 1, wherein, described step B also further comprises: searching storage spare, the home record position of definite storage abnormal information.
5, a kind of method of storing abnormal information as claimed in claim 1, wherein, described step B also further comprises: the posting field of marker stores device local anomaly.
6, a kind of method of storing abnormal information as claimed in claim 1, wherein, described step C also further comprises: judge nearest canned data, if after identical information reaches predetermined number, then no longer store the identical information of catching thereafter.
CNB031440029A 2003-07-25 2003-07-25 A method for storing abnormal information Expired - Fee Related CN1318978C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031440029A CN1318978C (en) 2003-07-25 2003-07-25 A method for storing abnormal information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031440029A CN1318978C (en) 2003-07-25 2003-07-25 A method for storing abnormal information

Publications (2)

Publication Number Publication Date
CN1570879A true CN1570879A (en) 2005-01-26
CN1318978C CN1318978C (en) 2007-05-30

Family

ID=34471316

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031440029A Expired - Fee Related CN1318978C (en) 2003-07-25 2003-07-25 A method for storing abnormal information

Country Status (1)

Country Link
CN (1) CN1318978C (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100452100C (en) * 2006-04-29 2009-01-14 浪潮齐鲁软件产业有限公司 Tax-controlled collecting machine operating information recording storage and fault inquiry method
CN101788949A (en) * 2010-03-10 2010-07-28 中兴通讯股份有限公司 Method and device for realizing embedded type system function monitoring
CN101208753B (en) * 2005-03-14 2012-12-12 晟碟以色列有限公司 Method of achieving wear leveling in flash memory using relative grades
CN104978148A (en) * 2014-04-09 2015-10-14 瑞萨电子(中国)有限公司 Data writing method and device and data reading method and device
CN105138655A (en) * 2015-08-31 2015-12-09 深圳市茁壮网络股份有限公司 Data storage and reading method and device
CN113819995A (en) * 2021-10-28 2021-12-21 深圳市道中创新科技有限公司 Gravity sensor deformation automatic correction method for gravity vending cabinet

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3159821B2 (en) * 1993-02-16 2001-04-23 株式会社日立ビルシステム Elevator abnormal data storage device
JPH0919827A (en) * 1995-07-07 1997-01-21 Nkk Corp Thread cutting method for steel pipe
JP2002108719A (en) * 2000-10-03 2002-04-12 Matsushita Electric Ind Co Ltd System abnormality information recording method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101208753B (en) * 2005-03-14 2012-12-12 晟碟以色列有限公司 Method of achieving wear leveling in flash memory using relative grades
CN100452100C (en) * 2006-04-29 2009-01-14 浪潮齐鲁软件产业有限公司 Tax-controlled collecting machine operating information recording storage and fault inquiry method
CN101788949A (en) * 2010-03-10 2010-07-28 中兴通讯股份有限公司 Method and device for realizing embedded type system function monitoring
CN101788949B (en) * 2010-03-10 2015-01-28 中兴通讯股份有限公司 Method and device for realizing embedded type system function monitoring
CN104978148A (en) * 2014-04-09 2015-10-14 瑞萨电子(中国)有限公司 Data writing method and device and data reading method and device
CN105138655A (en) * 2015-08-31 2015-12-09 深圳市茁壮网络股份有限公司 Data storage and reading method and device
CN113819995A (en) * 2021-10-28 2021-12-21 深圳市道中创新科技有限公司 Gravity sensor deformation automatic correction method for gravity vending cabinet

Also Published As

Publication number Publication date
CN1318978C (en) 2007-05-30

Similar Documents

Publication Publication Date Title
US10725669B2 (en) Incremental snapshot based technique on paged translation systems
US6738863B2 (en) Method for rebuilding meta-data in a data storage system and a data storage system
US9292434B2 (en) Method and apparatus for restoring flash translation layer (FTL) in non-volatile storage device
US8201024B2 (en) Managing memory faults
CN1300803C (en) Method for driving remapping in flash memory and its flash memory system structure
US9032151B2 (en) Method and system for ensuring reliability of cache data and metadata subsequent to a reboot
ES2663701T3 (en) Data management and cache metadata
US20120203958A1 (en) Storage control system with change logging mechanism and method of operation thereof
US20080162611A1 (en) Methods and apparatus for marking objects for garbage collection in an object-based memory system
US20030200392A1 (en) Locating references and roots for in-cache garbage collection
US20090063548A1 (en) Log-structured store for streaming data
US10949342B2 (en) Persistent memory garbage collection
CN1894662A (en) Processor cache memory as ram for execution of boot code
US20090327374A1 (en) Method and apparatus for performing concurrent garbage collection
US7818611B2 (en) Memory device internal parameter reliability
CN1125338A (en) Method and apparatus for dynamically controlling address space allocation
TW201128383A (en) Portable executable file analysis
US9921959B2 (en) Efficient reference classification and quick memory reuse in a system that supports concurrent garbage collection
US20060294339A1 (en) Abstracted dynamic addressing
CN103914355A (en) Method and device for positioning memory repeated release
CN1570879A (en) A method for storing abnormal information
US8103849B2 (en) Reducing memory usage of kernel memory management structures
US7660961B2 (en) Concurrent evacuation of the young generation
CN1447243A (en) Calculation method executed in quick flash memory fast and not caused abnormal power breakdown as well as its control system
CN1534509A (en) Flash memory calculating method possessing quick and preventing improper operation function and its control system

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070530

Termination date: 20100725