CN108052411B - Method and device for repairing one-way linked list interruption - Google Patents

Method and device for repairing one-way linked list interruption Download PDF

Info

Publication number
CN108052411B
CN108052411B CN201711440304.XA CN201711440304A CN108052411B CN 108052411 B CN108052411 B CN 108052411B CN 201711440304 A CN201711440304 A CN 201711440304A CN 108052411 B CN108052411 B CN 108052411B
Authority
CN
China
Prior art keywords
node
linked list
target
nodes
pointer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711440304.XA
Other languages
Chinese (zh)
Other versions
CN108052411A (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201711440304.XA priority Critical patent/CN108052411B/en
Publication of CN108052411A publication Critical patent/CN108052411A/en
Application granted granted Critical
Publication of CN108052411B publication Critical patent/CN108052411B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0796Safety measures, i.e. ensuring safe condition in the event of error, e.g. for controlling element

Abstract

The application provides a method and a device for repairing an interruption of a single linked list, which are applied to storage equipment, wherein the method comprises the following steps: when a pointer in any target node in the one-way linked list is lost or wrong, judging a target linked list to which the target node belongs logically; the target node and each node in the target linked list before the target node, the tail node in the target linked list and each node in the other linked list except the target linked list in the unidirectional linked list logically carry a mark for identifying that the node is found; and after the next node of the target node is found in the target linked list based on a preset query mode, repairing a pointer pointing to the next node of the target node in the target node. By adopting the technical method, the reliability of the single-direction linked list can be improved.

Description

Method and device for repairing one-way linked list interruption
Technical Field
The present application relates to the field of data storage technologies, and in particular, to a method and an apparatus for repairing an interruption of a single linked list.
Background
The single direction chain table is a basic data structure, which is composed of several nodes, each node is composed of data field and pointer field. The data field is used for storing data, and the pointer field is used for storing a pointer of a next node.
Referring to fig. 1, fig. 1 is a schematic diagram of a singly linked list. In physical structure, each node of the unidirectional linked list is in a continuous storage state, and logically, each node of the unidirectional linked list determines the access sequence of each node based on the pointer. When a pointer in a pointer field of a certain node is damaged due to a hardware or software problem, the storage device cannot access data in each node behind the node, and the one-way linked list is interrupted.
For example, in FIG. 1, when the pointer in node 2 is destroyed, the storage device will not have access to node 3 and node Use _ tail.
In the prior art, a bidirectional linked list is provided to solve the problem of interruption of the unidirectional linked list. Referring to fig. 2, fig. 2 is a schematic diagram of a doubly linked list in the prior art. Each node in the doubly linked list includes a data field for storing data and two pointer fields, one pointer field for storing a pointer for a next node and the other pointer field for storing a pointer for a previous node. Similarly, the nodes of the doubly linked list are physically contiguous and logically, the nodes of the doubly linked list determine the access order of the nodes based on the pointers. Where there is a forward access and a reverse access in the doubly linked list. The forward access is from the head node of the linked list, based on the pointer of the next node in each node, until the tail node of the linked list. The reverse access is from the tail node of the linked list, and based on the order of the pointer pointing to the previous node in each node, the access is carried out until the head node of the linked list.
When the storage device accesses each node of the bidirectional linked list based on a certain direction, if the bidirectional linked list is interrupted, the storage device can access each node of the bidirectional linked list based on another direction, so that each node in the bidirectional linked list can still be accessed through another access direction under the condition that the linked list is interrupted in the certain access direction, and the reliability of the bidirectional linked list is improved.
In the prior art, node add and delete operations are supported regardless of whether a singly linked list or a doubly linked list. Because the nodes in the doubly linked list have one more pointer to the previous node than the nodes in the singly linked list, the doubly linked list consumes more memory than the singly linked list, and at the same time, adding or deleting nodes in the doubly linked list consumes more time than adding or deleting nodes in the singly linked list.
In devices with higher processing performance requirements, doubly linked lists are not suitable as data storage structures for such devices.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for repairing an interruption of a single linked list, which are applied to a storage device and used for improving reliability of the single linked list.
Specifically, the method is realized through the following technical scheme:
a method for repairing the interruption of a single-direction linked list is applied to a storage device, logically, the single-direction linked list is divided into a use linked list and an idle linked list, and physically, each node in the single-direction linked list is continuously stored, and the method comprises the following steps:
when a pointer in any target node in the one-way linked list is lost or wrong, judging a target linked list to which the target node belongs logically;
the target node and each node in the target linked list before the target node, the tail node in the target linked list and each node in the other linked list except the target linked list in the unidirectional linked list logically carry a mark for identifying that the node is found;
after the next node of the target node is found in the target linked list based on a preset query mode, a pointer pointing to the next node of the target node is repaired in the target node; and the next node of the target node is the initial node found based on the query mode when the target linked list is traversed for the last time.
A repair device for the interruption of a single chain table is applied to a storage device, logically, the single chain table is divided into a use chain table and an idle chain table, and physically, each node in the single chain table is stored continuously, and the repair device comprises:
the judging unit is used for judging the target linked list to which the target node belongs logically when the pointer in any target node in the unidirectional linked list is lost or wrong;
a carrying unit, configured to carry a flag used to identify that a node has been found in the target node and each node in the target linked list before the target node, a tail node in the target linked list, and each node in another linked list except the target linked list in the unidirectional linked list logically;
the repair unit is used for repairing a pointer pointing to the next node of the target node in the target node after the next node of the target node is found in the target linked list based on a preset query mode; and the next node of the target node is the initial node found based on the query mode when the target linked list is traversed for the last time.
The technical method provided by the application has the following beneficial effects:
in this application, when a pointer of any target node in the one-way linked list is lost or incorrect, the storage device may carry a flag for identifying that a node has been found in each node in the target linked list to which the target node logically belongs, the node before the target node, the tail node of the target linked list, and each node in another logical linked list other than the target linked list in the one-way linked list. After the storage device finds the starting node (the node is the next node of the target node) when the target linked list is traversed for the last time based on the preset query mode, the pointer pointing to the next node of the target node is repaired in the target node, and therefore the reliability of the linked list can be improved without adopting the technology of the bidirectional linked list.
Drawings
FIG. 1 is a schematic diagram of a singly linked list;
FIG. 2 is a schematic diagram of a doubly linked list as proposed in the prior art;
FIG. 3 is a flowchart of a repair method for an interruption of a single linked list according to an embodiment of the present disclosure;
FIG. 4 is a map of the physical storage structure of each node in the single-direction linked list, the usage linked list, and the idle linked list;
FIG. 5 is a schematic diagram of the principle of adding nodes in a singly linked list;
FIG. 6 is a schematic diagram illustrating that nodes of a single-direction linked list carry a flag when the single-direction linked list is interrupted according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating a process of searching for a subsequent node of a target node in a target linked list according to an embodiment of the present application;
fig. 8 is a hardware structure diagram of a storage device in which a repair apparatus for an interruption of a singly linked list is located according to a second embodiment of the present application;
fig. 9 is a device for repairing an interruption of a singly linked list according to a second embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The single direction chain table is a basic data structure, which is composed of several nodes, each node is composed of data field and pointer field. The data field is used for storing data, and the pointer field is used for storing a pointer of a next node.
In physical structure, each node of the one-way linked list is in a continuous storage state. Logically, each node of the unidirectional linked list determines the access sequence of each node based on the pointer, and the unidirectional linked list can be divided into a use linked list and an idle linked list according to the use condition of the node.
When a pointer in a pointer field of a certain node is damaged due to a hardware or software problem, the storage device cannot access data in each node behind the node, and the one-way linked list is interrupted.
In order to improve the reliability of the linked list, a technique of a doubly linked list is proposed in the prior art. However, both singly linked and doubly linked lists support node add and delete operations. Because the nodes in the doubly linked list have one more pointer to the previous node than the nodes in the singly linked list, the doubly linked list consumes more memory than the singly linked list, and at the same time, adding or deleting nodes in the doubly linked list consumes more time than adding or deleting nodes in the singly linked list. In devices with higher processing performance requirements, doubly linked lists are not suitable as data storage structures for such devices.
Example one
In order to improve the reliability of the single-direction linked list, the first embodiment of the present application shows a repair method for single-direction linked list interruption, which is applied to a storage device. Referring to fig. 3, fig. 3 is a flowchart of a repair method for an interruption of a single linked list according to an embodiment of the present application, and specifically executes the following steps:
step 301: when a pointer in any target node in the one-way linked list is lost or wrong, judging a target linked list to which the target node belongs logically;
in this embodiment, a storage resource capable of being stored continuously is applied in advance in the storage device, and is stored in a single linked list manner.
The method for applying for the storage resources in advance is adopted, so that the time for applying for the memory is saved when the nodes are added in the single-direction linked list, and the time for recycling the memory is saved when the nodes are deleted, and therefore, the speed of adding the nodes and deleting the nodes in the single-direction linked list can be improved.
In actual application, the one-way linked list is logically divided into a use linked list and an idle linked list according to whether data is stored in a data field of each node in the one-way linked list. The node adding means that a node is moved from the idle linked list and added to the use linked list, and the node deleting means that a node is added to the idle linked list after the node is deleted from the use linked list.
Whether the node is deleted or added, the physical storage position of the node is not changed, and only the data field and the pointer field of the node are operated.
For example, referring to fig. 4, fig. 4 is a comparison diagram of the physical storage structure of each node in the single direction linked list, the usage linked list, and the free linked list.
As shown in fig. 4, Use _ head, Use _ tail, Free _ head, and Free _ tail are respectively a head node and a tail node of the usage linked list and a head node and a tail node of the idle linked list, u1, u2, and u3 are nodes in the usage linked list, and f1, f2, and f3 are nodes in the spatial linked list. In the physical storage structure of the single-direction linked list, the direction of the arrow between each node represents the pointer of each node to the next node.
The processor of the storage device maintains pointers to the head node and the tail node of the usage linked list, and pointers to the head node and the tail node of the free linked list. The data fields of the head nodes do not store data, and the pointer field of the tail node does not store a pointer.
As shown in fig. 4, when a node needs to be added to the usage linked list, the node is usually located directly to the head node of the idle linked list according to the pointer stored in the head node, and then located to the next node (i.e. f1 in fig. 4) according to the pointer stored in the head node, and the node is used as a data storage node and added to the tail node of the usage linked list. Adding a pointer pointing to f1 in a pointer field of an original tail node of a used linked list, changing f1 into a new tail node of the used linked list, changing a pointer of a head node in an idle linked list into a pointer pointing to f2, and finally changing into a result shown in fig. 5, wherein fig. 5 is a schematic diagram of the principle of adding nodes in a single-direction linked list.
In this embodiment, the storage device may detect each node in the unidirectional linked list except for the tail node of the usage linked list and the tail node of the idle linked list, and determine whether the pointer in the pointer field of each node is lost or erroneous.
The pointer is not stored in the tail node, so the detection range of the storage device does not include the tail node. In addition, since the singly linked list supports addition and deletion of nodes, the physical storage location of the tail node may change.
When the storage device detects that the pointer of any target node is lost or wrong, the storage device may determine a target linked list to which the target node logically belongs, that is, determine whether the target node is a node using the linked list or a node of an idle linked list.
Step 302: the target node and each node in the target linked list before the target node, the tail node in the target linked list and each node in the other linked list except the target linked list in the unidirectional linked list logically carry a mark for identifying that the node is found;
in this embodiment, after the storage device determines the target linked list to which the target node logically belongs, the storage device may directly locate the head node according to the stored pointer pointing to the head node of the target linked list, and traverse the nodes in the target linked list from the head node.
When the storage device traverses the nodes of the target link, the traversing edge carries a mark for identifying that the node has been found in the traversed node until the target node is traversed, and the mark is carried in the target node.
In addition, the storage device can also directly position to the tail node according to the stored pointer pointing to the tail node of the target linked list, carry the mark in the tail node, and carry the mark in each node in the other logical linked list except the target linked list in the one-way linked list.
Wherein, the process of carrying the mark in each node in the other logical linked list except the target linked list in the one-way linked list comprises the following steps:
and directly positioning to the head node according to the stored pointer pointing to the head node of the other logically linked list, and traversing the linked list from the head node. The storage device carries the label in the traversed node by traversing the edge until the whole linked list is traversed.
For example, please refer to fig. 6, where fig. 6 is a schematic diagram illustrating that a node of a singly linked list carries a flag when the singly linked list is interrupted according to an embodiment of the present application.
As shown in FIG. 6, assuming that the pointer in node u1 in the usage linked list is lost, the nodes (node use _ head), node use _ tail, nodes in the free linked list (node free _ head, node f1, node f2, node f3, node free _ tail) before node u1 and node u1 carry a flag (e.g., found) to identify that a node has been found.
Step 303: after the next node of the target node is found in the target linked list based on a preset query mode, a pointer pointing to the next node of the target node is repaired in the target node; and the next node of the target node is the initial node found based on the query mode when the target linked list is traversed for the last time.
In this embodiment, after the storage device carries the target mark in the target node and each node in the target linked list before the target node, the tail node in the target linked list, and each node in another logical linked list except the target linked list in the unidirectional linked list, the storage device may find the start node when the target linked list is traversed for the last time based on a preset query manner.
Referring to fig. 7, fig. 7 is a flowchart illustrating a process of searching for a node subsequent to a target node in a target linked list according to an embodiment of the present application.
Wherein, the query mode is as follows:
a) traversing nodes in the single-direction linked list from the head node based on an array traversal mode, judging whether the currently traversed nodes carry marks used for identifying that the nodes are found, if so, executing the step b), and if not, executing the step c);
b) judging whether nodes in the single-direction linked list are traversed based on an array traversal mode, if not, executing the step a), and if so, executing the step f);
c) carrying the mark in the node traversed based on the array traversal mode at present, recording that the node traversed based on the array traversal mode at present is an initial node traversed based on the logic traversal mode, and executing the step d);
d) starting to traverse the nodes in the single-direction linked list from the current node based on a logic traversal mode, judging whether the nodes traversed based on the logic traversal mode carry the marks or not, if so, executing the step a), and if not, executing the step e);
e) carrying the mark in the node traversed based on the logic traversal mode at present, and executing the step d);
f) determining the node recorded last as the next node of the target node in the target linked list; and the last recorded node is the initial node when the one-way linked list is traversed for the last time based on a logic traversal mode.
The array traversal mode is based on the sequence of each node on the physical storage. The logic traversal mode is based on pointers in all nodes for traversal.
For example, as shown in FIG. 6, first a physical traversal is made, starting from the head node use _ head of the singly linked list, and when traversing to node u3, it can be detected that node u3 does not carry a found flag.
At this point, a logical traversal begins, i.e., node u3 carries the found flag, and node u3 is recorded. Traversal then begins in the usage linked list from node u 3. Since the subsequent node use _ tail of the node u3 carries the found flag, when the node use _ tail is traversed, the physical traversal is returned, that is, the traversal is continued from the node u 3.
When traversing to node u2, since node u2 does not carry a found flag, a logical traversal is started, i.e., node u2 carries a found flag, and node u2 is recorded. And then traversing from the node u2 in the use linked list, wherein because the node u3 and the node use _ tail both carry found marks, the nodes return to physical traversal after traversing to the node use _ tail, namely the nodes continue traversing from the node u2, and the nodes in the one-way linked list are completely traversed after traversing to the node f 3. Since node u2 is the last recorded node, it can be determined that node u2 is the next node of the target node.
In this embodiment, when the storage device finds a node subsequent to the target node, the pointer pointing to the node subsequent to the target node may be repaired in the target node. For example, as shown in FIG. 6, a pointer "node u1 → node u 2" is established in node u 1.
In summary, in the present application, when a pointer of any target node in the one-way linked list is lost or has an error, the storage device may carry a flag for identifying that a node has been found in each node in the target linked list to which the target node logically belongs, each node in the target linked list before the target node, a tail node of the target linked list, and each node in another logical linked list in the one-way linked list except the target linked list. After the storage device finds the starting node (the node is the next node of the target node) when the target linked list is traversed for the last time based on the preset query mode, the pointer pointing to the next node of the target node is repaired in the target node, and therefore the reliability of the linked list can be improved without adopting the technology of the bidirectional linked list.
Example two
Corresponding to the first embodiment of the method for repairing the interruption of the single linked list, the application also provides a second embodiment of a device for repairing the interruption of the single linked list.
The embodiment of the repair device for the interruption of the single linked list can be applied to storage equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading a corresponding computer program instruction in the nonvolatile memory into the memory through the processor of the storage device where the device is located to operate. In terms of hardware, as shown in fig. 8, a hardware structure diagram of a storage device where a repair apparatus for a single linked list interrupt is located in the second embodiment of the present application is shown, where in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 8, the storage device where the apparatus is located in the second embodiment may also include other hardware according to an actual function of repairing the single linked list interrupt, which is not described again.
Referring to fig. 9, fig. 9 is a device for repairing an interruption of a single-direction linked list, which is applied to a storage device and is shown in a second embodiment of the present application, where logically, the single-direction linked list is divided into a used linked list and an idle linked list, and physically, each node in the single-direction linked list is stored continuously, and the device includes: a judging unit 910, a carrying unit 920 and a repairing unit 930.
The determining unit 910 is configured to determine, when a pointer in any target node in the one-way linked list is lost or incorrect, a target linked list to which the target node belongs logically;
a carrying unit 920, configured to carry a flag used for identifying that a node has been found in the target node and each node in the target linked list before the target node, a tail node in the target linked list, and each node in another linked list except the target linked list in the unidirectional linked list logically;
a repairing unit 930, configured to repair, in the target node, a pointer pointing to a next node of the target node after the next node of the target node is found in the target linked list based on a preset query manner, where the next node of the target node is an initial node when the target linked list is traversed for the last time that is found based on the query manner.
Each node in the single direction linked list includes a data field for storing data and a pointer field for storing a pointer pointing to a next node logically, and the determining unit 910 is specifically configured to:
judging whether the data field of the target node has stored data or not;
if so, determining the target linked list to which the target node logically belongs as a use linked list;
and if not, determining that the target linked list to which the target node logically belongs is an idle linked list.
In this embodiment, the apparatus further includes:
a query unit to:
a) traversing nodes in the single-direction linked list from the head node based on an array traversal mode, judging whether the currently traversed nodes carry marks used for identifying that the nodes are found, if so, executing the step b), and if not, executing the step c);
b) judging whether nodes in the single-direction linked list are traversed based on an array traversal mode, if not, executing the step a), and if so, executing the step f);
c) carrying the mark in the node traversed based on the array traversal mode at present, recording that the node traversed based on the array traversal mode at present is an initial node traversed based on the logic traversal mode, and executing the step d);
d) starting to traverse the nodes in the single-direction linked list from the current node based on a logic traversal mode, judging whether the nodes traversed based on the logic traversal mode carry the marks or not, if so, executing the step a), and if not, executing the step e);
e) carrying the mark in the node traversed based on the logic traversal mode at present, and executing the step d);
f) determining the node recorded last as the next node of the target node in the target linked list; and the last recorded node is the initial node when the one-way linked list is traversed for the last time based on a logic traversal mode.
And the detection unit is used for detecting all nodes except the tail node of the use linked list and the tail node of the idle linked list in the single-direction linked list and determining whether the pointer is lost or the pointer is wrong.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (6)

