CN102708020A - Method and device for detecting stored data exception - Google Patents

Method and device for detecting stored data exception Download PDF

Info

Publication number
CN102708020A
CN102708020A CN2012101421920A CN201210142192A CN102708020A CN 102708020 A CN102708020 A CN 102708020A CN 2012101421920 A CN2012101421920 A CN 2012101421920A CN 201210142192 A CN201210142192 A CN 201210142192A CN 102708020 A CN102708020 A CN 102708020A
Authority
CN
China
Prior art keywords
chained list
write sequence
data
linked list
sequence number
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.)
Pending
Application number
CN2012101421920A
Other languages
Chinese (zh)
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 CN2012101421920A priority Critical patent/CN102708020A/en
Publication of CN102708020A publication Critical patent/CN102708020A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

An embodiment of the invention provides a method and a device for detecting stored data exception. The method and the device are used for detecting various exception conditions of a chain table, and the exception conditions are difficult to be detected. The method includes that a writing serial number contained in a chain table element of the chain table is read, and the writing serial number is an identification which changes according to a fixed step on the basis of a writing serial number contained in a prior chain table element when each chain table element is added in the chain table; whether the read writing serial number corresponds to a reading serial number of the chain table is judged, if the read writing serial number doesn't correspond to the reading serial number of the chain table, stored data are detected to be exceptional, otherwise, the stored data are detected to be normal, and when the serial number is read, and the change way of the reading of the writing serial number is the same as the fixed step change way of the writing serial number when each chain table element is added in the chain table. The method is capable of sensitively detecting various exceptional conditions of the chain table and greatly increasing the detection probability of chain table exceptions.

Description

