CN103064881A - Annular data manager in dynamic internal memory allocation and annular data management method - Google Patents

Annular data manager in dynamic internal memory allocation and annular data management method Download PDF

Info

Publication number
CN103064881A
CN103064881A CN2012105088912A CN201210508891A CN103064881A CN 103064881 A CN103064881 A CN 103064881A CN 2012105088912 A CN2012105088912 A CN 2012105088912A CN 201210508891 A CN201210508891 A CN 201210508891A CN 103064881 A CN103064881 A CN 103064881A
Authority
CN
China
Prior art keywords
linked list
doubly linked
closed
data
dynamic array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105088912A
Other languages
Chinese (zh)
Other versions
CN103064881B (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

Images

Landscapes

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

Abstract

The invention provides an annular data manager in dynamic internal memory allocation. Annular data are double linked lists which are connected from end to end. The annular data manager comprises a plurality of groups of construction modules and an element positioning module. The plurality of groups of construction modules are used for constructing closed-loop dynamic array lists corresponding to the double linked lists. The closed-loop dynamic array lists comprise N data items, each data item comprises a pointer, the pointers of the N data items in the closed-loop dynamic array lists respectively point to different elements in the double linked lists, and the serial number interval of the elements in the double linked lists and pointed by the pointers in the adjacent data items is xN. The element positioning module is used for positioning the elements in the double linked lists through the closed-loop dynamic array lists. The invention further provides an annular data management method. According to the annular data manager in dynamic internal memory allocation and the annular data management method, the closed-loop dynamic array lists are introduced on the basis of the double linked lists of the annular data, and accordingly the efficiency during basic operation is remarkably improved on the large scale problem.

Description

Annular data management system and annular data managing method during Dram distributes
Technical field
The present invention relates to computer dynamic Memory Allocation field, more particularly, relate to annular data management system and annular data managing method in a kind of Dram distribution.
Background technology
The annular data are abstract to end to end doubly linked list generally.It otherwise be empty, at this time do not comprise any element; Comprise n(n〉0) individual element, and have unique header element, and it is numbered 0, and the element numbering is respectively 1,2 thereafter in the direction of the clock ..., n-1.The annular data allow by specifying the numbering access elements; Allow new element is inserted into appointment numbering (the element numbering adds 1 automatically thereafter); Permission will be specified the element deletion (the element numbering subtracts 1 automatically thereafter) of numbering; Permission will encircle unit of quantity's (namely renumbeing) of " left-handed " or " dextrorotation " appointment etc.
The annular data have irreplaceable status and unique advantage in the problem solving in some fields, such as the fields such as Dram distribution at 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 to use the closed-loop dynamic array.When managing annular data with doubly linked list, the position fixing process of every operation all is by beginning to travel through to finish from being numbered 0 header element; For insertion, deletion and rotary manipulation also relate to a small amount of modification linked operation.When managing annular data with the closed-loop dynamic array, the position fixing process of every operation all is based upon on the basis of efficient array element random access; And for inserting and deletion action, then relate to a large amount of element move operations of a high price.
When extensive problem occurring, no matter be to adopt doubly linked list, still adopt the closed-loop dynamic array, annular data often all are difficult to by specifying numbering searching, insert, deleting element, and will encircle by specified quantity unit in every basic operation such as rotation and obtain gratifying efficient.Table 1 is the time complexity that adopts the operations of the doubly linked list that doubly linked list and closed-loop dynamic array realize: (n problem of representation scale, i represents to operate the element numbering of appointment, m represents the unit of quantity of rotating).
Administrative skill basic operation Search i Insert i Deletion i Rotation m
Doubly linked list O(n/2) O(n/2) O(n/2) O(n/2)
The 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 (such as n=100000000), almost no longer may utilize existing scheme to manage annular data.
Summary of the invention
The technical problem to be solved in the present invention is, for the lower problem of every basic operation efficient of above-mentioned annular data, provides annular data management system and annular data managing method in a kind of Dram distribution.
The technical scheme that the present invention solves the problems of the technologies described above is, the annular data management system of a kind of Dram in distributing is provided, 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 used for creating the closed-loop dynamic array corresponding with described doubly linked list; Described closed-loop dynamic array comprises that N data item and each data item comprise a pointer, N is the integral part of sqrt (n+1), n is the quantity of element in the doubly linked list, the pointer of N data item points to respectively the different elements in the described doubly linked list in this closed-loop dynamic array, and the sequence number of the element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, xN=max (N, n/N) wherein; Described element locating module is used for the element by described closed-loop dynamic array positioning bidirectional chained list.
In the annular data management system in Dram of the present invention distributes, described element locating module comprises interval judgement unit and data traversal unit, wherein: described interval judgement unit is for two data item obtaining according to the sequence number of doubly linked list element to be positioned in the closed-loop dynamic array, between two elements of described element to be positioned in the doubly linked list that described two data item are pointed to; Described data traversal unit is used for obtaining element to be positioned take an element pointed of two data item of interval judgement unit acquisition as initial element travels through doubly linked list.
In the annular data management system in Dram of the present invention distributes, described data traversal unit comprises that starting point is obtained subelement and step-length is obtained subelement, and wherein: starting point is obtained the direction that subelement is used for determining apart from the distance of the element of two data item sensings according to described element to be positioned initial element and traversal; Described step-length is obtained subelement and is used for determining to travel through step-length according to the position relationship of described definite initial element, traversal direction and element to be positioned and initial element; Described data traversal unit uses described initial element, traversal direction and traversal step-length to travel through described doubly linked list and obtains element to be positioned.
In the annular data management system in Dram of the present invention distributes, described annular data management system also comprises the array maintenance module, this array maintenance module comprises position acquisition unit, data maintenance unit and pointer modified unit, and wherein: described position acquisition unit is for the position of the element that obtains by the element locating module to be inserted into or to delete at described doubly linked list; Described data maintenance unit is used for inserting or the deletion element in the position of described acquisition; Described pointer modified unit is used for adjusting according to the variation of described doubly linked list the pointer of described closed-loop dynamic array corresponding data item.
In the annular data management system in Dram of the present invention distributes, described array maintenance module comprises rotation positioning unit and reorientation unit, wherein: described rotation positioning unit is used for specified quantity unit is asked mould to n, and the result that will ask mould is as element to be positioned; Described reorientation unit is used for locating described element to be positioned by the element locating module, and the element that described location is obtained is as the header element of doubly linked list.
The present invention also provides the annular data managing method in a kind of Dram distribution, and described annular data are end to end doubly linked list; May further comprise the steps:
(a) create closed-loop dynamic array corresponding to doubly linked list, wherein said closed-loop dynamic array comprises that N data item and each data item comprise a pointer, and N is the integral part of sqrt (n+1), and n is the quantity of element in the doubly linked list;
(b) make the pointer of N data item in the described closed-loop dynamic array point to respectively different elements in the described doubly linked list, and the sequence number of the element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein xN=max (N, n/N);
(c) by the element in the described closed-loop dynamic array positioning bidirectional chained list.
In the annular data managing method in Dram of the present invention distributes, in the described step (c), may further comprise the steps by the element in the described closed-loop dynamic array positioning bidirectional chained list:
(c1) obtain two data item in the closed-loop dynamic array according to the sequence number of element to be positioned in the doubly linked list, between two elements of described element to be positioned in the doubly linked list that described two data item are pointed to;
(c2) element pointed in two data item that obtain in the step (c1) obtains element to be positioned as initial element traversal doubly linked list.
In the annular data managing method in Dram of the present invention distributes, described step (c2) comprising:
The distance of the element that (c21) points to according to two data item of described element to be positioned distance is determined the direction of initial element and traversal;
(c22) determine the traversal step-length according to the position relationship of described definite initial element, traversal direction and element to be positioned and initial element;
(c23) use described definite initial element, traversal direction and traversal step-length to travel through described doubly linked list and obtain element to be positioned.
In the annular data managing method in Dram of the present invention distributes, described method also comprises: insert element or delete element from doubly linked list in doubly linked list by described closed-loop dynamic array, specifically may further comprise the steps:
Locate the position of element in described doubly linked list that is inserted into or deletes by described closed-loop dynamic array;
Insert or the deletion element position in the doubly linked list that described location obtains;
Adjust the pointer of corresponding data item in the described closed-loop dynamic array according to the variation of described doubly linked list.
In the annular data managing method in Dram of the present invention distributes, described method also comprises by described closed-loop dynamic array rotates doubly linked list by specified quantity unit, specifically may further comprise the steps:
Specified quantity unit is asked mould to n, and the result that will ask mould is as element to be positioned;
Use described closed-loop dynamic array to locate described element to be positioned;
The element that described location is obtained is as the header element of doubly linked list.
Annular data management system and method during Dram of the present invention distributes, introduce the closed-loop dynamic array by the basis at the doubly linked list of annular data, thereby on extensive problem, annular data are finished by specifying numbering to search, insert, delete element and having outstanding efficient will encircle the basic operation such as rotation by specified quantity unit the time.
Description of drawings
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 during Dram of the present invention distributes.
Fig. 3 uses annular data management system of the present invention to carry out the schematic diagram of element location.
Fig. 4 is the process flow diagram of the annular data managing method embodiment during Dram of the present invention distributes.
Fig. 5 is the process flow diagram that uses closed-loop dynamic array location element among Fig. 4.
Fig. 6 is the process flow diagram that obtains element among Fig. 5 take a data item as initial element traversal.
Fig. 7 is the process flow diagram that doubly linked list is safeguarded in the annular data managing method during Dram of the present invention distributes.
Fig. 8 is the process flow diagram of doubly linked list rotation in the annular data managing method during Dram of the present invention distributes.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, 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, is not intended to limit the present invention.
The present invention is on the basis of the doubly linked list of annular data, introduce the closed-loop dynamic array as control and management center (CMC), thereby make the Dynamic Annular data search, insert, delete and during the basic operation such as rotation, no longer by beginning to travel through doubly linked list and finish from being numbered 0 header element.
As shown in Figure 2, it is the schematic diagram of the annular data management system embodiment during Dram of the present invention distributes, 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 for greater than 1 integer).Need to prove, for the element in the doubly linked list, without any specific (special) requirements, can be any data instance that resides in the Dram, perhaps is used for the link (such as the C pointer) of these data instances of access.
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 used for creating the closed-loop dynamic array corresponding with doubly linked list.The closed-loop dynamic array comprises that N data item and each data item comprise a pointer, and wherein N is the integral part of sqrt (n+1).
First data item da[0 of closed-loop dynamic array for example] element of the pointer indication preserved is numbered xindex in doubly linked list; Except da[0] N-1 pointer of other data item, any one data item da[x wherein] element being numbered in doubly linked list of pointer indication: from its adjacent left-hand pointer (can be da[0]) da[x-1] numbering of xN element arriving clockwise of indication element.In the dynamic changing process of doubly linked list, the implicit this numbering relation of the pointer of the data item of closed-loop dynamic array must be kept from the beginning to the end, be that the pointer of N data item in the closed-loop dynamic array points to respectively the different elements in the doubly linked list, and the sequence number of the 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, so that the closed-loop dynamic array relatively easily realizes, and can in 0 (sqrt (n)) time complexity, finish each basic operation.
The element that element locating module 23 is used for by closed-loop dynamic array (da) positioning bidirectional chained list.The positioning action of this element locating module 23 is at first by a small amount of logical calculated, and utilizes the random access characteristic of closed-loop dynamic array da, and the scope quick lock in is interval at the element of 0 (sqrt (n)) scale; By the logical calculated of trace, the element that scope is further narrowed down to 0 (sqrt (n)/2) scale is interval again; At last, interval by traveling through this element, the location of finishing designed element.The time complexity of whole position fixing process is 0 (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 that further starting point is obtained subelement and step-length is obtained subelement.The course of work of this element locating module 23 as shown in Figure 3.
The interval judgement unit is for two data item obtaining according to the sequence number of doubly linked list element to be positioned in the closed-loop dynamic array, between two elements of bit i element undetermined in the doubly linked list that above-mentioned two data item are pointed to, namely obtain the interval [ j of da in the closed-loop dynamic array, k ], element i to be positioned is positioned at data item da[j] and da[k] two elements of doubly linked list of pointed between.This starting point acquiring unit executable operations can be expressed as with false code:
Figure BDA00002516311100061
Figure BDA00002516311100071
Starting point is obtained subelement is determined initial element and traversal according to the distance of the element of two data item sensings of element distance to be positioned direction, namely select da[j] and da[k] both one of element pointed as the initial element of traversal, determine simultaneously traversal direction (namely take the element of pointed near the data item of element i to be positioned as initial element, and take from the direction of initial element directed element i to be positioned as traversal direction).Particularly, starting point is obtained the subelement executable operations and can be expressed as with false code:
Step-length is obtained subelement and is used for determining traversal step-length (loop) according to the position relationship of initial element, traversal direction and element to be positioned and the initial element determined.This step-length is obtained the subelement executable operations and can be expressed as with false code:
Figure BDA00002516311100073
Figure BDA00002516311100081
The above interval judgement of data traversals unit comprehensive unit, starting point are obtained the execution result that subelement and step-length are obtained subelement, namely use starting point to obtain the initial element of subelement acquisition, obtain the traversal step-length that subelement obtains with step-length, and obtain the traversal direction traversal doubly linked list that subelement obtains along starting point and obtain element i to be positioned, just can finish the position fixing process based on element i to be positioned.
According to<n,<N, xN〉〉 relation, as seen the time complexity based on the position fixing process of closed-loop dynamic array is O (sqrt (n)/4).
Certainly, element in any doubly linked list pointed in two data item that above-mentioned data traversal unit also can be only obtains take the interval judgement unit obtains element to be positioned (element that traversal direction is pointed to as another data item of initial element directed, the traversal step-length is 1) as initial element traversal doubly linked list.But this moment, data traveled through the less efficient of unit.
In the annular data management system during above-mentioned Dram distributes, also can comprise the array maintenance module, this array maintenance module comprises position acquisition unit, data maintenance unit and pointer modified unit, and wherein: the position acquisition unit is for the position of the element that obtains by the element locating module to be inserted into or to delete at doubly linked list; The data maintenance unit is used for inserting or the deletion element in the position that the position acquiring unit obtains; The pointer modified unit is used for adjusting according to the variation of doubly linked list the pointer of closed-loop dynamic array corresponding data item.
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, xN〉〉 have a Relationship Between Dynamic Change of " smoothly ", this is so that for N arbitrarily, when n changed, only following three kinds of situations may occur: when n changed, N and xN remained unchanged; When n changed, N was constant, and xN adds 1 (update) or subtracts 1 (deletion action); When n changed, N added 1 (update) or subtracts 1 (deletion action), and xN is constant.Correspondingly, different operations is carried out in the pointer modified unit.
1. particularly, when n changed, N and xN remained unchanged, at this moment, and for the numbering relation of the element of the pointer of the data item of keeping closed-loop dynamic array da and doubly linked list:
A. for update, after update is finished, pointer modified unit executable operations can represent with following false code, wherein da[k]-〉 rlink and da[k]-〉 llink represents respectively to point to da[k] the adjacent right side of indication element and the pointer of adjacent left-hand element:
Figure BDA00002516311100091
Figure BDA00002516311100101
B. for deletion action, after deletion action is finished, pointer modified unit executable operations can represent with following false code (if deleted element is da[j] element of indication, then da[j] before deletion action, should be replaced by da[j]-〉 rlink):
Figure BDA00002516311100102
The time complexity of above two parts algorithm is identical, specifically:
0(2*(1+2+…N/2)/N)=0(N/4+1/2)=0(N/4)=0(sqrt(n)/4)。
2. when n changed, N was constant, and xN adds 1 (update) or subtracts 1 (deletion action), at this moment, and for the numbering relation of the element of the pointer of keeping closed-loop dynamic array data item and doubly linked list,
A. for update, after update was finished, pointer modified unit executable operations can represent with following false code:
Figure BDA00002516311100111
Figure BDA00002516311100121
Figure BDA00002516311100141
B. for deletion action, after deletion action is finished, pointer modified unit executable operations can with as
Lower false code represent (if deleted element is da[j] element of indication, then da[j] before deletion action, should be replaced by da[j]-〉 rlink):
Figure BDA00002516311100151
Figure BDA00002516311100161
Figure BDA00002516311100171
The time complexity of above two parts algorithm also is identical, specifically:
0(2*(1+2+…N/2))=0(N*N/4+N/2)=0(N*N/4)=0(n/4)。
3. when n changed, N added 1 (update) or subtracts 1 (deletion action), and xN is constant, at this moment, and for the numbering relation of the element of the pointer of the data item of keeping closed-loop dynamic array da and doubly linked list,
A. for update, after update was finished, pointer modified unit executable operations can use following false code to represent:
Figure BDA00002516311100172
B. for deletion action, after deletion action is finished, pointer modified unit executable operations can adopt following false code represent (if deleted element is da[j] element of indication, then da[j] in deletion action
Should be replaced by da[j before]-〉 rlink):
Figure BDA00002516311100191
The time complexity of above two parts algorithm only differs 0 (xN), specifically is respectively:
A.0((2*(1+2+…+N/2)/N+xN)=0(N/4+1/2+xN)=0(N/4+xN)
Consider N ≈ xN, above time complexity is equivalent to:
0(5*N/4)=O(5*sqrt(n)/4)。
B.0((2*(1+2+…+N/2)/N)=O(N/4+1/2)=0(N/4)=0(sqrt(n)/4)。
Based on the analysis to the operation of above three kinds of situation pointer modified unit, can calculate the cost of safeguarding for the closed-loop dynamic array:
A. update
0(((2*N-1)*N/4+N*N/4+5*N/4)/(2*N+1))=0(3*N/8)=0(3*sqrt(n)/8)
B. deletion action
0(((2*N-1)*N/4+N*N/4+N/4)/(2*N+1))=0(3*N/8)=O(3*sqrt(n)/8)
Above-mentioned array maintenance module also can comprise finite element rotation positioning unit and reorientation unit, presses the rotation of specific data unit to realize doubly linked list.Above-mentioned rotation positioning unit is used for specified quantity unit is asked mould to n, and the result that will ask mould is as element to be positioned; The reorientation unit is used for using described element to be positioned by the element locating module, and will locate the element of acquisition as the header element of doubly linked list.
To sum up, the annular data management system during above-mentioned Dram distributes is for by specifying numbering to search, insert, delete element and will encircle the basic operation such as rotation by specified quantity unit, and more specific as follows on the algorithm time complexity of prior art:
Figure BDA00002516311100201
Especially, the annular data management system during Dram of the present invention distributes is at n 〉=be better than existing scheme at 4 o'clock; And the closed-loop dynamic array reasonably creates and a little can be arranged on after certain update; In addition, when creating the closed-loop dynamic array, xindex can be initialized as 0, meanwhile, da[0] should be set to point to the pointer of doubly linked list header element.
As shown in Figure 4, it is the schematic flow sheet of the annular data managing method embodiment during Dram of the present invention distributes, 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 for greater than 1 integer).Need to prove, for the element in the doubly linked list, without any specific (special) requirements, can be any data instance that resides in the Dram, perhaps is used for the link (such as the C pointer) of these data instances of access.
Method in the present embodiment may further comprise the steps:
Step S41: create closed-loop dynamic array corresponding to doubly linked list, wherein said closed-loop dynamic array comprises that N data item and each data item comprise a pointer, and N is the integral part of sqrt (n+1), and n is the quantity of element in the doubly linked list.
Step S42: make the pointer of N data item in the described closed-loop dynamic array point to respectively different elements in the described doubly linked list, and the sequence number of the 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 the described closed-loop dynamic array positioning bidirectional chained list.
As shown in Figure 5, be the idiographic flow of element in the positioning bidirectional chained list among Fig. 4, it may further comprise the steps:
Step S431: obtain two data item in the closed-loop dynamic array according to the sequence number of element to be positioned in the doubly linked list, between two elements of described element to be positioned in the doubly linked list that described two data item are pointed to.
Step S432: an element pointed in two data item that obtain in the step S431 obtains element to be positioned as initial element traversal doubly linked list.
As shown in Figure 6, the doubly linked list traversal step among Fig. 5 comprises:
Step S4321: the direction of determining initial element and traversal according to described element to be positioned apart from the distance of the element of two data item sensings.
Step S4322: determine the traversal step-length according to the position relationship of described definite initial element, traversal direction and element to be positioned and initial element.
Step S4323: use initial element, traversal direction and the traversal step-length determined among step S4321 and the 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 during Dram of the present invention distributes also comprises: insert element or delete element from doubly linked list in doubly linked list by the closed-loop dynamic array, may further comprise the steps:
Step S71: locate the position of element in described doubly linked list that is inserted into or deletes by the closed-loop dynamic array.
Step S72: insert or the deletion element position in the doubly linked list that the location obtains.
Step S73: the pointer of adjusting corresponding data item in the closed-loop dynamic array according to the variation of doubly linked list.
As shown in Figure 8, the annular data managing method during Dram of the present invention distributes also comprises: by the closed-loop dynamic array doubly linked list is pressed the rotation of specified quantity unit, may further comprise the steps:
Step S81: specified quantity unit is asked mould to n, and the result that will ask mould is as element to be positioned.
Step S82: use the closed-loop dynamic array to locate described element to be positioned.
Step S83: will locate the element of acquisition as the header element of doubly linked list.
The above; only for the better embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation 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 (10)

1. the annular data management system during a Dram distributes, 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 used for creating the closed-loop dynamic array corresponding with described doubly linked list; Described closed-loop dynamic array comprises that N data item and each data item comprise a pointer, N is the integral part of sqrt (n+1), n is the quantity of element in the doubly linked list, the pointer of N data item points to respectively the different elements in the described doubly linked list in this closed-loop dynamic array, and the sequence number of the element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, xN=max (N, n/N) wherein; Described element locating module is used for the element by described closed-loop dynamic array positioning bidirectional chained list.
2. the annular data management system during Dram according to claim 1 distributes, it is characterized in that: described element locating module comprises interval judgement unit and data traversal unit, wherein: described interval judgement unit is for two data item obtaining according to the sequence number of doubly linked list element to be positioned in the closed-loop dynamic array, between two elements of described element to be positioned in the doubly linked list that described two data item are pointed to; Described data traversal unit is used for obtaining element to be positioned take an element pointed of two data item of interval judgement unit acquisition as initial element travels through doubly linked list.
3. the annular data management system during Dram according to claim 2 distributes, it is characterized in that: described data traversal unit comprises that starting point is obtained subelement and step-length is obtained subelement, and wherein: starting point is obtained the direction that subelement is used for determining apart from the distance of the element of two data item sensings according to described element to be positioned initial element and traversal; Described step-length is obtained subelement and is used for determining to travel through step-length according to the position relationship of described definite initial element, traversal direction and element to be positioned and initial element; Described data traversal unit uses described initial element, traversal direction and traversal step-length to travel through described doubly linked list and obtains element to be positioned.
4. the annular data management system during Dram according to claim 1 distributes, it is characterized in that: described annular data management system also comprises the array maintenance module, this array maintenance module comprises position acquisition unit, data maintenance unit and pointer modified unit, and wherein: described position acquisition unit is for the position of the element that obtains by the element locating module to be inserted into or to delete at described doubly linked list; Described data maintenance unit is used for inserting or the deletion element in the position of described acquisition; Described pointer modified unit is used for adjusting according to the variation of described doubly linked list the pointer of described closed-loop dynamic array corresponding data item.
5. the annular data management system during Dram according to claim 4 distributes, it is characterized in that: described array maintenance module comprises rotation positioning unit and reorientation unit, wherein: described rotation positioning unit is used for specified quantity unit is asked mould to n, and the result that will ask mould is as element to be positioned; Described reorientation unit is used for locating described element to be positioned by the element locating module, and the element that described location is obtained is as the header element of doubly linked list.
6. the annular data managing method during a Dram distributes, described annular data are end to end doubly linked list; It is characterized in that: may further comprise the steps:
(a) create closed-loop dynamic array corresponding to doubly linked list, wherein said closed-loop dynamic array comprises that N data item and each data item comprise a pointer, and N is the integral part of sqrt (n+1), and n is the quantity of element in the doubly linked list;
(b) make the pointer of N data item in the described closed-loop dynamic array point to respectively different elements in the described doubly linked list, and the sequence number of the element in the doubly linked list of the pointed of adjacent data items is spaced apart xN, wherein xN=max (N, n/N);
(c) by the element in the described closed-loop dynamic array positioning bidirectional chained list.
7. the annular data managing method during Dram according to claim 6 distributes is characterized in that: in the described step (c), may further comprise the steps by the element in the described closed-loop dynamic array positioning bidirectional chained list:
(c1) obtain two data item in the closed-loop dynamic array according to the sequence number of element to be positioned in the doubly linked list, between two elements of described element to be positioned in the doubly linked list that described two data item are pointed to;
(c2) element pointed in two data item that obtain in the step (c1) obtains element to be positioned as initial element traversal doubly linked list.
8. the annular data managing method during Dram according to claim 7 distributes, it is characterized in that: described step (c2) comprising:
The distance of the element that (c21) points to according to two data item of described element to be positioned distance is determined the direction of initial element and traversal;
(c22) determine the traversal step-length according to the position relationship of described definite initial element, traversal direction and element to be positioned and initial element;
(c23) use described definite initial element, traversal direction and traversal step-length to travel through described doubly linked list and obtain element to be positioned.
9. the annular data managing method during Dram according to claim 6 distributes, it is characterized in that: described method also comprises: insert element or delete element from doubly linked list in doubly linked list by described closed-loop dynamic array, specifically may further comprise the steps:
Locate the position of element in described doubly linked list that is inserted into or deletes by described closed-loop dynamic array;
Insert or the deletion element position in the doubly linked list that described location obtains;
Adjust the pointer of corresponding data item in the described closed-loop dynamic array according to the variation of described doubly linked list.
10. the annular data managing method during Dram according to claim 1 distributes is characterized in that: described method also comprises by described closed-loop dynamic array rotates doubly linked list by specified quantity unit, specifically may further comprise the steps:
Specified quantity unit is asked mould to n, and the result that will ask mould is as element to be positioned;
Use described closed-loop dynamic array to locate described element to be positioned;
The element that described location is obtained 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 true CN103064881A (en) 2013-04-24
CN103064881B 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)

Cited By (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
CN109271383A (en) * 2018-09-05 2019-01-25 广州视源电子科技股份有限公司 Dynamic labels processing method, device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020099919A1 (en) * 2000-12-19 2002-07-25 Thales Method of memory management
CN101276334A (en) * 2007-03-29 2008-10-01 上海新跃仪表厂 Linked list implementing method for quickly searching data

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020099919A1 (en) * 2000-12-19 2002-07-25 Thales Method of memory management
CN101276334A (en) * 2007-03-29 2008-10-01 上海新跃仪表厂 Linked list implementing method for quickly searching data

Cited By (4)

* 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
CN109271383A (en) * 2018-09-05 2019-01-25 广州视源电子科技股份有限公司 Dynamic labels processing method, device, computer equipment and storage medium
CN109271383B (en) * 2018-09-05 2021-01-08 广州视源电子科技股份有限公司 Dynamic label processing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN103064881B (en) 2016-01-13

Similar Documents

Publication Publication Date Title
CN102541529B (en) A kind of query page generating device and method
US10846278B2 (en) Dynamic updates to a semantic database using fine-grain locking
CN107113341A (en) The system of the high-throughput processing of affairs in the Distributed Relation Database Management System divided for data
CN101876983B (en) Method for partitioning database and system thereof
CN103544153B (en) A kind of data-updating method based on data base and system
US6031995A (en) Object-oriented sequencing using hierarchical configuration streams
CN103559323B (en) Database implementation method
CN101673287A (en) SQL sentence generation method and system
CN104750720B (en) The realization that high-performance data is handled under multi-thread concurrent access environment
CN101571810B (en) Method for implementing program, method for verifying program result, devices and system
CN108388604A (en) User right data administrator, method and computer readable storage medium
CN102932415A (en) Method and device for storing mirror image document
CN104216955A (en) Methods and devices for operating data and managing events and distributed system
CN102375827B (en) Method for fast loading versioned electricity network model database
CN103530168B (en) Multi-satellite remote sensing data processing system and method based on virtualization technology
CN105095261A (en) Data insertion method and device
CN104021219B (en) The generation method and device of a kind of data template
CN103886109A (en) Method and device for realizing row lock of database
CN104871153A (en) System and method for flexible distributed massively parallel processing (mpp) database
CN111125229A (en) Data blood margin generation method and device and electronic equipment
CN101763415A (en) Method and device for generating B tree index of database
CN105912601A (en) Partition storage method for distributed real-time memory database of energy management system
CN103064881A (en) Annular data manager in dynamic internal memory allocation and annular data management method
CN101923571A (en) Method and device for managing terminal data logging
CN101578579A (en) Taxonomy object modeling

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