1. A method for restoring the interruption of a single-direction linked list is applied to a storage device, the single-direction linked list is logically divided into a use linked list and an idle linked list, and each node in the single-direction linked list is stored continuously physically, which is characterized by comprising the following steps:
when a pointer in any target node in the one-way linked list is lost or wrong, judging a target linked list to which the target node belongs logically;
the target node and each node in the target linked list before the target node, the tail node in the target linked list and each node in the other linked list except the target linked list in the unidirectional linked list logically carry a mark for identifying that the node is found;
after the next node of the target node is found in the target linked list based on a preset query mode, a pointer pointing to the next node of the target node is repaired in the target node; the next node of the target node is a starting node found based on the query mode when the target linked list is traversed for the last time;
the query mode is as follows:
a) traversing nodes in the single-direction linked list from the head node based on an array traversal mode, judging whether the currently traversed nodes carry marks used for identifying that the nodes are found, if so, executing the step b), and if not, executing the step c);
b) judging whether nodes in the single-direction linked list are traversed based on an array traversal mode, if not, executing the step a), and if so, executing the step f);
c) carrying the mark in the node traversed based on the array traversal mode at present, recording that the node traversed based on the array traversal mode at present is an initial node traversed based on the logic traversal mode, and executing the step d);
d) starting to traverse the nodes in the single-direction linked list from the current node based on a logic traversal mode, judging whether the nodes traversed based on the logic traversal mode carry the marks or not, if so, executing the step a), and if not, executing the step e);
e) carrying the mark in the node traversed based on the logic traversal mode at present, and executing the step d);
f) determining the node recorded last as the next node of the target node in the target linked list; wherein the last recorded node is the initial node when the one-way linked list is traversed for the last time based on a logic traversal mode,
the array traversal mode is based on the sequence of each node on physical storage; the logic traversal mode is based on the pointers in all the nodes for traversal.
2. The method of claim 1, wherein each node in the singly linked list includes a data field for storing data and a pointer field for storing a pointer that logically points to a next node;
the judging of the target linked list to which the target node logically belongs includes:
judging whether the data field of the target node has stored data or not;
if so, determining the target linked list to which the target node logically belongs as a use linked list;
and if not, determining that the target linked list to which the target node logically belongs is an idle linked list.
3. The method of claim 1, further comprising:
and detecting all nodes except the tail node of the use linked list and the tail node of the idle linked list in the single linked list, and determining whether the pointer is lost or the pointer is wrong.
4. A repair device for the interruption of a single chain table is applied to a storage device, logically, the single chain table is divided into a use chain table and an idle chain table, and physically, each node in the single chain table is stored continuously, and the repair device is characterized by comprising:
the judging unit is used for judging the target linked list to which the target node belongs logically when the pointer in any target node in the unidirectional linked list is lost or wrong;
a carrying unit, configured to carry a flag used to identify that a node has been found in the target node and each node in the target linked list before the target node, a tail node in the target linked list, and each node in another linked list except the target linked list in the unidirectional linked list logically;
the repair unit is used for repairing a pointer pointing to the next node of the target node in the target node after the next node of the target node is found in the target linked list based on a preset query mode; the next node of the target node is a starting node found based on the query mode when the target linked list is traversed for the last time;
a query unit to:
a) traversing nodes in the single-direction linked list from the head node based on an array traversal mode, judging whether the currently traversed nodes carry marks used for identifying that the nodes are found, if so, executing the step b), and if not, executing the step c);
b) judging whether nodes in the single-direction linked list are traversed based on an array traversal mode, if not, executing the step a), and if so, executing the step f);
c) carrying the mark in the node traversed based on the array traversal mode at present, recording that the node traversed based on the array traversal mode at present is an initial node traversed based on the logic traversal mode, and executing the step d);
d) starting to traverse the nodes in the single-direction linked list from the current node based on a logic traversal mode, judging whether the nodes traversed based on the logic traversal mode carry the marks or not, if so, executing the step a), and if not, executing the step e);
e) carrying the mark in the node traversed based on the logic traversal mode at present, and executing the step d);
f) determining the node recorded last as the next node of the target node in the target linked list; the last recorded node is an initial node when the one-way linked list is traversed for the last time based on a logic traversal mode;
the array traversal mode is based on the sequence of each node on physical storage; the logic traversal mode is based on the pointers in all the nodes for traversal.
5. The apparatus of claim 4, wherein each node in the singly linked list includes a data field for storing data and a pointer field for storing a pointer to a next node logically, comprising:
the judgment unit is specifically configured to:
judging whether the data field of the target node has stored data or not;
if so, determining the target linked list to which the target node logically belongs as a use linked list;
and if not, determining that the target linked list to which the target node logically belongs is an idle linked list.
6. The apparatus of claim 4, further comprising:
and the detection unit is used for detecting all nodes except the tail node of the use linked list and the tail node of the idle linked list in the single-direction linked list and determining whether the pointer is lost or the pointer is wrong.
CN201711440304.XA 2017-12-27 2017-12-27 Method and device for repairing one-way linked list interruption Active CN108052411B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711440304.XA CN108052411B (en) 2017-12-27 2017-12-27 Method and device for repairing one-way linked list interruption

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711440304.XA CN108052411B (en) 2017-12-27 2017-12-27 Method and device for repairing one-way linked list interruption