A kind of method and apparatus that is used for the detection of stored data exception
Technical field
The present invention relates to the communications field, relate in particular to a kind of method and apparatus that is used for the detection of stored data exception.
Background technology
In using, often use a plurality of queue stores different data flow professional, and every data stream all there is order to write the demand that calls over about the storage-forwarding of data.A kind of storage mode the most commonly used is to use the queue management of continuous storage; When access data, the address of this mode obtains with more new capital is very convenient, but every data stream all need distribute enough big storage space to bear the maximum burst of application; Data even without correspondence exist; This part space is fixing to be divided, and can not be used by other data stream, so causes the waste of storage resources.
And use in the storage mode of chained list, the data block of every data stream no longer requires continuous storage, only need when writing data, before each data block, add linked list element head (head), and the value of linked list element head has been carried the address of next data block.Therefore, as long as when reading of data, know the address of the first data block of data stream, just can find next data block one by one, like this, every data stream independence chaining has only the business datum of existence just can take storage space, has significantly reduced the waste of storage resources.
Chained list is made up of several linked list elements; And the composition of a linked list element comprises linked list element head (head) and data field (data); The linked list element head is the storage address of next associated data, i.e. the pointer of next data, and this pointer can be called the linked list element head pointer.So, N linked list element is connected in series through a line, if mistake appears in middle any linked list element head, can cause chained list chain rupture, intersection or situation such as ring certainly, and promptly chained list is unusual.
Existing a kind of unusual method of chained list that detects is the general data verification method of storer; For example; Find wrong and correction (Error Checkingand Correcting; ECC), (Cyclic Redundancy Check, CRC) or the double copies of important information (being linked list head) etc., the common feature of these methods is that expectation is found the various unusual of chained list through the physical detection of bottom in CRC.
Yet the inventor finds, these methods of calibration based on the storer particle are applied in has following deficiency on the storage organization of chained list class:
1) can not detect fully that chained list intersects, chained list abnormal conditions such as ring and chain rupture certainly.This is that the path of process is not limited only to storer itself because based on the storage of chained list with read, and therefore, the annexation correctness between linked list element can't be checked.Data mistake when a kind of situation is write store; For example; Device soft failure or clock cause the raw data mistake of write store unusually, and just on the raw data of mistake, add check and inspection check based on the storer particle, and it is unusual to check out that chained list is used; Another kind of situation is that the storage address mistake for example, writes data A and data B, hopes to read data A, but because error in address is read data B, and data A and data B itself are the correct numerical value of storer verification, can't detect unusual;
2) even primary memory particle mistake once in a while also possibly cause chained list unusual, but can not do any processing to the one-time detection alarm that occurs once in a while in using usually, therefore, alarm being submerged probably, and system continues to operate in up-set condition.
Summary of the invention
The embodiment of the invention provides a kind of method and apparatus that is used for the detection of stored data exception, is difficult to the various abnormal case of detected chained list to detect prior art.
The embodiment of the invention provides a kind of method that is used for the detection of stored data exception; Said storage data are the data of the needs storage that produces in data or the data handling procedure of the needs storage that produces in the communication process; Said storage data use the chained list mode to carry out access, and said method comprises:
Read the write sequence that comprises in the linked list element of chained list number; Each linked list element in the said chained list all comprises write sequence number, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that changes with the fixed step size Δ;
Judge the said write sequence that reads number whether with said chained list to read sequence number corresponding; If it is not corresponding; Then detect said storage data and occur unusually, otherwise it is normal to detect said storage data; The said sequence number of reading number equates with said write sequence when said chained list initialization, when reading said write sequence with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change.
Alternatively; Said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that increases progressively with the fixed step size Δ; Perhaps, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign of successively decreasing with the fixed step size Δ.
Alternatively, after detecting said storage data appearance unusually, said method further comprises: with the value X that reads sequence number of said chained list SnrValue X with the said write sequence that reads number SnwAll be changed to 0.
Alternatively, after the said storage data of detection were normal, said method further comprised: with the value X that reads sequence number of said chained list SnrBe incremented to X with said fixed step size Δ Snr+ Δ, perhaps, with the value X that reads sequence number of said chained list SnrBe decremented to X with said fixed step size Δ Snr-Δ.
Alternatively, saidly comprise before reading the write sequence that comprised in the linked list element of chained list number:, construct said chained list according to the sequencing of data write storage unit.
Alternatively, the said chained list of said structure comprises: linked list head pointer and chained list tail pointer are set, and said linked list head pointer and chained list tail pointer point to the afterbody of an address blank and said chained list respectively.
Alternatively, said fixed step size Δ is 1.
The embodiment of the invention provides a kind of device that is used for the detection of stored data exception; Said storage data are the data of the needs storage that produces in data or the data handling procedure of the needs storage that produces in the communication process; Said storage data use the chained list mode to carry out access; Said device comprises: read module; Be used for reading write sequence that a linked list element of chained list comprises number, each linked list element in the said chained list all comprises write sequence number, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that changes with the fixed step size Δ;
The abnormality detection module; Be used to judge the said write sequence that reads number whether with said chained list to read sequence number corresponding, if not corresponding, then detect said storage data and occur unusual; Otherwise; It is normal to detect institute's data of store, and the said sequence number of reading number equates with said write sequence when said chained list initialization, when reading said write sequence with said chained list in during linked list element of every increase said write sequence number according to the same way as variation of said fixed step size Δ variation.
Alternatively; Said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that increases progressively with the fixed step size Δ; Perhaps, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign of successively decreasing with the fixed step size Δ.
Alternatively, said device further comprises: the zero setting module is used for said abnormality detection module and detects said storage data and the value X that reads sequence number with said chained list occurs when unusual SnrWith the said value X that reads write sequence number SnwAll be changed to 0.
Alternatively, said device further comprises and increases progressively module or the module of successively decreasing; The said module that increases progressively is used for said abnormality detection module and detects said storage data just often with the value X that reads sequence number of said chained list SnrBe incremented to X with said fixed step size Δ Snr+ Δ; The said module of successively decreasing is used for said abnormality detection module and detects said storage data just often with the value X that reads sequence number of said chained list SnrBe decremented to X with said fixed step size Δ Snr-Δ.
Alternatively, said device further comprises: the link setup module, be used for sequencing according to the data write storage unit, and construct said chained list.
Alternatively, said link setup module comprises: pointer is provided with the unit, is used to be provided with linked list head pointer and chained list tail pointer, and said linked list head pointer and chained list tail pointer point to the afterbody of an address blank and said chained list respectively.
Alternatively, said fixed step size Δ is 1.
Can know from the invention described above embodiment; Since in the chained list write sequence of linked list element number according in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on change with the fixed step size Δ; And when reading write sequence; Chained list read sequence number also with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change; In case find chained list to read sequence number and the said write sequence that reads number not corresponding, then detect said storage data and occur unusually.Compare with the unusual method of existing detection chained list; The method that the embodiment of the invention provides does not also rely on the physical detection of bottom; Only need be in linked list element, to add write sequence number as identifying this small expense; Just can sensitivity detect various chained list abnormal case such as chain rupture, intersection or loopback, significantly improve the unusual detection probability of chained list.
Description of drawings
In order to be illustrated more clearly in the technical scheme of the embodiment of the invention; To do to introduce simply to the accompanying drawing of required use in prior art or the embodiment description below; Obviously; Accompanying drawing in describing below only is some embodiments of the present invention, to those skilled in the art, can also obtain other accompanying drawing like these accompanying drawings.
Fig. 1 is the method flow synoptic diagram that is used for the detection of stored data exception that the embodiment of the invention provides;
Fig. 2 a is the chained list organigram that the embodiment of the invention provides;
Fig. 2 b is the chained list organigram that another embodiment of the present invention provides;
Fig. 2 c is the chained list organigram that another embodiment of the present invention provides;
Fig. 2 d is the chained list organigram that another embodiment of the present invention provides;
Fig. 3 is the detection chained list intersection synoptic diagram that the embodiment of the invention provides;
Fig. 4 is the detection chain loopback fork synoptic diagram that the embodiment of the invention provides;
Fig. 5 is the apparatus structure synoptic diagram that is used for the detection of stored data exception that the embodiment of the invention provides;
Fig. 6 is the apparatus structure synoptic diagram that is used for the detection of stored data exception that another embodiment of the present invention provides;
Fig. 7 a is the apparatus structure synoptic diagram that is used for the detection of stored data exception that another embodiment of the present invention provides;
Fig. 7 b is the apparatus structure synoptic diagram that is used for the detection of stored data exception that another embodiment of the present invention provides;
Fig. 8 is the apparatus structure synoptic diagram that is used for the detection of stored data exception that another embodiment of the present invention provides;
Fig. 9 is the apparatus structure synoptic diagram that is used for the detection of stored data exception that another embodiment of the present invention provides.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those skilled in the art obtained belongs to the scope that the present invention protects.
Seeing also accompanying drawing 1, is the method flow synoptic diagram that is used for the detection of stored data exception that the embodiment of the invention provides, and mainly comprises step S101 and step S102:
S101; Read the sequence number that is comprised in the linked list element of chained list; Each linked list element bag in the said chained list all comprises write sequence number, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that changes with the fixed step size Δ.
In embodiments of the present invention; Storage data (Stored Data) are the data of the needs storage that produces in the data of the needs storage that produces in the communication process or the data handling procedure; For example; In packet switching network, need switching equipment to be stored in this node and need exchange to the packet of next node, the cache module in multi-input and-output radio system before baseband processing unit is handled and is temporary in the antenna transmitter unit and waiting for from data queue that antenna opening sends or the like.
Different with existing chained list is; In embodiments of the present invention; Linked list element promptly points to the pointer of next linked list element except comprising head (head) pointer of data and linked list element, also comprises write sequence number (Serial Number Write; SNW), the data in each linked list element are all corresponding to a SNW.The write sequence SNW of linked list element is as a kind of sign of each linked list element, in the chained list during linked list element of every increase, then the write sequence SNW of this linked list element before the write sequence basis that linked list element comprised on change with the fixed step size Δ.
As one embodiment of the invention, write sequence number can be in the chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that increases progressively with the fixed step size Δ.For example, existing linked list element E of chained list L 1, its data that comprise are D 1, corresponding write sequence SNW 1Value be X Snw1When in chained list L, increasing a new linked list element E 2The time, linked list element E then 2Write sequence SNW 2Value X Snw2With linked list element E 1Write sequence SNW 1Value X Snw1Relation can be X Snw2=X Snw1+ Δ.
As another embodiment of the present invention, write sequence number can be in the chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign of successively decreasing with the fixed step size Δ.For example, existing linked list element E of chained list L 1, its data that comprise are D 1, corresponding write sequence SNW 1Value be X Snw1When in chained list L, increasing a new linked list element E 2The time, linked list element E then 2Write sequence SNW 2Value X Snw2With linked list element E 1Write sequence SNW 1Value X Snw1Relation can be X Snw2=X Snw1-Δ.
S102; To read sequence number corresponding with said chained list current to judge the said write sequence that reads number, if not corresponding, then detect said storage data and occur unusual; Otherwise; It is normal to detect said storage data, and the said sequence number of reading number equates with said write sequence when said chained list initialization, when reading said write sequence with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change.
Data in the linked list element of same chained list, it is identical with the sequencing of write storage unit from the sequencing that storage unit reads.Therefore; Number similarly read sequence number (Serial Number Read if give one with the write sequence of linked list element to chained list; SNR); And whether the corresponding relation of write sequence number of just often reading sequence number SNR and linked list element with the storage data then can the detection of stored data occur as criterion unusually.Can be when the chained list initialization; The sequence number of reading of chained list is set to number equate with the write sequence of linked list element; Then, when reading storage data and write sequence, chained list read sequence number with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change; For example; Said write sequence is number according to said fixed step size Δ during linked list element of every increase in the chained list, and when reading write sequence, the sequence number of reading of chained list increases progressively or Δ/2 with 2 Δs accordingly.The corresponding relation of the write sequence of reading sequence number and linked list element of above-mentioned chained list number only illustrates, and more complicated corresponding relationships can also be arranged, and therefore, above-mentionedly illustrates that should not to be regarded as be limitation of the present invention.
As previously mentioned, for same chained list, because the write sequence SNW of linked list element changes with the fixed step size Δ according to the sequencing that data write; And the sequence number SNR that reads of chained list also changes with said fixed step size Δ according to the sequencing that data read; Therefore, in case the value of reading sequence number SNR of said chained list is not corresponding with the value of the said write sequence SNW that reads, then detects said storage data and occurred unusually; Otherwise it is normal to detect said storage data.
For example, in embodiments of the present invention, if in the chained list during linked list element of every increase, write sequence number increases progressively according to said fixed step size Δ, that is, and and X Snw=X Snw+ Δ, then when reading storage data and write sequence, the reading sequence number and also can increase progressively of chained list according to said fixed step size Δ, that is, and X Snr=X Snr+ Δ; Perhaps, if in the chained list during linked list element of every increase, write sequence number successively decreases according to said fixed step size Δ, that is, and and X Snw=X Snw-Δ, then when reading storage data and write sequence, the reading sequence number and also can successively decrease of chained list according to said fixed step size Δ, that is, and X Snr=X Snr-Δ.Therefore, as a kind of fairly simple corresponding relation, only need to judge whether the write sequence that reads number equates with the current sequence number of reading of said chained list, if unequal, then detect said storage data and occur unusually, otherwise it be normal to detect said storage data.
Can know from the method that is used for the detection of stored data exception that the invention described above embodiment provides; Since in the chained list write sequence of linked list element number according in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on change with the fixed step size Δ; And when reading write sequence; Chained list read sequence number also with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change; Be not equal to the value of the corresponding write sequence of the said data that read number in case find the value of reading sequence number of chained list, then detect said storage and occur unusual.Compare with the unusual method of existing detection chained list; The method that the embodiment of the invention provides does not also rely on the physical detection of bottom; Only need be in linked list element, to add write sequence number as identifying this small expense; Just can sensitivity detect various chained list abnormal case such as chain rupture, intersection or loopback, significantly improve the unusual detection probability of chained list.
In embodiments of the present invention, read before the data that linked list element comprised in the chained list, the sequencing that can write according to data is constructed said chained list, the linked list element of said chained list comprise with said linked list element in the corresponding write sequence SNW of data.In structure chained list process, linked list head pointer and chained list tail pointer need be set, said linked list head pointer and chained list tail pointer point to the afterbody of an address blank and said chained list respectively.If after detecting said storage data appearance unusually, then the value of reading sequence number SNR of said chained list and the value of the said write sequence SNW that reads all are changed to 0.If after the said storage data of detection are normal, with the value X that reads sequence number SNR of said chained list SnrBe incremented to X with said fixed step size Δ Snr+ Δ, perhaps, with the value X that reads sequence number of said chained list SnrBe decremented to X with said fixed step size Δ Snr-Δ.In embodiments of the present invention, in order to save resource, the fixed step size Δ can be taken as 1.
Like accompanying drawing 2a to shown in the accompanying drawing 2c; Be that to be stored in fixed step size that address A, address B and address C and write sequence SNW increase progressively respectively with data 0 (Data0), data 1 (Data1) and data 2 (Data2) be 1 to be example; The process of chained list structure of the present invention is described, is specified as follows:
Fig. 2 a: write data 0 to the address A.At this moment, the write sequence SNW of data 0 (Data0) is SNW 0=0, owing to be the first step of chained list structure, be equivalent to the initialization of chained list; Therefore, read sequence number SNR=0, (B this fashion in address does not write data to linked list head pointed address B; So for empty); The chained list tail pointer points to the afterbody of chained list, i.e. the linked list element 0 of chained list, and the linked list element 0 of chained list comprises data 0 (Data0) and write sequence SNW thereof 0, the head pointer of linked list element 0 points to address B.
Fig. 2 b: write data 1 to the address B.At this moment, the write sequence SNW of data 1 (Data1) is SNW 1=1, linked list head pointed address C (C this fashion in address does not write data, so be empty); Owing to be to write data at this moment, therefore, chained list read sequence number SNR=0, the chained list tail pointer still points to the afterbody of chained list, i.e. the linked list element 0 of chained list, and linked list element 1 comprises data 1 (Data1) and write sequence SNW thereof 1, the head pointer of linked list element 1 points to address C.
Fig. 2 c: write data 2 to the address C.At this moment, the write sequence SNW of data 2 (Data2) is SNW2=2, chained list read sequence number SNR=2, linked list head pointed address C (C this fashion in address does not write data, so be empty); Owing to be to write data at this moment, therefore, chained list read sequence number SNR=0, the chained list tail pointer still points to the afterbody of chained list, i.e. the linked list element 0 of chained list, and linked list element 2 comprises data 2 (Data2) and write sequence SNW thereof 2, the head pointer of linked list element 2 points to address D.
The construction process of whole chained list comprises above-mentioned accompanying drawing 2a to accompanying drawing 2c, and what Fig. 2 d illustrated is the process of reading of data.Because the chained list tail pointer points to the chained list afterbody, therefore, can be at first according to the sensing reading of data 0 (Data0) of chained list tail pointer, warp is relatively found, the write sequence SNW of data 0 (Data0) 0(SNW 0=0) with this moment chained list the sequence number SNR=0 that reads equate that chained list is normal.After having read data 0, the sequence number SNR that reads of chained list increases progressively and is SNR=1.The address that can know next data (being data 1) from the head pointer of linked list element 0 is address B, and the chained list tail pointer moves forward, and points to the chained list afterbody of this moment, and promptly linked list element 1.During reading of data 1, through relatively finding the write sequence SNW of data 1 (Data1) 1(SNW 1=1) with this moment chained list the sequence number SNR=1 that reads equate that chained list is normal.The process that reads of data 2 is not done and is given unnecessary details by that analogy.
Seeing also accompanying drawing 3, is that the detection chained list that provides of the embodiment of the invention intersects the synoptic diagram of these abnormal conditions.Suppose in Fig. 3, the write sequence SNW of data and chained list to read the fixed step size Δ that sequence number SNR increases progressively be 1, explain as follows.
Suppose the corresponding chained list 0 (L0) of business data flow 0 (S0), corresponding another chained list 1 (L1) of business data flow 1 (S1).The linked list element of chained list 0 comprises linked list element 0, linked list element 1, linked list element 2 and linked list element 3, and linked list element 0 comprises data 0 (Data0) and write sequence SNW thereof 0(SNW 0=0), linked list element 1 comprises data 1 (Data1) and write sequence SNW thereof 1(SNW 1=1), linked list element 2 comprises data 2 (Data2) and write sequence SNW thereof 2(SNW 2=2), linked list element 3 comprises data 3 (Data3) and write sequence SNW thereof 3(SNW 3=3); The linked list element of chained list 1 comprises linked list element 4 and linked list element 5, and linked list element 4 comprises data 4 (Data4) and write sequence SNW thereof 4(SNW 4=4), linked list element 5 comprises data 5 (Data5) and write sequence SNW thereof 5(SNW 5=5).
Suppose to read the linked list element 5 of chained list 1, the write sequence SNW of its data 5 5=5, and the sequence number SNR that reads of chained list also is 5 at this moment, promptly the chained list of this moment is normal.According to the example of accompanying drawing 3, the head pointer of the linked list element 5 of chained list 1 has pointed to chained list 0 linked list element 1, and promptly chained list 0 intersects with chained list 1, and this is a kind of abnormal conditions, does not allow to occur.Find that chained list 0 and the principle that chained list 1 intersects these abnormal conditions are: when having read the linked list element 5 of chained list 1; The value of reading sequence number SNR of chained list 1 is increased to 6 by fixed step size 1; And the value of the write sequence SNW of the data that next time read of expection is 6, but points to according to the head pointer of the linked list element 5 of chained list 1, and the data that read are the data 1 in the linked list element 1 of chained list 0; Through verifying the write sequence SNW of the data 1 in the linked list element 1 of chained list 0 1=1, be not equal to the value of reading sequence number SNR (being incremented to 6) of chained list 1 at this moment, therefore, judge that chained list 1 appearance this moment is unusual.Detect chained list unusual after, force to make the linked list head pointer of chained list 1 and chained list tail pointer to equate that point to address blank, soon chained list 1 empties, simultaneously the write sequence SNW that reads sequence number SNR and data of chained list 1 all is set to 0 and make SNR and SNW synchronous again.
Seeing also accompanying drawing 4, is the synoptic diagram of these abnormal conditions of detection chained list loopback of providing of the embodiment of the invention.Suppose in Fig. 4, the write sequence SNW of data and chained list to read the fixed step size Δ that sequence number SNR increases progressively be 1, explain as follows.
Suppose the corresponding chained list 0 of business data flow 0 (S0) (L0), the linked list element of chained list 0 comprises linked list element 0, linked list element 1, linked list element 2 and linked list element 3, and linked list element 0 comprises data 0 (Data0) and write sequence SNW thereof 0(SNW 0=0), linked list element 1 comprises data 1 (Data1) and write sequence SNW thereof 1(SNW 1=1), linked list element 2 comprises data 2 (Data2) and write sequence SNW thereof 2(SNW 2=2), linked list element 3 comprises data 3 (Data3) and write sequence SNW thereof 3(SNW 3=3).
Suppose to read linked list element 3, the write sequence SNW of its data 3 3=3, and the sequence number SNR that reads of chained list also is 3 at this moment, promptly the chained list of this moment is normal.According to the example of accompanying drawing 4, the head pointer of linked list element 3 has pointed to linked list element 0, and promptly loopback appears in chained list 0, and this is a kind of abnormal conditions, does not allow to occur.The principle of finding chained list 0 these abnormal conditions of loopback is: when having read the linked list element 3 of chained list 0; The value of reading sequence number SNR of chained list is increased to 4 by fixed step size 1; And the value of the write sequence SNW of the data that next time read of expection is 4, but points to according to the head pointer of linked list element 3, and the data that read are the data 0 in the linked list element 0 of chained list 0; Through verifying the write sequence SNW of the data 0 in the linked list element 0 of chained list 0 0=0, be not equal to the value of reading sequence number SNR (being incremented to 4) of chained list of this moment, therefore, judge that this moment, chained list occurred unusual.Detect chained list unusual after, force to make the linked list head pointer of chained list 0 and chained list tail pointer to equate that point to address blank, soon chained list 0 empties, read sequence number SNR and the write sequence SNW with chained list 0 all is set to 0 and make SNR and SNW synchronous again simultaneously.
Seeing also accompanying drawing 5, is the apparatus structure synoptic diagram that is used for the detection of stored data exception that the embodiment of the invention provides.For the ease of explanation, only show the part relevant with the embodiment of the invention.The device that is used for the detection of stored data exception of accompanying drawing 5 examples comprises data read module 501 and abnormality detection module 502, wherein:
Data read module 501; Be used for reading write sequence that a linked list element of chained list comprises number; Each linked list element in the said chained list all comprises write sequence number, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that changes with the fixed step size Δ.Abnormality detection module 502; To read sequence number corresponding with said chained list current to be used to judge the said write sequence that reads number, if not corresponding, then detect said storage data and occur unusual; Otherwise; It is normal to detect said storage data, and the said sequence number of reading number equates with said write sequence when said chained list initialization, when reading said write sequence with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change.
The device that is used for the detection of stored data exception in accompanying drawing 5 examples; Storage data (Stored Data) are the data of the needs storage that produces in the data of the needs storage that produces in the communication process or the data handling procedure; For example; In packet switching network, need switching equipment to be stored in this node and need exchange to the packet of next node, the cache module in multi-input and-output radio system before baseband processing unit is handled and is temporary in the antenna transmitter unit and waiting for from data queue that antenna opening sends or the like.
Different with existing chained list is; The device that is used for the detection of stored data exception in accompanying drawing 5 examples; Linked list element promptly points to the pointer of next linked list element except comprising head (head) pointer of data and linked list element, also comprises write sequence number (Serial Number Write; SNW), the data in each linked list element are all corresponding to a SNW.The write sequence SNW of linked list element is as a kind of sign of each linked list element, in the chained list during linked list element of every increase, then the write sequence SNW of this linked list element before the write sequence basis that linked list element comprised on change with the fixed step size Δ.
As one embodiment of the invention; The device that is used for the detection of stored data exception of accompanying drawing 5 examples, write sequence number can be in the chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that increases progressively with the fixed step size Δ.For example, existing linked list element E of chained list L 1, its data that comprise are D 1, corresponding write sequence SNW 1Value be X Snw1When in chained list L, increasing a new linked list element E 2The time, linked list element E then 2Write sequence SNW 2Value X Snw2With linked list element E 1Write sequence SNW 1Value X Snw1Relation can be X Snw2=X Snw1+ Δ.
As another embodiment of the present invention; The device that is used for the detection of stored data exception of accompanying drawing 5 examples, write sequence number can be in the chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign of successively decreasing with the fixed step size Δ.For example, existing linked list element E of chained list L 1, its data that comprise are D 1, corresponding write sequence SNW 1Value be X Snw1When in chained list L, increasing a new linked list element E 2The time, linked list element E then 2Write sequence SNW 2Value X Snw2With linked list element E 1Write sequence SNW 1Value X Snw1Relation can be X Snw2=X Snw1-Δ.
Data in the linked list element of same chained list, it is identical with the sequencing of write storage unit from the sequencing that storage unit reads.Therefore; Number similarly read sequence number (Serial Number Read if give one with the write sequence of linked list element to chained list; SNR); And the corresponding relation of write sequence number of just often reading sequence number SNR and linked list element with the storage data is as criterion, and then whether abnormality detection module 502 can the detection of stored data occur unusually.Can be when the chained list initialization; The sequence number of reading of chained list is set to number equate with the write sequence of linked list element; Then, when reading storage data and write sequence, chained list read sequence number with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change; For example; Said write sequence is number according to said fixed step size Δ during linked list element of every increase in the chained list, and when reading write sequence, the sequence number of reading of chained list increases progressively or Δ/2 with 2 Δs accordingly.The corresponding relation of the write sequence of reading sequence number and linked list element of above-mentioned chained list number only illustrates, and more complicated corresponding relationships can also be arranged, and therefore, above-mentionedly illustrates that should not to be regarded as be limitation of the present invention.
As previously mentioned, for same chained list, because the write sequence SNW of linked list element changes with the fixed step size Δ according to the sequencing that data write; And the sequence number SNR that reads of chained list also changes with said fixed step size Δ according to the sequencing that data read; Therefore, in case abnormality detection module 502 judges that the value of reading sequence number SNR of said chained list is not corresponding with the value of the said write sequence SNW that reads, then detect said storage data and occurred unusually; Otherwise it is normal to detect said storage data.
For example, in embodiments of the present invention, if in the chained list during linked list element of every increase, write sequence number increases progressively according to said fixed step size Δ, that is, and and X Snw=X Snw+ Δ, then when reading storage data and write sequence, the reading sequence number and also can increase progressively of chained list according to said fixed step size Δ, that is, and X Snr=X Snr+ Δ; Perhaps, if in the chained list during linked list element of every increase, write sequence number successively decreases according to said fixed step size Δ, that is, and and X Snw=X Snw-Δ, then when reading storage data and write sequence, the reading sequence number and also can successively decrease of chained list according to said fixed step size Δ, that is, and X Snr=X Snr-Δ.Therefore, as a kind of fairly simple corresponding relation, whether the write sequence that only needs abnormality detection module 502 to judge to read number equates with the current sequence number of reading of said chained list; If it is unequal; Then detect said storage data and occur unusually, otherwise it is normal to detect said storage data.
Need to prove; The embodiment that more than is used for the device of detection of stored data exception, the division of each functional module only illustrates, can be as required in the practical application; For example the facility of the realization of the configuration requirement of corresponding hardware or software is considered; And above-mentioned functions is distributed by the different functional completion, be about to the said inner structure that is used for the device of detection of stored data exception and be divided into different functional, to accomplish all or part of function of above description.And in the practical application, the corresponding functional modules in the present embodiment can be to be realized by relevant hardware; Also can carry out corresponding software by relevant hardware accomplishes; For example, aforesaid data read module can be to have to carry out the aforementioned hardware that reads the write sequence that comprises in the linked list element of chained list number; Data reader for example, thus also can be to carry out general processor or other hardware devices that the corresponding computer program is accomplished aforementioned functional; Aforesaid for another example abnormality detection module; Can be to have to carry out aforementionedly to judge the said write sequence that reads number to read sequence number corresponding with said chained list current; If not corresponding, then detect said storage data and occur unusually, otherwise; It is normal to detect said storage data; Saidly read sequence number number equates function with said write sequence when said chained list initialization hardware, anomaly detector for example, thus also can be to carry out general processor or other hardware devices (each embodiment that this instructions provides can use the foregoing description principle) that the corresponding computer program is accomplished aforementioned functional.
The device that is used for the detection of stored data exception of accompanying drawing 5 examples further comprises zero setting module 601, the device that is used for the detection of stored data exception that another embodiment of the present invention provides shown in accompanying drawing 6.Zero setting module 601 is used for said abnormality detection module 502 and detects said storage data and the value X that reads sequence number SNR with chained list occurs when unusual SnrValue X with the write sequence SNW that reads SnwAll be changed to 0.
If it is normal that abnormality detection module 502 detects; Then the device that is used for the detection of stored data exception of accompanying drawing 5 examples further comprises and increases progressively module 701 or the module 702 of successively decreasing; The device that is used for the detection of stored data exception that another embodiment of the present invention provides shown in accompanying drawing 7a or accompanying drawing 7b, wherein:
Increasing progressively module 701 is used for said abnormality detection module 502 and detects said storage data just often with the value X that reads sequence number SNR of chained list SnrBe incremented to X with the fixed step size Δ Snr+ Δ;
The module of successively decreasing 702 is used for said abnormality detection module and detects said storage data just often with the value X that reads sequence number of said chained list SnrBe decremented to X with said fixed step size Δ Snr-Δ.
The device that is used for the detection of stored data exception of accompanying drawing 5 examples may further include link setup module 801, the device that is used for the detection of stored data exception that another embodiment of the present invention provides shown in accompanying drawing 8.Link setup module 801 is used for the sequencing according to the data write storage unit, constructs said chained list, the linked list element of said chained list comprise with said linked list element in the corresponding write sequence SNW of data.
The link setup module 801 of accompanying drawing 8 examples can comprise that pointer is provided with unit 901, the unusual device of detection chained list that another embodiment of the present invention provides shown in accompanying drawing 9.Pointer is provided with unit 901 and is used to be provided with linked list head pointer and chained list tail pointer, and said linked list head pointer and chained list tail pointer point to the afterbody of an address blank and said chained list respectively.
In the unusual device of the detection chained list of accompanying drawing 5 to accompanying drawing 9 arbitrary examples, the fixed step size Δ can be 1.
Need to prove; Contents such as the information interaction between each module/unit of said apparatus, implementation; Since with the inventive method embodiment based on same design; Its technique effect that brings is identical with the inventive method embodiment, and particular content can repeat no more referring to the narration among the inventive method embodiment here.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to accomplish through program, such as following the whole bag of tricks one or more or all:
Read the write sequence that comprises in the linked list element of chained list number; Each linked list element in the said chained list all comprises write sequence number, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that changes with the fixed step size Δ;
To read sequence number corresponding with said chained list current to judge the said write sequence that reads number; If it is not corresponding; Then detect said storage data and occur unusually, otherwise it is normal to detect said storage data; The said sequence number of reading number equates with said write sequence when said chained list initialization, when reading said write sequence with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to accomplish through program; This program can be stored in the computer-readable recording medium; Storage medium can comprise: ROM (read-only memory) (ROM; Read Only Memory), RAS (RAM, Random Access Memory), disk or CD etc.
More than a kind of method and apparatus that is used for the detection of stored data exception that the embodiment of the invention is provided carried out detailed introduction; Used concrete example among this paper principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (14)

