CN103064881B - Annular data management system in dynamic memory distribution and annular data managing method - Google Patents

Annular data management system in dynamic memory distribution and annular data managing method Download PDF

Info

Publication number
CN103064881B
CN103064881B CN201210508891.2A CN201210508891A CN103064881B CN 103064881 B CN103064881 B CN 103064881B CN 201210508891 A CN201210508891 A CN 201210508891A CN 103064881 B CN103064881 B CN 103064881B
Authority
CN
China
Prior art keywords
linked list
doubly linked
closed
data
unit
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.)
Expired - Fee Related
Application number
CN201210508891.2A
Other languages
Chinese (zh)
Other versions
CN103064881A (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.)
Suzhou Inovance Technology Co Ltd
Shenzhen Inovance Technology Co Ltd
Shenzhen Inovance Control Technology Co Ltd
Original Assignee
Suzhou Inovance Technology Co Ltd
Shenzhen Inovance Technology Co Ltd
Shenzhen Inovance Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inovance Technology Co Ltd, Shenzhen Inovance Technology Co Ltd, Shenzhen Inovance Control Technology Co Ltd filed Critical Suzhou Inovance Technology Co Ltd
Priority to CN201210508891.2A priority Critical patent/CN103064881B/en
Publication of CN103064881A publication Critical patent/CN103064881A/en
Application granted granted Critical
Publication of CN103064881B publication Critical patent/CN103064881B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Dram (AREA)

Abstract

The invention provides the annular data management system in a kind of dynamic memory distribution, described annular data are end to end doubly linked list; Comprise array creation module and element locating module; Wherein: described array creation module is for creating the closed-loop dynamic array corresponding with described doubly linked list; Described closed-loop dynamic array comprises N number of data item and each data item comprises a pointer, in this closed-loop dynamic array, the pointer of N number of data item points to the different elements in described doubly linked list respectively, and the sequence number of element in the doubly linked list of the pointed of adjacent data items is spaced apart xN; Described element locating module, for by the element in described closed-loop dynamic array positioning bidirectional chained list.Present invention also offers a kind of method of correspondence.The present invention by introducing closed-loop dynamic array on the basis of the doubly linked list of annular data, thus in extensive problem, makes to have outstanding efficiency during basic operation.

Description