Publications (2)

Publication Number Publication Date
CN108052411A CN108052411A (en) 2018-05-18
CN108052411B true CN108052411B (en) 2020-12-29

Family

ID=62128237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711440304.XA Active CN108052411B (en) 2017-12-27 2017-12-27 Method and device for repairing one-way linked list interruption

Country Status (1)

Country Link
CN (1) CN108052411B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110838333B (en) * 2018-08-17 2021-10-26 成都华为技术有限公司 Hash table repairing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8745741B1 (en) * 2012-08-31 2014-06-03 Google Inc. Detecting and handling vtable pointer corruption
CN104182291A (en) * 2013-05-28 2014-12-03 上海博达数据通信有限公司 Method for recovering destroyed idle memory linked list
CN104239564A (en) * 2014-09-28 2014-12-24 深圳市锐明视讯技术有限公司 Method and device for organizing and repairing indexes of files
CN104572432A (en) * 2013-10-24 2015-04-29 杭州迪普科技有限公司 Lock-free linked list management device
CN104598194A (en) * 2014-12-09 2015-05-06 中国航空工业集团公司第六三一研究所 Initializing method and circuit of head and tail pointer chain table storage
CN106295260A (en) * 2016-08-05 2017-01-04 武汉斗鱼网络科技有限公司 The hidden method of a kind of application program nucleus module and system
CN106656865A (en) * 2016-10-28 2017-05-10 杭州迪普科技股份有限公司 Method and system for managing linked list resource

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2009202442A1 (en) * 2009-06-18 2011-01-13 Canon Kabushiki Kaisha Skip list generation
US8312243B2 (en) * 2009-07-16 2012-11-13 Lantiq Deutschland Gmbh Memory management in network processors

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8745741B1 (en) * 2012-08-31 2014-06-03 Google Inc. Detecting and handling vtable pointer corruption
CN104182291A (en) * 2013-05-28 2014-12-03 上海博达数据通信有限公司 Method for recovering destroyed idle memory linked list
CN104572432A (en) * 2013-10-24 2015-04-29 杭州迪普科技有限公司 Lock-free linked list management device
CN104239564A (en) * 2014-09-28 2014-12-24 深圳市锐明视讯技术有限公司 Method and device for organizing and repairing indexes of files
CN104598194A (en) * 2014-12-09 2015-05-06 中国航空工业集团公司第六三一研究所 Initializing method and circuit of head and tail pointer chain table storage
CN106295260A (en) * 2016-08-05 2017-01-04 武汉斗鱼网络科技有限公司 The hidden method of a kind of application program nucleus module and system
CN106656865A (en) * 2016-10-28 2017-05-10 杭州迪普科技股份有限公司 Method and system for managing linked list resource

