[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN105224532B - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN105224532B
CN105224532B CN201410232570.3A CN201410232570A CN105224532B CN 105224532 B CN105224532 B CN 105224532B CN 201410232570 A CN201410232570 A CN 201410232570A CN 105224532 B CN105224532 B CN 105224532B
Authority
CN
China
Prior art keywords
array
array member
mentioned
data
target object
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
CN201410232570.3A
Other languages
Chinese (zh)
Other versions
CN105224532A (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.)
Tencent Technology Shenzhen Co Ltd
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Tencent Technology Beijing 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 Tencent Technology Shenzhen Co Ltd, Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410232570.3A priority Critical patent/CN105224532B/en
Publication of CN105224532A publication Critical patent/CN105224532A/en
Application granted granted Critical
Publication of CN105224532B publication Critical patent/CN105224532B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention discloses a kind of data processing method and devices, wherein, this method comprises: receiving for requesting the first message operated to the first array, wherein, it include different types of pending data in first array, each type of pending data is stored in one in the first array several group memberships;Position of the array member for being stored with target object in the first array is searched in Mapping data structure according to the mark of the target object of operation, wherein, at least record has the mark of each type of pending data and is stored with corresponding relationship of the array member of pending data between the position in the first array in Mapping data structure;If finding position of the array member for being stored with target object in the first array in Mapping data structure, operation is executed to target object on the position in the first array.The present invention needs to be traversed for the low technical problem of data-handling efficiency caused by whole arrays during solving processing data.

Description

Data processing method and device
Technical field
The present invention relates to computer fields, in particular to a kind of data processing method and device.
Background technique
Currently, many aspects in life all realize electronization, and such as: e-commerce, community space are shared etc., because And the interaction for also having more and more people that the client in terminal is begun to use to realize information.However, a large amount of in face of backstage and Many and diverse data usually also generally include following at least one in the data processing method used in state of the art:
Scheme 1, the big array that n regular length is created according to type class (if value is from 0 to n-1), each array storage The data of the type, array then replace oldest data when full.However this mode but has the disadvantage in that
(1) mobile monolith memory is needed when the operations such as data are newly-increased, delete, is taken a long time;
(2) each array length is difficult to estimate, and when categorical data distribution is uneven, space utilization rate is low;
(3) all arrays are needed to be traversed for when searching some data.
Scheme 2 creates n chained list according to type class (if value is from 0 to n-1).Dynamic application memory, is inserted when newly-increased data Enter into chained list, is deleted when deleting data from chained list, releasing memory.However this mode equally exists following many defects:
(1) dynamic application space, is easy to appear the problems such as Installed System Memory exhausts.If limiting maximum application nodal point number, When oldest node is replaced, entire chained list is needed to be traversed for;
(2) frequently application, releasing memory, CPU need defrag of taking time, and aggravate CPU burden;
(3) all chained lists are needed to be traversed for when searching some data.
When carrying out data processing in the above manner, it is low all to there is space utilization rate, needs to be traversed for when searching data all The problems such as data-handling efficiency caused by data is low.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of data processing method and devices, at least to solve the process due to handling data In need to be traversed for the low technical problem of data-handling efficiency caused by whole arrays.
According to an aspect of an embodiment of the present invention, a kind of data processing method is provided, comprising: receive for request pair The first message that first array is operated, wherein include different types of pending data, every type in above-mentioned first array The above-mentioned pending data of type is stored in one in above-mentioned first array several group memberships;According to the target object of aforesaid operations Mark the above-mentioned array member for being stored with above-mentioned target object is searched in Mapping data structure in above-mentioned first array Position, wherein at least record has the mark of each type of above-mentioned pending data and is stored in above-mentioned Mapping data structure Corresponding relationship of the above-mentioned array member of above-mentioned pending data between the position in above-mentioned first array;If in mapping data Position of the above-mentioned array member for being stored with above-mentioned target object in above-mentioned first array is found in structure, then above-mentioned Aforesaid operations are executed to above-mentioned target object on above-mentioned position in one array.
Optionally, before the first message that above-mentioned reception is used to request to operate the first array, further includes: in foundation The first array is stated, in the several group memberships that each type of above-mentioned pending data is stored in above-mentioned first array, In, each it is stored with the above-mentioned array member of above-mentioned pending data further include: the type of above-mentioned pending data, for indicating The preceding node identification of position of the previous array member in above-mentioned first array, for indicating the latter array member above-mentioned The postjunction of position in first array identifies;Wherein, be stored with the above-mentioned array of same type of above-mentioned pending data at Member identifies to form link by above-mentioned preceding node identification and above-mentioned postjunction;Above-mentioned Mapping data structure is established, in above-mentioned mapping At least record has the mark of each type of above-mentioned pending data and is stored with the upper of above-mentioned pending data in data structure State corresponding relationship of the array member between the position in above-mentioned first array.
Optionally, the mark of the above-mentioned target object according to aforesaid operations searched in Mapping data structure be stored with it is above-mentioned Position of the above-mentioned array member of target object in above-mentioned first array includes: that record is searched in above-mentioned Mapping data structure Above-mentioned pending data identical with the mark of the above-mentioned target object list item of mark, wherein each above-mentioned pending data Mark be stored with the above-mentioned array member of above-mentioned pending data between the position in above-mentioned first array it is corresponding close It is in a list item being recorded in above-mentioned Mapping data structure;If finding the mark of the above-mentioned pending data of above-mentioned record List item identical with the mark of above-mentioned target object, then it represents that above-mentioned target object be include above-mentioned in above-mentioned first array Pending data, and obtain from the above-mentioned list item found and to be stored with the above-mentioned array member of above-mentioned target object above-mentioned the Position in one array;If the mark and the mark of above-mentioned target object of the above-mentioned pending data of above-mentioned record can not be found Identical list item, then it represents that above-mentioned target object is and include different new of above-mentioned pending data in above-mentioned first array Increase data, and indicates that the above-mentioned array member for being stored with above-mentioned target object can not be found in Mapping data structure upper State the position in the first array.
Optionally, the cryptographic Hash for being identified as above-mentioned pending data of above-mentioned pending data, the mark of above-mentioned target object Know the cryptographic Hash for above-mentioned target object, above-mentioned Mapping data structure is Hash table, wherein if above-mentioned record can not be found The mark list item identical with the mark of above-mentioned target object of above-mentioned pending data, the above method further include: will be above-mentioned newly-increased The cryptographic Hash of data obtains the result N of above-mentioned remainder to the columns remainder of above-mentioned Hash table;Judge each row in above-mentioned Hash table Whether the list item of N column is empty;It is if it exists empty above-mentioned list item, then selects one to record in the above-mentioned above-mentioned list item for sky The cryptographic Hash of above-mentioned newly-increased data and the array member of above-mentioned newly-increased data is stored between the position in above-mentioned first array Corresponding relationship;It is if it does not exist empty above-mentioned list item, then selects a table in the list item of each row Nth column in above-mentioned Hash table , the cryptographic Hash recorded in selected list item is replaced with to the cryptographic Hash of above-mentioned newly-increased data.
Optionally, aforesaid operations are inquiry operation, above-mentioned target object be include in above-mentioned first array it is above-mentioned to Handle data, wherein executing aforesaid operations to above-mentioned target object on the above-mentioned above-mentioned position in above-mentioned first array includes: Above-mentioned target object is obtained from the above-mentioned array member being located on above-mentioned position;Return to the above-mentioned target object got.
Optionally, aforesaid operations are newly-increased operation, and above-mentioned target object is and include above-mentioned in above-mentioned first array The different newly-increased data of pending data, wherein in the mark according to the target objects of aforesaid operations in Mapping data structure The above-mentioned array member for being stored with above-mentioned target object is searched after the position in above-mentioned first array, the above method also wraps It includes: if the above-mentioned above-mentioned array member for being stored with above-mentioned target object can not be found in above-mentioned Mapping data structure above-mentioned Position in first array then judges in above-mentioned first array with the presence or absence of empty array member;The array of above-mentioned sky if it exists Member then selects the array member of an above-mentioned sky, and above-mentioned newly-increased data and upper are stored in the array member of selected sky State the type of newly-increased data;The preceding node identification for including in the array member of above-mentioned selected sky is provided for indicating to deposit It contains in the above-mentioned array member of type above-mentioned pending data identical with the type of above-mentioned newly-increased data positioned at above-mentioned selected Position of the array member in above-mentioned first array before the empty array member selected, by the array of above-mentioned selected sky at Member in include postjunction mark be provided for indicate be stored with type it is identical with the type of above-mentioned newly-increased data it is above-mentioned to The array member being located at after the array member of above-mentioned selected sky in the above-mentioned array member of data is handled above-mentioned first Position in array;Postjunction mark in the above-mentioned array member before the array member of above-mentioned selected sky is repaired It is changed to position of the array member for indicating above-mentioned selected sky in above-mentioned first array, and is located at above-mentioned institute for above-mentioned The preceding node identification in array member after the empty array member of selection is revised as indicating above-mentioned selected sky Position of the array member in above-mentioned first array;Mark and the institute of above-mentioned newly-increased data are recorded in above-mentioned Mapping data structure Corresponding relationship of the empty array member of selection between the position in the first array.
Optionally, after in judging above-mentioned first array with the presence or absence of empty array member, the above method further include: if There is no the array members of above-mentioned sky, then the above-mentioned mark for being stored with mark with above-mentioned newly-increased data is searched in above-mentioned first array Know the above-mentioned array member of relevant above-mentioned pending data;By include in the above-mentioned above-mentioned array member found it is above-mentioned to Processing data replace with above-mentioned newly-increased data, the above-mentioned pending data that will include in the above-mentioned above-mentioned array member found Type replaces with the type of above-mentioned newly-increased data;Before the preceding node identification expression in the above-mentioned above-mentioned array member found Postjunction mark in one several group membership is revised as indicating the postjunction mark in the above-mentioned above-mentioned array member found Know position of the latter array member indicated in above-mentioned first array, and will be in the above-mentioned above-mentioned array member found The preceding node identification in the latter array member that above-mentioned postjunction mark indicates is revised as finding for indicating above-mentioned State position of the above-mentioned previous array member of the preceding node identification expression in array member in above-mentioned first array;It will be above-mentioned The preceding node identification for including in the above-mentioned array member found is revised as indicating to be stored with type and above-mentioned newly-increased data The identical above-mentioned pending data of type above-mentioned array member in be located at the above-mentioned above-mentioned array member found before The postjunction for including in the above-mentioned above-mentioned array member found mark is repaired in position of the array member in above-mentioned first array It is changed to the above-mentioned array member for indicating to be stored with type above-mentioned pending data identical with the type of above-mentioned newly-increased data In be located at position of the array member in above-mentioned first array after the above-mentioned above-mentioned array member found;It is located at above-mentioned Postjunction mark in array member before the above-mentioned array member found is revised as finding for indicating above-mentioned State position of the array member in above-mentioned first array, and by the above-mentioned array after the above-mentioned array member found at Preceding node identification in member is revised as the position for indicating the above-mentioned above-mentioned array member found in above-mentioned first array.
Optionally, type above-mentioned number to be processed identical with the type of above-mentioned newly-increased data is being stored with by following steps According to above-mentioned array member in search the array member being located at before the array member of above-mentioned selected sky and positioned at above-mentioned institute Array member after the empty array member of selection: the class for being stored with type Yu above-mentioned newly-increased data is searched from the second array Position of the first above-mentioned array member of the identical above-mentioned pending data of type in above-mentioned first array, wherein above-mentioned Two arrays, which at least record, has above-mentioned each type and above-mentioned first for being stored with each type of above-mentioned pending data above-mentioned Corresponding relationship of the array member between the position in above-mentioned first array;Successively judge since the position found above-mentioned new Increase data and the above-mentioned above-mentioned array member for being stored with type above-mentioned pending data identical with the type of above-mentioned newly-increased data In include in adjacent two number group memberships above-mentioned pending data whether meet predetermined insertion condition, until finding in satisfaction Above-mentioned two array member of predetermined insertion condition is stated, and the previous conduct in above-mentioned two array member is above-mentioned positioned at upper The array member before the array member of selected sky is stated, and using the latter in two number group memberships as above-mentioned positioned at upper State the array member after the array member of selected sky.
Optionally, aforesaid operations are delete operation, above-mentioned target object be include in above-mentioned first array it is above-mentioned to Handle data, wherein executing aforesaid operations to above-mentioned target object on the above-mentioned above-mentioned position in above-mentioned first array includes: The above-mentioned array member on above-mentioned position is deleted in above-mentioned first array, by the preceding node mark in the above-mentioned array member of deletion Know the rear knot that the postjunction mark in the previous array member indicated is revised as in the above-mentioned array member for indicating to delete The latter array member that point identification indicates, and the above-mentioned postjunction mark in the above-mentioned array member of deletion is indicated latter Preceding node identification in number group membership is revised as what the preceding node identification in the above-mentioned array member for indicating to delete indicated Above-mentioned previous array member;It is being deleted in above-mentioned Mapping data structure between the mark of above-mentioned target object and above-mentioned position Corresponding relationship.
According to another aspect of an embodiment of the present invention, a kind of data processing equipment is additionally provided, comprising: receiving unit is used In reception for requesting the first message operated to the first array, wherein include different types of in above-mentioned first array Pending data, each type of above-mentioned pending data are stored in one in above-mentioned first array several group memberships;First Searching unit searches in Mapping data structure for the mark according to the target objects of aforesaid operations and is stored with above-mentioned target pair Position of the above-mentioned array member of elephant in above-mentioned first array, wherein at least record has every kind in above-mentioned Mapping data structure The above-mentioned pending data of type mark be stored with the above-mentioned array member of above-mentioned pending data in above-mentioned first array In position between corresponding relationship;Processing unit is stored with above-mentioned target object for finding in Mapping data structure Position of the above-mentioned array member in above-mentioned first array when, to above-mentioned target on the above-mentioned position in above-mentioned first array Object executes aforesaid operations.
Optionally, above-mentioned apparatus further include: first establishing unit, for receiving for requesting to grasp the first array Before the first message of work, above-mentioned first array is established, each type of above-mentioned pending data is stored in above-mentioned first number In a several group memberships in group, wherein be each stored with the above-mentioned array member of above-mentioned pending data further include: it is above-mentioned to It handles the type of data, the preceding node identification for indicating position of the previous array member in above-mentioned first array, be used for Indicate the postjunction mark of position of the latter array member in above-mentioned first array;Wherein, it is stored on same type of The above-mentioned array member for stating pending data identifies to form link by above-mentioned preceding node identification and above-mentioned postjunction;Second establishes Unit, for establishing above-mentioned Mapping data structure, in above-mentioned Mapping data structure at least record have it is each type of it is above-mentioned to It handles the mark of data and is stored with the above-mentioned array member of above-mentioned pending data between the position in above-mentioned first array Corresponding relationship.
Optionally, above-mentioned first searching unit includes: the first searching module, for searching in above-mentioned Mapping data structure The mark list item identical with the mark of above-mentioned target object of the above-mentioned pending data of record, wherein each above-mentioned to be processed Data identify and are stored with pair of the above-mentioned array member of above-mentioned pending data between the position in above-mentioned first array Answer relation record in a list item in above-mentioned Mapping data structure;First judgment module, for finding above-mentioned record Above-mentioned pending data mark list item identical with the mark of above-mentioned target object when, judge above-mentioned target object for packet The above-mentioned pending data in above-mentioned first array is included, and is obtained from the above-mentioned list item found and is stored with above-mentioned target pair Position of the above-mentioned array member of elephant in above-mentioned first array;Second judgment module, for above-mentioned record can not to be found Above-mentioned pending data mark list item identical with the mark of above-mentioned target object when, judge above-mentioned target object be with Including the different newly-increased data of the above-mentioned pending data in above-mentioned first array, and can not be looked into Mapping data structure Find position of the above-mentioned array member for being stored with above-mentioned target object in above-mentioned first array.
Optionally, the cryptographic Hash for being identified as above-mentioned pending data of above-mentioned pending data, the mark of above-mentioned target object Know be above-mentioned target object cryptographic Hash, above-mentioned Mapping data structure is Hash table, wherein above-mentioned second judgment module includes: Computational submodule obtains the knot of above-mentioned remainder for the columns remainder by the cryptographic Hash of above-mentioned newly-increased data to above-mentioned Hash table Fruit N;Judging submodule, for judging whether the list item of each row Nth column in above-mentioned Hash table is empty;First choice submodule is used In the Kazakhstan for when existing for empty above-mentioned list item, selecting one to record above-mentioned newly-increased data in the above-mentioned above-mentioned list item for sky It wishes value and is stored with corresponding relationship of the array member of above-mentioned newly-increased data between the position in above-mentioned first array;Second choosing Submodule is selected, for being empty above-mentioned list item when being not present, then selects one in the list item of each row Nth column in above-mentioned Hash table When list item, the cryptographic Hash recorded in selected list item is replaced with to the cryptographic Hash of above-mentioned newly-increased data.
Optionally, aforesaid operations are inquiry operation, above-mentioned target object be include in above-mentioned first array it is above-mentioned to Handle data, wherein above-mentioned processing unit includes: acquisition module, for from the above-mentioned array member being located on above-mentioned position Obtain above-mentioned target object;Return module, for returning to the above-mentioned target object got.
Optionally, aforesaid operations are newly-increased operation, and above-mentioned target object is and include above-mentioned in above-mentioned first array The different newly-increased data of pending data, wherein above-mentioned apparatus further include: judging unit, in the mesh according to aforesaid operations The mark of mark object searches the above-mentioned array member for being stored with above-mentioned target object in above-mentioned first number in Mapping data structure After position in group, when the above-mentioned above-mentioned number for being stored with above-mentioned target object can not be found in above-mentioned Mapping data structure When position of the group membership in above-mentioned first array, judge in above-mentioned first array with the presence or absence of empty array member;Storage is single Member selects the array member of an above-mentioned sky for when there are the array member of above-mentioned sky, selected sky array at The type of above-mentioned newly-increased data and above-mentioned newly-increased data is stored in member;Setting unit, for by the array of above-mentioned selected sky The preceding node identification for including in member is provided for indicating to be stored with type and the type of above-mentioned newly-increased data is identical above-mentioned Array member in the above-mentioned array member of pending data before the array member of above-mentioned selected sky is above-mentioned the Position in one array is provided for the postjunction for including in the array member of above-mentioned selected sky mark to indicate storage Have in the above-mentioned array member of type above-mentioned pending data identical with the type of above-mentioned newly-increased data positioned at above-mentioned selected Empty array member after position of the array member in above-mentioned first array;By above-mentioned positioned at above-mentioned selected empty Postjunction mark in array member before array member is revised as indicating that the array member of above-mentioned selected sky exists Position in above-mentioned first array, and will be before in the above-mentioned array member after the array member of above-mentioned selected sky Node identification is revised as position of the array member in above-mentioned first array for indicating above-mentioned selected sky;Record Member, for recording the mark of above-mentioned newly-increased data and the array member of selected sky in above-mentioned Mapping data structure first The corresponding relationship between position in array.
Optionally, above-mentioned apparatus further include: the second searching unit, with the presence or absence of empty number in judging above-mentioned first array After group membership, when be not present above-mentioned sky array member when, searched in above-mentioned first array it is above-mentioned be stored with identify with it is upper State the above-mentioned array member of the relevant above-mentioned pending data of mark of newly-increased data;Replacement unit, for being found above-mentioned Above-mentioned array member in include above-mentioned pending data replace with above-mentioned newly-increased data, by the above-mentioned above-mentioned array found The type for the above-mentioned pending data for including in member replaces with the type of above-mentioned newly-increased data;First modification unit, being used for will The postjunction in previous array member that preceding node identification in the above-mentioned above-mentioned array member found indicates identifies modification For for indicating the latter array member that the mark of the postjunction in the above-mentioned above-mentioned array member found indicates above-mentioned the Position in one array, and the latter array that the above-mentioned postjunction mark in the above-mentioned above-mentioned array member found is indicated Preceding node identification in member is revised as indicating what the preceding node identification in the above-mentioned above-mentioned array member found indicated Position of the above-mentioned previous array member in above-mentioned first array;Second modification unit, for by it is above-mentioned find it is above-mentioned The preceding node identification for including in array member is revised as identical with the type of above-mentioned newly-increased data for indicating to be stored with type Array member in the above-mentioned array member of above-mentioned pending data before the above-mentioned above-mentioned array member found is upper The position in the first array is stated, the postjunction for including in the above-mentioned above-mentioned array member found mark is revised as being used to indicate It is stored in the above-mentioned array member of type above-mentioned pending data identical with the type of above-mentioned newly-increased data and is located at above-mentioned look into Position of the array member in above-mentioned first array after the above-mentioned array member found;Third modify unit, for by Postjunction mark of the rheme in the array member before the above-mentioned array member found is revised as indicating above-mentioned lookup To position of the above-mentioned array member in above-mentioned first array, and by above-mentioned after the above-mentioned array member found Preceding node identification in array member is revised as indicating the above-mentioned above-mentioned array member found in above-mentioned first array Position.
Optionally, above-mentioned apparatus further include: third searching unit, in the class for being stored with type Yu above-mentioned newly-increased data It is searched in the above-mentioned array member of the identical above-mentioned pending data of type before being located at the array member of above-mentioned selected sky Array member and the array member after the array member of above-mentioned selected sky;Above-mentioned third searching unit includes: Two searching modules, for searching from the second array, to be stored with type identical with the type of above-mentioned newly-increased data above-mentioned to be processed Position of the above-mentioned array member of first of data in above-mentioned first array, wherein on above-mentioned second array at least records and has Each type and above-mentioned first above-mentioned array member for being stored with each type of above-mentioned pending data are stated above-mentioned first The corresponding relationship between position in array;Third judgment module is above-mentioned new for successively judging since the position found Increase data and the above-mentioned above-mentioned array member for being stored with type above-mentioned pending data identical with the type of above-mentioned newly-increased data In include in adjacent two number group memberships above-mentioned pending data whether meet predetermined insertion condition, until finding in satisfaction Above-mentioned two array member of predetermined insertion condition is stated, and the previous conduct in above-mentioned two array member is above-mentioned positioned at upper The array member before the array member of selected sky is stated, and using the latter in two number group memberships as above-mentioned positioned at upper State the array member after the array member of selected sky.
Optionally, aforesaid operations are delete operation, above-mentioned target object be include in above-mentioned first array it is above-mentioned to Handle data, wherein above-mentioned processing unit includes: modified module, for deleting on above-mentioned position in above-mentioned first array Above-mentioned array member, the postjunction in previous array member that the preceding node identification in the above-mentioned array member of deletion is indicated The latter array member that the postjunction mark that mark is revised as in the above-mentioned array member for indicating to delete indicates, and will delete The preceding node identification in the latter array member that above-mentioned postjunction mark in the above-mentioned array member removed indicates is revised as using The above-mentioned previous array member that preceding node identification in the above-mentioned array member for indicating to delete indicates;Removing module is used for The corresponding relationship between the mark of above-mentioned target object and above-mentioned position is being deleted in above-mentioned Mapping data structure.
In embodiments of the present invention, different types of pending data is stored in an array, and using mapping number The mark of each type of pending data is recorded according to structure and is stored with position of the array member of pending data in array Corresponding relationship between setting, in this way, can quickly be found by corresponding relationship documented in Mapping data structure wait operate Position of the target object in array, need to be traversed for number caused by whole arrays during solving processing data Achieve the purpose that improve data-handling efficiency according to the low technical problem for the treatment of effeciency.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of optional data processing method according to an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of optional data processing according to an embodiment of the present invention;
Fig. 3 is the schematic diagram of another optional data processing according to an embodiment of the present invention;
Fig. 4 is the schematic diagram of another optional data processing according to an embodiment of the present invention;
Fig. 5 is the schematic diagram of another optional data processing according to an embodiment of the present invention;
Fig. 6 is the schematic diagram of another optional data processing according to an embodiment of the present invention;
Fig. 7 is the schematic diagram of another optional data processing according to an embodiment of the present invention;And
Fig. 8 is the structural schematic diagram of another optional data processing equipment according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of data processing method is provided, as shown in Figure 1, this method comprises:
S102 is received for requesting the first message operated to the first array, wherein includes difference in the first array The pending data of type, each type of pending data are stored in one in the first array several group memberships;
S104 searches the array for being stored with target object according to the mark of the target object of operation in Mapping data structure Position of the member in the first array, wherein the mark for having each type of pending data is at least recorded in Mapping data structure Know and be stored with corresponding relationship of the array member of pending data between the position in the first array;
S106, if finding position of the array member for being stored with target object in the first array in Mapping data structure It sets, then operation is executed to target object on the position in the first array.
Optionally, above-mentioned data processing method can be applied to server 204 to coming on self terminal 206 in the present embodiment Client 202 the process that is handled of data, as shown in Figure 2.Wherein, above-mentioned client 202 can include but is not limited to Application in terminal 206, for example, wechat, microblogging.Optionally, the data in client 202 above-mentioned in the present embodiment execute Processing can include but is not limited to following at least one: newly-increased, inquiry is deleted.For example, it is assumed that above-mentioned client 202 is with micro- For rich client, when server 204 receive to the 3rd message in the temperature ranking list in above-mentioned microblogging client into Row is deleted, then can execute deletion to the data in microblogging client using above-mentioned data processing method.The example above is one Kind example, the present embodiment do not do any restriction to this.
Optionally, above-mentioned Mapping data structure can be, but not limited to pass through above-mentioned Hash for Hash table in the present embodiment The mapping relations recorded in table search position of the array member for being stored with target object in the first array.
Optionally, in the present embodiment, it in step S102, receives for requesting first operated to the first array to disappear Before breath, further includes:
S1 establishes the first array, the several group memberships of one each type of pending data is stored in the first array In;
S2 establishes Mapping data structure, and at least record has each type of pending data in Mapping data structure Identify and be stored with corresponding relationship of the array member of pending data between the position in the first array.
It optionally, in the present embodiment, include different types of pending data in above-mentioned first array, it is each type of Pending data is stored in one in the first array several group memberships, wherein be each stored with the array of pending data at Member further include: the type of pending data, the preceding node mark for indicating position of the previous array member in the first array Know, the postjunction for indicating position of the latter array member in the first array identifies.
Specifically illustrate in conjunction with attached drawing, as shown in figure 3, the first array is indicated with DArray, in the first array DArray It is described for the first array member D_1 of the 3rd position.It wherein, include: the class of pending data in array member Type Type is 2, and it is 0 that the preceding node identification of position of the previous array member in the first array DArray, which is PreElem, latter It is 10 that the postjunction of position of the number group membership in the first array DArray, which is identified as NextElem,.
Optionally, in the present embodiment, the array member for being stored with same type of pending data passes through preceding node mark Know and postjunction identifies to form link, wherein above-mentioned link can be, but not limited to as chained list link.For example, in conjunction with Fig. 3-Fig. 4 institute Show, same type is belonged in the first array DArray, and the array member for the pending data that type Type is 2 includes: the first number Group membership D_1, the second array member D_2, third array member D_3.For the previous array member of the second array member D_2 It is 3 that the preceding node identification of position in the first array DArray, which is PreElem, and the latter array member is in the first array It is 25 that the postjunction of position in DArray, which is identified as NextElem, then the above-mentioned array for belonging to same type of pending data Member can identify NextElem by preceding node identification PreElem and postjunction and form chained list link as shown in Figure 4.
Optionally, in the present embodiment, at least record has each type of pending data in above-mentioned Mapping data structure Mark (Key) be stored with the array member of pending data between the position (Index) in the first array it is corresponding pass System.Optionally, in the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, the mark of above-mentioned pending data It can be, but not limited to the cryptographic Hash for pending data.For example, as shown in figure 3, to be located at the 3rd position in the first array DArray It is described for the first array member D_1 set, above-mentioned first array member D_1 corresponding packet in Hash table DHash It includes: for identifying mark key, the value k3 of the data Data in the first array member D_1, and for searching the first array The index Index of position of the member D_1 in the first array DArray, value 3.
Optionally, in the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, above-mentioned Hash table DHash The size in occupied space is less than the occupied space size of pending data in the first array DArray.
For example, above-mentioned Hash table DHash can be as shown in table 1." sky " in table 1 indicates that the position is unoccupied, " ... " Indicate that the position is occupied, the mark of specific pending data is counted with the array member for being stored with pending data first Position in group does not indicate in detail herein.
Table 1
Optionally, further include in the present embodiment but be not limited to the second array TArray.Wherein, the second array at least records There is each type and is stored with first several group membership of each type of pending data between the position in the first array Corresponding relationship.It is alternatively possible to which the sequence according to type will successively be stored with first of each type of pending data Array member is in the array member that the position in the first array is recorded in the second array TArray.
For example, as shown in figure 3, record storage has type Type in first several group membership in the second array TArray For 0 pending data position of first several group membership D_1 in the first array DArray (for example, HeadIndex= 11, it is the first array DArray that expression, which is stored with the position of first several group membership D_1 of the pending data that type Type is 0, In the 11st), in second several group membership in the second array TArray record storage have type Type be 1 it is to be processed Position of the several group membership D_1 of first of data in the first array DArray is (for example, HeadIndex=4, indicates to be stored with The position of the several group membership D_1 of first of the pending data that type Type is 1 is the 4th in the first array DArray), In It is first number of 2 pending data that record storage, which has type Type, in third number group membership in second array TArray Group membership D_1 in the first array DArray position (for example, HeadIndex=3, indicate to be stored with type Type be 2 to The position of first several group membership D_1 of data is handled as the 3rd in the first array DArray).
Optionally, in the present embodiment, server 204 receive the transmission of the client 202 in terminal 206 for requesting The first message that pending data in first array DArray is operated, wherein above-mentioned first message includes but unlimited In: the operation that request is inquired pending data, increases newly, deleted.
Optionally, in the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, according to Hash table DHash In stored each type of pending data mark be stored with the array member of pending data in the first array The corresponding relationship between position in DArray searches position of the target object of aforesaid operations in the first array DArray, If finding position of the array member of above-mentioned target object in the first array DArray in Hash table DHash, Corresponding operation is executed to above-mentioned target object on corresponding position in one array DArray.
It is described below in conjunction with concrete scene, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, above-mentioned client 202 by taking microblogging client as an example, above-mentioned microblogging client creates a memory pool in memory at end, and the is established in the memory pool One array DArray, all types of data are stored in the first array DArray in the memory, for example, above-mentioned first number Type in group DArray can include but is not limited to: the liveness in temperature, microblogging, the emphasis in microblogging in microblogging push away It recommends.Assuming that above-mentioned first array DArary total amount of data is m.Server 204 receive that above-mentioned microblogging client sends to microblogging In temperature ranking list in ranking the 3rd message deleted, then server 204 will disappear according to above-mentioned ranking the 3rd The mark (for example, this is identified as k3) of breath searches target object corresponding to above-mentioned message in the first number in Hash table DHash Position in group DArray.Assuming that finding target corresponding to the above-mentioned ranking in microblogging temperature ranking list the 3rd message The position of object is 3, then deletes the target object in the first array DArray on corresponding position, that is, rank microblogging temperature Ranking the 3rd message is deleted in list, and to the front and back array member of array member in the connection of chained list corresponding to the type Node identification modified accordingly so that other message in microblogging client temperature ranking list can also be according to certain Sequence is shown.
The embodiment provided through the invention, by establishing the first array and opposite with the array member in the first array The Mapping data structure answered is stored with mesh in Mapping data structure lookup using the mark of the target object of requested operation The array member for marking object position in the first array, to realize quickly and accurately obtaining to the array member in the first array It takes, and then improves the treatment effeciency to the data in the first array.
As a kind of optionally scheme, step S104, according to the mark of the target object of operation in Mapping data structure Searching position of the array member for being stored with target object in the first array includes:
S1, the mark that the pending data of record is searched in Mapping data structure table identical with the mark of target object , wherein each pending data mark be stored with position of the array member of pending data in the first array it Between corresponding relationship be recorded in a list item in Mapping data structure, the Kazakhstan for being identified as pending data of pending data Uncommon value;
S2, if the mark for finding the pending data of record list item identical with the mark of target object, then it represents that mesh Marking object to be includes the pending data in the first array, and the number for being stored with target object is obtained from the list item found Position of the group membership in the first array;
S3, if the mark that the pending data of record can not be found list item identical with the mark of target object, table Show that target object is the newly-increased data different from including pending data in the first array, and indicates in mapping data knot Position of the array member for being stored with target object in the first array can not be found in structure.
Optionally, in the present embodiment, the mark of above-mentioned pending data can be, but not limited to the Kazakhstan for pending data Uncommon value, the mark of above-mentioned target object can be, but not limited to the cryptographic Hash for target object, above-mentioned Mapping data structure can with but It is not limited to Hash table.The present embodiment does not do any restriction to this.
Optionally, it is searched whether in the cryptographic Hash that Hash table DHash has been recorded identical as the cryptographic Hash of target object List item.If cryptographic Hash list item identical with target object can be found in above-mentioned Hash table DHash, then it represents that above-mentioned Target object has had record in the array member of the pending data of the first array DArray, then can be directly by Hash table Position of the target object that DHash is obtained in the first array DArray;If can not be found in above-mentioned Hash table DHash Cryptographic Hash list item identical with target object, then it represents that above-mentioned target object is and has been recorded in the first array DArray wait locate The different newly-increased data of data are managed, further, also can not just find and be stored with the array member of the target object and exist Position in first array DArray.
Specifically combine following example explanation, it is assumed that server 204 receive client 202 transmission be used for the first array The request that the second array member D_2 that type Type in DArray is 2 is deleted, wherein the Hash of above-mentioned target object Value be k1, then searched whether in Hash table DHash have with above-mentioned target object, i.e. type Type be 2 the second array at The identical list item of cryptographic Hash of member D_2, it is assumed that find in Hash table DHash with identical as the cryptographic Hash of above-mentioned target object List item, then can be directly from obtaining position of the corresponding array member of above-mentioned target object in the first array, example in list item Such as, the value of the index Index of above-mentioned target object position is 10, that is, above-mentioned target object is located at the first array DArray's 10th position.Assuming that server 204 receive the transmission of client 202 for the type Type in the first array DArray Cryptographic Hash and above-mentioned mesh are not found after Hash table DHash lookup for 2 request modified of the 4th array member D_4 Mark object the identical list item of cryptographic Hash, then it represents that above-mentioned target object be with the pending data in the first array DArray not Same data.
The embodiment provided through the invention, by being searched whether in Mapping data structure with the mark with target object Know identical list item, and then judge whether above-mentioned target object is array member in the first array, if judging is first Array member in array can then reach from position of the above-mentioned target object in the first array is obtained in Mapping data structure To the position of the array member quickly and accurately obtained in the first array, the treatment effeciency to data is improved, is user Save the operating time.
As a kind of optional scheme, the cryptographic Hash for being identified as pending data of above-mentioned pending data, above-mentioned target The cryptographic Hash for being identified as target object of object, above-mentioned Mapping data structure are Hash table, wherein if record can not be found The mark of pending data and the identical list item of the mark of target object, the above method further include:
S1 obtains the result N of remainder by the cryptographic Hash of newly-increased data to the columns remainder of Hash table;
S2 judges whether the list item of each row Nth column in Hash table is empty;
S3 is empty list item if it exists, then in for empty list item selection one come record newly-increased data cryptographic Hash and It is stored with corresponding relationship of the array member of newly-increased data between the position in the first array;
S4 is if it does not exist empty list item, then a list item is selected in the list item of each row Nth column in Hash table, by institute The cryptographic Hash recorded in the list item of selection replaces with the cryptographic Hash of newly-increased data.
It is specifically described in conjunction with following example, in conjunction with shown in table 1, it is assumed that the cryptographic Hash of newly-increased data is K, will be above-mentioned newly-increased The cryptographic Hash K of data obtains remainder N to the columns remainder of Hash table DHash, for example, above-mentioned remainder is 3, then above-mentioned Hash Whether the list item that each row the 3rd arranges in table DHash is sky, obtains there is empty list item in the 3rd column of the 3rd row after lookup, then can select Above-mentioned empty list item is selected to store position of the array member of newly-increased data in the first array DArray.
In another example in conjunction with shown in table 1, it is assumed that the cryptographic Hash of newly-increased data is K (for example, K=6), by above-mentioned newly-increased data Cryptographic Hash K to columns (for example, columns=10) remainder of Hash table DHash, obtain remainder N (for example, above-mentioned remainder is 6). Then, judge whether the list item that each row the 6th arranges in above-mentioned Hash table DHash is sky, as shown in Table 1 it is found that in Hash table DHash List item in 6th column of every row has occupied, then can select a list item (example in the 6th column of each row in Hash table DHash Such as, selection is stored in the list item of the 6th column of the 1st row in Hash table earliest), the cryptographic Hash recorded in selected list item is replaced For the cryptographic Hash for increasing data newly.
Optionally, in the present embodiment, to being replaced in the list item in Mapping data structure (for example, Hash table DHash) It can be, but not limited to first replace record time longest list item when changing.Wherein, in the present embodiment Mapping data structure (for example, Hash table DHash) in the array member that is identified of the list item of array member and newly-increased data that is identified of the list item that is replaced can With but be not limited to relevant array member.
The embodiment provided through the invention, when can not be found in Mapping data structure (for example, Hash table DHash) The mark (for example, cryptographic Hash of pending data) of pending data and the mark of target object are (for example, the Hash of target object Value) identical list item when, then in Mapping data structure according to scheduled condition select a suitable list item it is newly-increased to record The cryptographic Hash of data and it is stored with corresponding relationship of the array member of above-mentioned newly-increased data between the position in the first array, led to The mode for being updated the relevant information of newly-increased data in Mapping data structure is crossed, the number in Hash table and the first array is made Group membership can keep corresponding relationship in real time, and then guarantee accurately obtain in real time in the first array by Mapping data structure Array member position.
As a kind of optional scheme, aforesaid operations are inquiry operation, and above-mentioned target object is to be included in the first array Pending data, wherein on the position in the first array to target object execute operation include:
S1 obtains target object from the array member being located on position;
S2 returns to the target object got.
Specifically combine following example explanation, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, above-mentioned number to be processed According to the cryptographic Hash for being identified as pending data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 Receive the transmission of client 202 is used for the second array member D_2 progress for being 2 to the type Type in the first array DArray The request of inquiry, wherein the cryptographic Hash of above-mentioned target object be k1, then searched whether in Hash table DHash have with it is above-mentioned The identical list item of cryptographic Hash for the second array member D_2 that target object, i.e. type Type are 2, it is assumed that can find above-mentioned List item then obtains position of the above-mentioned target object in the first array DArray, example by the list item in above-mentioned Hash table DHash Such as, the value of the index Index of position of the above-mentioned target object in the first array DArray is 10, then from above-mentioned position Array member obtains Data corresponding to target object, and Data corresponding to the above-mentioned target object got is returned.
It is described below in conjunction with concrete scene, it is assumed that client 202 is microblogging client, and server 204 receives above-mentioned micro- The request for ranking the 3rd message for inquiring in the temperature ranking list in microblogging that client is sent is won, then server 204 Exist above-mentioned message is searched in Hash table DHash according to the mark (for example, this is identified as k3) of above-mentioned ranking the 3rd message Then position in first array DArray obtains above-mentioned message from the array member being located on above-mentioned position, and returns and obtain The above-mentioned message got.
The embodiment provided through the invention, by searching above-mentioned target object in the first array using Mapping data structure In position, obtained above-mentioned target object will be searched further according to above-mentioned position and returned, and then realize and quickly search the first array In array member in data, improve the efficiency of data query.
It as a kind of optional scheme, operates as newly-increased operation, target object is and include in the first array wait locate Manage the different newly-increased data of data, wherein storage is searched in Mapping data structure in the mark of the target object according to operation There is the array member of target object after the position in the first array, method further include:
S1, if the array member for being stored with target object can not be found in Mapping data structure in the first array Position then judges in the first array with the presence or absence of empty array member;
S2, empty array member, then select an empty array member, in the array member of selected sky if it exists Store the type of newly-increased data and newly-increased data;
S3, by the preceding node identification for including in the array member of selected sky be provided for indicate be stored with type with The array being located at before the array member of selected sky in the array member of the identical pending data of type of newly-increased data The postjunction for including in the array member of selected sky mark is provided for indicating by position of the member in the first array Be stored in the array member of type pending data identical with the type of newly-increased data positioned at selected sky array at Position of the array member in the first array after member;It will be in the array member before the array member that selected sky is located at Postjunction mark be revised as position of the array member in the first array for indicating selected sky, and selected by being located at The preceding node identification in array member after the empty array member selected be revised as indicate the array of selected sky at Position of the member in the first array;
S4 records the mark of newly-increased data and the array member of selected sky in the first array in Mapping data structure In position between corresponding relationship.
Specifically combine following example explanation, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, above-mentioned number to be processed According to the cryptographic Hash for being identified as pending data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 Receive the transmission of client 202 is used for the 4th array member D_4 progress for being 2 to the type Type in the first array DArray The request of processing, wherein the cryptographic Hash of above-mentioned target object is k4.If can not be found in Hash table DHash and be stored with mesh Position of the 4th array member D_4 of object in the first array DArray is marked, then may determine that aforesaid operations are newly-increased number According to operation, thus further judgement, with the presence or absence of empty array member in the first array DArray.Assuming that there is empty array Member then selects an empty array member for storing above-mentioned newly-increased data and above-mentioned newly-increased from the array member of above-mentioned sky The type of data, wherein position of the above-mentioned sky array member in the first array DArray is 8.Meanwhile as shown in figure 5, to institute Front and back node identification in the empty array member of selection is configured, it is assumed that increase above-mentioned 4th array member D_4 to first newly Between array member D_1 and the second array member D_2, then by the preceding node identification PreElem's of above-mentioned 4th array member D_4 Value is set as 3, and the value of postjunction mark NextElem is set as 10, and to the first number before the 4th array member D_4 The value (for example, the value be 10) of the postjunction mark NextElem of group membership D_1 be revised as indicate the 4th array at The value 8 of member D_4 position, to the preceding node identification PreElem's of the second array member D_2 after the 4th array member D_4 Value (for example, the value is 3) is revised as the value 8 for indicating the 4th position array member D_4, and in Hash table DHash The middle mark for recording newly-increased data is corresponding between the position in the first array DArray with the array member of selected sky Relationship.
The embodiment provided through the invention, by stored in the empty array member in the first array newly-increased data and The type of newly-increased data, while modifying the linking relationship between above-mentioned array member, thus ensure that can real-time, quickly from Corresponding array member is obtained in first array, improves the efficiency of data processing.
As a kind of optional scheme, after whether there is empty array member in judging the first array, method is also wrapped It includes:
S1, empty array member, then search the mark for being stored with mark with newly-increased data in the first array if it does not exist The array member of relevant pending data;
The pending data for including in the array member found is replaced with newly-increased data, the array that will be found by S2 The type for the pending data for including in member replaces with the type of newly-increased data;
S3, the postjunction in previous array member that the preceding node identification in the array member found is indicated identify The latter array member that the postjunction mark being revised as in the array member for indicating to find indicates is in the first array Position, and by the array member found postjunction mark indicate the latter array member in preceding node identification repair The previous array member that the preceding node identification being changed in the array member for indicating to find indicates is in the first array Position;
The preceding node identification for including in the array member found is revised as being used to indicate to be stored with type and increasing newly by S4 It is located at array member before the array member that finds in the array member of the identical pending data of the type of data the Position in one array, by the postjunction for including in the array member found mark be revised as being used for indicating being stored with type with The array member being located at after the array member found in the array member of the identical pending data of type of newly-increased data Position in the first array;
Postjunction mark in array member before the array member found is revised as being used to indicate to look by S5 Position of the array member found in the first array, and before being located in the array member after the array member that finds Node identification is revised as position of the array member in the first array for indicating to find.
Optionally, in this city embodiment, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, and above-mentioned first When the array member of above-mentioned sky being not present in array, then the dependency number group membership for needing to select to meet predetermined condition carries out data Replacement, wherein as array member no longer free in above-mentioned first array DArray, then corresponding Hash table DHash is also State is taken, thus when needing newly-increased data, then it needs also to be updated replacement to the data in Hash table DHash.Wherein, Array member in the above-mentioned first array DArray scheduled condition to be met in replacement can include but is not limited to: newly Increasing data and being replaced data is related data members co-located in Hash table DHash.
Specifically illustrate in conjunction with following example, it is assumed that when above-mentioned Mapping data structure be Hash table DHash, it is above-mentioned to be processed The cryptographic Hash for being identified as pending data of data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 receive client 202 transmission for the type Type in the first array DArray be 2 the 4th array member D_4 The request handled, wherein the cryptographic Hash of above-mentioned target object is k4.If storage can not be found in Hash table DHash There is position of the 4th array member D_4 of target object in the first array DArray, then may determine that aforesaid operations are new Increase data manipulation, thus further judgement, with the presence or absence of empty array member in the first array DArray.Assuming that there is no skies Array member, then need the original old array member that will have been recorded to be replaced with new array member.As shown in fig. 6, The 4th newly-increased array member D_4 replaces original second array member D_2, while by the preceding knot of the 4th array member D_4 The value of point identification PreElem is set as 3, and the value of postjunction mark NextElem is set as 25, and to the 4th array member The value (for example, the value is 10) of the postjunction mark NextElem of the first array member D_1 before D_4 is revised as being used for The value 8 for indicating the 4th position array member D_4, to the preceding node of the third array member D_3 after the 4th array member D_4 The value (for example, the value is 3) of mark PreElem is revised as the value 8 for indicating the 4th position array member D_4.
It is described below in conjunction with concrete scene, it is assumed that client 202 is microblogging client, and server 204 receives above-mentioned micro- The request for being used to increase newly ranking the 3rd message in the temperature ranking list in microblogging that client is sent is won, then server 204 Exist above-mentioned message is searched in Hash table DHash according to the mark (for example, this is identified as k3) of above-mentioned ranking the 3rd message The 3rd newly-increased message is replaced in temperature ranking list existing 3rd and disappeared by the position in the first array DArray Breath, and modify to the linking relationship between in above-mentioned temperature ranking list ranking the 2nd and the 4th in array member.
The embodiment provided through the invention is realized by the replacement to the array member recorded in the first array The type of newly-increased data and newly-increased data is stored, while modifying the linking relationship between above-mentioned array member, to ensure that Corresponding array member can be obtained from the first array real-time, quickly, improves the efficiency of data processing.
As a kind of optional scheme, by following steps to be stored with type identical with the type of newly-increased data wait locate It manages and searches the array member being located at before the array member of selected sky in the array member of data and positioned at selected sky Array member after array member:
S1 searches first for being stored with type pending data identical with the type of newly-increased data from the second array Position of the array member in the first array;
S2 successively judges newly-increased data since the position found and to be stored with type identical as the type of newly-increased data Pending data array member in include in adjacent two number group memberships pending data whether meet predetermined insertion Condition meets two number group memberships of predetermined insertion condition until finding, and will be previous as position in two number group memberships Array member before the array member of selected sky, and the latter in two number group memberships is selected as being located at Empty array member after array member.
Optionally, in the present embodiment, the second array TArray, which is at least recorded, has each type and is stored with each type Pending data first several corresponding relationships of the group membership between the position in the first array.Optionally, in this implementation In example, when the type of newly-increased data is existing type in the first array DArray, then the second array TArray can use Start adjacent in the array member for the pending data for successively judging newly-increased data and same type two according to the type of data Whether array member meets predetermined insertion condition.
Specifically illustrate in conjunction with following example, record has the first of different types of array member in the second array TArray Number group membership is in the position of the first array DArray, for example, as shown in figure 3, for the type Type pending data for being 2 Position of first several group membership D_1 in the first array DArray is 3, then the HeadIndex in the second array TArray Value is 3.
Further, as shown in connection with fig. 5, the type of data (for example, above-mentioned newly-increased data are the 4th array member D_4) is increased newly For existing type in the first array DArray, then it can use the second array TArray for newly-increased data and be inserted into homogeneous data chain The corresponding position of table, while the mark of the front and back node of above-mentioned newly-increased array member is modified accordingly.
As a kind of optional scheme, operate as delete operation, target object be include to be processed in the first array Data, wherein executing operation to target object on the position in the first array includes:
S1, the array member in the first array on delete position, by the preceding node designation list in the array member of deletion Postjunction mark in the previous array member shown is revised as the postjunction mark table in the array member for indicating to delete The latter array member shown, and by the array member of deletion postjunction mark indicate the latter array member in front of Node identification is revised as the previous array member that the preceding node identification in the array member for indicating to delete indicates;
S2, the corresponding relationship between the mark and position of delete target object in Mapping data structure.
Specifically illustrate in conjunction with following example, it is assumed that when above-mentioned Mapping data structure be Hash table DHash, it is above-mentioned to be processed The cryptographic Hash for being identified as pending data of data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 receive client 202 transmission for the type Type in the first array DArray be 2 the second array member D_2 The request deleted, wherein the cryptographic Hash of above-mentioned target object be k1, then searched whether in Hash table DHash have with The identical list item of cryptographic Hash for the second array member D_2 that above-mentioned target object, i.e. type Type are 2, it is assumed that can find Above-mentioned list item then obtains position of the above-mentioned target object in the first array DArray by the list item in above-mentioned Hash table DHash It sets, for example, the value of the index Index of position of the above-mentioned target object in the first array DArray is 10, then by upper rheme Data corresponding to the target object of the array member set is deleted, meanwhile, as shown in fig. 7, by before the second array member D_2 The value (for example, the value be 10) of postjunction mark NextElem of the first array member D_1 be revised as indicating the The value 25 of three positions array member D_3, by the preceding node of the third array member D_3 after the second array member D_2 The value (for example, the value is 10) of mark PreElem is revised as the value 3 for indicating the first position array member D_1, and Corresponding relationship between the mark and position for deleting above-mentioned target object in DHash.
It is described below in conjunction with concrete scene, it is assumed that client 202 is microblogging client, and server 204 receives above-mentioned micro- The request for being used to delete ranking the 3rd message in the temperature ranking list in microblogging that client is sent is won, then server 204 Exist above-mentioned message is searched in Hash table DHash according to the mark (for example, this is identified as k3) of above-mentioned ranking the 3rd message Then position in first array DArray will delete the above-mentioned message being located in above-mentioned position, and modify above-mentioned temperature seniority among brothers and sisters Linking relationship in list between ranking the 2nd and the 4th in array member.
The embodiment provided through the invention, by searching above-mentioned target object in the first array using Mapping data structure In position, then by the array member deletion in above-mentioned position, and then realize the array member quickly searched in the first array, and It is deleted according to request, improves the efficiency of data deletion.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing The part that technology contributes can be embodied in the form of software products, which is stored in a storage In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
According to embodiments of the present invention, additionally provide it is a kind of for implementing the data processing equipment of above-mentioned data processing method, As shown in figure 8, the device includes:
1) receiving unit 802, for receiving the first message for being used for requesting to operate the first array, wherein first It include different types of pending data in array, each type of pending data is stored in an array in the first array In member;
2) the first searching unit 804 is searched in Mapping data structure for the mark according to the target object of operation and is deposited Contain position of the array member of target object in the first array, wherein at least record has every type in Mapping data structure The mark of the pending data of type is corresponding between the position in the first array with the array member for being stored with pending data Relationship;
3) processing unit 806, for finding the array member for being stored with target object in Mapping data structure When position in one array, operation is executed to target object on the position in the first array.
Optionally, above-mentioned data processing method can be applied to server 204 to coming on self terminal 206 in the present embodiment Client 202 the process that is handled of data, as shown in Figure 2.Wherein, above-mentioned client 202 can include but is not limited to Application in terminal 206, for example, wechat, microblogging.Optionally, the data in client 202 above-mentioned in the present embodiment execute Processing can include but is not limited to following at least one: newly-increased, inquiry is deleted.For example, it is assumed that above-mentioned client 202 is with micro- For rich client, when server 204 receive to the 3rd message in the temperature ranking list in above-mentioned microblogging client into Row is deleted, then can execute deletion to the data in microblogging client using above-mentioned data processing method.The example above is one Kind example, the present embodiment do not do any restriction to this.
Optionally, above-mentioned Mapping data structure can be, but not limited to pass through above-mentioned Hash for Hash table in the present embodiment The mapping relations recorded in table search position of the array member for being stored with target object in the first array.
Optionally, in the present embodiment, it in step S102, receives for requesting first operated to the first array to disappear Before breath, further includes:
S1 establishes the first array, the several group memberships of one each type of pending data is stored in the first array In;
S2 establishes Mapping data structure, and at least record has each type of pending data in Mapping data structure Identify and be stored with corresponding relationship of the array member of pending data between the position in the first array.
It optionally, in the present embodiment, include different types of pending data in above-mentioned first array, it is each type of Pending data is stored in one in the first array several group memberships, wherein be each stored with the array of pending data at Member further include: the type of pending data, the preceding node mark for indicating position of the previous array member in the first array Know, the postjunction for indicating position of the latter array member in the first array identifies.
Specifically illustrate in conjunction with attached drawing, as shown in figure 3, the first array is indicated with DArray, in the first array DArray It is described for the first array member D_1 of the 3rd position.It wherein, include: the class of pending data in array member Type Type is 2, and it is 0 that the preceding node identification of position of the previous array member in the first array DArray, which is PreElem, latter It is 10 that the postjunction of position of the number group membership in the first array DArray, which is identified as NextElem,.
Optionally, in the present embodiment, the array member for being stored with same type of pending data passes through preceding node mark Know and postjunction identifies to form link, wherein above-mentioned link can be, but not limited to as chained list link.For example, in conjunction with Fig. 3-Fig. 4 institute Show, same type is belonged in the first array DArray, and the array member for the pending data that type Type is 2 includes: the first number Group membership D_1, the second array member D_2, third array member D_3.For the previous array member of the second array member D_2 It is 3 that the preceding node identification of position in the first array DArray, which is PreElem, and the latter array member is in the first array It is 25 that the postjunction of position in DArray, which is identified as NextElem, then the above-mentioned array for belonging to same type of pending data Member can identify NextElem by preceding node identification PreElem and postjunction and form chained list link as shown in Figure 4.
Optionally, in the present embodiment, at least record has each type of pending data in above-mentioned Mapping data structure Mark and be stored with corresponding relationship of the array member of pending data between the position in the first array.Optionally, In In the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, the mark of above-mentioned pending data be can be, but not limited to For the cryptographic Hash of pending data.For example, as shown in figure 3, to be located at the first array of the 3rd position in the first array DArray It is described for member D_1, above-mentioned first array member D_1 corresponding information in Hash table DHash includes: for identifying the Mark key, the value k3 of data Data in one array member D_1, and for searching the first array member D_1 first The index Index of position in array DArray, value 3.
Optionally, in the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, above-mentioned Hash table DHash The size in occupied space is less than the occupied space size of pending data in the first array DArray.
For example, above-mentioned Hash table DHash can be as shown in table 2." sky " in table 2 indicates that the position is unoccupied, " ... " Indicate that the position is occupied, the mark of specific pending data is counted with the array member for being stored with pending data first Position in group does not indicate in detail herein.
Table 2
Optionally, further include in the present embodiment but be not limited to the second array TArray.Wherein, the second array at least records There is each type and is stored with first several group membership of each type of pending data between the position in the first array Corresponding relationship.It is alternatively possible to which the sequence according to type will successively be stored with first of each type of pending data Array member is in the array member that the position in the first array is recorded in the second array TArray.
For example, as shown in figure 3, record storage has type Type in first several group membership in the second array TArray For 0 pending data position of first several group membership D_1 in the first array DArray (for example, HeadIndex= 11, it is the first array DArray that expression, which is stored with the position of first several group membership D_1 of the pending data that type Type is 0, In the 11st), in second several group membership in the second array TArray record storage have type Type be 1 it is to be processed Position of the several group membership D_1 of first of data in the first array DArray is (for example, HeadIndex=4, indicates to be stored with The position of the several group membership D_1 of first of the pending data that type Type is 1 is the 4th in the first array DArray), In It is first number of 2 pending data that record storage, which has type Type, in third number group membership in second array TArray Group membership D_1 in the first array DArray position (for example, HeadIndex=3, indicate to be stored with type Type be 2 to The position of first several group membership D_1 of data is handled as the 3rd in the first array DArray).
Optionally, in the present embodiment, server 204 receive the transmission of the client 202 in terminal 206 for requesting The first message that pending data in first array DArray is operated, wherein above-mentioned first message includes but unlimited In: the operation that request is inquired pending data, increases newly, deleted.
Optionally, in the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, according to Hash table DHash In stored each type of pending data mark be stored with the array member of pending data in the first array The corresponding relationship between position in DArray searches position of the target object of aforesaid operations in the first array DArray, If finding position of the array member of above-mentioned target object in the first array DArray in Hash table DHash, Corresponding operation is executed to above-mentioned target object on corresponding position in one array DArray.
It is described below in conjunction with concrete scene, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, above-mentioned client 202 by taking microblogging client as an example, above-mentioned microblogging client creates a memory pool in memory at end, and the is established in the memory pool One array DArray, all types of data are stored in the first array DArray in the memory, for example, above-mentioned first number Type in group DArray can include but is not limited to: the liveness in temperature, microblogging, the emphasis in microblogging in microblogging push away It recommends.Assuming that above-mentioned first array DArary total amount of data is m.Server 204 receive that above-mentioned microblogging client sends to microblogging In temperature ranking list in ranking the 3rd message deleted, then server 204 will disappear according to above-mentioned ranking the 3rd The mark (for example, this is identified as k3) of breath searches target object corresponding to above-mentioned message in the first number in Hash table DHash Position in group DArray.Assuming that finding target corresponding to the above-mentioned ranking in microblogging temperature ranking list the 3rd message The position of object is 3, then deletes the target object in the first array DArray on corresponding position, that is, rank microblogging temperature Ranking the 3rd message is deleted in list, and to the front and back array member of array member in the connection of chained list corresponding to the type Node identification modified accordingly so that other message in microblogging client temperature ranking list can also be according to certain Sequence is shown.
The embodiment provided through the invention, by establishing the first array and opposite with the array member in the first array The Mapping data structure answered is stored with mesh in Mapping data structure lookup using the mark of the target object of requested operation The array member for marking object position in the first array, to realize quickly and accurately obtaining to the array member in the first array It takes, and then improves the treatment effeciency to the data in the first array.
As a kind of optional scheme, above-mentioned apparatus in the present embodiment further include:
1) first establishing unit, for receiving for building before requesting the first message operated to the first array Vertical first array, in the several group memberships that each type of pending data is stored in the first array, wherein Mei Gecun Contain the array member of pending data further include: the type of pending data, for indicating previous array member first The preceding node identification of position in array, the postjunction mark for indicating position of the latter array member in the first array Know;Wherein, the array member for being stored with same type of pending data identifies to form chain by preceding node identification and postjunction It connects;
2) second unit is established, for establishing Mapping data structure, at least record has every type in Mapping data structure The mark of the pending data of type is corresponding between the position in the first array with the array member for being stored with pending data Relationship.
It optionally, in the present embodiment, include different types of pending data in above-mentioned first array, it is each type of Pending data is stored in one in the first array several group memberships, wherein be each stored with the array of pending data at Member further include: the type of pending data, the preceding node mark for indicating position of the previous array member in the first array Know, the postjunction for indicating position of the latter array member in the first array identifies.
Specifically illustrate in conjunction with attached drawing, as shown in figure 3, the first array is indicated with DArray, in the first array DArray It is described for the first array member D_1 of the 3rd position.It wherein, include: the class of pending data in array member Type Type is 2, and it is 0 that the preceding node identification of position of the previous array member in the first array DArray, which is PreElem, latter It is 10 that the postjunction of position of the number group membership in the first array DArray, which is identified as NextElem,.
Optionally, in the present embodiment, the array member for being stored with same type of pending data passes through preceding node mark Know and postjunction identifies to form link, wherein above-mentioned link can be, but not limited to as chained list link.For example, in conjunction with Fig. 3-Fig. 4 institute Show, same type is belonged in the first array DArray, and the array member for the pending data that type Type is 2 includes: the first number Group membership D_1, the second array member D_2, third array member D_3.For the previous array member of the second array member D_2 It is 3 that the preceding node identification of position in the first array DArray, which is PreElem, and the latter array member is in the first array It is 25 that the postjunction of position in DArray, which is identified as NextElem, then the above-mentioned array for belonging to same type of pending data Member can identify NextElem by preceding node identification PreElem and postjunction and form chained list link as shown in Figure 4.
Optionally, in the present embodiment, at least record has each type of pending data in above-mentioned Mapping data structure Mark and be stored with corresponding relationship of the array member of pending data between the position in the first array.Optionally, In In the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, the mark of above-mentioned pending data be can be, but not limited to It is identified with the cryptographic Hash of pending data.For example, as shown in figure 3, to be located at the of the 3rd position in the first array DArray It is described for one array member D_1, above-mentioned first array member D_1 corresponding information in Hash table DHash includes: to be used for Mark key, the value k3 of the data Data in the first array member D_1 are identified, and for searching the first array member D_1 The index Index of position in the first array DArray, value 3.
Optionally, in the present embodiment, when above-mentioned Mapping data structure is Hash table DHash, above-mentioned Hash table DHash The size in occupied space is less than the occupied space size of pending data in the first array DArray.
Optionally, further include in the present embodiment but be not limited to the second array TArray.Wherein, the second array at least records There is each type and is stored with first several group membership of each type of pending data between the position in the first array Corresponding relationship.For example, as shown in figure 3, for the type Type pending data for being 2 first several group membership D_1 the Position in one array DArray is 3, then the value of the HeadIndex in the second array TArray is 3, and corresponding other two kinds The value of the HeadIndex of type is respectively 11 and 4, that is to say, that the several group membership D_1 of first of these two types of pending datas Position in the first array DArray is respectively the 11st and the 4th.
As a kind of optional scheme, the first searching unit 804 includes:
1) the first searching module, for searching the mark and target pair of the pending data of record in Mapping data structure The identical list item of the mark of elephant, wherein the mark of each pending data be stored with the array member of pending data the The corresponding relationship between position in one array is recorded in a list item in Mapping data structure;
2) first judgment module, for identical in the mark for the pending data for finding record and the mark of target object List item when, judging that target object is includes the pending data in the first array, and is obtained from the list item found It is stored with position of the array member of target object in the first array;
3) the second judgment module, for the mark in the mark and target object that can not find the pending data of record When identical list item, judge that target object is the newly-increased data different from including pending data in the first array, and And position of the array member for being stored with target object in the first array can not be found in Mapping data structure.
Optionally, in the present embodiment, the mark of above-mentioned pending data can be, but not limited to the Kazakhstan for pending data Uncommon value, the mark of above-mentioned target object can be, but not limited to the cryptographic Hash for target object, above-mentioned Mapping data structure can with but It is not limited to Hash table.The present embodiment does not do any restriction to this.Optionally, in the cryptographic Hash that Hash table DHash has been recorded Search whether list item identical with the cryptographic Hash of target object.If Hash can be found in above-mentioned Hash table DHash Be worth identical with target object list item, then it represents that above-mentioned target object the pending data of the first array DArray array at There is record in member, then position of the target object that can be directly obtained by Hash table DHash in the first array DArray; If cryptographic Hash list item identical with target object can not be found in above-mentioned Hash table DHash, then it represents that above-mentioned target pair As if the newly-increased data different from the pending data recorded in the first array DArray further also can not just be found It is stored with position of the array member of the target object in the first array DArray.
Specifically combine following example explanation, it is assumed that server 204 receive client 202 transmission be used for the first array The request that the second array member D_2 that type Type in DArray is 2 is deleted, wherein the Hash of above-mentioned target object Value be k1, then searched whether in Hash table DHash have with above-mentioned target object, i.e. type Type be 2 the second array at The identical list item of cryptographic Hash of member D_2, it is assumed that find in Hash table DHash with identical as the cryptographic Hash of above-mentioned target object List item, then can be directly from obtaining position of the corresponding array member of above-mentioned target object in the first array, example in list item Such as, the value of the index Index of above-mentioned target object position is 10, that is, above-mentioned target object is located at the first array DArray's 10th position.Assuming that server 204 receive the transmission of client 202 for the type Type in the first array DArray Cryptographic Hash and above-mentioned mesh are not found after Hash table DHash lookup for 2 request modified of the 4th array member D_4 Mark object the identical list item of cryptographic Hash, then it represents that above-mentioned target object be with the pending data in the first array DArray not Same data.
The embodiment provided through the invention, by being searched whether in Mapping data structure with the mark with target object Know identical list item, and then judge whether above-mentioned target object is array member in the first array, if judging is first Array member in array can then reach from position of the above-mentioned target object in the first array is obtained in Mapping data structure To the position of the array member quickly and accurately obtained in the first array, the treatment effeciency to data is improved, is user Save the operating time.
As a kind of optional scheme, the cryptographic Hash for being identified as pending data of above-mentioned pending data, above-mentioned target The cryptographic Hash for being identified as target object of object, above-mentioned Mapping data structure are Hash table, wherein the second judgment module includes:
1) computational submodule obtains the result of remainder for the columns remainder by the cryptographic Hash of newly-increased data to Hash table N;
2) judging submodule, for judging whether the list item of each row Nth column in Hash table is empty;
3) first choice submodule, for selecting one to record in for empty list item when existing for empty list item It increases the cryptographic Hash of data newly and is stored with corresponding relationship of the array member of newly-increased data between the position in the first array;
4) the second selection submodule, for being empty list item when being not present, then in Hash table in the list item of each row Nth column When selecting a list item, the cryptographic Hash recorded in selected list item is replaced with to the cryptographic Hash of newly-increased data.
It is specifically described in conjunction with following example, in conjunction with shown in table 2, it is assumed that the cryptographic Hash of newly-increased data is K, will be above-mentioned newly-increased The cryptographic Hash K of data obtains remainder N to the columns remainder of Hash table DHash, for example, above-mentioned remainder is 3, then above-mentioned Hash Whether the list item that each row the 3rd arranges in table DHash is sky, obtains there is empty list item in the 3rd column of the 3rd row after lookup, then can select Above-mentioned empty list item is selected to store position of the array member of newly-increased data in the first array DArray.
In another example in conjunction with shown in table 2, it is assumed that the cryptographic Hash of newly-increased data is K (for example, K=6), by above-mentioned newly-increased data Cryptographic Hash K to columns (for example, columns=10) remainder of Hash table DHash, obtain remainder N (for example, above-mentioned remainder is 6). Then, judge whether the list item that each row the 6th arranges in above-mentioned Hash table DHash is sky, as shown in Table 2 it is found that in Hash table DHash List item in 6th column of every row has occupied, then can select a list item (example in the 6th column of each row in Hash table DHash Such as, selection is stored in the list item of the 6th column of the 1st row in Hash table earliest), the cryptographic Hash recorded in selected list item is replaced For the cryptographic Hash for increasing data newly.
Optionally, in the present embodiment, to being replaced in the list item in Mapping data structure (for example, Hash table DHash) It can be, but not limited to first replace record time longest list item when changing.Wherein, in the present embodiment Mapping data structure (for example, Hash table DHash) in the array member that is identified of the list item of array member and newly-increased data that is identified of the list item that is replaced can With but be not limited to relevant array member.
The embodiment provided through the invention, when can not be found in Mapping data structure (for example, Hash table DHash) The mark (for example, cryptographic Hash of pending data) of pending data and the mark of target object are (for example, the Hash of target object Value) identical list item when, then in Mapping data structure according to scheduled condition select a suitable list item it is newly-increased to record The cryptographic Hash of data and it is stored with corresponding relationship of the array member of above-mentioned newly-increased data between the position in the first array, led to The mode for being updated the relevant information of newly-increased data in Mapping data structure is crossed, the number in Hash table and the first array is made Group membership can keep corresponding relationship in real time, and then guarantee accurately obtain in real time in the first array by Mapping data structure Array member position.
As a kind of optional scheme, operate as inquiry operation, target object be include to be processed in the first array Data, wherein processing unit 806 includes:
1) module is obtained, for obtaining target object from the array member being located on position;
2) return module, for returning to the target object got.
Specifically combine following example explanation, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, above-mentioned number to be processed According to the cryptographic Hash for being identified as pending data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 Receive the transmission of client 202 is used for the second array member D_2 progress for being 2 to the type Type in the first array DArray The request of inquiry, wherein the cryptographic Hash of above-mentioned target object be k1, then searched whether in Hash table DHash have with it is above-mentioned The identical list item of cryptographic Hash for the second array member D_2 that target object, i.e. type Type are 2, it is assumed that can find above-mentioned List item then obtains position of the above-mentioned target object in the first array DArray, example by the list item in above-mentioned Hash table DHash Such as, the value of the index Index of position of the above-mentioned target object in the first array DArray is 10, then from above-mentioned position Array member obtains Data corresponding to target object, and Data corresponding to the above-mentioned target object got is returned.
It is described below in conjunction with concrete scene, it is assumed that client 202 is microblogging client, and server 204 receives above-mentioned micro- The request for ranking the 3rd message for inquiring in the temperature ranking list in microblogging that client is sent is won, then server 204 Exist above-mentioned message is searched in Hash table DHash according to the mark (for example, this is identified as k3) of above-mentioned ranking the 3rd message Then position in first array DArray obtains above-mentioned message from the array member being located on above-mentioned position, and returns and obtain The above-mentioned message got.
The embodiment provided through the invention, by searching above-mentioned target object in the first array using Mapping data structure In position, obtained above-mentioned target object will be searched further according to above-mentioned position and returned, and then realize and quickly search the first array In array member in data, improve the efficiency of data query
As a kind of optional scheme, aforesaid operations are newly-increased operation, and above-mentioned target object is and is included in the first array In the different newly-increased data of pending data, wherein device further include:
1) judging unit is stored with mesh for searching in Mapping data structure in the mark according to the target object of operation The array member of object is marked after the position in the first array, is stored with target when that can not find in Mapping data structure When position of the array member of object in the first array, judge in the first array with the presence or absence of empty array member;
2) storage unit, for an empty array member being selected, in selected sky when there is empty array member Array member in store the types of newly-increased data and newly-increased data;
3) setting unit, for the preceding node identification for including in the array member of selected sky to be provided for indicating Be stored in the array member of type pending data identical with the type of newly-increased data positioned at selected sky array at Position of the array member in the first array before member, the postjunction for including in the array member of selected sky mark is set It is set in the array member for indicating to be stored with type pending data identical with the type of newly-increased data selected by being located at Empty array member after position of the array member in the first array;It will be located at before the array member of selected sky Array member in postjunction mark be revised as position of the array member in the first array for indicating selected sky, And the preceding node identification in the array member after the array member for being located at selected sky is revised as to be used to indicate selected Position of the empty array member in the first array;
4) recording unit, for recorded in Mapping data structure the array of the marks of newly-increased data and selected sky at Corresponding relationship of the member between the position in the first array.
Specifically combine following example explanation, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, above-mentioned number to be processed According to the cryptographic Hash for being identified as pending data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 Receive the transmission of client 202 is used for the 4th array member D_4 progress for being 2 to the type Type in the first array DArray The request of processing, wherein the cryptographic Hash of above-mentioned target object is k4.If can not be found in Hash table DHash and be stored with mesh Position of the 4th array member D_4 of object in the first array DArray is marked, then may determine that aforesaid operations are newly-increased number According to operation, thus further judgement, with the presence or absence of empty array member in the first array DArray.Assuming that there is empty array Member then selects an empty array member for storing above-mentioned newly-increased data and above-mentioned newly-increased from the array member of above-mentioned sky The type of data, wherein position of the above-mentioned sky array member in the first array DArray is 8.Meanwhile as shown in figure 5, to institute Front and back node identification in the empty array member of selection is configured, it is assumed that increase above-mentioned 4th array member D_4 to first newly Between array member D_1 and the second array member D_2, then by the preceding node identification PreElem's of above-mentioned 4th array member D_4 Value is set as 3, and the value of postjunction mark NextElem is set as 10, and to the first number before the 4th array member D_4 The value (for example, the value be 10) of the postjunction mark NextElem of group membership D_1 be revised as indicate the 4th array at The value 8 of member D_4 position, to the preceding node identification PreElem's of the second array member D_2 after the 4th array member D_4 Value (for example, the value is 3) is revised as the value 8 for indicating the 4th position array member D_4, and in Hash table DHash The middle mark for recording newly-increased data is corresponding between the position in the first array DArray with the array member of selected sky Relationship.
The embodiment provided through the invention, by stored in the empty array member in the first array newly-increased data and The type of newly-increased data, while modifying the linking relationship between above-mentioned array member, thus ensure that can real-time, quickly from Corresponding array member is obtained in first array, improves the efficiency of data processing.
As a kind of optional scheme, above-mentioned apparatus in the present embodiment further include:
1) the second searching unit, after whether there is empty array member in judging the first array, when there is no skies When array member, searched in the first array be stored with identify the array of pending data relevant to the mark of newly-increased data at Member;
2) replacement unit, the pending data for including in the array member for will find replace with newly-increased data, will The type for the pending data for including in the array member found replaces with the type of newly-increased data;
3) the first modification unit, the previous array that the preceding node identification in the array member for will find indicates at The latter array that the postjunction mark that postjunction mark in member is revised as in the array member for indicating to find indicates Position of the member in the first array, and the latter array member that the postjunction mark in the array member found is indicated In preceding node identification be revised as the preceding node identification in the array member for indicating to find expression previous array at Position of the member in the first array;
4) second unit is modified, the preceding node identification for including in the array member for will find is revised as being used to indicate Be stored in the array member of type pending data identical with the type of newly-increased data be located at the array member that finds it The postjunction for including in the array member found mark is revised as being used for by position of the preceding array member in the first array Indicate to be stored in the array member of type pending data identical with the type of newly-increased data positioned at the array that finds at Position of the array member in the first array after member;
5) third modifies unit, identifies for the postjunction in the array member before being located at the array member found It is revised as position of the array member in the first array for indicating to find, and will be after the array member found Array member in preceding node identification be revised as position of the array member in the first array for indicating to find.
Optionally, in this city embodiment, it is assumed that when above-mentioned Mapping data structure is Hash table DHash, and above-mentioned first When the array member of above-mentioned sky being not present in array, then the dependency number group membership for needing to select to meet predetermined condition carries out data Replacement, wherein as array member no longer free in above-mentioned first array DArray, then corresponding Hash table DHash is also State is taken, thus when needing newly-increased data, then it needs also to be updated replacement to the data in Hash table DHash.Wherein, Array member in the above-mentioned first array DArray scheduled condition to be met in replacement can include but is not limited to: newly Increasing data and being replaced data is related data members co-located in Hash table DHash.
Specifically illustrate in conjunction with following example, it is assumed that when above-mentioned Mapping data structure be Hash table DHash, it is above-mentioned to be processed The cryptographic Hash for being identified as pending data of data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 receive client 202 transmission for the type Type in the first array DArray be 2 the 4th array member D_4 The request handled, wherein the cryptographic Hash of above-mentioned target object is k4.If storage can not be found in Hash table DHash There is position of the 4th array member D_4 of target object in the first array DArray, then may determine that aforesaid operations are new Increase data manipulation, thus further judgement, with the presence or absence of empty array member in the first array DArray.Assuming that there is no skies Array member, then need the original old array member that will have been recorded to be replaced with new array member.As shown in fig. 6, The 4th newly-increased array member D_4 replaces original second array member D_2, while by the preceding knot of the 4th array member D_4 The value of point identification PreElem is set as 3, and the value of postjunction mark NextElem is set as 25, and to the 4th array member The value (for example, the value is 10) of the postjunction mark NextElem of the first array member D_1 before D_4 is revised as being used for The value 8 for indicating the 4th position array member D_4, to the preceding node of the third array member D_3 after the 4th array member D_4 The value (for example, the value is 3) of mark PreElem is revised as the value 8 for indicating the 4th position array member D_4.
It is described below in conjunction with concrete scene, it is assumed that client 202 is microblogging client, and server 204 receives above-mentioned micro- The request for being used to increase newly ranking the 3rd message in the temperature ranking list in microblogging that client is sent is won, then server 204 Exist above-mentioned message is searched in Hash table DHash according to the mark (for example, this is identified as k3) of above-mentioned ranking the 3rd message The 3rd newly-increased message is replaced in temperature ranking list existing 3rd and disappeared by the position in the first array DArray Breath, and modify to the linking relationship between in above-mentioned temperature ranking list ranking the 2nd and the 4th in array member.
The embodiment provided through the invention is realized by the replacement to the array member recorded in the first array The type of newly-increased data and newly-increased data is stored, while modifying the linking relationship between above-mentioned array member, to ensure that Corresponding array member can be obtained from the first array real-time, quickly, improves the efficiency of data processing.
As a kind of optional scheme, above-mentioned apparatus in the present embodiment further include:
1) third searching unit, in the array for being stored with type pending data identical with the type of newly-increased data In member search be located at selected sky array member before array member and positioned at selected sky array member it Array member afterwards;
2) third searching unit includes: the second searching module, is stored with type for searching from the second array and increases newly Position of the several group memberships of first of the identical pending data of the type of data in the first array, wherein the second array is extremely Few record has each type and is stored with first position of several group memberships in the first array of each type of pending data Corresponding relationship between setting;
3) third judgment module, for successively judging newly-increased data since the position found and being stored with type and new Increase the pending data for including in two number group memberships adjacent in the array member of the identical pending data of type of data Whether the predetermined insertion condition of satisfaction, meet two number group memberships of predetermined insertion condition until finding, and by two number group memberships In the previous array member as before the array member for being located at selected sky, and will be latter in two number group memberships A array member as after the array member for being located at selected sky.
Optionally, in the present embodiment, the second array TArray, which is at least recorded, has each type and is stored with each type Pending data first several corresponding relationships of the group membership between the position in the first array.Optionally, in this implementation In example, when the type of newly-increased data is existing type in the first array DArray, then the second array TArray can use Start adjacent in the array member for the pending data for successively judging newly-increased data and same type two according to the type of data Whether array member meets predetermined insertion condition.
Specifically illustrate in conjunction with following example, record has the first of different types of array member in the second array TArray Number group membership is in the position of the first array DArray, for example, as shown in figure 3, for the type Type pending data for being 2 Position of first several group membership D_1 in the first array DArray is 3, then the HeadIndex in the second array TArray Value is 3.
Further, as shown in connection with fig. 5, the type of data (for example, above-mentioned newly-increased data are the 4th array member D_4) is increased newly For existing type in the first array DArray, then it can use the second array TArray for newly-increased data and be inserted into homogeneous data chain The corresponding position of table, while the mark of the front and back node of above-mentioned newly-increased array member is modified accordingly.
As a kind of optional scheme, aforesaid operations are delete operation, and above-mentioned target object is to be included in the first array Pending data, wherein processing unit 806 includes:
1) modified module will be in the array member of deletion for the array member in the first array on delete position Postjunction mark in the previous array member that preceding node identification indicates is revised as in the array member for indicating to delete The latter array member that postjunction mark indicates, and the latter number that the postjunction mark in the array member of deletion is indicated Preceding node identification in group membership is revised as the previous number that the preceding node identification in the array member for indicating to delete indicates Group membership;
2) removing module, in the corresponding pass in Mapping data structure between the mark of delete target object and position System.
Specifically illustrate in conjunction with following example, it is assumed that when above-mentioned Mapping data structure be Hash table DHash, it is above-mentioned to be processed The cryptographic Hash for being identified as pending data of data, when the cryptographic Hash for being identified as target object of above-mentioned target object, server 204 receive client 202 transmission for the type Type in the first array DArray be 2 the second array member D_2 The request deleted, wherein the cryptographic Hash of above-mentioned target object be k1, then searched whether in Hash table DHash have with The identical list item of cryptographic Hash for the second array member D_2 that above-mentioned target object, i.e. type Type are 2, it is assumed that can find Above-mentioned list item then obtains position of the above-mentioned target object in the first array DArray by the list item in above-mentioned Hash table DHash It sets, for example, the value of the index Index of position of the above-mentioned target object in the first array DArray is 10, then by upper rheme Data corresponding to the target object of the array member set is deleted, meanwhile, as shown in fig. 7, by before the second array member D_2 The value (for example, the value be 10) of postjunction mark NextElem of the first array member D_1 be revised as indicating the The value 25 of three positions array member D_3, by the preceding node of the third array member D_3 after the second array member D_2 The value (for example, the value is 10) of mark PreElem is revised as the value 3 for indicating the first position array member D_1, and Corresponding relationship between the mark and position for deleting above-mentioned target object in DHash.
It is described below in conjunction with concrete scene, it is assumed that client 202 is microblogging client, and server 204 receives above-mentioned micro- The request for being used to delete ranking the 3rd message in the temperature ranking list in microblogging that client is sent is won, then server 204 Exist above-mentioned message is searched in Hash table DHash according to the mark (for example, this is identified as k3) of above-mentioned ranking the 3rd message Then position in first array DArray will delete the above-mentioned message being located in above-mentioned position, and modify above-mentioned temperature seniority among brothers and sisters Linking relationship in list between ranking the 2nd and the 4th in array member.
The embodiment provided through the invention, by searching above-mentioned target object in the first array using Mapping data structure In position, then by the array member deletion in above-mentioned position, and then realize the array member quickly searched in the first array, and It is deleted according to request, improves the efficiency of data deletion.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others side Formula is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, and only one Kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (14)