Annular data management system in dynamic memory distribution and annular data managing method
Technical field
The present invention relates to computer dynamic Memory Allocation field, more particularly, relate to the annular data management system in a kind of dynamic memory distribution and annular data managing method.
Background technology
Annular data are abstract to end to end doubly linked list under normal circumstances.It otherwise be empty, at this time do not comprise any element; Comprise n (n>0) individual element, and have unique header element, it is numbered 0, and element number is respectively 1,2 thereafter in the direction of the clock ..., n-1.Annular data allow by specifying numbering access elements; Allow new element to be inserted into specify numbering (element number adds 1 automatically thereafter); Allow to specify the element of numbering to delete (element number subtracts 1 automatically thereafter); Allow the unit of quantity's (namely renumbeing) etc. ring " left-handed " or " dextrorotation " specified.
Annular data have irreplaceable status and unique advantage in the problem solving in some fields, such as, in the field such as dynamic memory distribution of computer equipment.
The scheme of the annular data management of existing realization has two classes substantially: a class is the conventional end to end doubly linked list of use (as shown in Figure 1); Another kind of is use closed-loop dynamic array.When using doubly linked list to manage annular data, the position fixing process of every operation is all by having traveled through from the header element being numbered 0; For insertion, delete and rotation process, also relate to a small amount of amendment linked operation.When using closed-loop dynamic array to manage annular data, the position fixing process of every operation is all based upon on the basis of efficient array element random access; And for insertion and deletion action, then relate to element of a high price in a large number and move operation.
When there is extensive problem, no matter be adopt doubly linked list, or adopt closed-loop dynamic array, annular data are often all difficult to searching by appointment numbering, insert, deleting element, and obtain gratifying efficiency by specified quantity unit by every basic operations such as ring rotation.Table 1 is the time complexity of the operations of the doubly linked list adopting doubly linked list and closed-loop dynamic array to realize: (n problem of representation scale, i expression operates the element number of specifying, and m represents the unit of quantity of rotation).
Administrative skill basic operation Search i Insert i Delete i Rotate m
Doubly linked list O(n/2) O(n/2) O(n/2) O(n/2)
Closed-loop dynamic array O(1) O(n/2) O(n/2) O(1)
Table 1: the time complexity that annular data manipulation is corresponding
As seen from the above table, when problem scale reaches some levels (as n=100000000), existing scheme almost no longer may be utilized to manage annular data.
Summary of the invention
The technical problem to be solved in the present invention is, for the problem that every basic operation efficiency of above-mentioned annular data is lower, provides the annular data management system in a kind of dynamic memory distribution and annular data managing method.
The technical scheme that the present invention solves the problems of the technologies described above is, provides the annular data management system in a kind of dynamic memory distribution, and described annular data are end to end doubly linked list; Comprise array creation module and element locating module; Wherein: described array creation module is for creating the closed-loop dynamic array corresponding with described doubly linked list; Described closed-loop dynamic array comprises N number of data item and each data item comprises a pointer, N is the integral part of sqrt (n+1), n is the quantity of element in doubly linked list, in this closed-loop dynamic array, the pointer of N number of data item points to the different elements in described doubly linked list respectively, and the sequence number of element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein xN=max (N, n/N); Described element locating module, for by the element in described closed-loop dynamic array positioning bidirectional chained list;
Described element locating module comprises interval judgement unit and data traversal unit, wherein: described interval judgement unit is used for two data item obtained according to the sequence number of element to be positioned in doubly linked list in closed-loop dynamic array, between two elements of described element to be positioned in the doubly linked list of described two data item sensing; Described data traversal unit is used for a pointed element in two data item of interval judgement unit acquisition for starting elemental traversal doubly linked list obtains element to be positioned;
Described data traversal unit comprises starting point and obtains subelement and step-length and obtain subelement, wherein: starting point obtains the distance determination starting elemental of element and the direction of traversal that subelement is used for pointing to according to described element distance to be positioned two data item; Described step-length obtains starting elemental that subelement is used for determining according to described, the position relationship of traversal direction and element to be positioned and starting elemental is determined to travel through step-length; Described data traversal unit uses described starting elemental, traversal direction and traversal step-length to travel through described doubly linked list and obtains element to be positioned.
In annular data management system in dynamic memory distribution of the present invention, described annular data management system also comprises array maintenance module, this array maintenance module comprises position acquisition unit, data maintenance unit and pointer modified unit, wherein: described position acquisition unit is used for obtaining by element locating module the position of element in described doubly linked list being inserted into or deleting; Described data maintenance unit is used for inserting in the position of described acquisition or deleting element; Described pointer modified unit is used for the pointer adjusting corresponding data item in described closed-loop dynamic array according to the change of described doubly linked list.
In annular data management system in dynamic memory distribution of the present invention, described array maintenance module comprises rotational positioning unit and reorientation unit, wherein: described rotational positioning unit is used for specified quantity unit to ask mould to n, and will the result of mould be asked as element to be positioned; Described reorientation unit is used for by the described element to be positioned in element locating module location, and the element obtained described location is as the header element of doubly linked list.
The present invention also provides the annular data managing method in a kind of dynamic memory distribution, and described annular data are end to end doubly linked list; Comprise the following steps:
A () creates closed-loop dynamic array corresponding to doubly linked list, wherein said closed-loop dynamic array comprises N number of data item and each data item comprises a pointer, and N is the integral part of sqrt (n+1), and n is the quantity of element in doubly linked list;
B () makes the pointer of N number of data item in described closed-loop dynamic array point to different elements in described doubly linked list respectively, and the sequence number of element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein xN=max (N, n/N);
C () is by the element in described closed-loop dynamic array positioning bidirectional chained list;
In described step (c), comprised the following steps by the element in described closed-loop dynamic array positioning bidirectional chained list:
(c1) two data item in closed-loop dynamic array are obtained according to the sequence number of element to be positioned in doubly linked list, between two elements of described element to be positioned in the doubly linked list of described two data item sensing;
(c2) be that starting elemental traversal doubly linked list obtains element to be positioned with a pointed element in two data item obtained in step (c1);
Described step (c2) comprising:
(c21) according to the distance determination starting elemental of element and the direction of traversal of two the data item sensings of described element distance to be positioned;
(c22) position relationship of the starting elemental determined according to described, traversal direction and element to be positioned and starting elemental is determined to travel through step-length;
(c23) use described starting elemental, traversal direction and the traversal step-length determined to travel through described doubly linked list and obtain element to be positioned.
In annular data managing method in dynamic memory distribution of the present invention, described method also comprises: in doubly linked list, insert element by described closed-loop dynamic array or delete element from doubly linked list, specifically comprising the following steps:
The position of element in described doubly linked list being inserted into or deleting is located by described closed-loop dynamic array;
Position in the doubly linked list that described location obtains is inserted or deletes element;
The pointer of corresponding data item in described closed-loop dynamic array is adjusted according to the change of described doubly linked list.
In annular data managing method in dynamic memory distribution of the present invention, described method also comprise by described closed-loop dynamic array by doubly linked list by specified quantity unit rotate, specifically comprise the following steps:
Specified quantity unit is asked mould to n, and will the result of mould be asked as element to be positioned;
Described closed-loop dynamic array is used to locate described element to be positioned;
The element obtained described location is as the header element of doubly linked list.
Annular data management system in dynamic memory distribution of the present invention and method, by introducing closed-loop dynamic array on the basis of the doubly linked list of annular data, thus in extensive problem, make annular data search by appointment numbering, insert, delete element and have outstanding efficiency by specified quantity unit by during the basic operations such as ring rotation completing.
Accompanying drawing explanation
Fig. 1 is the schematic diagram of the existing doubly linked list of the present invention.
Fig. 2 is the schematic diagram of the annular data management system embodiment in dynamic memory distribution of the present invention.
Fig. 3 is the schematic diagram using annular data management system of the present invention to carry out element location.
Fig. 4 is the process flow diagram of the annular data managing method embodiment in dynamic memory distribution of the present invention.
Fig. 5 is the process flow diagram using closed-loop dynamic array location element in Fig. 4.
Fig. 6 is with the process flow diagram of a data item for starting elemental traversal acquisition element in Fig. 5.
Fig. 7 is the process flow diagram that in the annular data managing method in dynamic memory distribution of the present invention, doubly linked list is safeguarded.
Fig. 8 is the process flow diagram that in the annular data managing method in dynamic memory distribution of the present invention, doubly linked list rotates.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The present invention is on the basis of the doubly linked list of annular data, introduce closed-loop dynamic array as control and management center (CMC), thus make Dynamic Annular data carrying out searching, insert, delete and the basic operation such as rotation time, no longer come by traveling through doubly linked list from the header element being numbered 0.
As shown in Figure 2, it is the schematic diagram of the annular data management system embodiment in dynamic memory distribution of the present invention, wherein annular data are end to end doubly linked list, and this doubly linked list comprises n element, this n element arrange in order and join end to end (n be greater than 1 integer).It should be noted that, for the element in doubly linked list, without any particular/special requirement, can be any data instance resided in Dram, or the link (as C pointer) for accessing these data instances.
Annular data management system in the present embodiment comprises array creation module 21 and element locating module 23, and wherein array creation module 21 is for creating the closed-loop dynamic array corresponding with doubly linked list.Closed-loop dynamic array comprises N number of data item and each data item comprises a pointer, and wherein N is the integral part of sqrt (n+1).
The element of the pointer indication that first data item da [0] of such as closed-loop dynamic array is preserved is numbered xindex in doubly linked list; N-1 pointer of other data item except da [0], element being numbered in doubly linked list of the pointer indication of any one data item da [x] wherein: from the numbering of the N number of element of xth that its adjacent left-hand pointer (can be da [0]) da [x-1] indication element arrives clockwise.In the dynamic changing process of doubly linked list, this numbering relation that the pointer of the data item of closed-loop dynamic array is implicit must be maintained from the beginning to the end, namely in closed-loop dynamic array, the pointer of N number of data item points to the different elements in doubly linked list respectively, and the sequence number of element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein, xN and N, n have following relation:
XN=max (integral part of N, n/N).
Above-mentioned <n, <N, xN>> relation, makes closed-loop dynamic array relatively easily realize, and can complete each basic operation in O (sqrt (n)) time complexity.
Element locating module 23 is for passing through the element in closed-loop dynamic array (da) positioning bidirectional chained list.The positioning action of this element locating module 23 first by a small amount of logical calculated, and utilizes the random access property of closed-loop dynamic array da, and scope quick lock in is interval at the element of O (sqrt (n)) scale; Again by the logical calculated of trace, element scope being narrowed down to further O (sqrt (n)/2) scale is interval; Finally, interval by traveling through this element, come the location of designed element.The time complexity of whole position fixing process is O (sqrt (n)/4).
When specific implementation, above-mentioned element locating module 23 can comprise interval judgement unit and data traversal unit, and above-mentioned data traversal unit comprises starting point further and obtains subelement and step-length acquisition subelement.The course of work of this element locating module 23 as shown in Figure 3.
Interval judgement unit is used for two data item obtained according to the sequence number of element to be positioned in doubly linked list in closed-loop dynamic array, between two elements of bit i element undetermined in the doubly linked list of above-mentioned two data item sensing, namely da interval [j in closed-loop dynamic array is obtained, k], element i to be positioned is positioned between two elements of the doubly linked list of the pointed of data item da [j] and da [k].This starting point acquiring unit executable operations can be expressed as by false code:
Starting point obtains subelement according to the distance determination starting elemental of element of element distance to be positioned two data item sensings and the direction of traversal, namely the element selecting one of both da [j] and da [k] pointed is as the starting elemental of traversal, determine simultaneously traversal direction (namely with the element of pointed near the data item of element i to be positioned for starting elemental, and with the direction pointing to element i to be positioned from starting elemental for traversal direction).Particularly, starting point acquisition subelement executable operations can be expressed as by false code:
Step-length obtains subelement and is used for determining to travel through step-length (loop) according to the position relationship of the starting elemental determined, traversal direction and element to be positioned and starting elemental.This step-length obtains subelement executable operations and can be expressed as by false code:
The above interval judgement unit of data traversal unit comprehensive, starting point obtain the execution result of subelement and step-length acquisition subelement, namely starting point is used to obtain the starting elemental of subelement acquisition, obtain the traversal step-length of subelement acquisition with step-length, and obtain element i to be positioned along the traversal direction traversal doubly linked list that starting point acquisition subelement obtains, just can complete the position fixing process based on element i to be positioned.
According to <n, <N, xN>> relation, the time complexity as seen based on the position fixing process of closed-loop dynamic array is O (sqrt (n)/4).
Certainly, above-mentioned data traversal unit also only can obtain element to be positioned (traversal direction is the element that starting elemental points to the sensing of another data item, and traversal step-length is 1) with the element in the doubly linked list pointed by any one in two data item of interval judgement unit acquisition for starting elemental travels through doubly linked list.But the now less efficient of data traversal unit.
In annular data management system in above-mentioned dynamic memory distribution, also can comprise array maintenance module, this array maintenance module comprises position acquisition unit, data maintenance unit and pointer modified unit, wherein: position acquisition unit is used for obtaining by element locating module the position of element in doubly linked list being inserted into or deleting; The position that data maintenance unit is used for obtaining at position acquiring unit is inserted or is deleted element; Pointer modified unit is used for the pointer of corresponding data item in the change adjustment closed-loop dynamic array according to doubly linked list.
By specifying numbering to doubly linked list insertion element with in the middle of the process of doubly linked list deletion element, because <n, <N, the Relationship Between Dynamic Change that xN>> has " smoothly ", this makes for arbitrary N, when n changes, only following three kinds of situations may be there are: when n changes, N and xN remains unchanged; When n changes, N is constant, and xN adds 1 (update) or subtracts 1 (deletion action); When n changes, N adds 1 (update) or subtracts 1 (deletion action), and xN is constant.Correspondingly, pointer modified unit performs different operations.
1. particularly, when n changes, N and xN remains unchanged, now, and the numbering relation in order to the element of the pointer and doubly linked list that maintain the data item of closed-loop dynamic array da:
A. for update, after update completes, pointer modified unit executable operations can represent by following false code, and wherein da [k]->rlink and da [k]->llink represents the adjacent right side of sensing da [k] indication element and the pointer of adjacent left-hand element respectively:
B. for deletion action, after deletion action completes, pointer modified unit executable operations can represent by following false code (if deleted element is the element of da [j] indication, then da [j] should be replaced by da [j]->rlink before deletion action):
The time complexity of above two parts algorithm is identical, specifically:
O(2*(1+2+…+N/2)/N)=O(N/4+1/2)=O(N/4)=O(sqrt(n)/4)。
2. when n changes, N is constant, and xN adds 1 (update) or subtracts 1 (deletion action), now, in order to the numbering relation of the element of the pointer and doubly linked list that maintain closed-loop dynamic array data item,
A., for update, after update completes, pointer modified unit executable operations can represent by following false code:
B. for deletion action, after deletion action completes, pointer modified unit executable operations can represent by following false code (if deleted element is the element of da [j] indication, then da [j] should be replaced by da [j]->rlink before deletion action):
The time complexity of above two parts algorithm is also identical, specifically:
O(2*(1+2+…+N/2))=O(N*N/4+N/2)=O(N*N/4)=O(n/4)。
3., when n changes, N adds 1 (update) or subtracts 1 (deletion action), and xN is constant, now, in order to the numbering relation of the element of the pointer and doubly linked list that maintain the data item of closed-loop dynamic array da,
A., for update, after update completes, pointer modified unit executable operations can use following false code to represent:
B. for deletion action, after deletion action completes, pointer modified unit executable operations can adopt following false code to represent (if deleted element is the element of da [j] indication, then da [j] should be replaced by da [j]->rlink before deletion action):
The time complexity of above two parts algorithm only differs O (xN), specifically respectively:
A.O((2*(1+2+…+N/2)/N+xN)=O(N/4+1/2+xN)=O(N/4+xN)
Consider N ≈ xN, above time complexity is equivalent to:
O(5*N/4)=O(5*sqrt(n)/4)。
B.O((2*(1+2+…+N/2)/N)=O(N/4+1/2)=O(N/4)=O(sqrt(n)/4)。
Based on the analysis of the operation to above three kinds of situation pointer modified unit, the cost safeguarded for closed-loop dynamic array can be calculated:
A. update
O(((2*N-1)*N/4+N*N/4+5*N/4)/(2*N+1))=O(3*N/8)=O(3*sqrt(n)/8)
B. deletion action
O(((2*N-1)*N/4+N*N/4+N/4)/(2*N+1))=O(3*N/8)=O(3*sqrt(n)/8)
Above-mentioned array maintenance module also can comprise finite element rotation positioning unit and reorientation unit, rotates by specific data unit to realize doubly linked list.Above-mentioned rotational positioning unit is used for specified quantity unit to ask mould to n, and will the result of mould be asked as element to be positioned; Reorientation unit is used for using described element to be positioned by element locating module, and the element obtained location is as the header element of doubly linked list.
To sum up, the annular data management system in above-mentioned dynamic memory distribution for searching by appointment numbering, insert, delete element and by specified quantity unit by basic operations such as ring rotations, and more specific as follows on Algorithms T-cbmplexity of prior art:
Especially, the annular data management system in dynamic memory distribution of the present invention is better than existing scheme when n>=4; And after closed-loop dynamic array reasonably creates and a little can be arranged on certain update; In addition, when creating closed-loop dynamic array, xindex can be initialized as 0, meanwhile, da [0] should be set to the pointer pointing to doubly linked list header element.
As shown in Figure 4, it is the schematic flow sheet of the annular data managing method embodiment in dynamic memory distribution of the present invention, wherein annular data are end to end doubly linked list, this doubly linked list comprises n element, this n element arrange in order and join end to end (n be greater than 1 integer).It should be noted that, for the element in doubly linked list, without any particular/special requirement, can be any data instance resided in Dram, or the link (as C pointer) for accessing these data instances.
Method in the present embodiment comprises the following steps:
Step S41: create the closed-loop dynamic array that doubly linked list is corresponding, wherein said closed-loop dynamic array comprises N number of data item and each data item comprises a pointer, and N is the integral part of sqrt (n+1), and n is the quantity of element in doubly linked list.
Step S42: make the pointer of N number of data item in described closed-loop dynamic array point to different elements in described doubly linked list respectively, and the sequence number of element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein xN=max (N, n/N).
Step S43: by the element in described closed-loop dynamic array positioning bidirectional chained list.
As shown in Figure 5, be the idiographic flow of element in positioning bidirectional chained list in Fig. 4, it comprises the following steps:
Step S431: obtain two data item in closed-loop dynamic array according to the sequence number of element to be positioned in doubly linked list, between two elements of described element to be positioned in the doubly linked list of described two data item sensing.
Step S432: with a pointed element in obtain in step S431 two data item for starting elemental traversal doubly linked list obtains element to be positioned.
As shown in Figure 6, the doubly linked list traversal step in Fig. 5 comprises:
Step S4321: the distance determination starting elemental of element pointed to according to described element distance to be positioned two data item and the direction of traversal.
Step S4322: the position relationship of the starting elemental determined according to described, traversal direction and element to be positioned and starting elemental is determined to travel through step-length.
Step S4323: use starting elemental, traversal direction and the traversal step-length determined in step S4321 and step S4322 to travel through described doubly linked list and obtain element to be positioned.
As shown in Figure 7, the annular data managing method in dynamic memory distribution of the present invention also comprises: in doubly linked list, insert element by closed-loop dynamic array or delete element from doubly linked list, comprising the following steps:
Step S71: located the position of element in described doubly linked list being inserted into or deleting by closed-loop dynamic array.
Step S72: the position in the doubly linked list that location obtains is inserted or deleted element.
Step S73: according to the pointer of corresponding data item in the change adjustment closed-loop dynamic array of doubly linked list.
As shown in Figure 8, the annular data managing method in dynamic memory distribution of the present invention also comprises: rotated by specified quantity unit by doubly linked list by closed-loop dynamic array, comprise the following steps:
Step S81: specified quantity unit is asked mould to n, and will the result of mould be asked as element to be positioned.
Step S82: use the described element to be positioned in closed-loop dynamic array location.
Step S83: the element obtained location is as the header element of doubly linked list.
The above; be only the present invention's preferably embodiment, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (6)

1. the annular data management system in dynamic memory distribution, described annular data are end to end doubly linked list; It is characterized in that: comprise array creation module and element locating module; Wherein: described array creation module is for creating the closed-loop dynamic array corresponding with described doubly linked list; Described closed-loop dynamic array comprises N number of data item and each data item comprises a pointer, N is the integral part of sqrt (n+1), n is the quantity of element in doubly linked list, in this closed-loop dynamic array, the pointer of N number of data item points to the different elements in described doubly linked list respectively, and the sequence number of element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein xN=max (N, n/N); Described element locating module, for by the element in described closed-loop dynamic array positioning bidirectional chained list;
Described element locating module comprises interval judgement unit and data traversal unit, wherein: described interval judgement unit is used for two data item obtained according to the sequence number of element to be positioned in doubly linked list in closed-loop dynamic array, between two elements of described element to be positioned in the doubly linked list of described two data item sensing; Described data traversal unit is used for a pointed element in two data item of interval judgement unit acquisition for starting elemental traversal doubly linked list obtains element to be positioned;
Described data traversal unit comprises starting point and obtains subelement and step-length and obtain subelement, wherein: starting point obtains the distance determination starting elemental of element and the direction of traversal that subelement is used for pointing to according to described element distance to be positioned two data item; Described step-length obtains starting elemental that subelement is used for determining according to described, the position relationship of traversal direction and element to be positioned and starting elemental is determined to travel through step-length; Described data traversal unit uses described starting elemental, traversal direction and traversal step-length to travel through described doubly linked list and obtains element to be positioned.
2. the annular data management system in dynamic memory distribution according to claim 1, it is characterized in that: described annular data management system also comprises array maintenance module, this array maintenance module comprises position acquisition unit, data maintenance unit and pointer modified unit, wherein: described position acquisition unit is used for obtaining by element locating module the position of element in described doubly linked list being inserted into or deleting; Described data maintenance unit is used for inserting in the position of described acquisition or deleting element; Described pointer modified unit is used for the pointer adjusting corresponding data item in described closed-loop dynamic array according to the change of described doubly linked list.
3. the annular data management system in dynamic memory distribution according to claim 2, it is characterized in that: described array maintenance module comprises rotational positioning unit and reorientation unit, wherein: described rotational positioning unit is used for specified quantity unit to ask mould to n, and will the result of mould be asked as element to be positioned; Described reorientation unit is used for by the described element to be positioned in element locating module location, and the element obtained described location is as the header element of doubly linked list.
4. the annular data managing method in dynamic memory distribution, described annular data are end to end doubly linked list; It is characterized in that: comprise the following steps:
A () creates closed-loop dynamic array corresponding to doubly linked list, wherein said closed-loop dynamic array comprises N number of data item and each data item comprises a pointer, and N is the integral part of sqrt (n+1), and n is the quantity of element in doubly linked list;
B () makes the pointer of N number of data item in described closed-loop dynamic array point to different elements in described doubly linked list respectively, and the sequence number of element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein xN=max (N, n/N);
C () is by the element in described closed-loop dynamic array positioning bidirectional chained list;
In described step (c), comprised the following steps by the element in described closed-loop dynamic array positioning bidirectional chained list:
(c1) two data item in closed-loop dynamic array are obtained according to the sequence number of element to be positioned in doubly linked list, between two elements of described element to be positioned in the doubly linked list of described two data item sensing;
(c2) be that starting elemental traversal doubly linked list obtains element to be positioned with a pointed element in two data item obtained in step (c1);
Described step (c2) comprising:
(c21) according to the distance determination starting elemental of element and the direction of traversal of two the data item sensings of described element distance to be positioned;
(c22) position relationship of the starting elemental determined according to described, traversal direction and element to be positioned and starting elemental is determined to travel through step-length;
(c23) use described starting elemental, traversal direction and the traversal step-length determined to travel through described doubly linked list and obtain element to be positioned.
5. the annular data managing method in dynamic memory distribution according to claim 4, it is characterized in that: described method also comprises: in doubly linked list, insert element by described closed-loop dynamic array or delete element from doubly linked list, specifically comprising the following steps:
The position of element in described doubly linked list being inserted into or deleting is located by described closed-loop dynamic array;
Position in the doubly linked list that described location obtains is inserted or deletes element;
The pointer of corresponding data item in described closed-loop dynamic array is adjusted according to the change of described doubly linked list.
6. the annular data managing method in dynamic memory distribution according to claim 5, is characterized in that: described method also comprise by described closed-loop dynamic array by doubly linked list by specified quantity unit rotate, specifically comprise the following steps:
Specified quantity unit is asked mould to n, and will the result of mould be asked as element to be positioned;
Described closed-loop dynamic array is used to locate described element to be positioned;
The element obtained described location is as the header element of doubly linked list.
CN201210508891.2A 2012-12-03 2012-12-03 Annular data management system in dynamic memory distribution and annular data managing method Expired - Fee Related CN103064881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210508891.2A CN103064881B (en) 2012-12-03 2012-12-03 Annular data management system in dynamic memory distribution and annular data managing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210508891.2A CN103064881B (en) 2012-12-03 2012-12-03 Annular data management system in dynamic memory distribution and annular data managing method

Publications (2)

Publication Number Publication Date
CN103064881A CN103064881A (en) 2013-04-24
CN103064881B true CN103064881B (en) 2016-01-13

Family

ID=48107511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210508891.2A Expired - Fee Related CN103064881B (en) 2012-12-03 2012-12-03 Annular data management system in dynamic memory distribution and annular data managing method

Country Status (1)

Country Link
CN (1) CN103064881B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664411A (en) * 2018-05-03 2018-10-16 晶晨半导体(上海)股份有限公司 A kind of memory chained list and the optimization method of memory management
CN109005174A (en) * 2018-08-03 2018-12-14 京信通信系统(中国)有限公司 Data communications method, device, computer storage medium and equipment
CN109271383B (en) * 2018-09-05 2021-01-08 广州视源电子科技股份有限公司 Dynamic label processing method and device, computer equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276334A (en) * 2007-03-29 2008-10-01 上海新跃仪表厂 Linked list implementing method for quickly searching data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2818403B1 (en) * 2000-12-19 2003-03-07 Thomson Csf MEMORY MANAGEMENT METHOD

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276334A (en) * 2007-03-29 2008-10-01 上海新跃仪表厂 Linked list implementing method for quickly searching data

Also Published As

Publication number Publication date
CN103064881A (en) 2013-04-24

Similar Documents

Publication Publication Date Title
US6223342B1 (en) Object-oriented sequencing using hierarachical configuration streams
CN102981884B (en) Serializing device and sequencing method
CN103559323B (en) Database implementation method
CN101673287A (en) SQL sentence generation method and system
CN105653396B (en) Standby system and its backup method
CN103064881B (en) Annular data management system in dynamic memory distribution and annular data managing method
CN105095261A (en) Data insertion method and device
US20160004694A1 (en) Methods, systems, and devices for managing and accessing graphical data for physical facilities
Chen Mining top-k frequent patterns over data streams sliding window
CN107729396A (en) Data Dynamic Query method and device
CN101578579A (en) Taxonomy object modeling
US20110113319A1 (en) Introducing a form instance into an information container
CN105930354A (en) Storage model conversion method and device
CN104391935A (en) Implementation method and device of range lock
CN103198011A (en) Method and device for detecting file disturbance of JAVA program
US20070236508A1 (en) Management of gridded map data regions
Alper et al. Label Flow: exploiting workflow provenance to surface scientific data provenance
JP7106000B2 (en) OBJECT MANAGEMENT METHOD USING TRACKING IDENTIFIER, APPARATUS, COMPUTER PROGRAM AND RECORDING MEDIUM THEREOF
CN105378709A (en) Systems and methods for file management by mobile computing devices
CN103870562A (en) Regulation verifying method and system in intelligent building system
CN103700084A (en) Chemical molecular structure chart partition method based on area size and curvature
CN105955971A (en) Key value buffer memory implementation method and device
CN106709843A (en) Information loading method and system for auxiliary urban and rural planning
CN100356330C (en) Paste link processing method based on object memory database and past link processor
CN104919454A (en) Managing interactions with data having membership in multiple groupings

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160113

Termination date: 20201203