1. method that is used for the detection of stored data exception; It is characterized in that; Said storage data are the data of the needs storage that produces in data or the data handling procedure of the needs storage that produces in the communication process, and said storage data use the chained list mode to carry out access, and said method comprises:
Read the write sequence that comprises in the linked list element of chained list number; Each linked list element in the said chained list all comprises write sequence number, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that changes with the fixed step size Δ;
To read sequence number corresponding with said chained list current to judge the said write sequence that reads number; If it is not corresponding; Then detect said storage data and occur unusually, otherwise it is normal to detect said storage data; The said sequence number of reading number equates with said write sequence when said chained list initialization, when reading said write sequence with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change.
2. the method for claim 1; It is characterized in that; Said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that increases progressively with the fixed step size Δ; Perhaps, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign of successively decreasing with the fixed step size Δ.
3. method as claimed in claim 2 is characterized in that, after detecting said storage data appearance unusually, said method further comprises:
The value X that reads sequence number with said chained list SnrValue X with the said write sequence that reads number SnwAll be changed to 0.
4. method as claimed in claim 2 is characterized in that, after the said storage data of detection were normal, said method further comprised:
The value X that reads sequence number with said chained list SnrBe incremented to X with said fixed step size Δ Snr+ Δ, perhaps, with the value X that reads sequence number of said chained list SnrBe decremented to X with said fixed step size Δ Snr-Δ.
5. method as claimed in claim 2 is characterized in that, saidly comprises before reading the write sequence that comprised in the linked list element of chained list number:
According to the sequencing of data write storage unit, construct said chained list.
6. method as claimed in claim 5 is characterized in that, the said chained list of said structure comprises:
Linked list head pointer and chained list tail pointer are set, and said linked list head pointer and chained list tail pointer point to the afterbody of an address blank and said chained list respectively.
7. like any described method of claim 1 to 6, it is characterized in that said fixed step size Δ is 1.
8. device that is used for the detection of stored data exception; It is characterized in that; Said storage data are the data of the needs storage that produces in data or the data handling procedure of the needs storage that produces in the communication process, and said storage data use the chained list mode to carry out access, and said device comprises:
Read module; Be used for reading write sequence that a linked list element of chained list comprises number; Each linked list element in the said chained list all comprises write sequence number, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that changes with the fixed step size Δ;
The abnormality detection module; To read sequence number corresponding with said chained list current to be used to judge the said write sequence that reads number, if not corresponding, then detect said storage data and occur unusual; Otherwise; It is normal to detect said storage data, and the said sequence number of reading number equates with said write sequence when said chained list initialization, when reading said write sequence with said chained list in said write sequence number changes according to said fixed step size Δ during linked list element of every increase same way as change.
9. device as claimed in claim 8; It is characterized in that; Said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign that increases progressively with the fixed step size Δ; Perhaps, said write sequence number in the said chained list during linked list element of every increase before the write sequence basis that linked list element comprised on the sign of successively decreasing with the fixed step size Δ.
10. device as claimed in claim 9 is characterized in that, said device further comprises:
The zero setting module is used for said abnormality detection module and detects said storage data and the value X that reads sequence number with said chained list occurs when unusual SnrWith the said value X that reads write sequence number SnwAll be changed to 0.
11. device as claimed in claim 9 is characterized in that, said device further comprises and increases progressively module or the module of successively decreasing;
The said module that increases progressively is used for said abnormality detection module and detects said storage data just often with the value X that reads sequence number of said chained list SnrBe incremented to X with said fixed step size Δ Snr+ Δ;
The said module of successively decreasing is used for said abnormality detection module and detects said storage data just often with the value X that reads sequence number of said chained list SnrBe decremented to X with said fixed step size Δ Snr-Δ.
12. device as claimed in claim 9 is characterized in that, said device further comprises:
The link setup module is used for the sequencing according to the data write storage unit, constructs said chained list.
13. device as claimed in claim 12 is characterized in that, said link setup module comprises:
Pointer is provided with the unit, is used to be provided with linked list head pointer and chained list tail pointer, and said linked list head pointer and chained list tail pointer point to the afterbody of an address blank and said chained list respectively.
14., it is characterized in that said fixed step size Δ is 1 like any described device of claim 8 to 13.
CN2012101421920A 2012-05-09 2012-05-09 Method and device for detecting stored data exception Pending CN102708020A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012101421920A CN102708020A (en) 2012-05-09 2012-05-09 Method and device for detecting stored data exception

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012101421920A CN102708020A (en) 2012-05-09 2012-05-09 Method and device for detecting stored data exception