1. a kind of data processing method characterized by comprising
It receives for requesting the first message operated to the first array, wherein include different type in first array Pending data, each type of pending data is stored in one in first array several group memberships;
It is searched and is stored with described in the target object in Mapping data structure according to the mark of the target object of the operation Position of the array member in first array, wherein at least record has each type of institute in the Mapping data structure It states the mark of pending data and is stored with position of the array member of the pending data in first array Between corresponding relationship;
If finding the array member for being stored with the target object in Mapping data structure in first array Position, then the operation is executed to the target object on the position in first array;
Wherein, it is described operation be inquiry operation in the case where, the target object be include the institute in first array State pending data, wherein the operation is executed to the target object on the position in first array It include: to obtain the target object from the array member being located on the position;Return to the target pair got As;
Wherein, the cryptographic Hash for being identified as the pending data of the pending data, the target object are identified as institute The cryptographic Hash of target object is stated, the Mapping data structure is Hash table, the mark of the target object according to the operation Position packet of the array member for being stored with the target object in first array is searched in Mapping data structure It includes: if identifying and the target object for the pending data of record can not be found in the Mapping data structure Identify identical list item, then it represents that the target object is and include that the pending data in first array is different Newly-increased data obtain the result N of the remainder by the cryptographic Hash of the newly-increased data to the columns remainder of the Hash table; If the list item of each row Nth column is sky in the Hash table, described described to record for selection one in the empty list item It increases the cryptographic Hash of data newly and is stored with pair of the array member of the newly-increased data between the position in first array It should be related to;If the list item of each row Nth column is not empty in the Hash table, in the Hash table in the list item of each row Nth column A list item is selected, the cryptographic Hash recorded in selected list item is replaced with to the cryptographic Hash of the newly-increased data.
2. the method according to claim 1, wherein what the reception was used to request to operate the first array Before first message, further includes:
First array is established, an array each type of pending data being stored in first array In member, wherein be each stored with the array member of the pending data further include: the class of the pending data Type, the preceding node identification for indicating position of the previous array member in first array, for indicating latter number The postjunction of position of the group membership in first array identifies;Wherein, it is stored with the same type of pending data The array member identify to form link by the preceding node identification and the postjunction;
The Mapping data structure is established, at least record has each type of number to be processed in the Mapping data structure According to mark it is corresponding between the position in first array with the array member for being stored with the pending data Relationship.
3. the method according to claim 1, wherein the mark of the target object according to the operation is being reflected It penetrates in data structure to search and is stored with the position of the array member of the target object in first array and includes:
The mark and the mark of the target object of the pending data of the record are searched in the Mapping data structure Know identical list item, wherein the mark of each pending data be stored with the array of the pending data at In the list item that corresponding relationship of the member between the position in first array is recorded in the Mapping data structure;
If finding the mark list item identical with the mark of the target object of the pending data of the record, table Showing that the target object is includes the pending data in first array, and is obtained from the list item found Take position of the array member for being stored with the target object in first array;
If the mark list item identical with the mark of the target object of the pending data of the record can not be found, Then indicate not finding the array member for being stored with the target object in Mapping data structure in first number Position in group.
4. according to the method in any one of claims 1 to 3, which is characterized in that in the feelings that the operation is newly-increased operation Under condition, the target object is the newly-increased data different from including the pending data in first array, wherein The number for being stored with the target object is searched in Mapping data structure in the mark according to the target object of the operation Group membership after the position in first array, the method also includes:
If being stored with the array member of the target object in institute described in can not finding in the Mapping data structure The position in the first array is stated, then is judged in first array with the presence or absence of empty array member;
The array member of the sky if it exists then selects the array member of a sky, in the array member of selected sky The type of middle the storage newly-increased data and the newly-increased data;
The preceding node identification for including in the array member of the selected sky is provided for indicating to be stored with type and institute State the array for being located at the selected sky in the array member of the identical pending data of type of newly-increased data Position of the array member in first array before member, after including in the array member of the selected sky Node identification is provided for the institute for indicating to be stored with the type pending data identical with the type of the newly-increased data State position of the array member in array member after the array member of the selected sky in first array; Postjunction mark in the array member before the array member of the selected sky is revised as being used to indicate Position of the array member of the selected sky in first array, and by the number positioned at the selected sky The preceding node identification in array member after group membership is revised as the array member for indicating the selected sky in institute State the position in the first array;
The mark of the newly-increased data and the array member of selected sky are recorded in the Mapping data structure in the first number The corresponding relationship between position in group.
5. according to the method described in claim 4, it is characterized in that, with the presence or absence of empty array in judging first array After member, the method also includes:
The array member of the sky if it does not exist is then stored with mark and the newly-increased number in first array described in lookup According to the relevant pending data of mark the array member;
The pending data for including in the array member found is replaced with into the newly-increased data, it will be described The type for the pending data for including in the array member found replaces with the type of the newly-increased data;
The postjunction mark in previous array member that preceding node identification in the array member found is indicated Know and is revised as indicating that the latter array member of the postjunction mark expression in the array member found exists Position in first array, and the postjunction mark in the array member found is indicated latter Preceding node identification in number group membership is revised as indicating the preceding node identification in the array member found Position of the previous array member indicated in first array;
The preceding node identification for including in the array member found is revised as being used to indicate to be stored with type and institute It states and is located at the array found in the array member of the identical pending data of type of newly-increased data Position of the array member in first array before member, after including in the array member found Node identification is revised as the institute for indicating to be stored with the type pending data identical with the type of the newly-increased data State position of the array member after being located at the array member found in array member in first array;
Postjunction mark in the array member before the array member found is revised as being used to indicate Position of the array member found in first array, and by it is described positioned at the array found at The preceding node identification in array member after member is revised as indicating the array member found described the Position in one array.
6. according to the method described in claim 4, it is characterized in that, being stored with type and the newly-increased number by following steps According to the identical pending data of type the array member in search be located at the selected sky array member Array member before and the array member after the array member of the selected sky:
It is searched from the second array and is stored with the first of the type pending data identical with the type of the newly-increased data Position of a array member in first array, wherein second array, which at least records, each type With position of the first array member for being stored with each type of pending data in first array Corresponding relationship between setting;
The newly-increased data and the class for being stored with type Yu the newly-increased data are successively judged since the position found The number to be processed for including in two adjacent number group memberships in the array member of the identical pending data of type According to whether predetermined insertion condition is met, meet described two array members of the predetermined insertion condition until finding, and by institute The previous array member as before the array member for being located at the selected sky in two number group memberships is stated, and Using the latter in two number group memberships as the array member after the array member of the selected sky.
7. according to the method in any one of claims 1 to 3, which is characterized in that in the feelings that the operation is delete operation Under condition, the target object be include the pending data in first array, wherein it is described it is described first number Executing the operation to the target object on the position in group includes:
The array member on the position is deleted in first array, by the preceding knot in the array member of deletion Postjunction mark in the previous array member that point identification indicates is revised as in the array member for indicating to delete The latter array member that postjunction mark indicates, and the postjunction mark in the array member of deletion is indicated Preceding node identification in the latter array member is revised as the preceding node designation list in the array member for indicating to delete The previous array member shown;
The corresponding relationship between the mark of the target object and the position is being deleted in the Mapping data structure.
8. a kind of data processing equipment characterized by comprising
Receiving unit, for receiving the first message for being used for requesting to operate the first array, wherein in first array Including different types of pending data, each type of pending data is stored in a number in first array In group membership;
First searching unit, the mark for the target object according to the operation have searched storage in Mapping data structure State position of the array member of target object in first array, wherein at least remember in the Mapping data structure Record has the mark of each type of pending data and is stored with the array member of the pending data described The corresponding relationship between position in first array;
Processing unit, for finding the array member for being stored with the target object in Mapping data structure described When position in the first array, the operation is executed to the target object on the position in first array;
Wherein, it is described operation be inquiry operation in the case where, the target object be include the institute in first array State pending data, wherein the processing unit includes: acquisition module, for from be located at the position on the array at The target object is obtained in member;Return module, for returning to the target object got;
Wherein, the cryptographic Hash for being identified as the pending data of the pending data, the target object are identified as institute The cryptographic Hash of target object is stated, the Mapping data structure is Hash table, and the first searching unit is used for through following steps come root Searched in Mapping data structure according to the mark of the target object of the operation be stored with the array of the target object at Position of the member in first array: if the pending data of record can not be found in the Mapping data structure Identical with the mark of the target object list item of mark, then it represents that the target object for and be included in first array In the different newly-increased data of the pending data, the cryptographic Hash of the newly-increased data takes the columns of the Hash table It is remaining, obtain the result N of the remainder;If the list item of each row Nth column is sky in the Hash table, described for the empty table Selection one records the cryptographic Hash of the newly-increased data and is stored with the array members of the newly-increased data described the in The corresponding relationship between position in one array;If the list item of each row Nth column is not empty in the Hash table, in the Hash A list item is selected in table in the list item of each row Nth column, the cryptographic Hash recorded in selected list item is replaced with described newly-increased The cryptographic Hash of data.
9. device according to claim 8, which is characterized in that described device further include:
First establishing unit, for receiving for before requesting the first message that is operated to the first array, described in foundation First array, in the several group memberships that each type of pending data is stored in first array, wherein Each be stored with the array member of the pending data further include: the type of the pending data, for indicate before The preceding node identification of position of one several group membership in first array, for indicating the latter array member described The postjunction of position in one array identifies;Wherein, it is stored with the array member of the same type of pending data It identifies to form link by the preceding node identification and the postjunction;
Second establishes unit, and for establishing the Mapping data structure, at least record has every kind in the Mapping data structure The pending data of type mark be stored with the array member of the pending data in first array In position between corresponding relationship.
10. device according to claim 8, which is characterized in that first searching unit includes:
First searching module, for searched in the Mapping data structure record the pending data mark with The identical list item of the mark of the target object, wherein the mark of each pending data be stored with it is described to be processed Corresponding relationship of the array member of data between the position in first array is recorded in the Mapping data structure In a list item in;
First judgment module, for the mark and the mark of the target object in the pending data for finding the record When knowing identical list item, judging that the target object is includes the pending data in first array, and from Position of the array member for being stored with the target object in first array is obtained in the list item found;
Second judgment module, in the pending data that can not find the record mark and the target object Mark identical list item when, judge that the number for being stored with the target object can not be found in Mapping data structure Position of the group membership in first array.
11. the device according to any one of claim 8 to 10, which is characterized in that operate described as newly-increased operation In the case of, the target object is the newly-increased data different from including the pending data in first array, In, described device further include:
Judging unit, for the mark according to the target object of the operation searched in Mapping data structure be stored with it is described The array member of target object is after the position in first array, when can not look into the Mapping data structure When being stored with position of the array member of the target object in first array described in finding, described first is judged With the presence or absence of empty array member in array;
Storage unit, for the array member of a sky being selected, selected when there are the array member of the sky The type of the newly-increased data and the newly-increased data is stored in empty array member;
Setting unit, for the preceding node identification for including in the array member of the selected sky to be provided for indicating to deposit It contains in the array member of the type pending data identical with the type of the newly-increased data positioned at described selected Position of the array member in first array before the empty array member selected, by the array of the selected sky at Member in include postjunction mark be provided for indicate be stored with type it is identical with the type of the newly-increased data described in The array member being located at after the array member of the selected sky in the array member of data is handled described first Position in array;Postjunction mark in the array member before the array member of the selected sky is repaired It is changed to position of the array member for indicating the selected sky in first array, and described will be located at the institute The preceding node identification in array member after the empty array member of selection is revised as indicating the selected sky Position of the array member in first array;
Recording unit, for recording the mark and the array of selected sky of the newly-increased data in the Mapping data structure Corresponding relationship of the member between the position in the first array.
12. device according to claim 11, which is characterized in that described device further include:
Second searching unit, after whether there is empty array member in judging first array, when there is no the skies Array member when, in first array search described in be stored with mark it is relevant to the mark of the newly-increased data described in The array member of pending data;
Replacement unit is described new for replacing with the pending data for including in the array member found Increase data, the type for the pending data for including in the array member found is replaced with into the newly-increased number According to type;
First modification unit, the previous array for indicating the preceding node identification in the array member found What the postjunction mark that the postjunction mark in member is revised as indicating in the array member found indicated Position of the latter array member in first array, and by knot after described in the array member found The preceding node identification in the latter array member that point identification indicates be revised as indicate the array found at Position of the previous array member that preceding node identification in member indicates in first array;
Second modification unit, for being revised as the preceding node identification for including in the array member found to be used for table Show described in being located in the array member for being stored with the type pending data identical with the type of the newly-increased data Position of the array member in first array before the array member found, by the number found The postjunction mark for including in group membership is revised as indicating to be stored with type institute identical with the type of the newly-increased data The array member after being located at the array member found in the array member of pending data is stated described Position in first array;
Third modifies unit, for by the postjunction mark in the array member before the array member found Know the position being revised as indicating the array member found in first array, and by it is described be located at look into Described in the preceding node identification in array member after the array member found is revised as finding for indicating described Position of the array member in first array.
13. device according to claim 11, which is characterized in that described device further include:
Third searching unit, in the institute for being stored with the type pending data identical with the type of the newly-increased data It states and searches the array member being located at before the array member of the selected sky in array member and be located at described selected Array member after empty array member;
The third searching unit includes: the second searching module, is stored with type and described new for searching from the second array Increase position of the first array member of the identical pending data of type of data in first array, In, second array, which at least records, to be had each type and described is stored with the of each type of pending data Corresponding relationship of one array member between the position in first array;
Third judgment module, for successively judge since the position found the newly-increased data and it is described be stored with type with It is wrapped in two adjacent number group memberships in the array member of the identical pending data of the type of the newly-increased data Whether the pending data included meets predetermined insertion condition, meets the described two of the predetermined insertion condition until finding Array member, and by described two array members it is previous as the array member positioned at the selected sky it Preceding array member, and using the latter in two number group memberships as the array member positioned at the selected sky it Array member afterwards.
14. the device according to any one of claim 8 to 10, which is characterized in that operate described as delete operation In the case of, the target object be include the pending data in first array, wherein the processing unit packet It includes:
Modified module, for deleting the array member on the position in first array, by the number of deletion Postjunction mark in the previous array member that preceding node identification in group membership indicates is revised as the institute for indicating to delete The latter array member that the postjunction mark in array member indicates is stated, and will be after described in the array member of deletion The preceding node identification in the latter array member that node identification indicates is revised as in the array member for indicating to delete Preceding node identification indicate the previous array member;
Removing module, for deleting pair between the mark of the target object and the position in the Mapping data structure It should be related to.
CN201410232570.3A 2014-05-28 2014-05-28 Data processing method and device Active CN105224532B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410232570.3A CN105224532B (en) 2014-05-28 2014-05-28 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410232570.3A CN105224532B (en) 2014-05-28 2014-05-28 Data processing method and device

