CN104794137B - The processing method and sorting query method and relevant apparatus and system of order recording - Google Patents
The processing method and sorting query method and relevant apparatus and system of order recording Download PDFInfo
- Publication number
- CN104794137B CN104794137B CN201410030043.4A CN201410030043A CN104794137B CN 104794137 B CN104794137 B CN 104794137B CN 201410030043 A CN201410030043 A CN 201410030043A CN 104794137 B CN104794137 B CN 104794137B
- Authority
- CN
- China
- Prior art keywords
- sorting
- record
- directory
- main
- sorted
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000003672 processing method Methods 0.000 title abstract description 15
- 238000013507 mapping Methods 0.000 claims abstract description 161
- 238000012163 sequencing technique Methods 0.000 claims description 463
- 238000012545 processing Methods 0.000 claims description 20
- 238000012986 modification Methods 0.000 description 34
- 230000004048 modification Effects 0.000 description 34
- 238000010586 diagram Methods 0.000 description 19
- 230000006870 function Effects 0.000 description 14
- 238000004891 communication Methods 0.000 description 8
- 230000002349 favourable effect Effects 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present invention discloses the processing method and sorting query method and relevant apparatus and system of order recording.A kind of processing method of order recording includes: the first sequence master record of acquisition and corresponding first sort type of the first catalogue of storage;The incidence relation between the corresponding sort type mark of the first sort type and the corresponding master record version number of the first sequence master record is recorded among the corresponding catalogue master record of the first catalogue;Mapping relations between the storage address of the sequence master record of key and first of record the first sequence master record;The key of first sequence master record includes the corresponding master record version number of the first sequence master record.Technical solution provided in an embodiment of the present invention is conducive to improve the single dimension of the subobject under catalogue or the external consistence control performance of various dimensions sequence.
Description
Technical Field
The invention relates to the technical field of file management, in particular to a processing method of sequencing records, a sequencing query method, a relevant device and a relevant system.
Background
In a distributed file system or other scenarios, the ordered presentation of sub-objects located under a directory (sub-objects under a directory may include files and/or sub-directories) is a key technology for providing a virtual file system directory service to users. How to effectively design the data structure, storage mode and the like of the sorting data of the sub-objects located under the directory so as to meet the requirement of a user on multi-latitude sorting and the like of the sub-objects located under the directory is also a key technical point of index design.
Especially for a large directory scene, when the number of the sub-objects under one directory reaches tens of thousands or more, the positioning and pulling performance of the sub-objects under the large directory can be effectively improved by splitting the directory index storage mode. However, supporting the requirement of multidimensional high-performance sorting of sub-objects located under a large directory is a technical difficulty, wherein multidimensional sorting of sub-objects is performed by batch pulling according to sorting of file names, batch pulling according to creation time and the like.
The existing popular scheme is mainly used for independently storing a plurality of pieces of sub-object sorting data through a relational database so as to support the multi-dimensional sorting requirements of sub-objects under a large directory at different latitudes. During research and practice, the inventor of the present invention finds that the prior art has at least the following technical problems: the existing mechanism for supporting single-dimension or multi-dimension ordering of the sub-objects under the directory has the problems that external consistency control is difficult to realize and the like. For example, when the sub-objects located under a certain directory are changed, part or all of the sub-object sorting data stored in the relational database may be invalid, and at this time, the user may still call the invalid sorting data to perform sub-object sorting presentation.
Disclosure of Invention
The embodiment of the invention provides a processing method and a sorting query method for sorting records, and a related device and a related system, so as to improve the outward consistency control performance of single-dimensional or multi-dimensional sorting of sub-objects under a directory.
A first aspect of an embodiment of the present invention provides a method for processing a sort record, including:
acquiring and storing a first sorting master record of a first sorting type corresponding to a first directory;
recording an association relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the first sorting main record in a directory main record corresponding to the first directory;
recording the mapping relation between the key value key of the first sequencing main record and the storage address of the first sequencing main record; wherein the key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record;
the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records includes a plurality of ordering items, the N11 ordering extended records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each ordering item includes a sub-object identifier and an ordering key value of the first ordering type corresponding to the sub-object.
A second aspect of the present invention provides a method for sorting queries, including:
receiving a sorting query instruction corresponding to a first directory, wherein the sorting query instruction carries a sorting type identifier;
acquiring a master record version number having an association relationship with the sorting type identifier from a directory master record corresponding to the first directory, wherein the association relationship between the sorting type identifier and the master record version number is recorded in the directory master record corresponding to the first directory, and the master record version number is used for identifying the first sorting master record;
obtaining the storage address of the first sequencing master record through the key of the first sequencing master record based on the mapping relation between the recorded storage address of the first sequencing master record and the key of the first sequencing master record containing the version number of the master record; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring N11 sequencing extended records pointed by the first sequencing main record based on the first sequencing main record; based on the N11 pieces of sequencing extended records, meta information of part or all of the sub-objects currently located under the first directory is shown according to a first sequencing type represented by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a one-to-one correspondence between a sequencing item and a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
A third aspect of the embodiments of the present invention provides a device for processing sorted records, including:
the acquisition unit is used for acquiring and storing a first sorting master record of a first sorting type corresponding to the first directory;
the association unit is used for recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory;
the recording unit is used for recording the mapping relation between the key value key of the first sequencing main record and the storage address of the first sequencing main record; wherein the key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record;
the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records includes a plurality of ordering items, the N11 ordering extended records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each ordering item includes a sub-object identifier and an ordering key value of the first ordering type corresponding to the sub-object.
A fourth aspect of the present invention provides a sort query apparatus, including:
the receiving unit is used for receiving a sorting query instruction corresponding to the first directory, wherein the sorting query instruction carries a sorting type identifier;
an association unit, configured to obtain, from a directory master record corresponding to the first directory, a master record version number having an association relationship with the sorting type identifier, where the directory master record corresponding to the first directory records an association relationship between the sorting type identifier and the master record version number, and the master record version number is used to identify the first sorting master record;
the presentation control unit is used for obtaining the storage address of the first sequencing master record through the key of the first sequencing master record based on the mapping relation between the recorded storage address of the first sequencing master record and the key of the first sequencing master record containing the master record version number; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring N11 sequencing extended records pointed by the first sequencing main record based on the first sequencing main record; based on the N11 pieces of sequencing extended records, meta information of part or all of the sub-objects currently located under the first directory is shown according to a first sequencing type represented by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a one-to-one correspondence between a sequencing item and a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
A fifth aspect of an embodiment of the present invention provides a service system, including:
the main index server is used for receiving a sorting query instruction corresponding to the first directory, wherein the sorting query instruction carries a sorting type identifier; acquiring a master record version number having an association relation with the sorting type identifier from a directory master record corresponding to the first directory, wherein the association relation between the sorting type identifier and the master record version number is recorded in the directory master record corresponding to the first directory, and the master record version number is used for identifying the first sorting master record and sending the master record version number to a sorting server;
the sorting server is configured to obtain the storage address of the first sorting master record through the key of the first sorting master record based on a mapping relationship between the recorded storage address of the first sorting master record and the key of the first sorting master record that includes the master record version number; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring N11 sequencing extended records pointed by the first sequencing main record based on the first sequencing main record; sending the N11 sorted expanded records to the main index server;
the main index server is specifically configured to, based on the N11 pieces of sorting expansion records, show meta information of some or all sub-objects currently located under the first directory according to a first sorting type indicated by the sorting type identifier, where each sorting expansion record in the N11 pieces of sorting expansion records includes a plurality of sorting entries, the sorting entries included in the N11 pieces of sorting expansion records correspond to the sub-objects currently located under the first directory in a one-to-one manner, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting entry includes a sub-object identifier and a sorting key value of the sub-object corresponding to the first sorting type.
It can be seen that, in some technical solutions of the embodiments of the present invention, after the first sorting master record corresponding to the first sorting type is obtained and stored; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory; recording the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record and the key of the first directory, or the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record; wherein the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records contains several ordering items, the N11 sorted expanded records contain sorted entries corresponding to the child objects currently located in the first directory, this is equivalent to providing an entry that implements the external consistency query function, which, subsequently in ranking queries, the master record version number associated with the sorting type identifier corresponding to a certain sorting type can be obtained through the directory master record corresponding to the first directory, further, the corresponding sorting main record can be obtained based on the version number of the main record, and then a plurality of sorting extended records pointed by the sorting main record can be obtained, and further, based on the sorting items contained in the sorting expansion records, the meta-information of part or all of the sub-objects currently located under the first directory can be displayed according to the certain sorting type. It can be seen that the version management of different sequencing master records is realized by introducing the master record version number, and further the locking of the sequencing master records is realized by the master record version number, and the sequencing master records can be uniquely locked based on the directory master record and the master record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for processing sorted records according to an embodiment of the present invention;
FIG. 2 is a flow chart of a query ranking method according to an embodiment of the present invention;
3-a-3-c are schematic diagrams of several directory masters provided by embodiments of the present invention;
FIG. 3-d is a schematic diagram illustrating a direction relationship between a directory main record and a directory extension record according to an embodiment of the present invention;
FIGS. 3-e-3-h are schematic diagrams of directory extension records provided by embodiments of the present invention;
3-i-3-k are schematic diagrams of several sorted master records provided by embodiments of the present invention;
3-l-3-n are schematic diagrams of several first type mapping relationship records provided by embodiments of the present invention;
FIGS. 3-o-3-r are diagrams of several second type mapping relationship records provided by embodiments of the present invention;
3-s-3-u are diagrams of several sequenced extended records provided by embodiments of the present invention;
3-v are schematic diagrams of a directional relationship between a sorted main record and a sorted extended record provided by an embodiment of the present invention;
3-w-3-y are schematic diagrams of the evolution of versions of several sequenced master records provided by embodiments of the present invention;
FIG. 4-a is a schematic diagram of a service system according to an embodiment of the present invention;
FIG. 4-b is a flow chart illustrating another method for processing sorted records according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating another method for processing sorted records according to an embodiment of the present invention;
FIG. 6 is a flow chart illustrating another method for processing sorted records according to an embodiment of the present invention;
FIG. 7 is a flow chart illustrating another method for sorting queries according to an embodiment of the present invention;
FIG. 8-a is a schematic diagram of a device for processing sorted records according to an embodiment of the present invention;
FIG. 8-b is a schematic diagram of a device for processing sorted records according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of another apparatus for processing sorted records according to an embodiment of the invention;
FIG. 10 is a diagram of a query ranking device according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of another apparatus for sorting queries according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a service system according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a processing method and a sorting query method for sorting records, and a related device and a related system, which are beneficial to improving the external consistency control performance of single-dimensional or multi-dimensional sorting of sub-objects under a directory.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following are detailed below.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
One embodiment of a method for processing sorted records according to the present invention may include: acquiring and storing a first sorting master record of a first sorting type corresponding to a first directory; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory; recording the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record and the key of the first directory, or the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record; the first sorting main record points to N11 sorting extended records, each of the N11 sorting extended records includes a plurality of sorting items, the N11 sorting extended records include sorting items corresponding to sub-objects currently located under the first directory in a one-to-one manner, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting item includes a sub-object identifier and a sorting key value corresponding to the sub-object of the first sorting type.
Referring to fig. 1, fig. 1 is a flowchart illustrating a processing method for sorting records according to an embodiment of the present invention. As shown in fig. 1, a processing method for sorting records according to an embodiment of the present invention may include the following steps:
101. and acquiring and storing a first sorting master record of a first sorting type corresponding to the first directory.
In some embodiments of the present invention, for example, after the first directory is created, a first sorting master record corresponding to the first sorting type in the first directory may be obtained and stored; or after receiving a creation instruction of the first directory corresponding to the first sort master record of the first sort type, acquiring and storing the first sort master record of the first directory corresponding to the first sort type; or, after it is monitored that the sub-objects located under the first directory change (where the change of the sub-objects located under the first directory may include deletion of a number of sub-objects located under the first directory, addition of a number of sub-objects below the first directory, and/or modification of a number of sub-objects located under the first directory, etc.), a first sorting master record of the first directory corresponding to the first sorting type may be obtained and stored. Wherein the first sorted primary record may be stored by a key-value store or otherwise.
102. And recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory.
In some embodiments of the present invention, the directory master record corresponding to the first directory may record therein a plurality of information related to the first directory. The key of the directory master record corresponding to the first directory may include an identifier of the first directory, and the like. For example, the directory main record corresponding to the first directory may be stored in the key value database, and the directory main record corresponding to the first directory may be obtained from the key value database through a key (an identifier of the first directory, etc.) of the directory main record corresponding to the first directory. Of course, after the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record is recorded in the directory primary record corresponding to the first directory, the directory primary record corresponding to the first directory after modification (that is, the directory primary record corresponding to the first directory after the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record is recorded) may be stored in the key value database.
103. And recording the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record.
The mapping relationship between the key of the first primary record and the storage address of the first primary record can be recorded by a key value database or other methods.
The key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record. Wherein the first ordering main record points to N11 ordering extended records, and each of the N11 ordering extended records contains several ordering items. The N11 pieces of sorting expansion records include sorting entries corresponding to the sub-objects currently located in the first directory, the sub-objects in the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting entry includes a sub-object identifier and a sorting key value corresponding to the sub-object in the first sorting type.
It is understood that there is no necessary sequence between step 102 and step 103, and the execution sequence can be adjusted arbitrarily.
In some embodiments of the present invention, the first sorted master record may point to the N11 sorted extended records by recording extended record identifiers of the N11 sorted extended records in the first sorted master record, or the first sorted master record may point to the N11 sorted extended records by recording storage addresses of the N11 sorted extended records in the first sorted master record. Of course, the first sorted master record may point to the N11 sorted extension records in other ways. Since the first-order main record points to N11 order extension records, the N11 order extension records can be acquired based on the first-order main record. The N11 sorted extension records pointed to by the first sorted primary record may also be stored in the key-value store.
The sort types (e.g., first sort type, second sort type, third sort type, etc.) of embodiments of the present invention may be sorted by time (e.g., sorted by creation time or sorted by modification time, etc.), sorted by size, sorted by name, or other sort types.
The sorting key value of the sub-object corresponding to a certain sorting type is key information related to sorting that needs to be used when sorting is performed according to the certain sorting type, and the sorting key value of the sub-object corresponding to the certain sorting type (for example, the first sorting type, the second sorting type, the third sorting type, and the like) may be creation time of the sub-object, latest modification time of the sub-object, content data size of the sub-object, or name of the sub-object. For example, if the sort type is sorted by creation time, the sort key value of the sub-object corresponding to the sort type may be the creation time of the sub-object. If the sort type is sorted according to the modification time, the sort key value of the sub-object corresponding to the sort type can be the latest modification time of the sub-object. If the sort type is sort by size, the sort key value of the sub-object corresponding to the sort type may be the size of the content data volume of the sub-object. If the sort type is sort by name, the sort key value of the sub-object corresponding to the sort type may be the name of the sub-object. Other scenarios are analogized.
In some embodiments of the present invention, the meta-information of the sub-object may include an identifier of the sub-object (the identifier of the sub-object and the name of the sub-object may be the same or different), and/or a sort key value of the sub-object corresponding to a certain sort type.
It can be seen that, in the embodiment, after the first sorting master record corresponding to the first sorting type in the first directory is obtained and stored; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory; and storing a mapping relationship between the key of the first sequence main record and the storage address of the first sequence main record; the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record and the key of the first directory, or the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record; wherein the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records contains several ordering items, the N11 sorted expanded records contain sorted entries corresponding to the child objects currently located in the first directory, this is equivalent to providing an entry that implements the external consistency query function, which, subsequently in ranking queries, the master record version number associated with the sorting type identifier corresponding to a certain sorting type can be obtained through the directory master record corresponding to the first directory, further, the corresponding sorting main record can be obtained based on the version number of the main record, and then a plurality of sorting extended records pointed by the sorting main record can be obtained, and further, based on the sorting items contained in the sorting expansion records, the meta-information of part or all of the sub-objects currently located under the first directory can be displayed according to the certain sorting type. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
In some embodiments of the present invention, the number of the sorting entries included in any one of the N11 sorting expansion records pointed to by the first sorting master record may be less than or equal to a first threshold N1, where the first threshold N1 is a positive integer, and N1 may be, for example, 1, 2, 5, 8, 10, 15, 20, or other values.
Further, for a scenario with a requirement of multidimensional sequencing, the method further includes: acquiring and storing a tenth sorting main record of the second sorting type corresponding to the first directory; recording the association relationship between the sorting type identifier corresponding to the second sorting type and the main record version number corresponding to the tenth sorting main record in the directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the tenth sorting main record and the storage address of the tenth sorting main record; wherein the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record and a key of the first directory, or the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record; the tenth ordering main record points to N41 ordering extended records, each of the N41 ordering extended records includes several ordering items, the N41 ordering extended records include ordering items corresponding to sub-objects currently under the first directory, the N41 is a positive integer, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the second ordering type.
Wherein the second sorting type is different from the first sorting type, and the tenth sorting master record is different from the first sorting master record. It is understood that the above-mentioned scenarios of acquiring and storing the first directory corresponding to the sorted main records of other sort types and so on are not illustrated here.
It can be understood that after the recording of the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after the recording of the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the sub-object located below the first directory may further be changed, where the changing of the sub-object located below the first directory may include: a number of sub-objects located under the first directory are deleted, a number of sub-objects are added under the first directory and/or a number of sub-objects located under the first directory are modified, etc. When the child object under the first directory may still be changed, a new sorting master record corresponding to the first sorting type and/or other sorting types in the first directory may be obtained and stored (where the new sorting master record is different from the first sorting master record and is different from the tenth sorting master record). Several application scenarios are presented below by way of example.
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if k1 child objects under the first directory are deleted, obtaining the key of the first sequence main record based on the directory main record corresponding to the first directory, and obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and deleting k1 sequencing items corresponding to the k1 sub-objects contained in N12 sequencing expansion records in the N11 sequencing expansion records. And acquiring and storing a second sorting main record of the first directory corresponding to the first sorting type. Recording an association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the second sorting primary record in the directory primary record corresponding to the first directory, and recording a mapping relationship between the key value key of the second sorting primary record and the storage address of the second sorting primary record. The key of the second sorting main record includes a main record version number corresponding to the second sorting main record and the key of the first directory, or the key of the second sorting main record includes a main record version number corresponding to the second sorting main record. Wherein the second-ordered main record points to N13 ordered extended records, and a main record version number corresponding to the second-ordered main record is different from a main record version number corresponding to the first-ordered main record. Wherein the N13 sorted expanded records include the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records other than the N12 sorted expanded records from among the N11 sorted expanded records, or the N13 sorted expanded records are obtained by merging the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records from among the N11 sorted expanded records other than the N12 sorted expanded records, the N13 is less than or equal to the N11, and the k1 is a positive integer.
In some embodiments of the present invention, the deleting k1 sorted entries corresponding to the k1 sub-objects included in N12 sorted expanded records of the N11 sorted expanded records may include: determining N12 sequencing expansion records to which k1 sequencing items corresponding to the k1 sub-objects belong based on the identifier of the k1 sub-objects and/or the sequencing key value of the k1 sub-objects corresponding to the first sequencing type, where the N12 sequencing expansion records are a subset of the N11 sequencing expansion records; deleting the k1 sorted entries in the N12 sorted expanded records.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N13 sorted expanded records pointed to by the second sorted main record may be less than or equal to a second threshold N2, where the second threshold N2 is a positive integer, and N2 may be, for example, 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the first example, in some embodiments of the present invention, when the second sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the second sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record recorded in a directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the second sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replacing the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, replacing the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the second sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record in the directory main record corresponding to the first directory The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, after the second primary record of the first directory corresponding to the first sorting type is obtained and stored, and the second primary record of the first directory corresponding to the first sorting type is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory primary record corresponding to the first directory and the primary record version number corresponding to the first sorting primary record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a second sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if k1 sub-objects under the first directory are deleted, acquiring and storing a third sorting main record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the third sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the third sorting main record and the storage address of the third sorting main record; wherein the key of the third sorting master record includes a master record version number corresponding to the third sorting master record and a key of the first directory, or the key of the third sorting master record includes a master record version number corresponding to the third sorting master record; the version number of the main record corresponding to the third-order main record is different from the version number of the main record corresponding to the first-order main record;
the third sorted main record points to N14 sorted expanded records, each of the N14 sorted expanded records includes several sort entries, the N14 sorted expanded records include sort entries corresponding to sub-objects currently located in the first directory, the N14 and the k1 are positive integers, the N14 sorted expanded records do not include k1 sorted entries corresponding to the k1 sub-objects, and each sort entry includes a sub-object identifier and a sort key value corresponding to the sub-object in the first sort type.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N14 sorted expanded records pointed to by the third sorted main record may be less than or equal to a third threshold N3, where the third threshold N3 is a positive integer, and N3 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to example two, in some embodiments of the present invention, when a third sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the third sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record recorded in a directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the third sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the third sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another example scenario corresponding to the second example, in another embodiment of the present invention, after the third primary record of the first directory corresponding to the first sorting type is obtained and stored, and the third primary record of the first directory corresponding to the first sorting type is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory primary record corresponding to the first directory and the primary record version number corresponding to the first sorting primary record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a third sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if k2 child objects are added under the first directory, obtaining the key of the first sequence main record based on the directory main record corresponding to the first directory, and obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; inserting k2 sorting entries corresponding to the k2 sub-objects into N15 sorting expansion records in the N11 sorting expansion records based on the sorting key value of the k2 sub-objects corresponding to the first sorting type;
acquiring and storing a fourth sorting main record of the first directory corresponding to the first sorting type, wherein the fourth sorting main record points to N16 sorting expanded records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a primary record version number corresponding to the fourth sorting primary record in a directory primary record corresponding to the first directory, and recording a mapping relationship between a key value key of the fourth sorting primary record and a storage address of the fourth sorting primary record;
wherein the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record and the key of the first directory, or the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record; wherein, the version number of the main record corresponding to the fourth sorting main record is different from the version number of the main record corresponding to the first sorting main record; k2 is a positive integer, N16 is a positive integer not less than N11;
wherein the N16 sorted expanded records include the N15 sorted expanded records after the k2 sorted entries are inserted and sorted expanded records other than the N15 sorted expanded records among the N11 sorted expanded records, or the N16 sorted expanded records are obtained by splitting sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted, or the N16 sorted expanded records are obtained by splitting and merging sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N16 sorted expanded records pointed to by the fourth sorted main record may be less than or equal to a fourth threshold N4, where the fourth threshold N4 is a positive integer, and N4 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the third example, in some embodiments of the present invention, when a fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the fourth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the fourth sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another example scenario corresponding to the third example, in another embodiment of the present invention, after the fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, and the fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a fourth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if k2 child objects are added under the first directory, acquiring and storing a fifth sorting master record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the fifth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the fifth sorting main record and the storage address of the fifth sorting main record; wherein the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record and the key of the first directory, or the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record;
wherein, the version number of the main record corresponding to the fifth sorting main record is different from the version number of the main record corresponding to the first sorting main record; the fifth sorted main record points to N17 sorted expanded records, each of the N17 sorted expanded records includes several sorted entries, the N17 sorted expanded records include sorted entries corresponding to sub-objects currently located under the first directory in a one-to-one manner, the N17 and the k2 are positive integers, the N17 sorted expanded records include k2 sorted entries corresponding to the k2 sub-objects, and each sorted entry includes a sub-object identifier and a sort key value of the sub-object corresponding to the first sort type.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N17 sorted expanded records pointed to by the fifth sorted main record may be less than or equal to a fifth threshold N5, where the fifth threshold N5 is a positive integer, and N4 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the fourth example, in some embodiments of the present invention, when a fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the fifth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the fifth sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the fifth sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, when the fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, and after the fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a fifth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if the k3 sub-objects under the first directory are modified according to the sorting key value of the first sorting type, obtaining the key of the first sorting master record based on the directory master record corresponding to the first directory;
obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k3 sequencing items corresponding to the k3 sub-objects in N18 sequencing extended records in the N11 sequencing extended records;
generating the k3 sorted entries corresponding to the k3 sub-objects based on the modified sort key value of the k3 sub-objects, and inserting the acquired and stored k3 sorted entries into N19 sorted expanded records based on the modified sort key value of the k3 sub-objects, wherein the N19 sorted expanded records are subsets of the N11 sorted expanded records;
acquiring and storing a sixth sequencing main record of the first directory corresponding to the first sequencing type, wherein the sixth sequencing main record points to N20 sequencing extended records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the sixth sorting main record in a directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the sixth sorting main record and the storage address of the sixth sorting main record; wherein the key of the sixth sorting master record includes a master record version number corresponding to the sixth sorting master record and the key of the first directory, or the key of the sixth sorting master record includes a master record version number corresponding to the sixth sorting master record;
wherein a major record version number corresponding to the sixth-ordered major record is different from a major record version number corresponding to the first-ordered major record, the k3 is a positive integer, and the N20 is a positive integer greater than or equal to the N11; wherein, the N20 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or, the N20 pieces of sequencing expanded records are obtained by splitting a sequencing expanded record, into which a sequencing item is inserted and/or deleted, among the N11 pieces of sequencing expanded records and a sequencing expanded record, into which a sequencing item is not inserted and/or deleted, among the N11 pieces of sequencing expanded records; or, the N20 sorted expanded records are obtained by splitting and merging the sorted expanded records into which the sorted items are inserted and/or deleted from the N11 sorted expanded records and the sorted expanded records into which the sorted items are not inserted and/or deleted from the N11 sorted expanded records.
In some embodiments of the present invention, deleting the k3 sorted entries corresponding to the k3 sub-objects in the N18 sorted expanded records of the N11 sorted expanded records may include: determining N18 sequencing expansion records to which k3 sequencing items corresponding to the k3 sub-objects belong based on the identification of the k3 sub-objects, wherein the N18 sequencing expansion records are subsets of the N11 sequencing expansion records; deleting the k3 sorted entries in the N18 sorted expanded records.
In some embodiments of the present invention, based on the identification of the k3 sub objects, N18 sorted expanded records to which k3 sorted items corresponding to the k3 sub objects belong are determined, where the N18 sorted expanded records are a subset of the N11 sorted expanded records; deleting the k3 sorted entries in the N18 sorted expanded records;
in some embodiments of the present invention, the number of the sorted entries contained in any one of the N20 sorted expanded records pointed to by the sixth sorted main record may be less than or equal to a sixth threshold N6, where the sixth threshold N6 is a positive integer, and N6 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the fifth example, in some embodiments of the present invention, when a sixth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the sixth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record recorded in a directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the sixth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the sixth sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the sixth sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in a scenario corresponding to the fifth example, in other embodiments of the present invention, after the sixth sorted master record corresponding to the first sort type in the first directory is obtained and stored, and the sixth sorted master record corresponding to the first sort type in the first directory is obtained and stored, the association relationship between the sort type identifier corresponding to the first sort type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sort master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a sixth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if the k3 sub-objects under the first directory are modified according to the sorting key value of the first sorting type, acquiring and storing a seventh sorting main record of the first directory according to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the seventh sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the seventh sorting main record and the storage address of the seventh sorting main record; wherein the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record and the key of the first directory, or the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record;
wherein, the version number of the main record corresponding to the seventh sorting main record is different from the version number of the main record corresponding to the first sorting main record; the seventh sorting main record points to N21 sorting expansion records, each sorting expansion record in the N21 sorting expansion records includes several sorting entries, the sorting entries included in the N21 sorting expansion records correspond to sub-objects currently located under the first directory in a one-to-one manner, the N21 and the k3 are positive integers, wherein each sorting entry includes a sub-object identifier and a sorting key value of the sub-object corresponding to the first sorting type, and the sorting entry corresponding to each sub-object in the k3 sub-objects included in the N21 sorting expansion records includes the sorting key value after the sub-object is modified.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N21 sorted expanded records pointed to by the seventh sorted main record may be less than or equal to a seventh threshold N7, where the seventh threshold N7 is a positive integer, and N7 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a sixth scenario, in some embodiments of the present invention, when a seventh sorted master record of the first directory corresponding to the first sort type is obtained and stored, after the seventh sorted master record of the first directory corresponding to the first sort type is obtained and stored, an association relationship between a sort type identifier corresponding to the first sort type and a master record version number corresponding to the first sort master record, which are recorded in a directory master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the seventh sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the seventh sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the seventh sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the seventh sorting main record), which are recorded in the directory main record corresponding to the first directory, by using the sorting type identifier corresponding The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in a scenario corresponding to the sixth example, in other embodiments of the present invention, after the seventh sorted main record corresponding to the first sort type in the first directory is obtained and stored, and the seventh sorted main record corresponding to the first sort type in the first directory is obtained and stored, the association relationship between the sort type identifier corresponding to the first sort type recorded in the directory main record corresponding to the first directory and the main record version number corresponding to the first sort main record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a seventh sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if k4 child objects under the first directory are deleted and k5 child objects under the first directory are added, obtaining the key of the first order master record based on the directory master record corresponding to the first directory;
obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; and obtaining the first sequencing main record based on the storage address of the first sequencing main record. Acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and deleting the k4 sorted items corresponding to the k4 child objects in the N22 sorted expanded records in the N11 sorted expanded records. Based on the sorting key value of the k5 sub-objects corresponding to the first sorting type, inserting k5 sorting entries corresponding to the k5 sub-objects into N23 sorting expansion records, wherein the N23 sorting expansion records are subsets of the N11 sorting expansion records.
Acquiring and storing an eighth sequencing main record of the first directory corresponding to the first sequencing type, wherein the eighth sequencing main record points to N24 sequencing extended records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the eighth sorting main record in a directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the eighth sorting main record and the storage address of the eighth sorting main record; the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record and a key of the first directory, or the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record.
Wherein, the version number of the main record corresponding to the eighth-order main record is different from the version number of the main record corresponding to the first-order main record; k4, k5 and N24 are positive integers; wherein, the N24 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or, the N24 pieces of sequencing expanded records are obtained by splitting a sequencing expanded record, into which a sequencing item is inserted and/or deleted, among the N11 pieces of sequencing expanded records and a sequencing expanded record, into which a sequencing item is not inserted and/or deleted, among the N11 pieces of sequencing expanded records; or, the N24 sorted expanded records are obtained by splitting and merging the sorted expanded records into which the sorted items are inserted and/or deleted from the N11 sorted expanded records and the sorted expanded records into which the sorted items are not inserted and/or deleted from the N11 sorted expanded records.
In some embodiments of the present invention, the deleting k4 ranking items corresponding to the k4 sub-objects in the N22 ranking expanded records of the N11 ranking expanded records may specifically include: determining N22 sequencing expansion records to which k4 sequencing items corresponding to the k4 sub-objects belong based on the identifier of the k4 sub-objects and/or the sequencing key value of the k4 sub-objects corresponding to the first sequencing type, where the N22 sequencing expansion records are a subset of the N11 sequencing expansion records; deleting the k1 sorted entries in the N22 sorted expanded records.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N24 sorted expanded records pointed to by the eighth sorted main record may be less than or equal to an eighth threshold N8, where the eighth threshold N8 is a positive integer, and N8 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In some embodiments of the present invention, in a scenario corresponding to the seventh example, when the eighth sorted master record corresponding to the first sort type in the first directory is obtained and stored, after the eighth sorted master record corresponding to the first sort type in the first directory is obtained and stored, an association relationship between a sort type identifier corresponding to the first sort type and a master record version number corresponding to the first sort master record recorded in the directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the eighth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the eighth sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which is recorded in the directory main record corresponding to the first directory, that is, replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the eighth sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the eighth sorting main record), which is recorded in the directory main record corresponding to the first directory The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, after acquiring and storing the eighth sorted master record corresponding to the first sort type in the first directory, and after acquiring and storing the eighth sorted master record corresponding to the first sort type in the first directory, the association relationship between the sort type identifier corresponding to the first sort type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sort master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, an eighth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method may further include:
if k4 sub-objects under the first directory are deleted and k5 sub-objects under the first directory are added, acquiring and storing a ninth-ordered main record of the first directory corresponding to the first ordering type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the ninth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the ninth sorting main record and the storage address of the ninth sorting main record; wherein the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record and a key of the first directory, or the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record;
wherein, the version number of the main record corresponding to the ninth-order main record is different from the version number of the main record corresponding to the first-order main record; the ninth ordering main record points to N25 ordering expansion records, each of the N25 ordering expansion records includes a plurality of ordering items, the ordering items included in the N25 ordering expansion records are in one-to-one correspondence with sub-objects currently located under the first directory, the N25, the k4, and the k5 are positive integers, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type, the N25 ordering expansion records include k5 ordering items corresponding to the k5 sub-objects, and the N25 ordering expansion records do not include k4 ordering items corresponding to the k4 sub-objects.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N25 sorted expanded records pointed to by the ninth sorted main record may be less than or equal to a ninth threshold N9, where the ninth threshold N9 is a positive integer, and N9 is, for example, equal to 1, 2, 5, 8, 10, 15, 20 or other values.
In an example scenario corresponding to the eighth embodiment of the present invention, when the ninth master record corresponding to the first directory is obtained and stored, after the ninth master record corresponding to the first directory is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record, which are recorded in the master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the ninth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the ninth sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which is recorded in the directory main record corresponding to the first directory, that is, replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the ninth sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the ninth sorting main record), which are recorded in the directory main record corresponding to the first directory The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, in an example of a scenario corresponding to the eighth embodiment, after the ninth-ranked main record corresponding to the first ranking type of the first directory is obtained and stored, and the ninth-ranked main record corresponding to the first ranking type of the first directory is obtained and stored, the association relationship between the ranking type identifier corresponding to the first ranking type recorded in the directory main record corresponding to the first directory and the main record version number corresponding to the first ranking main record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a ninth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For simplicity, the number of the sorted entries included in any one of the sorted extension records pointed by each sorted main record (e.g., the first sorted main record to the ninth sorted main record) in the embodiments of the present invention may be less than or equal to the first threshold n 1.
It can be understood that, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, if a sub-object located below the first directory changes, reference may be made to the above-mentioned first to eighth examples to describe a manner of acquiring and storing various new sorting master records corresponding to the second sorting type corresponding to the first directory, which is not described herein again.
In an embodiment of a method for ranking queries of the present invention, a method for ranking queries may comprise: receiving a sorting query instruction corresponding to a first directory, wherein the sorting query instruction carries a sorting type identifier; acquiring a master record version number having an association relationship with the sorting type identifier from a directory master record corresponding to the first directory, wherein the association relationship between the sorting type identifier and the master record version number is recorded in the directory master record corresponding to the first directory, and the master record version number is used for identifying the first sorting master record; obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; based on the N11 pieces of sequencing extended records, the meta information of part or all of the sub-objects currently located under the first directory is shown according to the first sequencing type indicated by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a sequencing item corresponding to a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
Referring to fig. 2, fig. 2 is a schematic flowchart of a query ranking method according to another embodiment of the present invention. As shown in fig. 2, a query ranking method according to another embodiment of the present invention may include the following steps:
201. and receiving a sorting query instruction corresponding to the first directory, wherein the sorting query instruction carries a sorting type identifier.
202. And obtaining a main record version number having an association relationship with the sorting type identifier from a directory main record corresponding to the first directory, wherein the directory main record corresponding to the first directory records the association relationship between the sorting type identifier and the main record version number, and the main record version number is used for identifying the first sorting main record.
203. Obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; based on the N11 pieces of sequencing extended records, the meta information of part or all of the sub-objects currently located under the first directory is shown according to the first sequencing type indicated by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a sequencing item corresponding to a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
In some embodiments of the present invention, the above-mentioned ordering query instruction may also carry sub-object constraint range information; wherein, the displaying the meta information of part or all of the sub-objects currently located under the first directory according to the first sorting type indicated by the sorting type identifier based on the N11 sorting expansion records may include: and displaying the meta-information of the sub-object currently positioned under the first directory and belonging to the range restricted by the sub-object restricted range information according to the first sorting type represented by the sorting type identifier based on the N11 sorting expansion records.
The sub-object constraint range information may include the number of sub-objects and/or the range information of the sorting key values of the first sorting type corresponding to the sub-objects. For example, if the sub-object constraint range information includes the number of sub-objects, the displaying the meta-information of part or all of the sub-objects currently located under the first directory according to the first sorting type indicated by the sorting type identifier based on the N11 sorting extension records may include: and displaying the meta-information of the sub-objects which are currently positioned under the first directory and are less than or equal to the number of the sub-objects according to the first sorting type represented by the sorting type identifier on the basis of the N11 sorting expansion records. For another example, if the sub-object constraint range information includes sorting key value range information, the displaying, according to the first sorting type indicated by the sorting type identifier, meta-information of part or all of the sub-objects currently located under the first directory based on the N11 sorting extension records may include: and displaying the meta-information of the sub-object which is currently positioned under the first directory and of which the sorting key value corresponding to the first sorting type belongs to the value range constrained by the sorting key value range information according to the first sorting type represented by the sorting type identifier on the basis of the N11 sorting expansion records.
The sort types (e.g., first sort type, second sort type, third sort type, etc.) of embodiments of the present invention may be sorted by time (e.g., sorted by creation time or sorted by modification time, etc.), sorted by size, sorted by name, or other sort types.
The sorting key value of the sub-object corresponding to a certain sorting type is key information related to sorting that needs to be used when sorting is performed according to the certain sorting type, and the sorting key value of the sub-object corresponding to the certain sorting type (for example, the first sorting type, the second sorting type, the third sorting type, and the like) may be creation time of the sub-object, latest modification time of the sub-object, content data size of the sub-object, or name of the sub-object. For example, if the sort type is sorted by creation time, the sort key value of the sub-object corresponding to the sort type may be the creation time of the sub-object. If the sort type is sorted according to the modification time, the sort key value of the sub-object corresponding to the sort type can be the latest modification time of the sub-object. If the sort type is sort by size, the sort key value of the sub-object corresponding to the sort type may be the size of the content data volume of the sub-object. If the sort type is sort by name, the sort key value of the sub-object corresponding to the sort type may be the name of the sub-object. Other scenarios are analogized.
In some embodiments of the present invention, the meta-information of the sub-object may include an identifier of the sub-object (the identifier of the sub-object and the name of the sub-object may be the same or different), and/or a sort key value of the sub-object corresponding to a certain sort type.
It can be seen that, in the scheme of this embodiment, after receiving a sorting query instruction carrying a sorting type identifier corresponding to a first directory; acquiring a main record version number having an association relation with the sorting type identifier from a directory main record corresponding to the first directory; obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and based on the N11 pieces of sorting expansion records, displaying the meta-information of part or all of the sub-objects currently positioned under the first directory according to the first sorting type indicated by the sorting type identifier. Because the directory master record corresponding to the first directory records the association relationship between the sorting type identifier and the master record version number for identifying the first sorting master record, it is equivalent to providing an entry for implementing an external consistency query function, and during sorting query, the directory master record corresponding to the first directory can obtain the master record version number associated with the sorting type identifier corresponding to a certain sorting type, and further can obtain the corresponding sorting master record based on the master record version number, and further can obtain a plurality of sorting extended records pointed by the sorting master record, and further can show the meta information of part or all of the sub-objects currently located under the first directory according to the certain sorting type based on the sorting items contained in the plurality of sorting extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
In order to better understand the above solution of the embodiments of the present invention, the following describes some recorded structures related to the embodiments of the present invention by way of example with reference to the accompanying drawings.
Referring to fig. 3-a, fig. 3-a illustrates a structure of a directory master record, which may include a directory master record header field and a number of index fields for recording directory extension record indexes. Of course the directory master record may also include other fields not shown in fig. 3-a. Each directory may correspond to a directory master record.
Fig. 3-b and 3-c illustrate the specific structure of the fields of two directory master records by way of example.
The directory master record header field of the directory master record illustrated in fig. 3-b may include an ordering description field and an identification derivative field. The variable Maxid which can be automatically added or subtracted is recorded in the identification derived field, after the directory extension record is newly generated, the current value of the variable Maxid is used as the identification of the newly generated directory extension record, the identification of the newly generated directory extension record is derived by the variable Maxid which can be automatically added or subtracted by a set value (for example, the variable Maxid which can be automatically added or subtracted by 1), and the identification of all the directory extension records is different. The sort description field may include a field for recording the total number of the current sort types (where the value of the field may vary with the total number of the currently used sort types), and several associated record fields for recording the association relationship between the sort type identifier and the main record version number (for example, an associated record field may be used to record the association relationship between the sort type identifier of the first sort type and the main record version number of the first sort main record in the above embodiment). Of course, the sort description field may not include a field for recording the total number of current sort types. Wherein the directory owner record header field of a directory owner record illustrated by way of example in fig. 3-c does not include an identification derivative field.
The index field for recording the index of the directory extension record in the directory master record illustrated in fig. 3-b and 3-c may be specifically recorded: directory extension record ID, the number of directory entries contained in the directory extension record, and the prefix boundary of directory entries contained in the directory extension record. Of course, other information (e.g., the storage address of the directory extension record, etc.) that can point to the directory extension record may also be recorded in the index field of the directory main record for recording the index of the directory extension record.
The relationship between the directory main record, the directory extension record index and the directory extension record can be shown in fig. 3-d as an example. Each index field for recording the index of the directory extension record in the directory main record is used for pointing to one directory extension record, the directory main record can point to a plurality of directory extension records, each directory extension record can comprise a plurality of directory entries, and the directory entries are in one-to-one correspondence with sub-objects (the sub-objects comprise files and/or sub-directories) below the directory corresponding to the directory main record.
If the sub-object corresponding to a directory entry in a directory extension record is a file, meta information of the file and the like can be recorded in the directory entry. If the sub-object corresponding to a directory entry in a directory extension record is a sub-directory, the directory entry may record meta-information of the sub-directory and a directory owner record index for pointing to a directory owner record corresponding to the sub-directory.
Fig. 3-e-3-g illustrate the structure of several directory extension records. The directory extension record shown in fig. 3-e includes both directory entries corresponding to subdirectories and directory entries corresponding to files. The directory extension record shown in fig. 3-f includes directory entries corresponding to subdirectories, but does not include directory entries corresponding to files. The directory extension record shown in fig. 3-g does not include directory entries corresponding to subdirectories, but includes directory entries corresponding to files.
Fig. 3-e-3-g illustrate that several directory extension records do not contain a header field. And the directory extension record illustrated in fig. 3-h contains a header field, wherein the header field of the directory extension record may record one or more of the following information: a directory main record ID pointing to the directory extension record, a directory extension record ID corresponding to the directory extension record, the number of directory entries contained in the directory extension record, a prefix boundary of directory entries contained in the directory extension record, and the like.
Fig. 3-i and 3-j illustrate two structures of the sorted main records, in which each index field for recording the index of the sorted extended record in the sorted main record is used to point to one sorted extended record, the sorted main record may point to several sorted extended records, each sorted extended record may include several sorted items, and the several sorted items are in one-to-one correspondence with several sub-objects (sub-objects include files and/or sub-directories) below the directory to which the sorted main record corresponds. Wherein the sorted primary record illustrated in fig. 3-i does not contain a header field and the directory extension record illustrated in fig. 3-j contains a header field.
Fig. 3-k illustrates that any index field for recording the index of the sorted extended record in the sorted main record is specifically recordable: the index of the index. Of course, the index field for recording the index of the sorting extended record in the sorting main record may not record the information shown in fig. 3-k, but may record other information (e.g., the storage address of the sorting extended record, etc.) capable of pointing to the sorting extended record.
At least one of the following information can be recorded in the header field in the sorted main recording: the directory key of the directory corresponding to the sorting main record, the sorting type identifier of the sorting type corresponding to the sorting main record, the main record version number of the sorting main record and the identifier derivative field. After the sequencing extended records are newly generated, the current value of the variable Maxid-2 is used as the identifier of the newly generated sequencing extended records, the identifier of the newly generated sequencing extended records is derived by using the variable Maxid-a which can be automatically increased or decreased to obtain the identifier of the newly generated sequencing extended records, and the global uniqueness is favorably realized on the identifier of each sequencing extended record.
The key of the sorted master record and the mapping relationship of the storage address of the sorted master record may be recorded by the first type of mapping relationship record shown in fig. 3-l, fig. 3-m, or fig. 3-n, wherein the key of the sorted master record may include the master record version number of the sorted master record. Alternatively, the key for sorting the main record may include the version number of the main record of the sorting main record and the key (such as directory identifier) of the directory corresponding to the sorting main record. Alternatively, the key for sorting the main record may include the corresponding sorting type identifier of the sorting main record, the version number of the main record of the sorting main record, and the key (e.g., directory identifier, etc.) of the directory corresponding to the sorting main record. The key for sorting the master record may also include other information. The first type of mapping relation record is stored in the key value data, so that the storage address of the sequencing main record is obtained based on the key of the sequencing main record, and the sequencing main record is obtained based on the storage address of the sequencing main record.
The mapping relationship between the key of the sorting extended record and the storage address of the sorting extended record may be recorded by the second mapping relation record shown in fig. 3-o, fig. 3-p, fig. 3-q, or fig. 3-r, wherein the key of the sorting extended record may include the ID of the sorting extended record. Alternatively, the key of the sorting extended record may include the ID of the sorting extended record and the key (such as directory identifier) of the directory corresponding to the sorting extended record. Or the key of the sorting extended record may include a sorting type identifier of the sorting type corresponding to the sorting extended record, an ID of the sorting extended record, and a key (e.g., a directory identifier) of the directory corresponding to the sorting extended record. Or the key of the sorting extended record may include a sorting type identifier of the sorting type corresponding to the sorting extended record, an ID of the sorting extended record, and a primary record version number of the sorting primary record pointing to the sorting extended record. The key for sorting the extended records may also include other information. The second type of mapping relation record can be stored in the key value data, so that the storage address of the sequencing extended record can be obtained based on the key of the sequencing extended record, and the sequencing extended record can be obtained based on the storage address of the sequencing extended record.
Fig. 3-s and 3-t illustrate the structure of two sort extended records, wherein the sort main record may include several sort entries, and several sort entries are in one-to-one correspondence with several child objects under the directory corresponding to the sort main record pointing to the sort extended record. The sorting item shown in fig. 3-s may include a sub-object identifier of the sub-object corresponding to the sorting item and a sorting key value of the sub-object (the sorting key value is a sorting key value corresponding to the sorting type corresponding to the sorting extension record, and the sorting key value may be creation time of the sub-object, latest modification time of the sub-object, content size of the sub-object, name of the sub-object, or the like). The sort entry shown in fig. 3-t may include the sub-object identifier of the sub-object corresponding to the sort entry, the sort key value of the sub-object, and the sort type identifier of the sort type corresponding to the sort extension record to which the sort entry belongs.
Fig. 3-u illustrates another structure of the sorted extension record, and the sorted extension record shown in fig. 3-u further includes a sorted extension record header field, wherein the sorted extension record header field may record a primary record version number of the sorted primary record that identifies and/or points to the sorted extension record.
The relationship among the sorted main record, the sorted extended record index, and the sorted extended record may be as shown in fig. 3-v for example. The index field in the sorted master record for recording the index of the sorted extended records is used to point to one sorted extended record, and the sorted master record may point to several directory extended records.
3-w, 3-x, and 3-y illustrate several version evolution approaches to sorting the primary records.
Fig. 3-w show that the sorting master record of version 1 points to n sorting extended records, and if the sorting master record points to the n sorting extended records and is evolved to point to n +1 sorting extended records, the sorting master record of version 2 is obtained, and the sorting master record of version 2 points to one sorting extended record more than the sorting master record corresponding to version 1 (i.e., sorting extended record n + 1).
Fig. 3-x shows that the sorting master record corresponding to version 1 points to n sorting extended records, and if the sorting master record points to the n sorting extended records and is evolved to point to n-1 sorting extended records, the sorting master record corresponding to version 3 is obtained, and the sorting master record of version 3 points to one sorting extended record (i.e., sorting extended record n) less than the sorting master record of version 1.
Fig. 3-y shows that the sorting master record corresponding to the version 1 points to n sorting extended records, and if the sorting extended record 1 in the n sorting extended records to which the sorting master record points is replaced with a sorting extended record n +1, a sorting master record of the version 4 is obtained, where the sorting extended records to which the sorting master record of the version 4 points and the sorting extended record of the sorting master record of the version 1 point have the same number, but one sorting extended record is different.
It is understood that the version of the sorted master record changes when the sorted extension record pointed to by the sorted master record changes. The incidence relation between the version number of the main record of the new version of the sequencing main record and the sequencing type identifier corresponding to the sequencing type is recorded in the directory main record, so that the version number of the main record of the new version of the sequencing main record can be obtained based on the directory main record, and the pointed sequencing extended record of the new version of the sequencing main record can be obtained.
The structures of the various records shown in fig. 3-a to 3-y are only examples, and can be specifically adjusted according to needs in practical application. The various record structures shown in fig. 3-a through 3-y may be applied, in part or in whole, to aspects of various embodiments of the present invention.
In order to better understand the above solution of the embodiments of the present invention, the following further illustrates some specific application scenarios.
Referring to fig. 4-a, fig. 4-a is a schematic diagram of a service system according to another embodiment of the present invention. The technical solutions of the embodiments corresponding to fig. 4-b, fig. 5, fig. 6, and fig. 7 can be implemented based on the service system of the architecture shown in fig. 4-a, and certainly can also be implemented based on the modified architecture.
Referring to fig. 4-b, fig. 4-b is a schematic flow chart illustrating a processing method for sorting records according to another embodiment of the present invention. As shown in fig. 4-b, a processing method for sorting records according to another embodiment of the present invention may include the following steps:
401. after the first directory is created, the primary index server generates a directory primary record corresponding to the first directory, and the primary index server stores the directory primary record corresponding to the first directory in the key-value database. The key of the directory primary record may include a directory identification of the first directory, etc.
402. The sorting server generates a first sorting master record of a first sorting type corresponding to the first directory.
The sorting server stores the first sorting master record in a key-value store. The key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record.
In some embodiments of the present invention, the directory master record corresponding to the first directory may record therein a plurality of information related to the first directory. The key of the directory master record corresponding to the first directory may include an identifier of the first directory, and the like.
403. And the sorting server indicates a main index server to record the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory.
The primary index server may obtain the directory primary record corresponding to the first directory from the key value database through a key (an identifier of the first directory, etc.) of the directory primary record corresponding to the first directory. Of course, after the primary index server records the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record in the directory primary record corresponding to the first directory, the modified directory primary record corresponding to the first directory (i.e., the directory primary record corresponding to the first directory after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record) may be stored in the key value database.
404. The sorting server records the mapping relation between the key of the first sorting main record and the storage address of the first sorting main record in the key value database.
Wherein, the first ordering main record points to N11 ordering extended records, and each of the N11 ordering extended records contains several ordering items. The N11 pieces of sorting expansion records include sorting entries corresponding to the sub-objects currently located in the first directory, the sub-objects in the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting entry includes a sub-object identifier and a sorting key value corresponding to the sub-object in the first sorting type.
In some embodiments of the present invention, the first sorted master record may point to the N11 sorted extended records by recording extended record identifiers of the N11 sorted extended records in the first sorted master record, or the first sorted master record may point to the N11 sorted extended records by recording storage addresses of the N11 sorted extended records in the first sorted master record. Of course, the first sorted master record may point to the N11 sorted extension records in other ways. Since the first-order main record points to N11 order extension records, the N11 order extension records can be acquired based on the first-order main record. The N11 sorted extension records pointed to by the first sorted primary record may also be stored in the key-value store.
The sort types (e.g., the first sort type, the second sort type, the third sort type, etc.) of the embodiments of the present invention may be sorted by time (e.g., sorted by creation time or sorted by modification time, etc.), sorted by size, sorted by name, or other sort types.
The sorting key value of the sub-object corresponding to a certain sorting type is key information related to sorting that needs to be used when sorting is performed according to the certain sorting type, and the sorting key value of the sub-object corresponding to the certain sorting type (for example, the first sorting type, the second sorting type, the third sorting type, and the like) may be creation time of the sub-object, latest modification time of the sub-object, content data size of the sub-object, or name of the sub-object. For example, if the sort type is sorted by creation time, the sort key value of the sub-object corresponding to the sort type may be the creation time of the sub-object. If the sort type is sorted according to the modification time, the sort key value of the sub-object corresponding to the sort type can be the latest modification time of the sub-object. If the sort type is sort by size, the sort key value of the sub-object corresponding to the sort type may be the size of the content data volume of the sub-object. If the sort type is sort by name, the sort key value of the sub-object corresponding to the sort type may be the name of the sub-object. Other scenarios are analogized.
In some embodiments of the present invention, the number of the sorting entries included in any one of the N11 sorting expansion records pointed to by the first sorting master record may be less than or equal to a first threshold N1, where the first threshold N1 is a positive integer, and N1 may be, for example, 1, 2, 5, 8, 10, 15, 20, or other values.
Further, for a scene with a multi-dimensional sorting requirement, the sorting server may further obtain and store a tenth sorting master record of the second sorting type corresponding to the first directory; the sorting server executes the association relationship between the sorting type identifier corresponding to the second sorting type and the main record version number corresponding to the tenth sorting main record recorded by the main index server in the directory main record corresponding to the first directory; the sorting server records the mapping relation between the key value key of the tenth sorting main record and the storage address of the tenth sorting main record in a key value database; wherein the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record and a key of the first directory, or the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record; the tenth ordering main record points to N41 ordering extended records, wherein each of the N41 ordering extended records includes a plurality of ordering entries, and the N41 ordering extended records include ordering entries corresponding to sub-objects currently located under the first directory, wherein N41 is a positive integer, and each of the ordering entries includes a sub-object identifier and an ordering key value of the sub-object corresponding to the second ordering type.
Wherein the second sorting type is different from the first sorting type, and the tenth sorting master record is different from the first sorting master record. It is understood that the above-mentioned scenarios of acquiring and storing the first directory corresponding to the sorted main records of other sort types and so on are not illustrated here.
405. If the k1 child objects located under the first directory are deleted, the primary index server obtains the directory primary record corresponding to the first directory from the key-value database based on the key of the directory primary record corresponding to the first directory; and obtaining the key of the first sequencing master record based on the catalog master record corresponding to the first catalog, and sending the key of the first sequencing master record to the sequencing server.
Since the k1 sub-objects under the first directory are deleted, the main index server may further modify the directory main record corresponding to the first directory, so that the directory extension record pointed by the directory main record matches with the sub-objects currently under the first directory.
406. The sorting server obtains the storage address of the first sorting main record through the key of the first sorting main record based on the mapping relation between the key of the first sorting main record and the storage address of the first sorting main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and deleting k1 sequencing items corresponding to the k1 sub-objects contained in N12 sequencing expansion records in the N11 sequencing expansion records.
407. And the sorting server acquires and stores a second sorting main record of the first directory corresponding to the first sorting type in a key value database. And recording the mapping relation between the key value key of the second sorting main record and the storage address of the second sorting main record in the key value database.
408. The sorting server instructs the main index server to record the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the second sorting main record in the directory main record corresponding to the first directory.
The key of the second sorting main record includes a main record version number corresponding to the second sorting main record and the key of the first directory, or the key of the second sorting main record includes a main record version number corresponding to the second sorting main record. Wherein the second-ordered main record points to N13 ordered extended records, and a main record version number corresponding to the second-ordered main record is different from a main record version number corresponding to the first-ordered main record.
Wherein the N13 sorted expanded records include the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records other than the N12 sorted expanded records from among the N11 sorted expanded records, or the N13 sorted expanded records are obtained by merging the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records from among the N11 sorted expanded records other than the N12 sorted expanded records, the N13 is less than or equal to the N11, and the k1 is a positive integer.
In embodiments of the present invention, when the sum of the numbers of the sorted entries contained in the several sorted expanded records adjacent to the right boundary is less than or equal to the first threshold n1, the several sorted expanded records may be merged into one sorted expanded record. When the number of the sorting items contained in a certain sorting expansion record is greater than the first threshold n1, the certain sorting expansion record can be split into several sorting expansion records, and the number of the sorting items contained in each of the several splitting sorting expansion records is less than or equal to the first threshold n 1.
In some embodiments of the present invention, the deleting k1 sorted entries corresponding to the k1 sub-objects included in N12 sorted expanded records of the N11 sorted expanded records may include: determining N12 sequencing expansion records to which k1 sequencing items corresponding to the k1 sub-objects belong based on the identifier of the k1 sub-objects and/or the sequencing key value of the k1 sub-objects corresponding to the first sequencing type, where the N12 sequencing expansion records are a subset of the N11 sequencing expansion records; deleting the k1 sorted entries in the N12 sorted expanded records.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N13 sorted expanded records pointed to by the second sorted master record may be less than or equal to the first threshold N1.
In some embodiments of the present invention, after the sorting server obtains and stores the second sorting master record corresponding to the first sorting type in the first directory, the master index server may delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, where the association is recorded in the directory master record corresponding to the first directory. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the second sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replacing the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, replacing the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the second sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record in the directory main record corresponding to the first directory The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in other embodiments of the present invention, after the sorting server obtains and stores the second sorting master record corresponding to the first sorting type in the first directory, the master index server may not delete the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a second sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
It can be seen that, in the embodiment, after the sub-object located below the first directory changes, the sorting server obtains and stores a new version of the sorting master record corresponding to the first sorting type from the first directory; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the new version sorting main record in the directory main record corresponding to the first directory; and storing the mapping relationship between the key of the first ordering main record and the storage address of the new version ordering main record, which is equivalent to providing an entry for realizing an external consistency query function, and subsequently, when in ordering query, obtaining a main record version number associated with an ordering type identifier corresponding to a certain ordering type through the directory main record corresponding to the first directory, further obtaining a corresponding ordering main record based on the main record version number, further obtaining a plurality of ordering extended records pointed by the ordering main record, further displaying the meta information of part or all of the sub-objects currently positioned under the first directory according to the certain ordering type based on the ordering items contained in the ordering extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved. Thereby being beneficial to improving the reliability of sequencing inquiry.
Referring to fig. 5, fig. 5 is a flowchart illustrating a processing method for sorting records according to another embodiment of the present invention. As shown in fig. 5, a processing method for sorting records according to another embodiment of the present invention may include the following steps:
501. after the first directory is created, the primary index server generates a directory primary record corresponding to the first directory, and the primary index server stores the directory primary record corresponding to the first directory in the key-value database. The key of the directory primary record may include a directory identification of the first directory, etc.
502. The sorting server generates a first sorting master record of a first sorting type corresponding to the first directory.
The sorting server stores the first sorting master record in a key-value store. The key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record.
In some embodiments of the present invention, the directory master record corresponding to the first directory may record therein a plurality of information related to the first directory. The key of the directory master record corresponding to the first directory may include an identifier of the first directory, and the like.
503. And the sorting server indicates a main index server to record the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory.
The primary index server may obtain the directory primary record corresponding to the first directory from the key value database through a key (an identifier of the first directory, etc.) of the directory primary record corresponding to the first directory. Of course, after the primary index server records the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record in the directory primary record corresponding to the first directory, the modified directory primary record corresponding to the first directory (i.e., the directory primary record corresponding to the first directory after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record) may be stored in the key value database.
504. The sorting server records the mapping relation between the key of the first sorting main record and the storage address of the first sorting main record in the key value database.
Wherein, the first ordering main record points to N11 ordering extended records, and each of the N11 ordering extended records contains several ordering items. The N11 pieces of sorting expansion records include sorting entries corresponding to the sub-objects currently located in the first directory, the sub-objects in the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting entry includes a sub-object identifier and a sorting key value corresponding to the sub-object in the first sorting type.
In some embodiments of the present invention, the first sorted master record may point to the N11 sorted extended records by recording extended record identifiers of the N11 sorted extended records in the first sorted master record, or the first sorted master record may point to the N11 sorted extended records by recording storage addresses of the N11 sorted extended records in the first sorted master record. Of course, the first sorted master record may point to the N11 sorted extension records in other ways. Since the first-order main record points to N11 order extension records, the N11 order extension records can be acquired based on the first-order main record. The N11 sorted extension records pointed to by the first sorted primary record may also be stored in the key-value store.
The sort types (e.g., the first sort type, the second sort type, the third sort type, etc.) of the embodiments of the present invention may be sorted by time (e.g., sorted by creation time or sorted by modification time, etc.), sorted by size, sorted by name, or other sort types.
The sorting key value of the sub-object corresponding to a certain sorting type is key information related to sorting that needs to be used when sorting is performed according to the certain sorting type, and the sorting key value of the sub-object corresponding to the certain sorting type (for example, the first sorting type, the second sorting type, the third sorting type, and the like) may be creation time of the sub-object, latest modification time of the sub-object, content data size of the sub-object, or name of the sub-object. For example, if the sort type is sorted by creation time, the sort key value of the sub-object corresponding to the sort type may be the creation time of the sub-object. If the sort type is sorted according to the modification time, the sort key value of the sub-object corresponding to the sort type can be the latest modification time of the sub-object. If the sort type is sort by size, the sort key value of the sub-object corresponding to the sort type may be the size of the content data volume of the sub-object. If the sort type is sort by name, the sort key value of the sub-object corresponding to the sort type may be the name of the sub-object. Other scenarios are analogized.
In some embodiments of the present invention, the number of the sorting entries included in any one of the N11 sorting expansion records pointed to by the first sorting master record may be less than or equal to a first threshold N1, where the first threshold N1 is a positive integer, and N1 may be, for example, 1, 2, 5, 8, 10, 15, 20, or other values.
505. If the k1 sub-objects under the first directory are deleted, the sorting server obtains and stores a third sorting master record corresponding to the first sorting type in the first directory.
Since the k1 sub-objects under the first directory are deleted, the main index server may further modify the directory main record corresponding to the first directory, so that the directory extension record pointed by the directory main record matches with the sub-objects currently under the first directory.
506. The sorting server records the mapping relation between the key value key of the third sorting main record and the storage address of the third sorting main record; the key of the third sorting master record includes a master record version number corresponding to the third sorting master record and a key of the first directory, or the key of the third sorting master record includes a master record version number corresponding to the third sorting master record. Wherein a version number of a primary record corresponding to the third-ordered primary record is different from a version number of a primary record corresponding to the first-ordered primary record.
507. The sorting server instructs the main index server to record the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the third sorting main record in the directory main record corresponding to the first directory.
The third sorted main record points to N14 sorted expanded records, each of the N14 sorted expanded records includes several sort entries, the N14 sorted expanded records include sort entries corresponding to sub-objects currently located in the first directory, the N14 and the k1 are positive integers, the N14 sorted expanded records do not include k1 sorted entries corresponding to the k1 sub-objects, and each sort entry includes a sub-object identifier and a sort key value corresponding to the sub-object in the first sort type.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N13 sorted expanded records pointed to by the third sorted main record may be less than or equal to the first threshold N1.
In some embodiments of the present invention, after the sorting server obtains and stores the third sorting master record corresponding to the first sorting type in the first directory, the master index server may delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, where the association is recorded in the directory master record corresponding to the first directory. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the third sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the third sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in other embodiments of the present invention, after the sorting server obtains and stores the third sorting master record corresponding to the first sorting type in the first directory, the master index server may not delete the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a third sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
It can be seen that, in the embodiment, after the sub-object located below the first directory changes, the sorting server obtains and stores a new version of the sorting master record corresponding to the first sorting type from the first directory; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the new version sorting main record in the directory main record corresponding to the first directory; and storing the mapping relationship between the key of the first ordering main record and the storage address of the new version ordering main record, which is equivalent to providing an entry for realizing an external consistency query function, and subsequently, when in ordering query, obtaining a main record version number associated with an ordering type identifier corresponding to a certain ordering type through the directory main record corresponding to the first directory, further obtaining a corresponding ordering main record based on the main record version number, further obtaining a plurality of ordering extended records pointed by the ordering main record, further displaying the meta information of part or all of the sub-objects currently positioned under the first directory according to the certain ordering type based on the ordering items contained in the ordering extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved. Thereby being beneficial to improving the reliability of sequencing inquiry.
Referring to fig. 6, fig. 6 is a flowchart illustrating a processing method for sorting records according to another embodiment of the present invention. As shown in fig. 6, a processing method for sorting records according to another embodiment of the present invention may include the following steps:
601. after the first directory is created, the primary index server generates a directory primary record corresponding to the first directory, and the primary index server stores the directory primary record corresponding to the first directory in the key-value database. The key of the directory primary record may include a directory identification of the first directory, etc.
602. The sorting server generates a first sorting master record of a first sorting type corresponding to the first directory.
The sorting server stores the first sorting master record in a key-value store. The key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record.
In some embodiments of the present invention, the directory master record corresponding to the first directory may record therein a plurality of information related to the first directory. The key of the directory master record corresponding to the first directory may include an identifier of the first directory, and the like.
603. And the sorting server indicates a main index server to record the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory.
The primary index server may obtain the directory primary record corresponding to the first directory from the key value database through a key (an identifier of the first directory, etc.) of the directory primary record corresponding to the first directory. Of course, after the primary index server records the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record in the directory primary record corresponding to the first directory, the modified directory primary record corresponding to the first directory (i.e., the directory primary record corresponding to the first directory after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record) may be stored in the key value database.
604. The sorting server records the mapping relation between the key of the first sorting main record and the storage address of the first sorting main record in the key value database.
Wherein, the first ordering main record points to N11 ordering extended records, and each of the N11 ordering extended records contains several ordering items. The N11 pieces of sorting expansion records include sorting entries corresponding to the sub-objects currently located in the first directory, the sub-objects in the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting entry includes a sub-object identifier and a sorting key value corresponding to the sub-object in the first sorting type.
In some embodiments of the present invention, the first sorted master record may point to the N11 sorted extended records by recording extended record identifiers of the N11 sorted extended records in the first sorted master record, or the first sorted master record may point to the N11 sorted extended records by recording storage addresses of the N11 sorted extended records in the first sorted master record. Of course, the first sorted master record may point to the N11 sorted extension records in other ways. Since the first-order main record points to N11 order extension records, the N11 order extension records can be acquired based on the first-order main record. The N11 sorted extension records pointed to by the first sorted primary record may also be stored in the key-value store.
The sort types (e.g., the first sort type, the second sort type, the third sort type, etc.) of the embodiments of the present invention may be sorted by time (e.g., sorted by creation time or sorted by modification time, etc.), sorted by size, sorted by name, or other sort types.
The sorting key value of the sub-object corresponding to a certain sorting type is key information related to sorting that needs to be used when sorting is performed according to the certain sorting type, and the sorting key value of the sub-object corresponding to the certain sorting type (for example, the first sorting type, the second sorting type, the third sorting type, and the like) may be creation time of the sub-object, latest modification time of the sub-object, content data size of the sub-object, or name of the sub-object. For example, if the sort type is sorted by creation time, the sort key value of the sub-object corresponding to the sort type may be the creation time of the sub-object. If the sort type is sorted according to the modification time, the sort key value of the sub-object corresponding to the sort type can be the latest modification time of the sub-object. If the sort type is sort by size, the sort key value of the sub-object corresponding to the sort type may be the size of the content data volume of the sub-object. If the sort type is sort by name, the sort key value of the sub-object corresponding to the sort type may be the name of the sub-object. Other scenarios are analogized.
In some embodiments of the present invention, the number of the sorting entries included in any one of the N11 sorting expansion records pointed to by the first sorting master record may be less than or equal to a first threshold N1, where the first threshold N1 is a positive integer, and N1 may be, for example, 1, 2, 5, 8, 10, 15, 20, or other values.
Further, for a scene with a multi-dimensional sorting requirement, the sorting server may further obtain and store a tenth sorting master record of the second sorting type corresponding to the first directory; the sorting server executes the association relationship between the sorting type identifier corresponding to the second sorting type and the main record version number corresponding to the tenth sorting main record recorded by the main index server in the directory main record corresponding to the first directory; the sorting server records the mapping relation between the key value key of the tenth sorting main record and the storage address of the tenth sorting main record in a key value database; wherein the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record and a key of the first directory, or the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record; the tenth ordering main record points to N41 ordering extended records, wherein each of the N41 ordering extended records includes a plurality of ordering entries, and the N41 ordering extended records include ordering entries corresponding to sub-objects currently located under the first directory, wherein N41 is a positive integer, and each of the ordering entries includes a sub-object identifier and an ordering key value of the sub-object corresponding to the second ordering type.
Wherein the second sorting type is different from the first sorting type, and the tenth sorting master record is different from the first sorting master record. It is understood that the above-mentioned scenarios of acquiring and storing the first directory corresponding to the sorted main records of other sort types and so on are not illustrated here.
605. If k2 child objects are added under the first directory, the primary index server obtains the primary directory record corresponding to the first directory from the key value database based on the key of the primary directory record corresponding to the first directory; and obtaining the key of the first sequencing master record based on the catalog master record corresponding to the first catalog, and sending the key of the first sequencing master record to the sequencing server.
Since k2 sub-objects are added under the first directory, the primary index server may further modify the directory primary record corresponding to the first directory, so that the directory extension record pointed by the directory primary record matches with the sub-object currently under the first directory.
606. The sorting server obtains the key of the first sorting master record based on the directory master record corresponding to the first directory, and obtains the storage address of the first sorting master record through the key of the first sorting master record based on the mapping relation between the key of the first sorting master record and the storage address of the first sorting master record; obtaining the first sorting main record based on the storage address of the first sorting main record; the N11 sorted expanded records pointed to by the first sorted master record are obtained based on the first sorted master record.
607. The sorting server inserts k2 sorting entries corresponding to the k2 sub-objects into N15 sorting expansion records in the N11 sorting expansion records based on the sorting key value of the k2 sub-objects corresponding to the first sorting type. The sorting server records the mapping relationship between the key value key of the fourth sorting main record and the storage address of the fourth sorting main record.
608. The sorting server acquires and stores a fourth sorting main record of the first directory corresponding to the first sorting type, wherein the fourth sorting main record points to N16 sorting expanded records; the sorting server instructs the main index server to record the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the fourth sorting main record in the directory main record corresponding to the first directory.
Wherein the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record and the key of the first directory, or the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record; wherein, the version number of the main record corresponding to the fourth sorting main record is different from the version number of the main record corresponding to the first sorting main record; k2 is a positive integer, N16 is a positive integer not less than N11;
wherein the N16 sorted expanded records include the N15 sorted expanded records after the k2 sorted entries are inserted and sorted expanded records other than the N15 sorted expanded records among the N11 sorted expanded records, or the N16 sorted expanded records are obtained by splitting sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted, or the N16 sorted expanded records are obtained by splitting and merging sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted.
It can be seen that, in the embodiment, after the sub-object located below the first directory changes, the sorting server obtains and stores a new version of the sorting master record corresponding to the first sorting type from the first directory; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the new version sorting main record in the directory main record corresponding to the first directory; and storing the mapping relationship between the key of the first ordering main record and the storage address of the new version ordering main record, which is equivalent to providing an entry for realizing an external consistency query function, and subsequently, when in ordering query, obtaining a main record version number associated with an ordering type identifier corresponding to a certain ordering type through the directory main record corresponding to the first directory, further obtaining a corresponding ordering main record based on the main record version number, further obtaining a plurality of ordering extended records pointed by the ordering main record, further displaying the meta information of part or all of the sub-objects currently positioned under the first directory according to the certain ordering type based on the ordering items contained in the ordering extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved. Thereby being beneficial to improving the reliability of sequencing inquiry.
Referring to fig. 7, fig. 7 is a flowchart illustrating a query ranking method according to another embodiment of the present invention. As shown in fig. 7, a query ranking method according to another embodiment of the present invention may include the following steps:
701. the main index server receives a sorting query instruction corresponding to the first directory from the client.
Wherein, the sorting inquiry command carries a sorting type identifier.
702. The main index server obtains a main record version number having an association relationship with the sorting type identifier from the directory main record corresponding to the first directory, wherein the directory main record corresponding to the first directory records the association relationship between the sorting type identifier and the main record version number, and the main record version number is used for identifying the first sorting main record.
And the main index server sends the main record version number to the sorting server.
703. The sorting server obtains the storage address of the first sorting main record through the key of the first sorting main record based on the mapping relation between the recorded storage address of the first sorting main record and the key of the first sorting main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring N11 sequencing extended records pointed by the first sequencing main record based on the first sequencing main record; sending the N11 sequencing expansion records to a main index server;
704. the main index server shows meta information of part or all of the sub-objects currently located under the first directory according to a first sorting type indicated by the sorting type identifier based on the N11 sorting extended records, wherein each sorting extended record in the N11 sorting extended records includes a plurality of sorting items, the N11 sorting extended records include sorting items corresponding to the sub-objects currently located under the first directory one by one, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting item includes a sub-object identifier and a sorting key value of the sub-object corresponding to the first sorting type.
In some embodiments of the present invention, the above-mentioned ordering query instruction may also carry sub-object constraint range information; wherein, the displaying the meta information of part or all of the sub-objects currently located under the first directory according to the first sorting type indicated by the sorting type identifier based on the N11 sorting expansion records may include: and displaying the meta-information of the sub-object currently positioned under the first directory and belonging to the range restricted by the sub-object restricted range information according to the first sorting type represented by the sorting type identifier based on the N11 sorting expansion records.
The sub-object constraint range information may include the number of sub-objects and/or the range information of the sorting key values of the first sorting type corresponding to the sub-objects. For example, if the sub-object constraint range information includes the number of sub-objects, the displaying the meta-information of part or all of the sub-objects currently located under the first directory according to the first sorting type indicated by the sorting type identifier based on the N11 sorting extension records may include: and displaying the meta-information of the sub-objects which are currently positioned under the first directory and are less than or equal to the number of the sub-objects according to the first sorting type represented by the sorting type identifier on the basis of the N11 sorting expansion records. For another example, if the sub-object constraint range information includes sorting key value range information, the displaying, according to the first sorting type indicated by the sorting type identifier, meta-information of part or all of the sub-objects currently located under the first directory based on the N11 sorting extension records may include: and displaying the meta-information of the sub-object which is currently positioned under the first directory and of which the sorting key value corresponding to the first sorting type belongs to the value range constrained by the sorting key value range information according to the first sorting type represented by the sorting type identifier on the basis of the N11 sorting expansion records.
The sort types (e.g., first sort type, second sort type, third sort type, etc.) of embodiments of the present invention may be sorted by time (e.g., sorted by creation time or sorted by modification time, etc.), sorted by size, sorted by name, or other sort types.
The sorting key value of the sub-object corresponding to a certain sorting type is key information related to sorting that needs to be used when sorting is performed according to the certain sorting type, and the sorting key value of the sub-object corresponding to the certain sorting type (for example, the first sorting type, the second sorting type, the third sorting type, and the like) may be creation time of the sub-object, latest modification time of the sub-object, content data size of the sub-object, or name of the sub-object. For example, if the sort type is sorted by creation time, the sort key value of the sub-object corresponding to the sort type may be the creation time of the sub-object. If the sort type is sorted according to the modification time, the sort key value of the sub-object corresponding to the sort type can be the latest modification time of the sub-object. If the sort type is sort by size, the sort key value of the sub-object corresponding to the sort type may be the size of the content data volume of the sub-object. If the sort type is sort by name, the sort key value of the sub-object corresponding to the sort type may be the name of the sub-object. Other scenarios are analogized.
In some embodiments of the present invention, the meta-information of the sub-object may include an identifier of the sub-object (the identifier of the sub-object and the name of the sub-object may be the same or different), and/or a sort key value of the sub-object corresponding to a certain sort type.
It can be seen that, in the scheme of this embodiment, after receiving a sorting query instruction carrying a sorting type identifier corresponding to a first directory; acquiring a main record version number having an association relation with the sorting type identifier from a directory main record corresponding to the first directory; obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and based on the N11 pieces of sorting expansion records, displaying the meta-information of part or all of the sub-objects currently positioned under the first directory according to the first sorting type indicated by the sorting type identifier. Because the directory master record corresponding to the first directory records the association relationship between the sorting type identifier and the master record version number for identifying the first sorting master record, it is equivalent to providing an entry for implementing an external consistency query function, and during sorting query, the directory master record corresponding to the first directory can obtain the master record version number associated with the sorting type identifier corresponding to a certain sorting type, and further can obtain the corresponding sorting master record based on the master record version number, and further can obtain a plurality of sorting extended records pointed by the sorting master record, and further can show the meta information of part or all of the sub-objects currently located under the first directory according to the certain sorting type based on the sorting items contained in the plurality of sorting extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
It is understood that in some embodiments of the present invention, the main index server and the sorting server may be merged into an index server, and of course, part of the functions of the main index server and/or the sorting server may be migrated to other physical devices.
Referring to fig. 8-a, an embodiment of the present invention further provides a device 800 for processing sorted records, which may include:
an obtaining unit 810, an associating unit 820 and a recording unit 830.
An obtaining unit 810, configured to obtain and store a first sorting master record of a first sorting type corresponding to a first directory;
an associating unit 820, configured to record, in the directory master record corresponding to the first directory, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record;
a recording unit 830, configured to record a mapping relationship between the key value key of the first sequential primary record and the storage address of the first sequential primary record; wherein the key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record;
the first sorting main record points to N11 sorting extended records, each of the N11 sorting extended records includes a plurality of sorting items, the N11 sorting extended records include sorting items corresponding to sub-objects currently located under the first directory in a one-to-one manner, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting item includes a sub-object identifier and a sorting key value corresponding to the sub-object of the first sorting type.
Referring to fig. 8-b, in some embodiments of the invention, the processing means 800 of ordering records may further comprise an evolution unit 840.
For example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if k1 child objects under the first directory are deleted, obtaining the key of the first sequence main record based on the directory main record corresponding to the first directory, and obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k1 sequencing items corresponding to the k1 sub-objects contained in N12 sequencing expansion records in the N11 sequencing expansion records;
acquiring and storing a second sorting master record of the first sorting type corresponding to the first directory; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a primary record version number corresponding to the second sorting primary record in a directory primary record corresponding to the first directory, and recording a mapping relationship between a key value key of the second sorting primary record and a storage address of the second sorting primary record;
wherein the key of the second sorting master record includes a master record version number corresponding to the second sorting master record and the key of the first directory, or the key of the second sorting master record includes a master record version number corresponding to the second sorting master record; wherein the second-ordered main record points to N13 ordered extended records, and the main record version number corresponding to the second-ordered main record is different from the main record version number corresponding to the first-ordered main record;
wherein the N13 sorted expanded records include the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records other than the N12 sorted expanded records from among the N11 sorted expanded records, or the N13 sorted expanded records are obtained by merging the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records other than the N12 sorted expanded records from among the N11 sorted expanded records, the N13 is less than or equal to the N11, and the k1 is a positive integer.
For another example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if k1 sub-objects under the first directory are deleted, acquiring and storing a third sorting main record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the third sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the third sorting main record and the storage address of the third sorting main record; wherein the key of the third sorting master record includes a master record version number corresponding to the third sorting master record and a key of the first directory, or the key of the third sorting master record includes a master record version number corresponding to the third sorting master record; the version number of the main record corresponding to the third-order main record is different from the version number of the main record corresponding to the first-order main record;
the third sorted main record points to N14 sorted expanded records, each of the N14 sorted expanded records includes several sort entries, the N14 sorted expanded records include sort entries corresponding to sub-objects currently located in the first directory, the N14 and the k1 are positive integers, the N14 sorted expanded records do not include k1 sorted entries corresponding to the k1 sub-objects, and each sort entry includes a sub-object identifier and a sort key value of the sub-object corresponding to the first sort type.
For another example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if k2 child objects are added under the first directory, obtaining the key of the first sequence main record based on the directory main record corresponding to the first directory, and obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; inserting k2 sorting entries corresponding to the k2 sub-objects into N15 sorting expansion records in the N11 sorting expansion records based on the sorting key value of the k2 sub-objects corresponding to the first sorting type;
acquiring and storing a fourth sorting main record of the first directory corresponding to the first sorting type, wherein the fourth sorting main record points to N16 sorting expanded records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a primary record version number corresponding to the fourth sorting primary record in a directory primary record corresponding to the first directory, and recording a mapping relationship between a key value key of the fourth sorting primary record and a storage address of the fourth sorting primary record;
wherein the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record and the key of the first directory, or the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record; wherein, the version number of the main record corresponding to the fourth sorting main record is different from the version number of the main record corresponding to the first sorting main record; k2 is a positive integer, N16 is a positive integer not less than N11;
wherein the N16 sorted expanded records include the N15 sorted expanded records after the k2 sorted entries are inserted and sorted expanded records other than the N15 sorted expanded records among the N11 sorted expanded records, or the N16 sorted expanded records are obtained by splitting sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted, or the N16 sorted expanded records are obtained by splitting and merging sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted.
For another example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if k2 child objects are added under the first directory, acquiring and storing a fifth sorting master record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the fifth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the fifth sorting main record and the storage address of the fifth sorting main record; wherein the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record and the key of the first directory, or the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record;
wherein, the version number of the main record corresponding to the fifth sorting main record is different from the version number of the main record corresponding to the first sorting main record; the fifth sorted main record points to N17 sorted expanded records, each of the N17 sorted expanded records includes several sorted entries, the N17 sorted expanded records include sorted entries corresponding to sub-objects currently located under the first directory in a one-to-one manner, the N17 and the k2 are positive integers, the N17 sorted expanded records include k2 sorted entries corresponding to the k2 sub-objects, and each sorted entry includes a sub-object identifier and a sort key value of the sub-object corresponding to the first sort type.
For another example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if the k3 sub-objects under the first directory are modified according to the sorting key value of the first sorting type, obtaining the key of the first sorting master record based on the directory master record corresponding to the first directory;
obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k3 sequencing items corresponding to the k3 sub-objects in N18 sequencing extended records in the N11 sequencing extended records;
generating the k3 sorted entries corresponding to the k3 sub-objects based on the modified sort key value of the k3 sub-objects, and inserting the acquired and stored k3 sorted entries into N19 sorted expanded records based on the modified sort key value of the k3 sub-objects, wherein the N19 sorted expanded records are subsets of the N11 sorted expanded records;
acquiring and storing a sixth sequencing main record of the first directory corresponding to the first sequencing type, wherein the sixth sequencing main record points to N20 sequencing extended records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the sixth sorting main record in a directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the sixth sorting main record and the storage address of the sixth sorting main record; wherein the key of the sixth sorting master record includes a master record version number corresponding to the sixth sorting master record and the key of the first directory, or the key of the sixth sorting master record includes a master record version number corresponding to the sixth sorting master record;
wherein a major record version number corresponding to the sixth-ordered major record is different from a major record version number corresponding to the first-ordered major record, the k3 is a positive integer, and the N20 is a positive integer greater than or equal to the N11; wherein, the N20 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or, the N20 pieces of sequencing expanded records are obtained by splitting a sequencing expanded record, into which a sequencing item is inserted and/or deleted, among the N11 pieces of sequencing expanded records and a sequencing expanded record, into which a sequencing item is not inserted and/or deleted, among the N11 pieces of sequencing expanded records; or, the N20 sorted expanded records are obtained by splitting and merging the sorted expanded records into which the sorted items are inserted and/or deleted from the N11 sorted expanded records and the sorted expanded records into which the sorted items are not inserted and/or deleted from the N11 sorted expanded records.
For another example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if the k3 sub-objects under the first directory are modified according to the sorting key value of the first sorting type, acquiring and storing a seventh sorting main record of the first directory according to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the seventh sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the seventh sorting main record and the storage address of the seventh sorting main record; wherein the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record and the key of the first directory, or the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record;
wherein, the version number of the main record corresponding to the seventh sorting main record is different from the version number of the main record corresponding to the first sorting main record; the seventh sorting main record points to N21 sorting expansion records, each sorting expansion record in the N21 sorting expansion records includes several sorting entries, the sorting entries included in the N21 sorting expansion records correspond to sub-objects currently located under the first directory in a one-to-one manner, the N21 and the k3 are positive integers, wherein each sorting entry includes a sub-object identifier and a sorting key value of the sub-object corresponding to the first sorting type, and the sorting entry corresponding to each sub-object in the k3 sub-objects included in the N21 sorting expansion records includes the sorting key value after the sub-object is modified.
For another example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if k4 child objects under the first directory are deleted and k5 child objects under the first directory are added, obtaining the key of the first order master record based on the directory master record corresponding to the first directory;
obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k4 sequencing items corresponding to the k4 child objects in N22 sequencing expansion records in the N11 sequencing expansion records;
inserting k5 sorting entries corresponding to the k5 sub-objects into N23 sorting expansion records based on the sorting key value of the k5 sub-objects corresponding to the first sorting type, wherein the N23 sorting expansion records are subsets of the N11 sorting expansion records;
acquiring and storing an eighth sequencing main record of the first directory corresponding to the first sequencing type, wherein the eighth sequencing main record points to N24 sequencing extended records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the eighth sorting main record in a directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the eighth sorting main record and the storage address of the eighth sorting main record; wherein the key of the eighth-ranking main record includes a main record version number corresponding to the eighth-ranking main record and the key of the first directory, or the key of the eighth-ranking main record includes a main record version number corresponding to the eighth-ranking main record;
wherein, the version number of the main record corresponding to the eighth-order main record is different from the version number of the main record corresponding to the first-order main record; k4, k5 and N24 are positive integers; wherein, the N24 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or, the N24 pieces of sequencing expanded records are obtained by splitting a sequencing expanded record, into which a sequencing item is inserted and/or deleted, among the N11 pieces of sequencing expanded records and a sequencing expanded record, into which a sequencing item is not inserted and/or deleted, among the N11 pieces of sequencing expanded records; or, the N24 sorted expanded records are obtained by splitting and merging the sorted expanded records into which the sorted items are inserted and/or deleted from the N11 sorted expanded records and the sorted expanded records into which the sorted items are not inserted and/or deleted from the N11 sorted expanded records.
For another example, the evolving unit 840 is configured to, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory,
if k4 sub-objects under the first directory are deleted and k5 sub-objects under the first directory are added, acquiring and storing a ninth-ordered main record of the first directory corresponding to the first ordering type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the ninth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the ninth sorting main record and the storage address of the ninth sorting main record; wherein the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record and a key of the first directory, or the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record;
wherein, the version number of the main record corresponding to the ninth-order main record is different from the version number of the main record corresponding to the first-order main record; the ninth ordering main record points to N25 ordering expansion records, each of the N25 ordering expansion records includes a plurality of ordering items, the ordering items included in the N25 ordering expansion records are in one-to-one correspondence with sub-objects currently located under the first directory, the N25, the k4, and the k5 are positive integers, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type, the N25 ordering expansion records include k5 ordering items corresponding to the k5 sub-objects, and the N25 ordering expansion records do not include k4 ordering items corresponding to the k4 sub-objects.
In some embodiments of the present invention, the evolution unit 840 is further configured to, when a second sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the second sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit 840 is further configured to, when a third sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the third sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit 840 is further configured to, when a fourth sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the fourth sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit 840 is further configured to, when a fifth sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the fifth sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit 840 is further configured to, when a sixth sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the sixth sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit 840 is further configured to, when a seventh sorting master record corresponding to the first sorting type is obtained and stored, delete the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record, which are recorded in the directory master record corresponding to the first directory, after the seventh sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit 840 is further configured to, when an eighth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, where the sorting type identifier corresponds to the first sorting type and is recorded in a directory master record corresponding to the first directory, after the eighth sorting master record corresponding to the first sorting type in the first directory is obtained and stored;
or,
the evolution unit 840 is further configured to, when the ninth master record of the first directory corresponding to the first sorting type is obtained and stored, delete the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record, where the association relationship is recorded in the master record of the directory corresponding to the first directory, after the ninth master record of the first directory corresponding to the first sorting type is obtained and stored.
In some embodiments of the present invention, the obtaining unit 810 is further configured to obtain and store a tenth sorting master record of the second sorting type corresponding to the first directory;
the associating unit 820 is further configured to record, in the directory master record corresponding to the first directory, an association relationship between the sorting type identifier corresponding to the second sorting type and the master record version number corresponding to the tenth sorting master record;
the recording unit 830 is further configured to record a mapping relationship between the key value key of the tenth sorted main record and the storage address of the tenth sorted main record.
The key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record and a key of the first directory, or the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record.
The tenth ordering main record points to N41 ordering extended records, each of the N41 ordering extended records includes several ordering items, the N41 ordering extended records include ordering items corresponding to sub-objects currently under the first directory, the N41 is a positive integer, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the second ordering type.
In some embodiments of the present invention, the number of the sorted entries included in any sorted extended record pointed to by the sorted main record is less than or equal to a first threshold n1, where the first threshold n1 is a positive integer.
It can be seen that, in the embodiment, after the first sorting master record corresponding to the first sorting type in the first directory is obtained and stored; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory; and storing a mapping relationship between the key of the first sequence main record and the storage address of the first sequence main record; the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record and the key of the first directory, or the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record; wherein the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records contains several ordering items, the N11 sorted expanded records contain sorted entries corresponding to the child objects currently located in the first directory, this is equivalent to providing an entry that implements the external consistency query function, which, subsequently in ranking queries, the master record version number associated with the sorting type identifier corresponding to a certain sorting type can be obtained through the directory master record corresponding to the first directory, further, the corresponding sorting main record can be obtained based on the version number of the main record, and then a plurality of sorting extended records pointed by the sorting main record can be obtained, and further, based on the sorting items contained in the sorting expansion records, the meta-information of part or all of the sub-objects currently located under the first directory can be displayed according to the certain sorting type. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
Referring to fig. 9, fig. 9 is a block diagram of a device 900 for processing sorted records according to another embodiment of the present invention. The processing device 900 for sorting records may include: at least one processor 901, at least one network interface 904 or other user interface 903, memory 905, at least one communication bus 902. A communication bus 902 is used to enable connective communication between these components. The means 900 for processing the sorted recording optionally comprises a user interface 903 including a display (e.g. a touch screen, LCD, CRT, Holographic (Holographic) or projection (Projector), etc.), a pointing device (e.g. a mouse, a trackball (trackball) touch pad or touch screen, etc.), a camera and/or a sound pick-up, etc.
The memory 902 may include a read-only memory and a random access memory, among others, and provides instructions and data to the processor 901. A portion of the memory 902 may also include non-volatile random access memory.
In some embodiments, the memory 905 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof:
an operating system 9051, which includes various system programs for implementing various basic services and for processing hardware-based tasks;
the application module 9052 includes various applications for implementing various application services.
The application module 9052 includes, but is not limited to, an obtaining unit 810, an associating unit 820, a recording unit 830, an evolving unit 840, and/or the like.
In this embodiment of the present invention, by calling a program or an instruction stored in the memory 905, the processor 901 is configured to obtain and store a first sorting master record of a first sorting type corresponding to a first directory; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory; recording the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record and the key of the first directory, or the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record; the first sorting main record points to N11 sorting extended records, each of the N11 sorting extended records includes a plurality of sorting items, the N11 sorting extended records include sorting items corresponding to sub-objects currently located under the first directory in a one-to-one manner, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting item includes a sub-object identifier and a sorting key value corresponding to the sub-object of the first sorting type.
In some embodiments of the present invention, for example, after the first directory is created, a first sorting master record corresponding to the first sorting type in the first directory may be obtained and stored; or after receiving a creation instruction of the first directory corresponding to the first sort master record of the first sort type, acquiring and storing the first sort master record of the first directory corresponding to the first sort type; or, after it is monitored that the sub-objects located under the first directory change (where the change of the sub-objects located under the first directory may include deletion of a number of sub-objects located under the first directory, addition of a number of sub-objects below the first directory, and/or modification of a number of sub-objects located under the first directory, etc.), a first sorting master record of the first directory corresponding to the first sorting type may be obtained and stored. Wherein the first sorted primary record may be stored by a key-value store or otherwise.
In some embodiments of the present invention, the directory master record corresponding to the first directory may record therein a plurality of information related to the first directory. The key of the directory master record corresponding to the first directory may include an identifier of the first directory, and the like. For example, the directory main record corresponding to the first directory may be stored in the key value database, and the directory main record corresponding to the first directory may be obtained from the key value database through a key (an identifier of the first directory, etc.) of the directory main record corresponding to the first directory. Of course, after the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record is recorded in the directory primary record corresponding to the first directory, the directory primary record corresponding to the first directory after modification (that is, the directory primary record corresponding to the first directory after the association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the first sorting primary record is recorded) may be stored in the key value database.
The mapping relationship between the key of the first primary record and the storage address of the first primary record can be recorded by a key value database or other methods.
In some embodiments of the present invention, the first sorted master record may point to the N11 sorted extended records by recording extended record identifiers of the N11 sorted extended records in the first sorted master record, or the first sorted master record may point to the N11 sorted extended records by recording storage addresses of the N11 sorted extended records in the first sorted master record. Of course, the first sorted master record may point to the N11 sorted extension records in other ways. Since the first-order main record points to N11 order extension records, the N11 order extension records can be acquired based on the first-order main record. The N11 sorted extension records pointed to by the first sorted primary record may also be stored in the key-value store.
The sort types (e.g., first sort type, second sort type, third sort type, etc.) of embodiments of the present invention may be sorted by time (e.g., sorted by creation time or sorted by modification time, etc.), sorted by size, sorted by name, or other sort types.
The sorting key value of the sub-object corresponding to a certain sorting type is key information related to sorting that needs to be used when sorting is performed according to the certain sorting type, and the sorting key value of the sub-object corresponding to the certain sorting type (for example, the first sorting type, the second sorting type, the third sorting type, and the like) may be creation time of the sub-object, latest modification time of the sub-object, content data size of the sub-object, or name of the sub-object. For example, if the sort type is sorted by creation time, the sort key value of the sub-object corresponding to the sort type may be the creation time of the sub-object. If the sort type is sorted according to the modification time, the sort key value of the sub-object corresponding to the sort type can be the latest modification time of the sub-object. If the sort type is sort by size, the sort key value of the sub-object corresponding to the sort type may be the size of the content data volume of the sub-object. If the sort type is sort by name, the sort key value of the sub-object corresponding to the sort type may be the name of the sub-object. Other scenarios are analogized.
In some embodiments of the present invention, the meta-information of the sub-object may include an identifier of the sub-object (the identifier of the sub-object and the name of the sub-object may be the same or different), and/or a sort key value of the sub-object corresponding to a certain sort type.
In some embodiments of the present invention, the number of the sorting entries included in any one of the N11 sorting expansion records pointed to by the first sorting master record may be less than or equal to a first threshold N1, where the first threshold N1 is a positive integer, and N1 may be, for example, 1, 2, 5, 8, 10, 15, 20, or other values.
Further, for a scenario with a requirement of multidimensional sequencing, the method further includes: acquiring and storing a tenth sorting main record of the second sorting type corresponding to the first directory; recording the association relationship between the sorting type identifier corresponding to the second sorting type and the main record version number corresponding to the tenth sorting main record in the directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the tenth sorting main record and the storage address of the tenth sorting main record; wherein the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record and a key of the first directory, or the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record; the tenth ordering main record points to N41 ordering extended records, each of the N41 ordering extended records includes several ordering items, the N41 ordering extended records include ordering items corresponding to sub-objects currently under the first directory, the N41 is a positive integer, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the second ordering type.
Wherein the second sorting type is different from the first sorting type, and the tenth sorting master record is different from the first sorting master record. It is understood that the above-mentioned scenarios of acquiring and storing the first directory corresponding to the sorted main records of other sort types and so on are not illustrated here.
It can be understood that after the recording of the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after the recording of the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the sub-object located below the first directory may further be changed, where the changing of the sub-object located below the first directory may include: a number of sub-objects located under the first directory are deleted, a number of sub-objects are added under the first directory and/or a number of sub-objects located under the first directory are modified, etc. After the sub-objects under the first directory may still be changed, the processor 901 may obtain and store a new sorted main record corresponding to the first sort type and/or other sort types in the first directory (where the new sorted main record is different from the first sorted main record and is different from the tenth sorted main record). Several application scenarios are presented below by way of example.
For example, after recording the mapping relationship between the key value of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if k1 child objects under the first directory are deleted, obtaining the key of the first sequence main record based on the directory main record corresponding to the first directory, and obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and deleting k1 sequencing items corresponding to the k1 sub-objects contained in N12 sequencing expansion records in the N11 sequencing expansion records. And acquiring and storing a second sorting main record of the first directory corresponding to the first sorting type. Recording an association relationship between the sorting type identifier corresponding to the first sorting type and the primary record version number corresponding to the second sorting primary record in the directory primary record corresponding to the first directory, and recording a mapping relationship between the key value key of the second sorting primary record and the storage address of the second sorting primary record. The key of the second sorting main record includes a main record version number corresponding to the second sorting main record and the key of the first directory, or the key of the second sorting main record includes a main record version number corresponding to the second sorting main record. Wherein the second-ordered main record points to N13 ordered extended records, and a main record version number corresponding to the second-ordered main record is different from a main record version number corresponding to the first-ordered main record. Wherein the N13 sorted expanded records include the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records other than the N12 sorted expanded records from among the N11 sorted expanded records, or the N13 sorted expanded records are obtained by merging the N12 sorted expanded records from which the k1 sorted entries are deleted and sorted expanded records from among the N11 sorted expanded records other than the N12 sorted expanded records, the N13 is less than or equal to the N11, and the k1 is a positive integer.
In some embodiments of the present invention, the deleting k1 sorted entries corresponding to the k1 sub-objects included in N12 sorted expanded records of the N11 sorted expanded records may include: determining N12 sequencing expansion records to which k1 sequencing items corresponding to the k1 sub-objects belong based on the identifier of the k1 sub-objects and/or the sequencing key value of the k1 sub-objects corresponding to the first sequencing type, where the N12 sequencing expansion records are a subset of the N11 sequencing expansion records; deleting the k1 sorted entries in the N12 sorted expanded records.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N13 sorted expanded records pointed to by the second sorted main record may be less than or equal to a second threshold N2, where the second threshold N2 is a positive integer, and N2 may be, for example, 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the first example, in some embodiments of the present invention, when the second sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the second sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record recorded in a directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the second sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replacing the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, replacing the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the second sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record in the directory main record corresponding to the first directory The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, after the second primary record of the first directory corresponding to the first sorting type is obtained and stored, and the second primary record of the first directory corresponding to the first sorting type is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory primary record corresponding to the first directory and the primary record version number corresponding to the first sorting primary record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a second sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if k1 sub-objects under the first directory are deleted, acquiring and storing a third sorting main record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the third sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the third sorting main record and the storage address of the third sorting main record; wherein the key of the third sorting master record includes a master record version number corresponding to the third sorting master record and a key of the first directory, or the key of the third sorting master record includes a master record version number corresponding to the third sorting master record; the version number of the main record corresponding to the third-order main record is different from the version number of the main record corresponding to the first-order main record;
the third sorted main record points to N14 sorted expanded records, each of the N14 sorted expanded records includes several sort entries, the N14 sorted expanded records include sort entries corresponding to sub-objects currently located in the first directory, the N14 and the k1 are positive integers, the N14 sorted expanded records do not include k1 sorted entries corresponding to the k1 sub-objects, and each sort entry includes a sub-object identifier and a sort key value corresponding to the sub-object in the first sort type.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N14 sorted expanded records pointed to by the third sorted main record may be less than or equal to a third threshold N3, where the third threshold N3 is a positive integer, and N3 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to example two, in some embodiments of the present invention, when a third sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the third sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record recorded in a directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the third sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the third sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another example scenario corresponding to the second example, in another embodiment of the present invention, after the third primary record of the first directory corresponding to the first sorting type is obtained and stored, and the third primary record of the first directory corresponding to the first sorting type is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory primary record corresponding to the first directory and the primary record version number corresponding to the first sorting primary record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a third sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if k2 child objects are added under the first directory, obtaining the key of the first sequence main record based on the directory main record corresponding to the first directory, and obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; inserting k2 sorting entries corresponding to the k2 sub-objects into N15 sorting expansion records in the N11 sorting expansion records based on the sorting key value of the k2 sub-objects corresponding to the first sorting type;
acquiring and storing a fourth sorting main record of the first directory corresponding to the first sorting type, wherein the fourth sorting main record points to N16 sorting expanded records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a primary record version number corresponding to the fourth sorting primary record in a directory primary record corresponding to the first directory, and recording a mapping relationship between a key value key of the fourth sorting primary record and a storage address of the fourth sorting primary record;
wherein the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record and the key of the first directory, or the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record; wherein, the version number of the main record corresponding to the fourth sorting main record is different from the version number of the main record corresponding to the first sorting main record; k2 is a positive integer, N16 is a positive integer not less than N11;
wherein the N16 sorted expanded records include the N15 sorted expanded records after the k2 sorted entries are inserted and sorted expanded records other than the N15 sorted expanded records among the N11 sorted expanded records, or the N16 sorted expanded records are obtained by splitting sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted, or the N16 sorted expanded records are obtained by splitting and merging sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N16 sorted expanded records pointed to by the fourth sorted main record may be less than or equal to a fourth threshold N4, where the fourth threshold N4 is a positive integer, and N4 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the third example, in some embodiments of the present invention, when a fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the fourth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are already recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the fourth sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another example scenario corresponding to the third example, in another embodiment of the present invention, after the fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, and the fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a fourth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if k2 child objects are added under the first directory, acquiring and storing a fifth sorting master record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the fifth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the fifth sorting main record and the storage address of the fifth sorting main record; wherein the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record and the key of the first directory, or the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record;
wherein, the version number of the main record corresponding to the fifth sorting main record is different from the version number of the main record corresponding to the first sorting main record; the fifth sorted main record points to N17 sorted expanded records, each of the N17 sorted expanded records includes several sorted entries, the N17 sorted expanded records include sorted entries corresponding to sub-objects currently located under the first directory in a one-to-one manner, the N17 and the k2 are positive integers, the N17 sorted expanded records include k2 sorted entries corresponding to the k2 sub-objects, and each sorted entry includes a sub-object identifier and a sort key value of the sub-object corresponding to the first sort type.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N17 sorted expanded records pointed to by the fifth sorted main record may be less than or equal to a fifth threshold N5, where the fifth threshold N5 is a positive integer, and N4 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the fourth example, in some embodiments of the present invention, when a fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the fifth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the fifth sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the fifth sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, when the fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, and after the fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a fifth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if the k3 sub-objects under the first directory are modified according to the sorting key value of the first sorting type, obtaining the key of the first sorting master record based on the directory master record corresponding to the first directory;
obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; obtaining the first sorting main record based on the storage address of the first sorting main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k3 sequencing items corresponding to the k3 sub-objects in N18 sequencing extended records in the N11 sequencing extended records;
generating the k3 sorted entries corresponding to the k3 sub-objects based on the modified sort key value of the k3 sub-objects, and inserting the acquired and stored k3 sorted entries into N19 sorted expanded records based on the modified sort key value of the k3 sub-objects, wherein the N19 sorted expanded records are subsets of the N11 sorted expanded records;
acquiring and storing a sixth sequencing main record of the first directory corresponding to the first sequencing type, wherein the sixth sequencing main record points to N20 sequencing extended records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the sixth sorting main record in a directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the sixth sorting main record and the storage address of the sixth sorting main record; wherein the key of the sixth sorting master record includes a master record version number corresponding to the sixth sorting master record and the key of the first directory, or the key of the sixth sorting master record includes a master record version number corresponding to the sixth sorting master record;
wherein a major record version number corresponding to the sixth-ordered major record is different from a major record version number corresponding to the first-ordered major record, the k3 is a positive integer, and the N20 is a positive integer greater than or equal to the N11; wherein, the N20 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or, the N20 pieces of sequencing expanded records are obtained by splitting a sequencing expanded record, into which a sequencing item is inserted and/or deleted, among the N11 pieces of sequencing expanded records and a sequencing expanded record, into which a sequencing item is not inserted and/or deleted, among the N11 pieces of sequencing expanded records; or, the N20 sorted expanded records are obtained by splitting and merging the sorted expanded records into which the sorted items are inserted and/or deleted from the N11 sorted expanded records and the sorted expanded records into which the sorted items are not inserted and/or deleted from the N11 sorted expanded records.
In some embodiments of the present invention, deleting the k3 sorted entries corresponding to the k3 sub-objects in the N18 sorted expanded records of the N11 sorted expanded records may include: determining N18 sequencing expansion records to which k3 sequencing items corresponding to the k3 sub-objects belong based on the identification of the k3 sub-objects, wherein the N18 sequencing expansion records are subsets of the N11 sequencing expansion records; deleting the k3 sorted entries in the N18 sorted expanded records.
In some embodiments of the present invention, based on the identification of the k3 sub objects, N18 sorted expanded records to which k3 sorted items corresponding to the k3 sub objects belong are determined, where the N18 sorted expanded records are a subset of the N11 sorted expanded records; deleting the k3 sorted entries in the N18 sorted expanded records;
in some embodiments of the present invention, the number of the sorted entries contained in any one of the N20 sorted expanded records pointed to by the sixth sorted main record may be less than or equal to a sixth threshold N6, where the sixth threshold N6 is a positive integer, and N6 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a scenario corresponding to the fifth example, in some embodiments of the present invention, when a sixth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the sixth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record recorded in a directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the sixth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the sixth sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the sixth sorting main record) recorded in the directory main record corresponding to the first directory and the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the non-latest obtained sorting main record The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in a scenario corresponding to the fifth example, in other embodiments of the present invention, after the sixth sorted master record corresponding to the first sort type in the first directory is obtained and stored, and the sixth sorted master record corresponding to the first sort type in the first directory is obtained and stored, the association relationship between the sort type identifier corresponding to the first sort type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sort master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a sixth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if the k3 sub-objects under the first directory are modified according to the sorting key value of the first sorting type, acquiring and storing a seventh sorting main record of the first directory according to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the seventh sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the seventh sorting main record and the storage address of the seventh sorting main record; wherein the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record and the key of the first directory, or the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record;
wherein, the version number of the main record corresponding to the seventh sorting main record is different from the version number of the main record corresponding to the first sorting main record; the seventh sorting main record points to N21 sorting expansion records, each sorting expansion record in the N21 sorting expansion records includes several sorting entries, the sorting entries included in the N21 sorting expansion records correspond to sub-objects currently located under the first directory in a one-to-one manner, the N21 and the k3 are positive integers, wherein each sorting entry includes a sub-object identifier and a sorting key value of the sub-object corresponding to the first sorting type, and the sorting entry corresponding to each sub-object in the k3 sub-objects included in the N21 sorting expansion records includes the sorting key value after the sub-object is modified.
In some embodiments of the present invention, the number of sorted entries contained in any one of the N21 sorted expanded records pointed to by the seventh sorted main record may be less than or equal to a seventh threshold N7, where the seventh threshold N7 is a positive integer, and N7 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In a sixth scenario, in some embodiments of the present invention, when a seventh sorted master record of the first directory corresponding to the first sort type is obtained and stored, after the seventh sorted master record of the first directory corresponding to the first sort type is obtained and stored, an association relationship between a sort type identifier corresponding to the first sort type and a master record version number corresponding to the first sort master record, which are recorded in a directory master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the seventh sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the seventh sorting main record, which are recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which are recorded in the directory main record corresponding to the first directory, that is, to replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the seventh sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the seventh sorting main record), which are recorded in the directory main record corresponding to the first directory, by using the sorting type identifier corresponding The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in a scenario corresponding to the sixth example, in other embodiments of the present invention, after the seventh sorted main record corresponding to the first sort type in the first directory is obtained and stored, and the seventh sorted main record corresponding to the first sort type in the first directory is obtained and stored, the association relationship between the sort type identifier corresponding to the first sort type recorded in the directory main record corresponding to the first directory and the main record version number corresponding to the first sort main record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a seventh sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if k4 child objects under the first directory are deleted and k5 child objects under the first directory are added, obtaining the key of the first order master record based on the directory master record corresponding to the first directory;
obtaining the storage address of the first sequence main record through the key of the first sequence main record based on the mapping relation between the key of the first sequence main record and the storage address of the first sequence main record; and obtaining the first sequencing main record based on the storage address of the first sequencing main record. Acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and deleting the k4 sorted items corresponding to the k4 child objects in the N22 sorted expanded records in the N11 sorted expanded records. Based on the sorting key value of the k5 sub-objects corresponding to the first sorting type, inserting k5 sorting entries corresponding to the k5 sub-objects into N23 sorting expansion records, wherein the N23 sorting expansion records are subsets of the N11 sorting expansion records.
Acquiring and storing an eighth sequencing main record of the first directory corresponding to the first sequencing type, wherein the eighth sequencing main record points to N24 sequencing extended records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the eighth sorting main record in a directory main record corresponding to the first directory; recording a mapping relationship between the key value key of the eighth sorting main record and the storage address of the eighth sorting main record; the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record and a key of the first directory, or the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record.
Wherein, the version number of the main record corresponding to the eighth-order main record is different from the version number of the main record corresponding to the first-order main record; k4, k5 and N24 are positive integers; wherein, the N24 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or, the N24 pieces of sequencing expanded records are obtained by splitting a sequencing expanded record, into which a sequencing item is inserted and/or deleted, among the N11 pieces of sequencing expanded records and a sequencing expanded record, into which a sequencing item is not inserted and/or deleted, among the N11 pieces of sequencing expanded records; or, the N24 sorted expanded records are obtained by splitting and merging the sorted expanded records into which the sorted items are inserted and/or deleted from the N11 sorted expanded records and the sorted expanded records into which the sorted items are not inserted and/or deleted from the N11 sorted expanded records.
In some embodiments of the present invention, the deleting k4 ranking items corresponding to the k4 sub-objects in the N22 ranking expanded records of the N11 ranking expanded records may specifically include: determining N22 sequencing expansion records to which k4 sequencing items corresponding to the k4 sub-objects belong based on the identifier of the k4 sub-objects and/or the sequencing key value of the k4 sub-objects corresponding to the first sequencing type, where the N22 sequencing expansion records are a subset of the N11 sequencing expansion records; deleting the k1 sorted entries in the N22 sorted expanded records.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N24 sorted expanded records pointed to by the eighth sorted main record may be less than or equal to an eighth threshold N8, where the eighth threshold N8 is a positive integer, and N8 is, for example, equal to 1, 2, 5, 8, 10, 15, 20, or other values.
In some embodiments of the present invention, in a scenario corresponding to the seventh example, when the eighth sorted master record corresponding to the first sort type in the first directory is obtained and stored, after the eighth sorted master record corresponding to the first sort type in the first directory is obtained and stored, an association relationship between a sort type identifier corresponding to the first sort type and a master record version number corresponding to the first sort master record recorded in the directory master record corresponding to the first directory may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the eighth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the eighth sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which is recorded in the directory main record corresponding to the first directory, that is, replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the eighth sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the eighth sorting main record), which is recorded in the directory main record corresponding to the first directory The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, after acquiring and storing the eighth sorted master record corresponding to the first sort type in the first directory, and after acquiring and storing the eighth sorted master record corresponding to the first sort type in the first directory, the association relationship between the sort type identifier corresponding to the first sort type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sort master record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, an eighth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
For example, after recording the mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the processor 901 may further be configured to,
if k4 sub-objects under the first directory are deleted and k5 sub-objects under the first directory are added, acquiring and storing a ninth-ordered main record of the first directory corresponding to the first ordering type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the ninth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relationship between the key value key of the ninth sorting main record and the storage address of the ninth sorting main record; wherein the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record and a key of the first directory, or the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record;
wherein, the version number of the main record corresponding to the ninth-order main record is different from the version number of the main record corresponding to the first-order main record; the ninth ordering main record points to N25 ordering expansion records, each of the N25 ordering expansion records includes a plurality of ordering items, the ordering items included in the N25 ordering expansion records are in one-to-one correspondence with sub-objects currently located under the first directory, the N25, the k4, and the k5 are positive integers, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type, the N25 ordering expansion records include k5 ordering items corresponding to the k5 sub-objects, and the N25 ordering expansion records do not include k4 ordering items corresponding to the k4 sub-objects.
In some embodiments of the present invention, the number of the sorted entries contained in any one of the N25 sorted expanded records pointed to by the ninth sorted main record may be less than or equal to a ninth threshold N9, where the ninth threshold N9 is a positive integer, and N9 is, for example, equal to 1, 2, 5, 8, 10, 15, 20 or other values.
In an example scenario corresponding to the eighth embodiment of the present invention, when the ninth master record corresponding to the first directory is obtained and stored, after the ninth master record corresponding to the first directory is obtained and stored, the association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record, which are recorded in the master record corresponding to the first directory, may be deleted. Since the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the ninth sorting main record is recorded in the directory main record corresponding to the first directory, it is equivalent to replace the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the ninth sorting main record, which are already recorded in the directory main record corresponding to the first directory, by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record, which is recorded in the directory main record corresponding to the first directory, that is, replace the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the ninth sorting main record) by using the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the latest obtained sorting main record (here, the ninth sorting main record), which are recorded in the directory main record corresponding to the first directory The association between the major record version numbers corresponding to the sorted major records (here, the first sorted major records) is obtained. That is, at any time or most of the time, only the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to the sorting main record acquired most recently at that time may be recorded in the directory main record corresponding to the first directory, and the association relationship between the sorting type identifier corresponding to the first sorting type and the version number of the main record corresponding to any sorting main record acquired not most recently at that time may not be recorded in the directory main record corresponding to the first directory.
Of course, in another embodiment of the present invention, in an example of a scenario corresponding to the eighth embodiment, after the ninth-ranked main record corresponding to the first ranking type of the first directory is obtained and stored, and the ninth-ranked main record corresponding to the first ranking type of the first directory is obtained and stored, the association relationship between the ranking type identifier corresponding to the first ranking type recorded in the directory main record corresponding to the first directory and the main record version number corresponding to the first ranking main record may not be deleted. That is, the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to a latest obtained sorting master record (here, a ninth sorting master record), and the directory master record corresponding to the first directory may record an association relationship between the sorting type identifier corresponding to the first sorting type and a master record version number corresponding to one or more non-latest obtained sorting master records (here, including the first sorting master record).
It can be seen that, in the embodiment, after the first sorting master record corresponding to the first sorting type in the first directory is obtained and stored; recording the association relationship between the sorting type identifier corresponding to the first sorting type and the main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory; and storing a mapping relationship between the key of the first sequence main record and the storage address of the first sequence main record; the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record and the key of the first directory, or the key of the first sorting master record comprises a master record version number corresponding to the first sorting master record; wherein the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records contains several ordering items, the N11 sorted expanded records contain sorted entries corresponding to the child objects currently located in the first directory, this is equivalent to providing an entry that implements the external consistency query function, which, subsequently in ranking queries, the master record version number associated with the sorting type identifier corresponding to a certain sorting type can be obtained through the directory master record corresponding to the first directory, further, the corresponding sorting main record can be obtained based on the version number of the main record, and then a plurality of sorting extended records pointed by the sorting main record can be obtained, and further, based on the sorting items contained in the sorting expansion records, the meta-information of part or all of the sub-objects currently located under the first directory can be displayed according to the certain sorting type. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
Referring to fig. 10, an apparatus 1000 for sorting queries according to an embodiment of the present invention may include: a receiving unit 1010, an associating unit 1020, and a presentation control unit 1030.
The receiving unit 1010 is configured to receive a sorting query instruction corresponding to the first directory, where the sorting query instruction carries a sorting type identifier.
An associating unit 1020, configured to obtain a master record version number having an association relationship with the sorting type identifier from a directory master record corresponding to the first directory, where the directory master record corresponding to the first directory records an association relationship between the sorting type identifier and the master record version number, and the master record version number is used to identify the first sorting master record.
A presentation control unit 1030, configured to obtain a storage address of the first-order master record through a key of the first-order master record based on a mapping relationship between the recorded storage address of the first-order master record and the key of the first-order master record that includes the master record version number; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; based on the N11 pieces of sequencing extended records, the meta information of part or all of the sub-objects currently located under the first directory is shown according to the first sequencing type indicated by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a sequencing item corresponding to a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
In some embodiments of the present invention, the above-mentioned ordering query instruction further carries sub-object constraint range information; in the aspect of displaying meta information of part or all of sub-objects currently located under the first directory according to the first sorting type indicated by the sorting type identifier based on the N11 sorting expansion records, the display control unit 1030 may be specifically configured to: and displaying the meta-information of the sub-object currently positioned under the first directory and belonging to the range restricted by the sub-object restricted range information according to the first sorting type represented by the sorting type identifier based on the N11 sorting expansion records.
It can be seen that, in the scheme of this embodiment, after receiving a sorting query instruction carrying a sorting type identifier corresponding to a first directory; acquiring a main record version number having an association relation with the sorting type identifier from a directory main record corresponding to the first directory; obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and based on the N11 pieces of sorting expansion records, displaying the meta-information of part or all of the sub-objects currently positioned under the first directory according to the first sorting type indicated by the sorting type identifier. Because the directory master record corresponding to the first directory records the association relationship between the sorting type identifier and the master record version number for identifying the first sorting master record, it is equivalent to providing an entry for implementing an external consistency query function, and during sorting query, the directory master record corresponding to the first directory can obtain the master record version number associated with the sorting type identifier corresponding to a certain sorting type, and further can obtain the corresponding sorting master record based on the master record version number, and further can obtain a plurality of sorting extended records pointed by the sorting master record, and further can show the meta information of part or all of the sub-objects currently located under the first directory according to the certain sorting type based on the sorting items contained in the plurality of sorting extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
Referring to fig. 11, fig. 11 is a block diagram illustrating a sorting query apparatus 1100 according to another embodiment of the present invention. The sorting query device 1100 may include: at least one processor 1101, at least one network interface 1104 or other user interface 1103, a memory 1105, at least one communication bus 1102. A communication bus 1102 is used to enable communications among the components. The ranking query device 1100 optionally comprises a user interface 1103 including a display (e.g., a touch screen, an LCD, a CRT, a Holographic (Holographic) or projection (Projector), etc.), a pointing device (e.g., a mouse, a trackball (trackball) touch pad or touch screen, etc.), a camera and/or a sound pickup device, etc.
Memory 1102, which may include both read-only memory and random-access memory, provides instructions and data to processor 1101. A portion of the memory 1102 may also include non-volatile random access memory (NVRAM).
In some embodiments, memory 1105 stores the following elements, executable modules or data structures, or a subset or extended set thereof:
an operating system 11051 containing various system programs for implementing various basic services and for processing hardware-based tasks;
an application module 11052 contains various applications for implementing various application services.
The application module 11052 includes, but is not limited to, a receiving unit 1010, an associating unit 1020, a presentation control unit 1030, and the like.
In the embodiment of the present invention, by calling a program or an instruction stored in the memory 1105, the processor 1101 is configured to receive a sorting query instruction corresponding to the first directory, where the sorting query instruction carries a sorting type identifier; acquiring a master record version number having an association relationship with the sorting type identifier from a directory master record corresponding to the first directory, wherein the association relationship between the sorting type identifier and the master record version number is recorded in the directory master record corresponding to the first directory, and the master record version number is used for identifying the first sorting master record; obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; based on the N11 pieces of sequencing extended records, the meta information of part or all of the sub-objects currently located under the first directory is shown according to the first sequencing type indicated by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a sequencing item corresponding to a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
In some embodiments of the present invention, the above-mentioned ordering query instruction further carries sub-object constraint range information; in the aspect that the meta information of part or all of the sub-objects currently located under the first directory is shown according to the first sorting type indicated by the sorting type identifier based on the N11 sorting expansion records, the processor 1101 may be specifically configured to: and displaying the meta-information of the sub-object currently positioned under the first directory and belonging to the range restricted by the sub-object restricted range information according to the first sorting type represented by the sorting type identifier based on the N11 sorting expansion records.
It can be seen that, in the scheme of this embodiment, after receiving a sorting query instruction carrying a sorting type identifier corresponding to a first directory; acquiring a main record version number having an association relation with the sorting type identifier from a directory main record corresponding to the first directory; obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and based on the N11 pieces of sorting expansion records, displaying the meta-information of part or all of the sub-objects currently positioned under the first directory according to the first sorting type indicated by the sorting type identifier. Because the directory master record corresponding to the first directory records the association relationship between the sorting type identifier and the master record version number for identifying the first sorting master record, it is equivalent to providing an entry for implementing an external consistency query function, and during sorting query, the directory master record corresponding to the first directory can obtain the master record version number associated with the sorting type identifier corresponding to a certain sorting type, and further can obtain the corresponding sorting master record based on the master record version number, and further can obtain a plurality of sorting extended records pointed by the sorting master record, and further can show the meta information of part or all of the sub-objects currently located under the first directory according to the certain sorting type based on the sorting items contained in the plurality of sorting extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
Referring to fig. 12, an embodiment of the present invention provides a service system, which may include: a primary index server 1201 and a ranking server 1202.
The main index server 1201 is configured to receive a sorting query instruction corresponding to the first directory, where the sorting query instruction carries a sorting type identifier; and obtaining a master record version number having an association relationship with the sorting type identifier from the directory master record corresponding to the first directory, wherein the directory master record corresponding to the first directory records the association relationship between the sorting type identifier and the master record version number, and the master record version number is used for identifying the first sorting master record and sending the master record version number to the sorting server 1202.
A sorting server 1202, configured to obtain a storage address of the first sorting master record through a key of the first sorting master record based on a mapping relationship between the recorded storage address of the first sorting master record and the key of the first sorting master record that includes the master record version number; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; sending the N11 sorted expanded records to the main index server 1201;
the main index server 1201 is further configured to, based on the N11 pieces of sorting expansion records, show meta information of some or all sub-objects currently located under the first directory according to a first sorting type indicated by the sorting type identifier, where each sorting expansion record in the N11 pieces of sorting expansion records includes a plurality of sorting entries, each sorting entry included in the N11 pieces of sorting expansion records corresponds to a sub-object currently located under the first directory in a one-to-one manner, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting entry includes a sub-object identifier and a sorting key value of the sub-object corresponding to the first sorting type.
In some embodiments of the present invention, the above-mentioned ordering query instruction further carries sub-object constraint range information; in the aspect that the meta information of some or all of the sub-objects currently located under the first directory is shown according to the first sorting type indicated by the sorting type identifier based on the N11 sorting extended records, the main index server 1201 is specifically configured to show the meta information of the sub-objects currently located under the first directory and belonging to the range restricted by the sub-object restriction range information based on the N11 sorting extended records according to the first sorting type indicated by the sorting type identifier.
It can be seen that, in the scheme of this embodiment, after receiving a sorting query instruction carrying a sorting type identifier corresponding to a first directory; acquiring a main record version number having an association relation with the sorting type identifier from a directory main record corresponding to the first directory; obtaining the storage address of the first-order main record through the key of the first-order main record based on the mapping relation between the recorded storage address of the first-order main record and the key of the first-order main record containing the version number of the main record; obtaining the first sorting main record based on the storage address of the first sorting main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; and based on the N11 pieces of sorting expansion records, displaying the meta-information of part or all of the sub-objects currently positioned under the first directory according to the first sorting type indicated by the sorting type identifier. Because the directory master record corresponding to the first directory records the association relationship between the sorting type identifier and the master record version number for identifying the first sorting master record, it is equivalent to providing an entry for implementing an external consistency query function, and during sorting query, the directory master record corresponding to the first directory can obtain the master record version number associated with the sorting type identifier corresponding to a certain sorting type, and further can obtain the corresponding sorting master record based on the master record version number, and further can obtain a plurality of sorting extended records pointed by the sorting master record, and further can show the meta information of part or all of the sub-objects currently located under the first directory according to the certain sorting type based on the sorting items contained in the plurality of sorting extended records. It can be seen that the version management of different sequencing primary records is realized by introducing the primary record version number, and further the locking of the sequencing primary records is realized by the primary record version number, and the sequencing primary records can be uniquely locked based on the directory primary record and the primary record version number, so that the problem that the controllable consistency of the outward display result is difficult to obtain when a plurality of independent sequencing data exist in the prior art is solved, and the scheme is favorable for improving the outward consistency control performance of the single-dimensional or multi-dimensional sequencing of the sub-objects under the directory.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (30)
1. A method for processing sorted records, comprising:
acquiring and storing a first sorting master record of a first sorting type corresponding to a first directory;
recording an association relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the first sorting main record in a directory main record corresponding to the first directory;
recording the mapping relation between the key value key of the first sequencing main record and the storage address of the first sequencing main record; wherein the key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record;
the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records includes a plurality of ordering items, the N11 ordering extended records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each ordering item includes a sub-object identifier and an ordering key value of the first ordering type corresponding to the sub-object.
2. The method of claim 1,
after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory, the method further includes:
if the k1 sub-objects located under the first directory are deleted, obtaining a key of the first ordering main record based on a directory main record corresponding to the first directory, and obtaining a storage address of the first ordering main record through the key of the first ordering main record based on a mapping relation between the key of the first ordering main record and the storage address of the first ordering main record; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k1 sorted entries corresponding to the k1 sub-objects contained in N12 sorted expanded records among the N11 sorted expanded records;
acquiring and storing a second sorting master record of the first sorting type corresponding to the first directory; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a primary record version number corresponding to the second sorting primary record in a directory primary record corresponding to the first directory, and recording a mapping relationship between a key value key of the second sorting primary record and a storage address of the second sorting primary record;
wherein the key of the second sorting master record includes a master record version number corresponding to the second sorting master record and the key of the first directory, or the key of the second sorting master record includes a master record version number corresponding to the second sorting master record; wherein the second-ordered main record points to N13 ordered extended records, and a main record version number corresponding to the second-ordered main record is different from a main record version number corresponding to the first-ordered main record;
wherein, the N13 sorted expanded records include the N12 sorted expanded records after the k1 sorted entries are deleted and the sorted expanded records except for the N12 sorted expanded records among the N11 sorted expanded records, or the N13 sorted expanded records are obtained by combining the N12 sorted expanded records after the k1 sorted entries are deleted and the sorted expanded records except for the N12 sorted expanded records among the N11 sorted expanded records, the N13 is less than or equal to the N11, and the k1 is a positive integer.
3. The method of claim 1,
after recording a mapping relationship between the key value key of the first sorting master record and the storage address of the first sorting master record, or after recording an association relationship between the sorting type identifier corresponding to the first sorting type and the master record version number corresponding to the first sorting master record in the directory master record corresponding to the first directory, the method further includes:
if the k1 sub-objects located under the first directory are deleted, acquiring and storing a third sorting main record of the first directory corresponding to the first sorting type;
recording an incidence relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the third sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the third sorting main record and the storage address of the third sorting main record; the key of the third sorting master record comprises a master record version number corresponding to the third sorting master record and the key of the first directory, or the key of the third sorting master record comprises a master record version number corresponding to the third sorting master record; the version number of the main record corresponding to the third-order main record is different from the version number of the main record corresponding to the first-order main record;
the third ordering main record points to N14 ordering extension records, each of the N14 ordering extension records includes a plurality of ordering items, the N14 ordering extension records include ordering items that are in one-to-one correspondence with sub-objects currently located in the first directory, the N14 and the k1 are positive integers, the N14 ordering extension records do not include k1 ordering items corresponding to the k1 sub-objects, and each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type.
4. The method of claim 1,
after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory, the method further includes:
if k2 child objects are added below the first directory, obtaining a key of the first ordering master record based on a directory master record corresponding to the first directory, and obtaining a storage address of the first ordering master record through the key of the first ordering master record based on a mapping relation between the key of the first ordering master record and the storage address of the first ordering master record; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; inserting k2 sorting entries corresponding to the k2 sub-objects into N15 sorting expansion records in the N11 sorting expansion records based on the sorting key value of the k2 sub-objects corresponding to the first sorting type;
acquiring and storing a fourth sequencing main record of the first directory corresponding to the first sequencing type, wherein the fourth sequencing main record points to N16 sequencing extended records; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a primary record version number corresponding to the fourth sorting primary record in a directory primary record corresponding to the first directory, and recording a mapping relationship between a key value key of the fourth sorting primary record and a storage address of the fourth sorting primary record;
wherein the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record and the key of the first directory, or the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record; wherein a master record version number corresponding to the fourth sorted master record is different from a master record version number corresponding to the first sorted master record; the k2 is a positive integer, the N16 is a positive integer greater than or equal to the N11;
wherein the N16 sorted expanded records include the N15 sorted expanded records after the k2 sorted entries are inserted and sorted expanded records other than the N15 sorted expanded records among the N11 sorted expanded records, or the N16 sorted expanded records are obtained by splitting sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted, or the N16 sorted expanded records are obtained by splitting and merging sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted.
5. The method of claim 1,
after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory, the method further includes:
if k2 child objects are added below the first directory, acquiring and storing a fifth sorting master record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the fifth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the fifth sequencing main record and the storage address of the fifth sequencing main record; wherein the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record and the key of the first directory, or the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record;
wherein a master record version number corresponding to the fifth-order master record is different from a master record version number corresponding to the first-order master record; the fifth ordering main record points to N17 ordering extension records, each of the N17 ordering extension records includes several ordering items, the N17 ordering extension records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the N17 and the k2 are positive integers, the N17 ordering extension records include k2 ordering items corresponding to the k2 sub-objects, wherein each ordering item includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type.
6. The method of claim 1,
after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory, the method further includes:
if the k3 sub-objects below the first directory are modified corresponding to the sorting key value of the first sorting type, obtaining the key of the first sorting master record based on the directory master record corresponding to the first directory;
based on the mapping relation between the key of the first sequencing main record and the storage address of the first sequencing main record, obtaining the storage address of the first sequencing main record through the key of the first sequencing main record; obtaining the first sequencing main record based on the storage address of the first sequencing main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k3 sorted items corresponding to the k3 sub-objects in N18 sorted expanded records from the N11 sorted expanded records;
generating the k3 sorting items corresponding to the k3 sub-objects based on the modified sorting key value of the k3 sub-objects, and inserting the acquired and stored k3 sorting items into N19 sorting expansion records based on the modified sorting key value of the k3 sub-objects, wherein the N19 sorting expansion records are subsets of the N11 sorting expansion records;
acquiring and storing a sixth sequencing main record of the first directory corresponding to the first sequencing type, wherein the sixth sequencing main record points to N20 sequencing extended records; recording an incidence relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the sixth sorting main record in a directory main record corresponding to the first directory; recording a mapping relation between the key value key of the sixth sorting main record and the storage address of the sixth sorting main record; the key of the sixth sorted main record comprises a main record version number corresponding to the sixth sorted main record and the key of the first directory, or the key of the sixth sorted main record comprises a main record version number corresponding to the sixth sorted main record;
wherein the version number of the master record corresponding to the sixth-ordered master record is different from the version number of the master record corresponding to the first-ordered master record, the k3 is a positive integer, and the N20 is a positive integer greater than or equal to the N11; wherein the N20 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or the N20 sequencing extended records are obtained by splitting a sequencing extended record with a sequencing item inserted and/or deleted in the N11 sequencing extended records and a sequencing extended record with a sequencing item not inserted and/or deleted in the N11 sequencing extended records; or, the N20 sorted expanded records are obtained by splitting and merging sorted expanded records into which sorted items are inserted and/or deleted from the N11 sorted expanded records and sorted expanded records into which sorted items are not inserted and/or deleted from the N11 sorted expanded records.
7. The method of claim 1,
after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory, the method further includes:
if the sorting key value of the k3 sub objects under the first directory corresponding to the first sorting type is modified, acquiring and storing a seventh sorting main record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the seventh sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the seventh sequencing main record and the storage address of the seventh sequencing main record; wherein the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record and the key of the first directory, or the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record;
wherein a master record version number corresponding to the seventh-order master record is different from a master record version number corresponding to the first-order master record; the seventh ordering main record points to N21 ordering extension records, each of the N21 ordering extension records includes several ordering items, the ordering items included in the N21 ordering extension records are in one-to-one correspondence with sub-objects currently located under the first directory, the N21 and the k3 are positive integers, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type, and the ordering item corresponding to each of the k3 sub-objects included in the N21 ordering extension records includes an ordering key value of the modified sub-object.
8. The method of claim 1,
after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory, the method further includes:
if k4 sub-objects under the first directory are deleted and k5 sub-objects under the first directory are added, obtaining the key of the first ordering master record based on the directory master record corresponding to the first directory;
based on the mapping relation between the key of the first sequencing main record and the storage address of the first sequencing main record, obtaining the storage address of the first sequencing main record through the key of the first sequencing main record; obtaining the first sequencing main record based on the storage address of the first sequencing main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k4 sorted items corresponding to the k4 sub-objects in N22 sorted expanded records from the N11 sorted expanded records;
inserting k5 sorting entries corresponding to the k5 sub-objects into N23 sorting expansion records based on the sorting key value of the k5 sub-objects corresponding to the first sorting type, wherein the N23 sorting expansion records are subsets of the N11 sorting expansion records;
acquiring and storing an eighth sequencing main record of the first directory corresponding to the first sequencing type, wherein the eighth sequencing main record points to N24 sequencing extended records; recording an incidence relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the eighth sorting main record in a directory main record corresponding to the first directory; recording a mapping relation between the key value key of the eighth sequencing main record and the storage address of the eighth sequencing main record; wherein the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record and the key of the first directory, or the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record;
wherein a master record version number corresponding to the eighth-order master record is different from a master record version number corresponding to the first-order master record; the k4, the k5, and the N24 are positive integers; wherein the N24 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or the N24 sequencing extended records are obtained by splitting a sequencing extended record with a sequencing item inserted and/or deleted in the N11 sequencing extended records and a sequencing extended record with a sequencing item not inserted and/or deleted in the N11 sequencing extended records; or, the N24 sorted expanded records are obtained by splitting and merging sorted expanded records into which sorted items are inserted and/or deleted from the N11 sorted expanded records and sorted expanded records into which sorted items are not inserted and/or deleted from the N11 sorted expanded records.
9. The method of claim 1,
after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory, the method further includes:
if k4 sub-objects under the first directory are deleted and k5 sub-objects are added under the first directory, acquiring and storing a ninth-ranking main record of the first directory corresponding to the first ranking type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the ninth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the ninth sorting main record and the storage address of the ninth sorting main record; wherein the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record and the key of the first directory, or the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record;
wherein the version number of the master record corresponding to the ninth-ordered master record is different from the version number of the master record corresponding to the first-ordered master record; the ninth ordering main record points to N25 ordering expansion records, each of the N25 ordering expansion records includes a plurality of ordering items, the ordering items included in the N25 ordering expansion records are in one-to-one correspondence with sub-objects currently located under the first directory, the N25, the k4, and the k5 are positive integers, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type, the N25 ordering expansion records include k5 ordering items corresponding to the k5 sub-objects, and the N25 ordering expansion records do not include k4 ordering items corresponding to the k4 sub-objects.
10. The method according to any one of claims 1 to 9,
when a second sorting master record corresponding to the first sorting type in the first directory is obtained and stored, deleting the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record after the second sorting master record corresponding to the first sorting type in the first directory is obtained and stored;
or,
when a third sorting master record corresponding to the first sorting type in the first directory is obtained and stored, deleting the association relationship between the sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and the master record version number corresponding to the first sorting master record after the third sorting master record corresponding to the first sorting type in the first directory is obtained and stored;
or,
when a fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, deleting an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the fourth sorting master record corresponding to the first sorting type in the first directory is obtained and stored;
or,
when a fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, deleting an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the fifth sorting master record corresponding to the first sorting type in the first directory is obtained and stored;
or,
when a sixth sorting master record of the first sorting type corresponding to the first directory is obtained and stored, after the sixth sorting master record of the first sorting type corresponding to the first directory is obtained and stored, deleting an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in the directory master record corresponding to the first directory;
or,
when a seventh sorting master record of the first sorting type corresponding to the first directory is obtained and stored, after the seventh sorting master record of the first sorting type corresponding to the first directory is obtained and stored, deleting an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory;
or,
when an eighth sequencing master record of the first sequencing type corresponding to the first directory is obtained and stored, after the eighth sequencing master record of the first sequencing type corresponding to the first directory is obtained and stored, deleting an association relation between a sequencing type identifier corresponding to the first sequencing type and a master record version number corresponding to the first sequencing master record, which are recorded in the directory master record corresponding to the first directory;
or,
when a ninth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, after the ninth sorting master record corresponding to the first sorting type in the first directory is obtained and stored, deleting an association relationship between a sorting type identifier corresponding to the first sorting type recorded in the directory master record corresponding to the first directory and a master record version number corresponding to the first sorting master record.
11. The method according to any one of claims 1 to 9,
the method further comprises the following steps:
acquiring and storing a tenth sorting main record of the second sorting type corresponding to the first directory; recording an incidence relation between a sorting type identifier corresponding to the second sorting type and a main record version number corresponding to the tenth sorting main record in a directory main record corresponding to the first directory; recording a mapping relation between the key value key of the tenth sorting main record and the storage address of the tenth sorting main record;
wherein the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record and the key of the first directory, or the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record;
the tenth ordering main record points to N41 ordering extension records, each of the N41 ordering extension records includes several ordering items, the N41 ordering extension records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the N41 is a positive integer, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the second ordering type.
12. The method of claim 11,
the number of the sorting items contained in any sorting expansion record pointed by the sorting main record is less than or equal to a first threshold n1, and the first threshold n1 is a positive integer.
13. A method for ranking queries, comprising:
receiving a sorting query instruction corresponding to a first directory, wherein the sorting query instruction carries a sorting type identifier;
acquiring a master record version number having an association relationship with the sorting type identifier from a directory master record corresponding to the first directory, wherein the association relationship between the sorting type identifier and the master record version number is recorded in the directory master record corresponding to the first directory, and the master record version number is used for identifying the first sorting master record;
obtaining the storage address of the first sequencing master record through the key of the first sequencing master record based on the mapping relation between the recorded storage address of the first sequencing master record and the key of the first sequencing master record containing the version number of the master record; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring N11 sequencing extended records pointed by the first sequencing main record based on the first sequencing main record; based on the N11 pieces of sequencing extended records, meta information of part or all of the sub-objects currently located under the first directory is shown according to a first sequencing type represented by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a one-to-one correspondence between a sequencing item and a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
14. The method of claim 13,
the ordering query instruction also carries sub-object constraint range information; the displaying, based on the N11 sorted expanded records, meta information of part or all of the child objects currently located under the first directory according to the first sort type indicated by the sort type identifier includes: and displaying the meta-information of the sub-object which is currently positioned under the first directory and belongs to the range restricted by the sub-object restricted range information according to the first sorting type represented by the sorting type identifier on the basis of the N11 sorting extension records.
15. A processing apparatus for sorting records, comprising:
the acquisition unit is used for acquiring and storing a first sorting master record of a first sorting type corresponding to the first directory;
the association unit is used for recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the first sorting main record in the directory main record corresponding to the first directory;
the recording unit is used for recording the mapping relation between the key value key of the first sequencing main record and the storage address of the first sequencing main record; wherein the key of the first sorting master record includes a master record version number corresponding to the first sorting master record and a key of the first directory, or the key of the first sorting master record includes a master record version number corresponding to the first sorting master record;
the first ordering main record points to N11 ordering extended records, each of the N11 ordering extended records includes a plurality of ordering items, the N11 ordering extended records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each ordering item includes a sub-object identifier and an ordering key value of the first ordering type corresponding to the sub-object.
16. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if the k1 sub-objects located under the first directory are deleted, obtaining a key of the first ordering main record based on a directory main record corresponding to the first directory, and obtaining a storage address of the first ordering main record through the key of the first ordering main record based on a mapping relation between the key of the first ordering main record and the storage address of the first ordering main record; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k1 sorted entries corresponding to the k1 sub-objects contained in N12 sorted expanded records among the N11 sorted expanded records;
acquiring and storing a second sorting master record of the first sorting type corresponding to the first directory; recording an association relationship between a sorting type identifier corresponding to the first sorting type and a primary record version number corresponding to the second sorting primary record in a directory primary record corresponding to the first directory, and recording a mapping relationship between a key value key of the second sorting primary record and a storage address of the second sorting primary record;
wherein the key of the second sorting master record includes a master record version number corresponding to the second sorting master record and the key of the first directory, or the key of the second sorting master record includes a master record version number corresponding to the second sorting master record; wherein the second-ordered main record points to N13 ordered extended records, and a main record version number corresponding to the second-ordered main record is different from a main record version number corresponding to the first-ordered main record;
wherein, the N13 sorted expanded records include the N12 sorted expanded records after the k1 sorted entries are deleted and the sorted expanded records except for the N12 sorted expanded records among the N11 sorted expanded records, or the N13 sorted expanded records are obtained by combining the N12 sorted expanded records after the k1 sorted entries are deleted and the sorted expanded records except for the N12 sorted expanded records among the N11 sorted expanded records, the N13 is less than or equal to the N11, and the k1 is a positive integer.
17. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if the k1 sub-objects located under the first directory are deleted, acquiring and storing a third sorting main record of the first directory corresponding to the first sorting type;
recording an incidence relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the third sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the third sorting main record and the storage address of the third sorting main record; the key of the third sorting master record comprises a master record version number corresponding to the third sorting master record and the key of the first directory, or the key of the third sorting master record comprises a master record version number corresponding to the third sorting master record; the version number of the main record corresponding to the third-order main record is different from the version number of the main record corresponding to the first-order main record;
the third ordering main record points to N14 ordering extension records, each of the N14 ordering extension records includes a plurality of ordering items, the N14 ordering extension records include ordering items that are in one-to-one correspondence with sub-objects currently located in the first directory, the N14 and the k1 are positive integers, the N14 ordering extension records do not include k1 ordering items corresponding to the k1 sub-objects, and each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type.
18. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if k2 child objects are added below the first directory, obtaining a key of the first ordering master record based on a directory master record corresponding to the first directory, and obtaining a storage address of the first ordering master record through the key of the first ordering master record based on a mapping relation between the key of the first ordering master record and the storage address of the first ordering master record; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; inserting k2 sorting entries corresponding to the k2 sub-objects into N15 sorting expansion records in the N11 sorting expansion records based on the sorting key value of the k2 sub-objects corresponding to the first sorting type;
acquiring and storing a fourth sequencing main record of the first directory corresponding to the first sequencing type, wherein the fourth sequencing main record points to N16 sequencing extended records; recording a mapping relationship between a key value key of the fourth sorting master record and a storage address of the fourth sorting master record in an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number record corresponding to the fourth sorting master record in a directory master record corresponding to the first directory;
wherein the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record and the key of the first directory, or the key of the fourth sorting master record includes a master record version number corresponding to the fourth sorting master record; wherein a master record version number corresponding to the fourth sorted master record is different from a master record version number corresponding to the first sorted master record; the k2 is a positive integer, the N16 is a positive integer greater than or equal to the N11;
wherein the N16 sorted expanded records include the N15 sorted expanded records after the k2 sorted entries are inserted and sorted expanded records other than the N15 sorted expanded records among the N11 sorted expanded records, or the N16 sorted expanded records are obtained by splitting sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted, or the N16 sorted expanded records are obtained by splitting and merging sorted expanded records other than the N15 sorted expanded records among the N15 sorted expanded records and the N11 sorted expanded records after the k2 sorted entries are inserted.
19. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if k2 child objects are added below the first directory, acquiring and storing a fifth sorting master record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the fifth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the fifth sequencing main record and the storage address of the fifth sequencing main record; wherein the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record and the key of the first directory, or the key of the fifth sorting master record includes a master record version number corresponding to the fifth sorting master record;
wherein a master record version number corresponding to the fifth-order master record is different from a master record version number corresponding to the first-order master record; the fifth ordering main record points to N17 ordering extension records, each of the N17 ordering extension records includes several ordering items, the N17 ordering extension records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the N17 and the k2 are positive integers, the N17 ordering extension records include k2 ordering items corresponding to the k2 sub-objects, wherein each ordering item includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type.
20. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if the k3 sub-objects below the first directory are modified corresponding to the sorting key value of the first sorting type, obtaining the key of the first sorting master record based on the directory master record corresponding to the first directory;
based on the mapping relation between the key of the first sequencing main record and the storage address of the first sequencing main record, obtaining the storage address of the first sequencing main record through the key of the first sequencing main record; obtaining the first sequencing main record based on the storage address of the first sequencing main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k3 sorted items corresponding to the k3 sub-objects in N18 sorted expanded records from the N11 sorted expanded records;
generating the k3 sorting items corresponding to the k3 sub-objects based on the modified sorting key value of the k3 sub-objects, and inserting the acquired and stored k3 sorting items into N19 sorting expansion records based on the modified sorting key value of the k3 sub-objects, wherein the N19 sorting expansion records are subsets of the N11 sorting expansion records;
acquiring and storing a sixth sequencing main record of the first directory corresponding to the first sequencing type, wherein the sixth sequencing main record points to N20 sequencing extended records; recording an incidence relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the sixth sorting main record in a directory main record corresponding to the first directory; recording a mapping relation between the key value key of the sixth sorting main record and the storage address of the sixth sorting main record; the key of the sixth sorted main record comprises a main record version number corresponding to the sixth sorted main record and the key of the first directory, or the key of the sixth sorted main record comprises a main record version number corresponding to the sixth sorted main record;
wherein the version number of the master record corresponding to the sixth-ordered master record is different from the version number of the master record corresponding to the first-ordered master record, the k3 is a positive integer, and the N20 is a positive integer greater than or equal to the N11; wherein the N20 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or the N20 sequencing extended records are obtained by splitting a sequencing extended record with a sequencing item inserted and/or deleted in the N11 sequencing extended records and a sequencing extended record with a sequencing item not inserted and/or deleted in the N11 sequencing extended records; or, the N20 sorted expanded records are obtained by splitting and merging sorted expanded records into which sorted items are inserted and/or deleted from the N11 sorted expanded records and sorted expanded records into which sorted items are not inserted and/or deleted from the N11 sorted expanded records.
21. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if the sorting key value of the k3 sub objects under the first directory corresponding to the first sorting type is modified, acquiring and storing a seventh sorting main record of the first directory corresponding to the first sorting type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the seventh sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the seventh sequencing main record and the storage address of the seventh sequencing main record; wherein the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record and the key of the first directory, or the key of the seventh sorted main record includes the main record version number corresponding to the seventh sorted main record;
wherein a master record version number corresponding to the seventh-order master record is different from a master record version number corresponding to the first-order master record; the seventh ordering main record points to N21 ordering extension records, each of the N21 ordering extension records includes several ordering items, the ordering items included in the N21 ordering extension records are in one-to-one correspondence with sub-objects currently located under the first directory, the N21 and the k3 are positive integers, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type, and the ordering item corresponding to each of the k3 sub-objects included in the N21 ordering extension records includes an ordering key value of the modified sub-object.
22. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if k4 sub-objects under the first directory are deleted and k5 sub-objects under the first directory are added, obtaining the key of the first ordering master record based on the directory master record corresponding to the first directory;
based on the mapping relation between the key of the first sequencing main record and the storage address of the first sequencing main record, obtaining the storage address of the first sequencing main record through the key of the first sequencing main record; obtaining the first sequencing main record based on the storage address of the first sequencing main record;
acquiring the N11 sorted extended records pointed by the first sorted main record based on the first sorted main record; deleting k4 sorted items corresponding to the k4 sub-objects in N22 sorted expanded records from the N11 sorted expanded records;
inserting k5 sorting entries corresponding to the k5 sub-objects into N23 sorting expansion records based on the sorting key value of the k5 sub-objects corresponding to the first sorting type, wherein the N23 sorting expansion records are subsets of the N11 sorting expansion records;
acquiring and storing an eighth sequencing main record of the first directory corresponding to the first sequencing type, wherein the eighth sequencing main record points to N24 sequencing extended records; recording an incidence relation between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the eighth sorting main record in a directory main record corresponding to the first directory; recording a mapping relation between the key value key of the eighth sequencing main record and the storage address of the eighth sequencing main record; wherein the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record and the key of the first directory, or the key of the eighth sorted master record includes a master record version number corresponding to the eighth sorted master record;
wherein a master record version number corresponding to the eighth-order master record is different from a master record version number corresponding to the first-order master record; the k4, the k5, and the N24 are positive integers; wherein the N24 sorted expanded records include sorted expanded records with sorted items inserted and/or deleted from the N11 sorted expanded records and sorted expanded records with sorted items not inserted and/or deleted from the N11 sorted expanded records; or the N24 sequencing extended records are obtained by splitting a sequencing extended record with a sequencing item inserted and/or deleted in the N11 sequencing extended records and a sequencing extended record with a sequencing item not inserted and/or deleted in the N11 sequencing extended records; or, the N24 sorted expanded records are obtained by splitting and merging sorted expanded records into which sorted items are inserted and/or deleted from the N11 sorted expanded records and sorted expanded records into which sorted items are not inserted and/or deleted from the N11 sorted expanded records.
23. The apparatus of claim 15,
the device further comprises: an evolution unit, configured to record, after recording a mapping relationship between a key value key of the first sorting master record and a storage address of the first sorting master record, or after recording an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record in a directory master record corresponding to the first directory,
if k4 sub-objects under the first directory are deleted and k5 sub-objects are added under the first directory, acquiring and storing a ninth-ranking main record of the first directory corresponding to the first ranking type;
recording an association relationship between a sorting type identifier corresponding to the first sorting type and a main record version number corresponding to the ninth sorting main record in a directory main record corresponding to the first directory;
recording a mapping relation between the key value key of the ninth sorting main record and the storage address of the ninth sorting main record; wherein the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record and the key of the first directory, or the key of the ninth-ranked main record includes a main record version number corresponding to the ninth-ranked main record;
wherein the version number of the master record corresponding to the ninth-ordered master record is different from the version number of the master record corresponding to the first-ordered master record; the ninth ordering main record points to N25 ordering expansion records, each of the N25 ordering expansion records includes a plurality of ordering items, the ordering items included in the N25 ordering expansion records are in one-to-one correspondence with sub-objects currently located under the first directory, the N25, the k4, and the k5 are positive integers, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the first ordering type, the N25 ordering expansion records include k5 ordering items corresponding to the k5 sub-objects, and the N25 ordering expansion records do not include k4 ordering items corresponding to the k4 sub-objects.
24. The apparatus of any one of claims 16 to 23,
the evolution unit is further configured to, when a second sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the second sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit is further configured to, when a third sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the third sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit is further configured to, when a fourth sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the fourth sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit is further configured to, when a fifth sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the fifth sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit is further configured to, when a sixth sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the sixth sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit is further configured to, when a seventh sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the seventh sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit is further configured to, when an eighth sorting master record corresponding to the first sorting type is obtained and stored, delete an association relationship between a sorting type identifier corresponding to the first sorting type and a master record version number corresponding to the first sorting master record, which are recorded in a directory master record corresponding to the first directory, after the eighth sorting master record corresponding to the first sorting type is obtained and stored;
or,
the evolution unit is further configured to, when a ninth-ranking master record corresponding to the first ranking type is obtained and stored, delete an association relationship between a ranking type identifier corresponding to the first ranking type recorded in the directory master record corresponding to the first directory and a master record version number corresponding to the first ranking master record after the ninth-ranking master record corresponding to the first ranking type is obtained and stored.
25. The apparatus of any one of claims 15 to 23,
the obtaining unit is further configured to obtain and store a tenth sorting master record of the second sorting type corresponding to the first directory;
the association unit is further configured to record, in the directory master record corresponding to the first directory, an association relationship between the sort type identifier corresponding to the second sort type and the master record version number corresponding to the tenth sort master record;
the recording unit is further configured to record a mapping relationship between the key value key of the tenth sorted main record and the storage address of the tenth sorted main record;
wherein the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record and the key of the first directory, or the key of the tenth-ordered main record includes a main record version number corresponding to the tenth-ordered main record;
the tenth ordering main record points to N41 ordering extension records, each of the N41 ordering extension records includes several ordering items, the N41 ordering extension records include ordering items that are in one-to-one correspondence with sub-objects currently located under the first directory, the N41 is a positive integer, wherein each of the ordering items includes a sub-object identifier and an ordering key value of the sub-object corresponding to the second ordering type.
26. The apparatus of claim 24,
the number of the sorting items contained in any sorting expansion record pointed by the sorting main record is less than or equal to a first threshold n1, and the first threshold n1 is a positive integer.
27. An apparatus for ranking queries, comprising:
the receiving unit is used for receiving a sorting query instruction corresponding to the first directory, wherein the sorting query instruction carries a sorting type identifier;
an association unit, configured to obtain, from a directory master record corresponding to the first directory, a master record version number having an association relationship with the sorting type identifier, where the directory master record corresponding to the first directory records an association relationship between the sorting type identifier and the master record version number, and the master record version number is used to identify the first sorting master record;
the presentation control unit is used for obtaining the storage address of the first sequencing master record through the key of the first sequencing master record based on the mapping relation between the recorded storage address of the first sequencing master record and the key of the first sequencing master record containing the master record version number; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring N11 sequencing extended records pointed by the first sequencing main record based on the first sequencing main record; based on the N11 pieces of sequencing extended records, meta information of part or all of the sub-objects currently located under the first directory is shown according to a first sequencing type represented by the sequencing type identifier, where each of the N11 pieces of sequencing extended records includes several sequencing items, each of the N11 pieces of sequencing extended records includes a one-to-one correspondence between a sequencing item and a sub-object currently located under the first directory, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each of the sequencing items includes a sub-object identifier and a sequencing key value of the sub-object corresponding to the first sequencing type.
28. The apparatus of claim 27,
the ordering query instruction also carries sub-object constraint range information; in the aspect that the meta information of part or all of the sub-objects currently located under the first directory is presented according to the first sorting type indicated by the sorting type identifier based on the N11 sorting expansion records, the presentation control unit is specifically configured to: and displaying the meta-information of the sub-object which is currently positioned under the first directory and belongs to the range restricted by the sub-object restricted range information according to the first sorting type represented by the sorting type identifier on the basis of the N11 sorting extension records.
29. A service system, comprising:
the main index server is used for receiving a sorting query instruction corresponding to the first directory, wherein the sorting query instruction carries a sorting type identifier; acquiring a master record version number having an association relation with the sorting type identifier from a directory master record corresponding to the first directory, wherein the association relation between the sorting type identifier and the master record version number is recorded in the directory master record corresponding to the first directory, and the master record version number is used for identifying the first sorting master record and sending the master record version number to a sorting server;
the sorting server is configured to obtain the storage address of the first sorting master record through the key of the first sorting master record based on a mapping relationship between the recorded storage address of the first sorting master record and the key of the first sorting master record that includes the master record version number; obtaining the first sequencing main record based on the storage address of the first sequencing main record; acquiring N11 sequencing extended records pointed by the first sequencing main record based on the first sequencing main record; sending the N11 sorted expanded records to the main index server;
the main index server is specifically configured to, based on the N11 pieces of sorting expansion records, show meta information of some or all sub-objects currently located under the first directory according to a first sorting type indicated by the sorting type identifier, where each sorting expansion record in the N11 pieces of sorting expansion records includes a plurality of sorting entries, the sorting entries included in the N11 pieces of sorting expansion records correspond to the sub-objects currently located under the first directory in a one-to-one manner, the sub-objects under the first directory are sub-directories and/or files, the N11 is a positive integer, and each sorting entry includes a sub-object identifier and a sorting key value of the sub-object corresponding to the first sorting type.
30. The service system according to claim 29, wherein the query order further carries sub-object constraint range information; in the aspect that the meta information of part or all of the sub-objects currently located under the first directory is shown according to the first sorting type indicated by the sorting type identifier based on the N11 sorting extended records, the main index server is specifically configured to show the meta information of the sub-objects currently located under the first directory and belonging to the range restricted by the sub-object restriction range information based on the N11 sorting extended records according to the first sorting type indicated by the sorting type identifier.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410030043.4A CN104794137B (en) | 2014-01-22 | 2014-01-22 | The processing method and sorting query method and relevant apparatus and system of order recording |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410030043.4A CN104794137B (en) | 2014-01-22 | 2014-01-22 | The processing method and sorting query method and relevant apparatus and system of order recording |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104794137A CN104794137A (en) | 2015-07-22 |
CN104794137B true CN104794137B (en) | 2019-01-22 |
Family
ID=53558931
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410030043.4A Active CN104794137B (en) | 2014-01-22 | 2014-01-22 | The processing method and sorting query method and relevant apparatus and system of order recording |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104794137B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112308449B (en) * | 2020-11-12 | 2023-04-14 | 山东鲁软数字科技有限公司 | Method and system for sorting devices in branches in ring network diagram of power distribution automation system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6205445B1 (en) * | 1998-03-27 | 2001-03-20 | Matsushita Electric Industrial Co., Ltd. | File distribution system and method thereof |
CN103098056A (en) * | 2012-10-26 | 2013-05-08 | 华为技术有限公司 | Ordering method, apparatus and terminal |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8930496B2 (en) * | 2005-12-19 | 2015-01-06 | Commvault Systems, Inc. | Systems and methods of unified reconstruction in storage systems |
WO2010011342A1 (en) * | 2008-07-25 | 2010-01-28 | Brown University | Apparatus, methods, and computer program products providing dynamic provable data possession |
US9268665B2 (en) * | 2011-07-26 | 2016-02-23 | Trimble Navigation Limited | System and method for identifying fault prone computer code files |
-
2014
- 2014-01-22 CN CN201410030043.4A patent/CN104794137B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6205445B1 (en) * | 1998-03-27 | 2001-03-20 | Matsushita Electric Industrial Co., Ltd. | File distribution system and method thereof |
CN103098056A (en) * | 2012-10-26 | 2013-05-08 | 华为技术有限公司 | Ordering method, apparatus and terminal |
Also Published As
Publication number | Publication date |
---|---|
CN104794137A (en) | 2015-07-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10108544B1 (en) | Dynamic duplication estimation for garbage collection | |
US10942813B2 (en) | Cloud object data layout (CODL) | |
US7533115B2 (en) | Method for managing persistent federated folders within a federated content management system | |
US20150302111A1 (en) | Method and Apparatus for Constructing File System in Key-Value Storage System, and Electronic Device | |
CN101031907B (en) | Index processing | |
CN103631924B (en) | A kind of application process and system of distributive database platform | |
US9183212B2 (en) | Representing directory structure in content-addressable storage systems | |
CN111045857B (en) | Method for data backup and recovery, electronic device and computer readable storage medium | |
CN111427847B (en) | Indexing and querying method and system for user-defined metadata | |
JP2017504924A (en) | Content-based organization of the file system | |
EP3111406A1 (en) | Systems and methods for ephemeral eventing | |
US8880463B2 (en) | Standardized framework for reporting archived legacy system data | |
Salmon et al. | Perspective: Semantic Data Management for the Home. | |
CN112685223B (en) | File backup based on file type | |
EP4428706A2 (en) | File system metadata deduplication | |
US11977460B1 (en) | File system namespace reconstruction | |
CN107391769B (en) | Index query method and device | |
CN103530311A (en) | Method and apparatus for prioritizing metadata | |
CN104794137B (en) | The processing method and sorting query method and relevant apparatus and system of order recording | |
US20120023128A1 (en) | Discovery of user's preferred filing convention for media items | |
CN111045994B (en) | File classification retrieval method and system based on KV database | |
US8073870B2 (en) | Methods for storing data | |
Emery et al. | Full Bitcoin blockchain data made easy | |
CN113535404B (en) | Data management and control method, system, device and medium | |
CN100565495C (en) | File index is handled |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20190730 Address after: Shenzhen Futian District City, Guangdong province 518044 Zhenxing Road, SEG Science Park 2 East Room 403 Co-patentee after: Tencent cloud computing (Beijing) limited liability company Patentee after: Tencent Technology (Shenzhen) Co., Ltd. Address before: Shenzhen Futian District City, Guangdong province 518000 Zhenxing Road, SEG Science Park 2 East Room 403 Patentee before: Tencent Technology (Shenzhen) Co., Ltd. |