Publications (1)

Publication Number Publication Date
CN102708020A true CN102708020A (en) 2012-10-03

Family

ID=46900833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012101421920A Pending CN102708020A (en) 2012-05-09 2012-05-09 Method and device for detecting stored data exception

Country Status (1)

Country Link
CN (1) CN102708020A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125169A (en) * 2013-04-26 2014-10-29 联发科技股份有限公司 Link list processing apparatus, link list processing method and related network switch

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6769092B1 (en) * 2001-07-31 2004-07-27 Cisco Technology, Inc. Method and system for testing linked list integrity
CN100357898C (en) * 2004-12-17 2007-12-26 华为技术有限公司 Error detection method when linked list running
JP2009042895A (en) * 2007-08-07 2009-02-26 Fujitsu Telecom Networks Ltd Chain memory device and management method therefor
CN101788928A (en) * 2009-01-24 2010-07-28 华为技术有限公司 Method and device for detecting linked list

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6769092B1 (en) * 2001-07-31 2004-07-27 Cisco Technology, Inc. Method and system for testing linked list integrity
CN100357898C (en) * 2004-12-17 2007-12-26 华为技术有限公司 Error detection method when linked list running
JP2009042895A (en) * 2007-08-07 2009-02-26 Fujitsu Telecom Networks Ltd Chain memory device and management method therefor
CN101788928A (en) * 2009-01-24 2010-07-28 华为技术有限公司 Method and device for detecting linked list

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125169A (en) * 2013-04-26 2014-10-29 联发科技股份有限公司 Link list processing apparatus, link list processing method and related network switch
CN104125169B (en) * 2013-04-26 2017-12-01 联发科技股份有限公司 Chained list processing unit, chained list processing method and related network switch