Publications (2)

Publication Number Publication Date
CN105224532A CN105224532A (en) 2016-01-06
CN105224532B true CN105224532B (en) 2019-11-08

Family

ID=54993510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410232570.3A Active CN105224532B (en) 2014-05-28 2014-05-28 Data processing method and device

Country Status (1)

Country Link
CN (1) CN105224532B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107545011B (en) * 2016-06-29 2020-04-10 高德信息技术有限公司 Data reading method and device
CN107241387B (en) * 2017-05-12 2018-11-06 腾讯科技(深圳)有限公司 The processing method of request of data, apparatus and system
CN108737487B (en) * 2018-03-21 2020-09-29 腾讯科技(深圳)有限公司 Data synchronization method and device, storage medium and electronic device
CN108829831B (en) * 2018-06-15 2020-12-18 北京探境科技有限公司 Data processing method and device, hardware device and chip
CN109165360B (en) * 2018-07-12 2022-07-05 北京猫眼文化传媒有限公司 Data processing method and device
CN109039911B (en) * 2018-07-27 2021-02-26 烽火通信科技股份有限公司 Method and system for sharing RAM based on HASH searching mode
CN111767006B (en) 2019-04-02 2021-03-16 英韧科技(上海)有限公司 Data processing method and device
CN110727384B (en) * 2019-09-26 2022-04-22 北京金山安全软件有限公司 Unread message quantity statistical method and device and electronic equipment
CN111134974B (en) * 2019-12-09 2021-04-20 西安交通大学 Wheelchair robot system based on augmented reality and multi-mode biological signals
CN111694521B (en) * 2020-06-17 2022-08-05 杭州海康威视系统技术有限公司 Method, device and system for storing file
CN112631731A (en) * 2020-12-30 2021-04-09 平安证券股份有限公司 Data query method and device, electronic equipment and storage medium