Also Published As

Publication number Publication date
CN108052411A (en) 2018-05-18

Similar Documents

Publication Publication Date Title
CN102779180B (en) The operation processing method of data-storage system, data-storage system
CN105868122A (en) Data processing method and device for quick flashing storage equipment
CN103699585B (en) Methods, devices and systems for file metadata storage and file recovery
CN107818269B (en) File storage method and system based on Flash
CN102349055A (en) Optimizing access time of files stored on storages
KR101933766B1 (en) Methods and systems for improving flash memory flushing
CN104461390A (en) Method and device for writing data into imbricate magnetic recording SMR hard disk
JP6156517B2 (en) Write information storage device, method, and program
US20160306732A1 (en) Automatic repair of scripts
EP3438845A1 (en) Data updating method and device for a distributed database system
US20170270055A1 (en) Automatic recovery of application cache warmth
CN106910528A (en) A kind of optimization method and device of solid state hard disc data routing inspection
CN105574217A (en) Data synchronization method and device of distributed relational database
US10628487B2 (en) Method for hash collision detection based on the sorting unit of the bucket
CN102902770B (en) Method and system for assembling mirror image files
CN108604201B (en) Snapshot rollback method, device, storage controller and system
CN108052411B (en) Method and device for repairing one-way linked list interruption
US20160299834A1 (en) State storage and restoration device, state storage and restoration method, and storage medium
WO2014120139A1 (en) Acquiring identification of an application lifecycle management entity associated with similar code
CN110352410A (en) Track the access module and preextraction index node of index node
CN106326397A (en) Method and device for generating index file
CN106909514B (en) Method and device for positioning snapshot disk address
CN106611364B (en) Storage fragment sorting method and device
CN109325005A (en) A kind of data processing method and electronic equipment
CN112181288B (en) Data processing method of nonvolatile storage medium and computer storage medium

Legal Events

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