Similar Documents

Publication Publication Date Title
US10528410B2 (en) Apparatus, method and system to exchange error information in a unified protocol communication
US8042023B2 (en) Memory system with cyclic redundancy check
CN100375962C (en) Dual storage apparatus and control method for the dual storage apparatus
CN106463179A (en) Method, apparatus and system for handling data error events with memory controller
CN109614259A (en) A kind of system and method for server PCIe device positioning failure reason
FI127266B (en) System for processing data stream messages
CN108062235B (en) Data processing method and device
CN106373616B (en) Method and device for detecting faults of random access memory and network processor
CN105743725A (en) Method and device for testing application programs
CN110297764B (en) Vulnerability test model training method and device
US9122411B2 (en) Signal order-preserving method and apparatus
CN106502750B (en) OTA upgrade method and Bluetooth chip
US9934117B2 (en) Apparatus and method for fault detection to ensure device independence on a bus
JP2013034133A (en) Transmission apparatus, transmitting-receiving system, and control method
CN103257905A (en) Embedded computer system stored data checking circuit and method
CN102708020A (en) Method and device for detecting stored data exception
CN101127580A (en) Node device, control device, control method and control program
CN117667467A (en) Method for processing memory fault and related equipment thereof
JP2019020864A (en) Arithmetic unit
KR101420728B1 (en) Determining optimum delivery conditions associated with a restoration plan in a communication network
WO2021068686A1 (en) Device testing method, system, network device, and readable storage medium
US20160156431A1 (en) High speed data transmission methods and systems upon error detection
CN111130941B (en) Network error detection method and device and computer readable storage medium
CN109710445B (en) Memory correction method and electronic equipment
EP3404547B1 (en) Method for supervising and initializing ports

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20121003