Citations (2)

* 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
CN103678160A (en) * 2012-08-30 2014-03-26 腾讯科技(深圳)有限公司 Data storage method and device

Patent Citations (2)

* 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
CN103678160A (en) * 2012-08-30 2014-03-26 腾讯科技(深圳)有限公司 Data storage method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
java提高篇——HashTable;chenssy;《cnBlog》;20140403;第1-7页 *

Also Published As

Publication number Publication date
CN105224532A (en) 2016-01-06

Similar Documents

Publication Publication Date Title
CN105224532B (en) Data processing method and device
CN104462549B (en) A kind of data processing method and device
CN105426408B (en) A kind of data processing method and device of more indexes
CN110413611A (en) Data storage, querying method and device
CN107247778A (en) System and method for implementing expansible data storage service
CN104346458B (en) Date storage method and storage device
CN105843956A (en) Paging query method and system
CN107391554A (en) Efficient distributed local sensitivity hash method
EP1938212A1 (en) Methods and systems for joining database tables using indexing data structures
CN102915382A (en) Method and device for carrying out data query on database based on indexes
CN110020086A (en) A kind of user draws a portrait querying method and device
CN104636349A (en) Method and equipment for compression and searching of index data
CN106557499A (en) HBase secondary indexs creation method and device
CN107209768A (en) Method and apparatus for the expansible sequence of data set
CN104871501A (en) Packet processing device, flow entry arrangement method and program
CN106651077A (en) Method and device for searching equipment storage position
CN105550180B (en) The method, apparatus and system of data processing
CN101635001B (en) Method and apparatus for extracting information from a database
CN106649385B (en) Data reordering method and device based on HBase database
CN109254962A (en) A kind of optimiged index method and device based on T- tree
CN104253903A (en) Method and device for searching information
CN109522306A (en) A kind of global space and data sharing method
CN108241758A (en) Data query method and relevant device
CN107180098B (en) Keyword eliminates method and device in a kind of information search
CN112308476A (en) Order form combining method, device and storage medium

Legal Events

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