WO2014063351A1 - Ranking method, device and terminal - Google Patents
Ranking method, device and terminal Download PDFInfo
- Publication number
- WO2014063351A1 WO2014063351A1 PCT/CN2012/083582 CN2012083582W WO2014063351A1 WO 2014063351 A1 WO2014063351 A1 WO 2014063351A1 CN 2012083582 W CN2012083582 W CN 2012083582W WO 2014063351 A1 WO2014063351 A1 WO 2014063351A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- identification information
- data
- sorting
- updated
- data status
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 230000001960 triggered effect Effects 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 238000012163 sequencing technique Methods 0.000 description 4
- 239000000047 product Substances 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- 238000010923 batch production Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2457—Query processing with adaptation to user needs
- G06F16/24578—Query processing with adaptation to user needs using ranking
Definitions
- the present invention relates to data processing technologies, and in particular, to a method, an apparatus, and a terminal for sequencing. Background technique
- the processing of TOP N data often involves a large amount of data.
- the query system when the user queries the TOP N data, the query system generally first queries all the data sets, and sorts the data in the data set according to the given rules, and then takes the first N data as the TOP from the sorting result. N data is presented to the user. In this way, the number of times the query system reads and writes the disk is increased, thereby increasing the processing time of the query system for querying the TOP N data, and reducing the response speed of the query system.
- aspects of the present invention provide a method, apparatus, and terminal for sequencing that overcome the problem of long time consuming TOP N data in the prior art.
- a first aspect of the present invention provides a method for ranking, comprising:
- the sorting device When updating the data state of the main data in the database, the sorting device acquires a sorted list corresponding to the updated data state according to the updated data state of the main data, and the sorting list includes performing according to a preset sorting rule.
- the row is updated according to the updated data state parameter and the data state parameter corresponding to each of the identifier information
- the method further includes:
- the sorted list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identification information.
- the data state parameter corresponding to the updated data state parameter and the each identifier information Update the sorted list, including:
- Updating the sorted list according to the updated data state parameter and the data state parameter corresponding to each of the identifier information including:
- the main data corresponding to each of the identification information does not include the main data corresponding to the updated data state parameter, deleting the last identifier information in the identifier information set, and the updated data state parameter
- the identification information of the corresponding primary data is added to the sorted list according to a preset sorting rule.
- the method further includes:
- the identification information of the primary data is deleted from the sorted list
- the method further includes: When the identification information of the primary data to be deleted is deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
- the sorting list When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
- a second aspect of the present invention provides a sorting apparatus, including:
- a first obtaining unit configured to: when updating a data state of the main data in the database, acquire an ordered list corresponding to the updated data state according to the updated data state of the data, where the sorting list includes according to a preset An identification information set in which the collation is sorted;
- a second acquiring unit configured to acquire, according to each identifier information in the identifier information set acquired by the first acquiring unit, a status of the data corresponding to each identifier information
- a first updating unit configured to update the sorted list according to the updated data state parameter and a data state parameter acquired by the second acquiring unit.
- the method further includes: determining a preset threshold unit, where the determining the preset threshold unit is used to:
- the identifier information of the updated data state parameter is directly added to the sorted list, otherwise, the first update unit is triggered.
- the first update unit includes:
- a comparison subunit configured to compare the updated data state parameter with a data state parameter corresponding to a last identifier information in the identifier information set acquired by the first acquiring unit; and updating a subunit, configured to compare according to the comparison
- the comparison result of the subunits determines that the sorting list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identification information according to the preset sorting rule.
- the update subunit includes:
- a judging module configured to determine, according to the comparison result of the comparing subunits, according to the When the updated data state parameter and the data state parameter corresponding to each of the identifier information are sorted according to the preset sorting rule, determining whether the master data corresponding to each identifier information includes the The main data corresponding to the updated data state parameter, and when the judgment result is no, the sorting module is triggered;
- the sorting module is configured to delete the last identifier information in the identifier information set, and add the identifier information of the master data corresponding to the updated data state parameter to the sorted list according to a preset sorting rule.
- a second update unit is further included, where the second update unit is configured to:
- the identification information of the primary data is deleted from the sorted list
- the third update unit is further configured to:
- the identification information of the primary data is deleted from the sorted list
- the sorting list When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
- a third aspect of the present invention provides a terminal, comprising: at least one processor, and a memory, the memory for storing executable program code, wherein the processor reads the stored by:
- the method, the device and the terminal provided by the present invention only need to obtain a corresponding sorted list according to the updated data state parameter when the data state parameter of the main data in the database changes, and according to the sorted list.
- the identification information in the middle obtains N data state parameters, and then sorts according to the updated data state parameter and the acquired N data state parameters to update the sorted list, which overcomes the need to traverse when the data state parameter of the main data is updated.
- the entire database obtains the problems of low efficiency and long processing time of the first N main data that the user needs to obtain, which improves the user experience.
- FIG. 1A is a schematic structural diagram of a system for sorting according to an embodiment of the invention.
- FIG. 1B is a schematic flow chart of a method for sorting according to an embodiment of the invention.
- FIG. 2 is a schematic flow chart of a method for sorting according to another embodiment of the present invention.
- FIG. 3A is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention.
- FIG. 3B is a schematic structural diagram of a sorting apparatus according to another embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention.
- 5A is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention.
- FIG. 5B is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of a sorting apparatus according to another embodiment of the present invention. detailed description
- the sorted system includes a database 110 and a sorting device 300, and the database 110 and sorting device 300 are connectable via a bus 120.
- the database 110 includes a plurality of main data and data state parameters corresponding to the main data.
- the sorting device 300 has a sorting list, and the sorting list includes the identifier information sorted according to the preset sorting rule, and the data state parameter can be obtained according to the identifier information, and the master data can also be obtained.
- the sorting means 300 compares the updated data status parameter with the data status parameter corresponding to each identification information in the sorted list, and determines whether to update the sorted list based on the comparison result.
- the sorting device 300 only needs to update the sorted list for the updated data state parameter and the data state parameter corresponding to each identifier information in the sorted list, and does not need to traverse The entire database 110.
- this embodiment provides a method for sorting, which is used to implement fast sorting of TOP N main data when the data state parameter of the main data is updated, which is applicable to any of the prior art.
- the execution subject of the sorting method of this embodiment is a sorting means.
- FIG. 1B which is a schematic flowchart of a method according to the sorting according to the embodiment, the method includes:
- Step 101 When updating the data state of the main data in the database, the sorting device obtains the sorted list corresponding to the updated data state according to the updated data state, and the sorting list includes the identifier information sorted according to the preset sorting rule.
- the identification information of this embodiment is used to acquire the data state t.
- the identifier information may include an address of the data state parameter, and the data state parameter may be obtained according to the address of the data state parameter.
- the identifier information may be The address including the main data, after finding the main data according to the address of the main data, can find the corresponding data state parameter through the main data.
- the main data according to the data state can be obtained according to the data state.
- identification information may also include other various forms, as long as the identification information can be passed.
- the data state parameter may be found, and may be set according to actual requirements, which is not limited by the embodiment of the present invention.
- the database usually includes a lot of main data, and each main data can correspond to multiple data status parameters, which can be set according to actual needs.
- the main data is the sort name that the user needs to obtain, and the data status parameter is the attribute value of the main data.
- the main data can be "song name", the data status can be "download times", “on-demand times”, etc., or the main data can be "title”, and the data status can be "click", "update word”, etc. .
- the updated ⁇ : according to the status is the data status parameter that is currently changing, for example, when the number of downloads of a song is « ⁇ , the song of the song is named master data, and the corresponding download count is the updated data state. parameter.
- the main data and its main data and the list of the status thereof may correspond to a sorted list, or may correspond to multiple sorted lists, for example, when the data status is “click volume”, a corresponding sorted list thereof
- the N pieces of identification information arranged in descending order of the click amount may be included to obtain N data state parameters sorted according to the click amount from large to small, and each data state parameter of the N data state parameters
- the main data corresponding to each of the N data state parameters is the TOP N main data that the user needs to obtain; and the corresponding other sorted list may include the order of the downloads from small to large.
- N pieces of identification information in order to obtain the N from small to large according to the download amount: according to the status parameter and the main data corresponding to each of the N data states.
- the method for obtaining the preset sorted list can be obtained according to the prior art, that is, traversing the data state of all the main data in the database to find the top N data states t according to a preset sorting rule.
- N is an integer greater than 0.
- Step 102 Acquire, according to each identifier information in the identifier information set, a data state parameter corresponding to each identifier information.
- the identification information set included in the sorting list may include N pieces of identification information, and the main data and the data status parameter corresponding to each of the N pieces of identification information may be obtained according to the N pieces of identification information.
- the data state parameter may be obtained first, and then the obtained data state parameter obtains the main data, and the data state parameter and the main data may be simultaneously acquired according to the identification information.
- the sorting list itself may also include the data state.
- master data ie the data status and/or the master data itself is the identification information.
- Identification letter The specific implementation of the information and how to obtain the corresponding data shape parameters through the identification information can be set according to actual needs, and will not be mentioned here.
- Step 103 Update the sorted list according to the updated data state parameter and the data state parameter corresponding to each of the identifier information.
- the sorted list may be updated according to the updated data state parameter and the sorted result of the obtained data state parameter corresponding to each of the identifier information, so as to ensure that the user obtains the TOP N master data according to the sorted list.
- the sorting method of the embodiment when the data state parameter of the main data in the database changes, only N data state parameters need to be acquired according to the sorted list, and according to the updated data state parameter and the N data in the sorted list.
- the status parameter, updating the sorted list overcomes the problem of traversing the entire database when updating the data state parameters of the main data, thereby reducing the time for obtaining the TOP N main data and improving the user experience.
- the sorted list is preferably stored in the memory of the sorting device, that is, the preset sorted list is obtained according to the updated data state parameter, including: acquiring the preset in the memory of the sorting device according to the updated data state parameter. Sort the list. This minimizes the number of disk read and write operations.
- This embodiment provides a method of sorting based on the above embodiment. As shown in Fig. 2, it is a flow chart of the method of sorting according to the present embodiment.
- Step 201 When updating the data state history of the main data in the database, the sorting device determines, according to the updated data state of the data, whether there is a sorted list corresponding to the updated data state, and the sorting list includes sorting according to a preset. After the rule sorts the identification information set, when the judgment result is yes, ⁇ step 202, otherwise 4 kiosk # ⁇ .
- the identifier information set is a set of identifier information, and may include at least zero identifier information.
- Each data state belongs to a certain category. For example, when the data status is "click”, the category to which it belongs is "click volume”.
- the data state parameter of the main data is not necessarily used as the sorting. Only when the data state parameter of the main data is used as the sorting, the following steps are performed, for example, when the updated data state parameter is When there is no sorting list for the category of "Lyrics Words" for the “Lyonym Words", no further operations are required.
- the TOPN sort index ⁇ ⁇ sorts the category of the list, which can reflect the preset sorting rules B'J, for example, "the top N songs with the most clicks", “the top N books with the most downloads", "the top N Taobao stores with the least amount of reviews” and so on.
- the data status ⁇ 7 "click" of a song its corresponding TOP N sort index is "the top N songs with the most clicks”. Where N is an integer greater than zero.
- the TOPN sort index can be associated with a data status parameter.
- the index data is used as the identification information as an example for description.
- the sorting device obtains the sorted list according to the updated data state parameter, that is, the sorted list includes N index data.
- Each index data can be composed of "address of data status parameter", "sort number; address of data status parameter” or "sort number; song name; address of data status parameter”, etc., according to actual needs Make settings.
- the data state parameter corresponding to the index data may be directly obtained, or the main data corresponding to the index data may be acquired according to the index data, and the corresponding data state parameter is obtained according to the acquired main data, for example, according to the song name.
- the required data status parameters such as the click amount, the download amount, and the lyrics corresponding to the song name.
- the N corresponding to the sorted list can be called the TOP N data state parameter.
- Step 202 Determine whether the number of the identification information included in the identifier information set is less than a preset threshold. When the determination result is yes, go to step 203, otherwise go to step 204.
- the preset threshold of this embodiment may be set according to actual needs, and the preset threshold is not less than N. Specifically, the number of TOP N index data in the sorted list may be set to N according to actual needs. When the index data in the TOP N index data has been deleted before, but the new index data is not added to the TOP N index data, the number of TOP N index data is less than the preset threshold.
- Step 203 Add the identifier information of the updated data state parameter directly to the sorting list.
- the identifier information of the updated data state parameter may be directly added to the sorting list according to a preset sorting rule.
- Step 204 Compare the updated data state parameter with the data state parameter corresponding to the Nth identifier information in the identifier information set, and determine whether to update the sorting list according to the comparison result. When the determination result is yes, perform step 205, otherwise stop. operating.
- the last identification information is the identification information located at the last digit after the identification information set is sorted according to the preset rule. For example, when the updated data status parameter is "click volume”, the corresponding TOP N sort index is "the top N songs with the most clicks", and the sorted list includes the identification information corresponding to the top N songs with the most clicks.
- the data status parameter is the song click amount, and the sorting rule is arranged according to the click amount from large to small.
- the updated data state parameter becomes 200, and the data state parameter corresponding to the last TOP N index data in the TOP N index data set is 500, it can be known by comparison that the updated data state parameter is smaller than the last TOP N index data.
- Step 205 When it is determined according to the comparison result that the updated data state parameter and the data state parameter corresponding to each identifier information are to be sorted according to the preset sorting rule, determining and Whether the main data corresponding to each identification information includes the main data corresponding to the updated data status parameter. When the determination result is yes, the operation of step 206 is performed; otherwise, the operation of step 207 is performed.
- Step 206 Adjust the location of the identifier information of the updated data state parameter in the sorted list according to a preset collation.
- the identification information in the sorting list is reordered according to the value of the data state parameter according to the preset rule.
- Step 207 Delete the last identifier information in the sorted list, and add the identifier information of the master data corresponding to the updated data state parameter to the sorted list according to a preset sorting rule.
- the method of the embodiment by comparing the updated data state parameter with the data state parameter corresponding to the last index data in the TOP N index data, it can be determined whether the index data corresponding to the updated data needs to be added.
- the TOP N index data set reordering is only for the data status parameters corresponding to the updated data and the TOP N index data set. Row sorting requires less data to operate, reducing the burden on the sorting system.
- the identification information that can be included in the sorted list and/or the data state parameter corresponding to each of the identification information is also located in the memory of the sorting device, and the disk read and write operations can be minimized. .
- step 202 can also be performed between step 204 and step 207.
- TOP N sort index, TOP N data status and TOP N index data can all be used in the form of a list, and the corresponding TOPN main data can also use a column (column) manner, and can be used with each other.
- the way to map to find another item you want based on an item. In this way, creating TOPN index data can be as follows:
- This embodiment is further illustrated based on the method of sequencing in the second embodiment.
- each index data in the TOP N index data includes a sorted sort list 1
- the data state parameter is first obtained, and then the corresponding book name is obtained according to the data state parameter.
- the book name corresponding to address 1 is A, the click volume is 100; the book name corresponding to address 2 is B, and the click volume is 50; the book name corresponding to address 3 is C, the click volume is 30, and the book name corresponding to address 4
- the number of hits is 20, which is not included in the TOP N index data.
- the click volume of a certain book name in the database changes, for example, when the click amount of D becomes 40, it is judged that the corresponding index data is not in the preset TOP N index data, and then the amount of click of C is compared first and found. If the amount of clicks is greater than C, C is deleted, and the clicks of A, B, and D are compared, and the order is sorted in descending order.
- the updated TOP N index data is shown in Table 2.
- the click amount of a certain book name in the database changes, for example, when the click amount of B becomes 120, it is judged that the index data corresponding to B is located in the preset TOP N index data, and the click amount of B can be ranked only The number of clicks before B is compared, that is, only compared with A, and it is found that the click volume of B has exceeded the hit amount of A, and the updated TOP N index data is shown in the sorted list 3.
- the sorting system does not need to traverse the click volume corresponding to all book titles in the database for sorting, only based on the updated click volume and the preset TOP N main data.
- the number of clicks is sorted, the amount of data manipulated is small, the sorting speed is fast, and the sorting system is lighter.
- This embodiment further supplements the method of sorting in the above embodiment.
- This embodiment only specifies the operation of deleting the main data and the data state parameters corresponding to the main data.
- the identification information of the primary data to be deleted is deleted, the identification information of the primary data to be deleted is deleted from the sorted list.
- the update may be performed by any of the following methods:
- Method 1 lazy update mode: traverse the data status parameter in the database where the main data is located and update the sorted list so that the number of identification information included in the identification information set is iiJij preset threshold.
- the index data of the main data to be deleted is deleted from the TOP N index data, and the operation of adding the index data is not performed at this time, so that the number of index data in the TOP N index data is smaller than a preset threshold.
- the index data is added to the TOPN index data to make up the number of index data in the TOPN index data.
- the index data added in this way is not a true TOP N index data, It can avoid traversal of the entire database.
- the real TOPN index data is the most active data, the corresponding data state parameters will be updated very quickly, so the index data that should really be in the TOPN index data will soon be updated. Will be entered into the TOPN index data.
- Method 2 Fast update mode: when updating the sorted list, determining whether the main data corresponding to each identifier information includes the main data corresponding to the updated data state parameter, and when the judgment result is no, The identification information of the primary data corresponding to the updated data state parameter is added to the sorted list according to the preset sorting rule.
- Delete the index data corresponding to the data state parameter from the TOP N index data immediately traverse the data state parameter in the database, and find out that it should enter the TOP N data state parameter.
- the data status parameter, and its corresponding index data is added to the TOP N index data.
- the fast update method enables the user to obtain accurate TOP N master data each time.
- the number of index data in the preset TOP N index data may be set to N+S, that is, the preset threshold is N+S, where S is an integer greater than 0.
- the user requests the TOP N main data
- the user returns the data corresponding to the first N index data in the TOP N index data according to the TOP N index data.
- a delete operation occurs, such as deleting M index data
- the user can still see N TOP N main data, where 1 ⁇ 1 8 and ⁇ 1 are integers.
- the preset threshold in the TOP N index data is generally not modified.
- the preset threshold is decreased, the excess index data in the TOP N index data is deleted.
- the current preset threshold is 10, and the preset threshold is modified to 8 , delete the ninth index data and the tenth index data in the TOP N index data.
- the preset threshold is increased, the TOP N index data can be updated by using the lazy update method and the fast update method, and will not be described here.
- the embodiment provides a sorting apparatus for performing the sorting method of the first embodiment.
- FIG. 3A it is a schematic structural view of the sorting apparatus according to the present embodiment.
- the sorting device 300 includes a first obtaining unit 301, a second obtaining unit 302, and a first updating unit 303. Obtaining, according to the updated t data state of the main data, a sorting list corresponding to the updated data state, and the sorting list includes an identifier information set sorted according to a preset sorting rule;
- the second obtaining unit 302 is configured to use each of the identifier information sets acquired by the first acquiring unit 301. Identifying information, obtaining a data state corresponding to each of the identification information
- the first update unit 303 is configured to update the sorted list according to the updated data state parameter and the data state parameter acquired by the second obtaining unit 302.
- the sorting apparatus 300 of this embodiment when the data state parameter of the main data in the database changes, only N data state parameters need to be acquired according to the sorted list, and according to the updated data state parameter and the N corresponding to the sorted list.
- the data state parameters are sorted to update the sorted list, which overcomes the problem of low efficiency and long processing time of traversing the entire database to obtain the first N main data of interest to the user when the data state parameter of the main data is updated. User experience.
- the sorted list is preferably stored in the memory of the sorting device 300, that is, the preset sorted list is obtained according to the updated data state parameter, including: the in-memory preset of the sorting device 300 according to the updated data state parameter. Sorted list. This minimizes disk read and write operations.
- the sorting apparatus of this embodiment further includes a determining preset threshold unit 310, where the determining preset threshold unit 310 is configured to:
- the identifier information of the updated data state parameter is directly added to the sorting list, otherwise, the first updating unit 303 is triggered.
- This embodiment provides a sorting apparatus for performing the method of the 4# sequence of the second embodiment, the third embodiment or the fourth embodiment based on the fifth embodiment.
- the sorting device 300 includes a first obtaining unit 301, a second obtaining unit 302, and a first updating unit 303, which are consistent with the fifth embodiment, and may further include a determining preset threshold unit 310, which is not described herein.
- the first update unit 303 includes a comparison subunit 401 and an update subunit 402.
- the comparison subunit 401 is configured to compare the updated data state parameter with a data state parameter corresponding to the last identifier information in the identifier information set acquired by the first obtaining unit 301;
- the update subunit 402 is configured to The comparison result of the comparison subunit 401 determines that the updated data state parameter and the data state parameter corresponding to each of the identification information are required, When sorting according to the preset sorting rule, the sorted list is updated.
- the update subunit 402 includes a decision module 403 and a sort module 404.
- the determining module 403 is configured to determine, according to the comparison result of the comparing subunit 401, according to the updated data state parameter and the data state parameter corresponding to each identifier information, according to the preset
- the sorting rule is sorted, it is determined whether the main data corresponding to each of the identification information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the sorting module 404 is triggered; the sorting module 404 And deleting the last identifier information in the identifier information set, and adding the identifier information of the master data corresponding to the updated data state parameter to the sorted list according to a preset sorting rule.
- the sorting apparatus 300 of this embodiment further includes a second updating unit 405, where the second updating unit 405 is configured to:
- the identification information of the primary data is deleted from the sorted list
- the sorting apparatus of this embodiment further includes a third updating unit 406, where the third updating unit 406 is configured to:
- the identification information of the primary data is deleted from the sorted list
- the sorting list When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
- sorting device 300 may only need one of the second update unit 405 and the third update unit 406.
- the second update unit 405 and the third update unit 406 may exist at the same time. It is actually necessary to determine which update unit to start.
- the first obtaining unit 301 of this embodiment may be specifically configured to:
- the sorted list corresponding to the updated data state in the memory of the forest sorting apparatus 300 is obtained according to the updated data state, and the sorted list includes the identification information sorted according to the preset sorting rule.
- the identification information set includes N identification information, according to the N identifiers The information can obtain TOP N main data, where N is an integer greater than zero.
- sorting apparatus 300 of this embodiment is consistent with the second embodiment, the third embodiment, or the fourth embodiment, and will not be further described herein.
- the sorting apparatus 300 of the present embodiment by comparing the updated data with the data state parameters acquired according to the last identifier information in the sorted list, it can be determined whether the index data corresponding to the updated data needs to be added to the sorted list. Reordering only sorts the data state parameters corresponding to the updated data and the sorted list, and requires less data to operate, which reduces the burden on the sorting system.
- FIG. 5A is a structural diagram of another sorting apparatus according to an embodiment of the present invention.
- the sequencing device includes at least one processor 601, a communication bus 602, a memory 603, and at least one communication interface 604.
- the communication bus 602 is configured to implement a connection and communication between the components, and the communication interface 604 is configured to connect and communicate with an external device.
- the memory 603 is configured to store program code that needs to be executed, and the program may include: a first obtaining unit 6301, a second obtaining unit 6302, and a first updating unit 6303;
- the second obtaining unit 6302 is configured to obtain, according to each identifier information in the identifier information set acquired by the first acquiring unit 6301, a status of the data corresponding to each identifier information.
- the first update unit 6303 is configured to update the sorted list according to the updated data state parameter and the data state parameter acquired by the second obtaining unit 6302.
- the program code 603 for storing the program code to be executed may further include determining a preset threshold unit 6310, where the determining preset threshold unit 6310 is configured to:
- the identifier information of the updated data state parameter is directly added to the sorting list, otherwise, the first updating unit 6303 is triggered.
- This embodiment is a structure of still another sorting apparatus provided based on Embodiment 7.
- the first update unit 6303 in the sorting means 603 includes a comparison subunit 6401 and an update subunit 6402.
- the comparing subunit 6401 is configured to compare the updated data state parameter with a data state parameter corresponding to the last identifier information in the identifier information set acquired by the first acquiring unit 6301;
- the update subunit 6402 is configured to determine, according to the comparison result of the comparison subunit 6401, according to the updated data state parameter and the data state parameter corresponding to each identifier information, according to the preset When the collation is sorted, the sorted list is updated.
- the update subunit 6402 includes a decision module 6403 and a sort module 6404.
- the determining module 6403 is configured to determine, according to the comparison result of the comparing subunit 6401, according to the updated data state parameter and the data state parameter corresponding to each identifier information, according to the preset When the sorting rule is sorted, it is determined whether the main data corresponding to each of the identification information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the sorting module 6404 is triggered;
- the sorting module 6404 is configured to delete the last identifier information in the identifier information set, and the identifier information of the master data corresponding to the updated data state parameter is added to the sorted list according to a preset sorting rule.
- the memory 603 in the sorting apparatus of this embodiment further includes a second updating unit 6405, where the second updating unit 6405 is configured to:
- the identification information of the primary data is deleted from the sorted list
- the memory 603 in the sorting apparatus of this embodiment further includes a third updating unit 6406, where the third updating unit 6406 is configured to:
- the identification information of the primary data is deleted from the sorted list
- the sorting list When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
- the first obtaining unit 6301 in the memory 603 of the embodiment may be specifically configured to: when updating the data state of the main data, obtain the corresponding data state in the memory of the forest sorting device according to the updated data state.
- the sorting list includes an identifier information set that is sorted according to a preset sorting rule, and the identifier information set includes N pieces of identification information, and the TOP N master data can be obtained according to the N pieces of identification information.
- the sorting apparatus of the embodiment by comparing the updated data with the data state parameters obtained according to the last identifier information in the sorted list, it can be determined whether the index data corresponding to the updated data needs to be added to the sorted list, and reordering It also only sorts the updated data and the data state parameters corresponding to the sorted list, and requires less data to operate, which reduces the burden on the sorting system.
- the embodiment further provides a terminal, which includes at least one processor, and a memory, where the memory is used to store the program code, wherein the processor can perform the batch process by reading the stored batch program.
- a terminal which includes at least one processor, and a memory, where the memory is used to store the program code, wherein the processor can perform the batch process by reading the stored batch program.
- the processor updates the data by reading the updated data state parameter and the data state parameter corresponding to each of the identification information by reading the configurable program in the device Before sorting the list, it is also executed by reading the executable programs in the M3 ⁇ 4 device:
- the sorted list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identification information.
- the processor when the processor reads the program corresponding to the executable program code by reading the executable program in the ear device, the program is used according to the updated data state parameter and the N sorted data states.
- the parameter updates the sorted list the specifics can be:
- the processor determines, according to the comparison result, that the data state parameter that is updated according to the updated data state parameter and the data state parameter that is obtained according to each identifier information is sorted according to a preset sorting rule, specifically:
- the main data corresponding to each of the identification information does not include the main data corresponding to the updated data state parameter, deleting the last identifier information in the identifier information set, and the updated data state parameter
- the identification information of the corresponding primary data is added to the sorted list according to a preset sorting rule.
- the processor can also run the sequence corresponding to the executable by reading the executable program code stored in the devices for:
- the identification information of the primary data is deleted from the sorted list
- the identification information of the primary data to be deleted is deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
- the sorting list When the sorting list is updated, it is determined whether the main data corresponding to each of the identification information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state parameter is corresponding.
- the identification information of the primary data is added to the sorted list according to a preset sorting rule. According to the terminal of the embodiment, when the data state parameter of the main data in the database changes, only N data state parameters need to be obtained according to the sorted list, and according to the updated data state parameter and the N data in the sorted list.
- the state parameters are sorted to update the sorted list, which overcomes the problem that when the data state parameter of the main data is updated, the entire database needs to be traversed to obtain the first N main data of the user, and the operation efficiency is low and the processing time is long, thereby improving the user's Full body.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Provided are a ranking method, device and terminal. The method comprises: when the data state of master data in a database is updated, a ranking device acquiring a ranking list corresponding to the updated data state according to the updated data state of the master data, the ranking list comprising an identification information set ranked according to a preset ranking rule; according to each piece of identification information in the identification information set, acquiring data state parameters corresponding to each piece of the identification information; and according to the updated data state parameters and the data state parameters corresponding to each piece of the identification information, updating the ranking list. According to the ranking method, device and terminal of the present invention, the problem of acquiring TOP N data being time-consuming in the prior art can be overcome.
Description
一种排序的方法、 装置与终端 技术领域 本发明涉及数据处理技术, 尤其涉及一种排序的方法、 装置与终端。 背景技术 TECHNICAL FIELD The present invention relates to data processing technologies, and in particular, to a method, an apparatus, and a terminal for sequencing. Background technique
现有技术中, 为了提高企业、 个人、 产品等的知名度, 获取更大商业价 值, 艮多商业机构常常通过电视、 新闻或网络等媒体为排名位于前 N个的企 业、 个人和产品做 TOP N宣传和推广。 例如, 可以为世界排名前 500强的企 业进行宣传和推广。 In the prior art, in order to increase the visibility of enterprises, individuals, products, etc., and to obtain greater commercial value, many commercial organizations often do TOP N for the top N companies, individuals, and products through media such as television, news, or the Internet. Promotion and promotion. For example, it can be promoted and promoted by the top 500 companies in the world.
TOP N数据的处理往往涉及的数据量很大。 现有技术中, 用户在查询 TOP N数据时, 查询系统一般先查询出所有的数据集, 并对数据集中的数据 按照给定的规则进行排序,然后从排序结果中取出前 N个数据作为 TOP N数 据呈现给用户。 这样, 会增加查询系统读写磁盘的次数, 从而增加了查询系 统查询 TOP N数据的处理时间 , 降低了查询系统的响应速度。 发明内容 The processing of TOP N data often involves a large amount of data. In the prior art, when the user queries the TOP N data, the query system generally first queries all the data sets, and sorts the data in the data set according to the given rules, and then takes the first N data as the TOP from the sorting result. N data is presented to the user. In this way, the number of times the query system reads and writes the disk is increased, thereby increasing the processing time of the query system for querying the TOP N data, and reducing the response speed of the query system. Summary of the invention
本发明的多个方面提供一种排序的方法、 装置与终端, 用于克服现有 技术中获取 TOP N数据时耗费时间长的问题。 Aspects of the present invention provide a method, apparatus, and terminal for sequencing that overcome the problem of long time consuming TOP N data in the prior art.
本发明第一个方面提供一种排序的方法, 包括: A first aspect of the present invention provides a method for ranking, comprising:
当更新数据库中主数据的数据状态 时, 排序装置根据所述主数据的已更新 的数据状态 获取与所述已更新的数据状态 对应的排序列表, 所述排序列 表包括按照预设的排序规则进行排序后的标识信息集; When updating the data state of the main data in the database, the sorting device acquires a sorted list corresponding to the updated data state according to the updated data state of the main data, and the sorting list includes performing according to a preset sorting rule. The sorted identification information set;
根据所述标识信息集中的每个标识信息, 获取与所述每个标识信息对应的数据 状态参数; Acquiring, according to each identifier information in the identifier information set, a data status parameter corresponding to each identifier information;
根据所述已更新的数据状态参数以及所述与所述每个标识信息对应的数 据状态参数, 更新所述排序列表。 And updating the sorted list according to the updated data state parameter and the data state parameter corresponding to each of the identification information.
在第一种可能的实现方式中, 根据第一方面, 在根据所述已更新的数 据状态参数以及所述与所述每个标识信息对应的数据状态参数, 更新所述排
序列表之前, 所述方法还包括: In a first possible implementation manner, according to the first aspect, the row is updated according to the updated data state parameter and the data state parameter corresponding to each of the identifier information Before the sequence table, the method further includes:
判断所述标识信息集中所包含的标识信息的数目是否小于预设阈值; 若所述数目小于所述预设阈值, 则将所述已更新的数据状态参数的标 识信息直接加入所述排序列表, 否则, 根据所述已更新的数据状态参数以 及与所述每个标识信息对应的数据状态参数, 更新所述排序列表。 Determining whether the number of the identification information included in the identifier information set is less than a preset threshold; if the number is less than the preset threshold, adding the identifier information of the updated data state parameter directly to the sorting list, Otherwise, the sorted list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identification information.
在第二种可能的实现方式中, 结合第一方面或第一种可能的实现方 式, 所述根据所述已更新的数据状态参数以及所述与所述每个标识信息对应 的数据状态参数, 更新所述排序列表, 包括: In a second possible implementation manner, in combination with the first aspect or the first possible implementation manner, the data state parameter corresponding to the updated data state parameter and the each identifier information, Update the sorted list, including:
将所述已更新的数据状态参数与所述标识信息集中最后一个标识信 息对应的数据状态参数进行比较; Comparing the updated data state parameter with a data state parameter corresponding to the last identification information in the identification information set;
当根据比较结果确定需根据所述已更新的数据状态参数以及所述与 所述每个标识信息对应的数据状态参数, 按照所述预设的排序规则进行排序 时, 更新所述排序列表。 在第三种可能的实现方式中, 结合第一方面或第 一种可能的实现方式或第二种可能实现的方式, And determining, according to the comparison result, that the sorted list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identifier information, according to the preset sorting rule. In a third possible implementation manner, in combination with the first aspect or the first possible implementation manner or the second possible implementation manner,
所述根据所述已更新的数据状态参数以及与所述每个标识信息对应的数 据状态参数, 更新所述排序列表, 包括: Updating the sorted list according to the updated data state parameter and the data state parameter corresponding to each of the identifier information, including:
判断与所述每个标识信息对应的主数据是否包含所述已更新的数据状态 参数对应的主数据; Determining whether the main data corresponding to each of the identification information includes main data corresponding to the updated data status parameter;
当与所述每个标识信息对应的主数据未包含所述已更新的数据状态参数 对应的主数据, 则删除所述标识信息集中最后一个标识信息, 并将与所述 已更新的数据状态参数对应的主数据的标识信息按照预设的排序规则加 入到所述排序列表中。 When the main data corresponding to each of the identification information does not include the main data corresponding to the updated data state parameter, deleting the last identifier information in the identifier information set, and the updated data state parameter The identification information of the corresponding primary data is added to the sorted list according to a preset sorting rule.
在第四种可能的实现方式中, 结合第一种可能实现的方式或第二种可 能的实现方式或第三种可能实现的方式, 还包括: In a fourth possible implementation manner, in combination with the first possible implementation manner, the second possible implementation manner, or the third possible implementation manner, the method further includes:
当需删除主数据的标识信息时, 从所述排序列表中删除需删除的主数据 的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
遍历所述数据库中的数据状态 并更新所述排序列表, 以使所述标识信息集 所包含的标识信息的数目达到所述预设阈值。 Traversing the data status in the database and updating the sorted list such that the number of identification information included in the identification information set reaches the predetermined threshold.
在第五种可能的实现方式中, 结合第一种可能实现的方式至第四种可 能实现的方式, 还包括:
当需删除的主数据的标识信息时, 从所述排序列表中删除需删除的主数 据的标识信息; In a fifth possible implementation manner, combining the first possible implementation manner with the fourth possible implementation manner, the method further includes: When the identification information of the primary data to be deleted is deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
当更新所述排序列表时, 判断所述每个标识信息对应的主数据中是否包含所 述已更新的数据状态参数对应的主数据, 当判断结果为否时, 将所述已更 新的数据状态参数对应的主数据的标识信息按照所述预设的排序规则加 入到所述排序列表中。 When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
本发明第二方面提供一种排序装置, 包括: A second aspect of the present invention provides a sorting apparatus, including:
第一获取单元, 用于当更新数据库中主数据的数据状态 时, 根据所 数据的已更新的数据状态 获取与所述已更新的数据状态 对应的排序列表, 所述排序列表包括按照预设的排序规则进行排序的标识信息集; a first obtaining unit, configured to: when updating a data state of the main data in the database, acquire an ordered list corresponding to the updated data state according to the updated data state of the data, where the sorting list includes according to a preset An identification information set in which the collation is sorted;
第二获取单元, 用于根据所述第一获取单元获取的标识信息集中的每个标识 信息, 获取与所述每个标识信息对应的^:据状态 a second acquiring unit, configured to acquire, according to each identifier information in the identifier information set acquired by the first acquiring unit, a status of the data corresponding to each identifier information
第一更新单元,用于根据所述已更新的数据状态参数以及所述第二获取 单元获取的数据状态参数, 更新所述排序列表。 And a first updating unit, configured to update the sorted list according to the updated data state parameter and a data state parameter acquired by the second acquiring unit.
在第一种可能的实现方式中, 根据第二方面, 还包括: 判断预设阈值单元, 所述判断预设阈值单元用于: In a first possible implementation manner, according to the second aspect, the method further includes: determining a preset threshold unit, where the determining the preset threshold unit is used to:
判断所述第一获取单元获取的标识信息集中所包含的标识信息的数 目是否小于预设阈值; Determining whether the number of the identification information included in the identifier information set acquired by the first acquiring unit is less than a preset threshold;
若所述数目小于所述预设阈值时, 则将所述已更新的数据状态参数的 标识信息直接加入所述排序列表, 否则, 触发所述第一更新单元。 And if the number is less than the preset threshold, the identifier information of the updated data state parameter is directly added to the sorted list, otherwise, the first update unit is triggered.
在第二种可能的实现方式中, 结合第一方面或第一种可能实现的方式, 所述第 一更新单元包括: In a second possible implementation manner, in combination with the first aspect or the first possible implementation manner, the first update unit includes:
比较子单元, 用于将所述已更新的数据状态参数与所述第一获取单元 获取的标识信息集中最后一个标识信息对应的数据状态参数进行比较; 更新子单元, 用于当根据所述比较子单元的比较结果确定需根据所述 更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参数, 按 照所述预设的排序规则进行排序时, 更新所述排序列表。 a comparison subunit, configured to compare the updated data state parameter with a data state parameter corresponding to a last identifier information in the identifier information set acquired by the first acquiring unit; and updating a subunit, configured to compare according to the comparison The comparison result of the subunits determines that the sorting list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identification information according to the preset sorting rule.
在第三种可能的实现方式中, 结合第二种可能的实现方式, 所述更新 子单元包括: In a third possible implementation manner, in combination with the second possible implementation manner, the update subunit includes:
判断模块, 用于当根据所述比较子单元的比较结果确定需根据所述已
更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参数, 按 照所述预设的排序规则进行排序时, 判断与所述每个标识信息对应的主数 据是否包含所述已更新的数据状态参数对应的主数据, 并当判断结果为否 时, 触发排序模块; a judging module, configured to determine, according to the comparison result of the comparing subunits, according to the When the updated data state parameter and the data state parameter corresponding to each of the identifier information are sorted according to the preset sorting rule, determining whether the master data corresponding to each identifier information includes the The main data corresponding to the updated data state parameter, and when the judgment result is no, the sorting module is triggered;
所述排序模块, 用于删除所述标识信息集中最后一个标识信息, 并将 与所述已更新的数据状态参数对应的主数据的标识信息按照预设的排序 规则加入到所述排序列表中。 The sorting module is configured to delete the last identifier information in the identifier information set, and add the identifier information of the master data corresponding to the updated data state parameter to the sorted list according to a preset sorting rule.
在第四种可能的实现方式中, 结合第一种可能实现的方式至第三种可 能实现的方式, 还包括第二更新单元, 所述第二更新单元用于: In a fourth possible implementation, in combination with the first possible implementation manner to the third possible implementation manner, a second update unit is further included, where the second update unit is configured to:
当需删除主数据的标识信息时, 从所述排序列表中删除所述需删除的 主数据的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
遍历所述数据库中的数据状态 并更新所述排序列表, 以使所标识信息集所 包含的标识信息的个数 所述预设阈值。 Traversing the state of the data in the database and updating the sorted list such that the number of pieces of identification information included in the identified set of information is the predetermined threshold.
在第五种可能的实现方式中, 结合第一种可能实现的方式至第三种 可能实现的方式, 还包括第三更新单元, 所述第三更新单元用于: In a fifth possible implementation manner, in combination with the first possible implementation manner to the third possible implementation manner, the third update unit is further configured to:
当需删除主数据的标识信息时, 从所述排序列表中删除需删除的主数据 的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
当更新所述排序列表时, 判断所述每个标识信息对应的主数据中是否包含所 述已更新的数据状态参数对应的主数据, 当判断结果为否时, 将所述已更 新的数据状态参数对应的主数据的标识信息按照所述预设的排序规则加 入到所述排序列表中。 When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
本发明第三方面提供一种终端, 包括: 至少一个处理器, 以及存储器, 所述存储器用于存储可执行程序代码, 其中, 所述处理器通过读取所述存 以用于: A third aspect of the present invention provides a terminal, comprising: at least one processor, and a memory, the memory for storing executable program code, wherein the processor reads the stored by:
当更新数据库中主数据的数据状态 时, 根据所 数据的已更新的数据状 态 获取与所述已更新的数据状态 对应的排序列表, 所述排序列表包括按 照预设的排序规则进行排序后的标识信息集; When updating the data status of the primary data in the database, obtaining an ordered list corresponding to the updated data status according to the updated data status of the data, where the sorted list includes the identifiers sorted according to a preset sorting rule Information set
根据所述标识信息集中的每个标识信息, 获取与所述每个标识信息对应的数据 状态参数;
根据所述已更新的数据状态参数以及所述与所述每个标识信息对应的数 据状态参数, 更新所述排序列表。 Obtaining, according to each identifier information in the identifier information set, a data state parameter corresponding to each identifier information; Updating the sorted list according to the updated data state parameter and the data state parameter corresponding to each of the identification information.
由上述技术方案可知, 本发明提供的排序的方法、 装置与终端, 当数 据库中主数据的数据状态参数发生变化时, 仅需要根据已更新的数据状态 参数获取相应的排序列表,并根据排序列表中的标识信息获取 N个数据状 态参数即可,然后根据更新的数据状态参数和已获取的 N个数据状态参数 进行排序, 以更新排序列表, 克服了当主数据的数据状态参数进行更新时 需要遍历整个数据库获取用户所需获取的前 N个主数据的运行效率低和 处理时间长的问题, 提升了用户的体验。 附图说明 According to the foregoing technical solution, the method, the device and the terminal provided by the present invention only need to obtain a corresponding sorted list according to the updated data state parameter when the data state parameter of the main data in the database changes, and according to the sorted list. The identification information in the middle obtains N data state parameters, and then sorts according to the updated data state parameter and the acquired N data state parameters to update the sorted list, which overcomes the need to traverse when the data state parameter of the main data is updated. The entire database obtains the problems of low efficiency and long processing time of the first N main data that the user needs to obtain, which improves the user experience. DRAWINGS
实施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见 地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的 附图。 The drawings used in the embodiments or the description of the prior art are briefly described. It is obvious that the drawings in the following description are some embodiments of the present invention, and are not creative to those skilled in the art. Other drawings can also be obtained from these drawings on the premise of labor.
图 1 A为根据发明一实施例的排序的系统的结构示意图; 1A is a schematic structural diagram of a system for sorting according to an embodiment of the invention;
图 1B为根据本发明一实施例的排序的方法的流程示意图; FIG. 1B is a schematic flow chart of a method for sorting according to an embodiment of the invention; FIG.
图 2为根据本发明另一实施例的排序的方法的流程示意图; 2 is a schematic flow chart of a method for sorting according to another embodiment of the present invention;
图 3A为根据本发明又一实施例的排序装置的结构示意图; FIG. 3A is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention; FIG.
图 3B为根据本发明另一实施例的排序装置的结构示意图; FIG. 3B is a schematic structural diagram of a sorting apparatus according to another embodiment of the present invention; FIG.
图 4为根据本发明再一实施例的排序装置的结构示意图; 4 is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention;
图 5 A为根据本发明又一实施例的排序装置的结构示意图; 5A is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention;
图 5B为根据本发明再一实施例的排序装置的结构示意图; FIG. 5B is a schematic structural diagram of a sorting apparatus according to still another embodiment of the present invention; FIG.
图 6为根据本发明另一实施例的排序装置的结构示意图。 具体实施方式 FIG. 6 is a schematic structural diagram of a sorting apparatus according to another embodiment of the present invention. detailed description
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述,显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。
基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。 The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
如图 1A所示, 为根据本发明的排序的系统的结构示意图。 该排序的 系统包括数据库 110和排序装置 300 , 数据库 110和排序装置 300可通过 总线 120连接。 数据库 110中包括多个主数据以及各主数据对应的数据状 态参数。 排序装置 300中内设排序列表, 该排序列表包括按照预设的排序 规则进行排序后的标识信息, 根据标识信息可以获取数据状态参数, 还可 以获取到主数据。 当更新主数据的数据状态参数时, 排序装置 300将已更 新的数据状态参数与排序列表中各标识信息对应的数据状态参数进行比 较, 并根据比较结果确定是否更新排序列表。 这样, 当主数据的数据状态 参数发生变化并需要重新进行排序时, 排序装置 300只需要针对已更新的 数据状态参数和排序列表中各标识信息对应的数据状态参数更新排序列 表即可, 不需要遍历整个数据库 110。 1A is a schematic structural view of a system according to the present invention. The sorted system includes a database 110 and a sorting device 300, and the database 110 and sorting device 300 are connectable via a bus 120. The database 110 includes a plurality of main data and data state parameters corresponding to the main data. The sorting device 300 has a sorting list, and the sorting list includes the identifier information sorted according to the preset sorting rule, and the data state parameter can be obtained according to the identifier information, and the master data can also be obtained. When the data status parameter of the primary data is updated, the sorting means 300 compares the updated data status parameter with the data status parameter corresponding to each identification information in the sorted list, and determines whether to update the sorted list based on the comparison result. In this way, when the data state parameter of the primary data changes and needs to be reordered, the sorting device 300 only needs to update the sorted list for the updated data state parameter and the data state parameter corresponding to each identifier information in the sorted list, and does not need to traverse The entire database 110.
实施例一 Embodiment 1
基于图 1A所示的系统架构图, 本实施例提供一种排序的方法, 用于 在主数据的数据状态参数更新时实现对 TOP N主数据的快速排序, 其适 用于现有技术中的任何一种排序系统。 本实施例的排序的方法的执行主体 为排序装置。 Based on the system architecture diagram shown in FIG. 1A, this embodiment provides a method for sorting, which is used to implement fast sorting of TOP N main data when the data state parameter of the main data is updated, which is applicable to any of the prior art. A sorting system. The execution subject of the sorting method of this embodiment is a sorting means.
如图 1B所示, 为根据本实施例的排序的方法的流程示意图, 该方法 包括: As shown in FIG. 1B, which is a schematic flowchart of a method according to the sorting according to the embodiment, the method includes:
步骤 101 , 当更新数据库中主数据的数据状态 时,排序装置根据已更新的 数据状态 获取与已更新的数据状态 对应的排序列表, 排序列表包括按照 预设的排序规则进行排序后的标识信息。 Step 101: When updating the data state of the main data in the database, the sorting device obtains the sorted list corresponding to the updated data state according to the updated data state, and the sorting list includes the identifier information sorted according to the preset sorting rule.
本实施例的标识信息用于获取数据状态 t。 具体地, 在其中的一种实施方式 中, 该标识信息可以包括数据状态参数的地址, 根据数据状态参数的地址可以获得 该数据状态参数; 在其中的另一种实施方式中, 该标识信息可以包括主数据的地址, 在根据主数据的地址找到该主数据后, 可以通过主数据查找相应的数据状态参数。 The identification information of this embodiment is used to acquire the data state t. Specifically, in an implementation manner, the identifier information may include an address of the data state parameter, and the data state parameter may be obtained according to the address of the data state parameter. In another implementation manner, the identifier information may be The address including the main data, after finding the main data according to the address of the main data, can find the corresponding data state parameter through the main data.
其中, 需要说明的是, 在获得数据状态 时, 可以根据该数据状态 获得 与该^:据^ 态 于应的主^:据。 It should be noted that, when the data state is obtained, the main data according to the data state can be obtained according to the data state.
其中, 需要说明的是, 标识信息还可以包括其它各种形式, 只要能通过标识信
息查找到数据状态参数即可, 具体可以根据实际需求进行设定, 本发明实施例并未 对此进行限定。 It should be noted that the identification information may also include other various forms, as long as the identification information can be passed. The data state parameter may be found, and may be set according to actual requirements, which is not limited by the embodiment of the present invention.
数据库中通常包括很多个主数据, 每个主数据均可对应多个数据状态参数, 具 体可以根据实际需要进行设定。 其中, 主数据为用户需获取的排序名称, 数据 状态参数为该主数据的属性值。 例如, 主数据可以为 "歌曲名称" , 数据状态 可以为 "下载次数" 、 "点播次数" 等, 或者主数据可以为 "书名" , 数据状 态 可以为 "点击量" 、 "更新字数" 等。 的已更新的^:据状态 即是当 前发生变化的数据状态参数, 例如某首歌的下载次数«^斤时, 该首歌的歌名为主 数据, 相应的下载次数为已更新的数据状态参数。 在具体实现方式中, 主数据及其 主数据及其^ ^状态 的列表可以对应一个排序列表,也可以对应多个排序列表, 例如当数据状态 为 "点击量" 时, 其对应的一个排序列表可以包括按照点击量 从大到小的顺序进行排列的 N个标识信息, 以获取按照点击量从大到小进行排序的 N个数据状态参数以及该 N个数据状态参数中每个数据状态参数所对应主数据, 该 N个数据状态参数中每个数据状态 所对应主数据即是用户需要获取的 TOP N 主数据; 其对应的另一个排序列表可以包括按照下载量从小到大的顺序进行排列的 N个标识信息, 以获耳又按照下载量从小到大的 N个 :据状态参数以及该 N个数据状 态 中每个数据状态 所对应的主数据。 获取该预设的排序列表的方法可以按 照现有技术获取, 即遍历数据库中所有主数据的数据状态 按照预设的排序规 则找出前 N个数据状态 t。 其中, N为大于 0的整数。 The database usually includes a lot of main data, and each main data can correspond to multiple data status parameters, which can be set according to actual needs. The main data is the sort name that the user needs to obtain, and the data status parameter is the attribute value of the main data. For example, the main data can be "song name", the data status can be "download times", "on-demand times", etc., or the main data can be "title", and the data status can be "click", "update word", etc. . The updated ^: according to the status is the data status parameter that is currently changing, for example, when the number of downloads of a song is «^金, the song of the song is named master data, and the corresponding download count is the updated data state. parameter. In a specific implementation manner, the main data and its main data and the list of the status thereof may correspond to a sorted list, or may correspond to multiple sorted lists, for example, when the data status is “click volume”, a corresponding sorted list thereof The N pieces of identification information arranged in descending order of the click amount may be included to obtain N data state parameters sorted according to the click amount from large to small, and each data state parameter of the N data state parameters Corresponding to the main data, the main data corresponding to each of the N data state parameters is the TOP N main data that the user needs to obtain; and the corresponding other sorted list may include the order of the downloads from small to large. N pieces of identification information, in order to obtain the N from small to large according to the download amount: according to the status parameter and the main data corresponding to each of the N data states. The method for obtaining the preset sorted list can be obtained according to the prior art, that is, traversing the data state of all the main data in the database to find the top N data states t according to a preset sorting rule. Where N is an integer greater than 0.
需要指出的是, 更新操作包括很多种, 例如更 t _数据的某个数据状态 或者增加某个主 :据时; 如果增加某个主数据, 相应地, 也会增加该主数据的数据 状态参数。 It should be pointed out that there are many kinds of update operations, such as a certain data state of t_data or adding a certain master data; if a certain master data is added, correspondingly, the data state parameter of the master data is also increased. .
步骤 102,根据所述标识信息集中的每个标识信息,获取与所述每个标识信息对 应的数据状态参数。 Step 102: Acquire, according to each identifier information in the identifier information set, a data state parameter corresponding to each identifier information.
排序列表包含的标识信息集可包括 N个标识信息,根据该 N个标识信息可以获 得该 N个标识信息中每个标识信息对应的主数据和数据状态参数。 例如, 根据标识 信息可先获取数据状态参数, 再通过获取的数据状态参数获 目应的主数据, 还可 以根据标识信息同时获取数据状态参数和主数据, 当然该排序列表本身也可以包括 数据状态 和 /或主数据, 即数据状态 和 /或主数据本身就是标识信息。标识信
息的具体实现方式以及如何通过标识信息获取相应的数据状体参数可以根据实际需 要进行设定, 在此不再赞述。 The identification information set included in the sorting list may include N pieces of identification information, and the main data and the data status parameter corresponding to each of the N pieces of identification information may be obtained according to the N pieces of identification information. For example, according to the identification information, the data state parameter may be obtained first, and then the obtained data state parameter obtains the main data, and the data state parameter and the main data may be simultaneously acquired according to the identification information. Of course, the sorting list itself may also include the data state. And/or master data, ie the data status and/or the master data itself is the identification information. Identification letter The specific implementation of the information and how to obtain the corresponding data shape parameters through the identification information can be set according to actual needs, and will not be mentioned here.
步骤 103 , 根据所述已更新的数据状态参数以及所述与所述每个标识信 息对应的数据状态参数, 更新所述排序列表。 Step 103: Update the sorted list according to the updated data state parameter and the data state parameter corresponding to each of the identifier information.
具体可根据已更新的数据状态参数和获取到的与所述每个标识信息对应 的数据状态参数的排序结果来更新排序列表, 以保证用户根据该排序列表 获取到的是 TOP N主数据。 Specifically, the sorted list may be updated according to the updated data state parameter and the sorted result of the obtained data state parameter corresponding to each of the identifier information, so as to ensure that the user obtains the TOP N master data according to the sorted list.
根据本实施例的排序的方法, 当数据库中主数据的数据状态参数发生 变化时, 仅需要根据排序列表获取 N个数据状态参数, 并根据已更新的数 据状态参数和排序列表中的 N个数据状态参数, 更新排序列表, 克服了当 更新主数据的数据状态参数时需要遍历整个数据库的问题, 从而降低了获 取 TOP N主数据的时间, 提升了用户的体验。 According to the sorting method of the embodiment, when the data state parameter of the main data in the database changes, only N data state parameters need to be acquired according to the sorted list, and according to the updated data state parameter and the N data in the sorted list. The status parameter, updating the sorted list, overcomes the problem of traversing the entire database when updating the data state parameters of the main data, thereby reducing the time for obtaining the TOP N main data and improving the user experience.
本实施例中, 优选地将排序列表存在排序装置的内存中, 即根据已更 新的数据状态参数获取预设的排序列表包括: 根据已更新的数据状态参数获取在 排序装置的内存中预设的排序列表。 这样能够尽量减少磁盘读写操作的次数。 In this embodiment, the sorted list is preferably stored in the memory of the sorting device, that is, the preset sorted list is obtained according to the updated data state parameter, including: acquiring the preset in the memory of the sorting device according to the updated data state parameter. Sort the list. This minimizes the number of disk read and write operations.
实施例二 Embodiment 2
本实施例基于上述实施例提供一种排序的方法。 如图 2所示, 为根据 本实施例的排序的方法的流程示意图。 This embodiment provides a method of sorting based on the above embodiment. As shown in Fig. 2, it is a flow chart of the method of sorting according to the present embodiment.
步骤 201 , 当更新数据库中主数据的数据状态 史时,排序装置根据所 数 据的已更新的数据状态 判断是否有与已更新的数据状态 对应的排序列表, 所述排序列表包括按照预设的排序规则进行排序后的标识信息集, 当判断结果为是 时, 亍步骤 202, 否则 4亭止# ^乍。 Step 201: When updating the data state history of the main data in the database, the sorting device determines, according to the updated data state of the data, whether there is a sorted list corresponding to the updated data state, and the sorting list includes sorting according to a preset. After the rule sorts the identification information set, when the judgment result is yes, 亍 step 202, otherwise 4 kiosk #^乍.
其中, 标识信息集是标识信息的集合, 可以包含至少零个标识信息。 The identifier information set is a set of identifier information, and may include at least zero identifier information.
每个数据状态 均属于一定的类别, 例如当数据状态 为 "点击量" 时, 其所属的类别是 "点击量" 。 Each data state belongs to a certain category. For example, when the data status is "click", the category to which it belongs is "click volume".
其中, 需要说明的是, 主数据的数据状态参数不一定会被用作排序, 只 有在主数据的数据状态参数被用作排序时, 才会执行如下步骤, 例如, 当 已更新的数据状态参数为 "歌词字数" 时, 并未有对应对 "歌词字数" 这 一类别的排序列表时, 无需进行后续操作。 It should be noted that the data state parameter of the main data is not necessarily used as the sorting. Only when the data state parameter of the main data is used as the sorting, the following steps are performed, for example, when the updated data state parameter is When there is no sorting list for the category of "Lyrics Words" for the "Lyonym Words", no further operations are required.
可选地, 釆用 TOPN排序索引^ ^排序列表的类别, 其可以反映预设的排序规
贝' J, 例如 "点击量最多的前 N首歌" 、 "下载量最多的前 N本书" 、 "差评量最少 的前 N个淘宝店家"等等。 当数据状态 ^7某首歌的 "点击量"时,其对应的 TOP N排序索引为 "点击量最多的前 N首歌" 。 其中 N为大于 0的整数。 TOPN排序索 引可以与数据状态参数相关联。 Optionally, the TOPN sort index ^ ^ sorts the category of the list, which can reflect the preset sorting rules B'J, for example, "the top N songs with the most clicks", "the top N books with the most downloads", "the top N Taobao stores with the least amount of reviews" and so on. When the data status ^7 "click" of a song, its corresponding TOP N sort index is "the top N songs with the most clicks". Where N is an integer greater than zero. The TOPN sort index can be associated with a data status parameter.
本实施例中, 以索引数据为标识信息为例进行说明。 排序装置根据已 更新的数据状态参数获取排序列表, 即排序列表中包括 N个索引数据。 各 索引数据可以的组成方式可以是 "数据状态参数的地址" 、 "排序号码; 数据状态参数的地址" 或者是 "排序号码; 歌曲名称; 数据状态参数的地 址" 等等, 具体可以根据实际需要进行设定。 根据索引数据可以直接获取 与索引数据相应的数据状态参数, 或者根据该索引数据可以获取与索引数 据相应的主数据, 再根据获取的主数据获取相应的数据状态参数, 例如, 根据歌曲名称获取到与该歌曲名称对应的点击量、 下载量、 歌词等所需数 据状态参数等。 In this embodiment, the index data is used as the identification information as an example for description. The sorting device obtains the sorted list according to the updated data state parameter, that is, the sorted list includes N index data. Each index data can be composed of "address of data status parameter", "sort number; address of data status parameter" or "sort number; song name; address of data status parameter", etc., according to actual needs Make settings. According to the index data, the data state parameter corresponding to the index data may be directly obtained, or the main data corresponding to the index data may be acquired according to the index data, and the corresponding data state parameter is obtained according to the acquired main data, for example, according to the song name. The required data status parameters such as the click amount, the download amount, and the lyrics corresponding to the song name.
该排序列表对应的 N个 :据^ 态参^:可以称为 TOP N数据状态参数。 The N corresponding to the sorted list: According to the state parameter ^: can be called the TOP N data state parameter.
步骤 202, 判断标识信息集中包含的标识信息的数目是否小于预设阈 值, 当判断结果为是时, 执行步骤 203 , 否则执行步骤 204。 Step 202: Determine whether the number of the identification information included in the identifier information set is less than a preset threshold. When the determination result is yes, go to step 203, otherwise go to step 204.
本实施例的预设阈值可以根据实际需要进行设定,预设阈值不小于 N。 具体地, 可以根据实际需要将排序列表中的 TOP N索引数据的个数设置 为 N。 在之前已删除过 TOP N索引数据中的索引数据, 但并未在 TOP N 索引数据中增加新的索引数据时, TOP N索引数据的个数小于预设阈值。 The preset threshold of this embodiment may be set according to actual needs, and the preset threshold is not less than N. Specifically, the number of TOP N index data in the sorted list may be set to N according to actual needs. When the index data in the TOP N index data has been deleted before, but the new index data is not added to the TOP N index data, the number of TOP N index data is less than the preset threshold.
步骤 203 , 将已更新的数据状态参数的标识信息直接加入排序列表。 具体可以按照预设的排序规则将已更新的数据状态参数的标识信息 直接加入排序列表。 Step 203: Add the identifier information of the updated data state parameter directly to the sorting list. Specifically, the identifier information of the updated data state parameter may be directly added to the sorting list according to a preset sorting rule.
步骤 204,将已更新的数据状态参数与标识信息集中的第 N个标识信息 对应的数据状态参数进行比较, 根据比较结果判断是否更新排序列表, 当 判断结果为是时, 执行步骤 205 , 否则停止操作。 Step 204: Compare the updated data state parameter with the data state parameter corresponding to the Nth identifier information in the identifier information set, and determine whether to update the sorting list according to the comparison result. When the determination result is yes, perform step 205, otherwise stop. operating.
将所述已更新的数据状态参数与所述标识信息集中最后一个标识信 息对应的数据状态参数进行比较, 即可以判断出是否需将该已更新的数据 状态参数的索引数据加入排序列表中。 这里的最后一个标识信息即是标识 信息集中按照预设规则进行排序的之后, 位于末位的标识信息。
例如, 当已更新的数据状态参数为 "点击量" 时, 相应的 TOP N排 序索引为 "点击量最多的前 N首歌曲" , 排序列表中包括点击量最多的前 N首歌对应的标识信息, 数据状态参数为歌曲点击量, 排序规则为按照点 击量从大到小进行排列。 当已更新的数据状态参数变为 200, 且 TOP N索 引数据集中最后一个 TOP N索引数据对应的数据状态参数为 500时, 通 过比较可以得知已更新的数据状态参数小于该最后一个 TOP N索引数据 对应的数据状态参数, 又由于排序规则为点击量从大到小进行排序, 则可 以判断出不需要将已更新的数据对应的索引数据加入 TOP N索引数据中; 当已更新的数据状态参数为 600,且 TOP N索引数据集中最后一个索引数 据对应的数据状态参数为 500时, 通过比较得知已更新的数据状态参数大 于 TOP N索引数据集中最后一个索引数据对应的数据状态参数, 又由于 排序规则为点击量从大到小进行排序, 则说明该已更新的数据状态参数对 应的索引数据应该加入到排序列表中, 完成排序列表的更新。 Comparing the updated data state parameter with the data state parameter corresponding to the last identifier information in the identifier information set, that is, determining whether the index data of the updated data state parameter needs to be added to the sorting list. The last identification information here is the identification information located at the last digit after the identification information set is sorted according to the preset rule. For example, when the updated data status parameter is "click volume", the corresponding TOP N sort index is "the top N songs with the most clicks", and the sorted list includes the identification information corresponding to the top N songs with the most clicks. The data status parameter is the song click amount, and the sorting rule is arranged according to the click amount from large to small. When the updated data state parameter becomes 200, and the data state parameter corresponding to the last TOP N index data in the TOP N index data set is 500, it can be known by comparison that the updated data state parameter is smaller than the last TOP N index data. Corresponding data state parameters, and because the sorting rules sort the clicks from large to small, it can be determined that the index data corresponding to the updated data does not need to be added to the TOP N index data; when the updated data state parameter is 600, and the data state parameter corresponding to the last index data in the TOP N index data set is 500. By comparing, it is found that the updated data state parameter is larger than the data state parameter corresponding to the last index data in the TOP N index data set, and Sorting the clicks from large to small indicates that the index data corresponding to the updated data state parameter should be added to the sorted list to complete the update of the sorted list.
步骤 205 , 当根据比较结果确定需根据所述已更新的数据状态参数以 及所述与所述每个标识信息对应的数据状态参数, 按照所述预设的排序规则 进行排序时, 判断与所述每个标识信息对应的主数据是否包含所述已更新的 数据状态参数对应的主数据, 当判断结果为是时, 执行步骤 206的操作, 否则, 执行步骤 207的操作。 Step 205: When it is determined according to the comparison result that the updated data state parameter and the data state parameter corresponding to each identifier information are to be sorted according to the preset sorting rule, determining and Whether the main data corresponding to each identification information includes the main data corresponding to the updated data status parameter. When the determination result is yes, the operation of step 206 is performed; otherwise, the operation of step 207 is performed.
步骤 206, 按照预设的排序规则调整已更新的数据状态参数的标识信 息的在排序列表中的位置。 Step 206: Adjust the location of the identifier information of the updated data state parameter in the sorted list according to a preset collation.
当排序列表中的标识信息对应的主数据包含已更新的数据状态参数 对应的主数据时, 仅需要按照预设规则, 根据数据状态参数的值, 对排序 列表中的标识信息进行重新排序。 When the main data corresponding to the identification information in the sorting list includes the main data corresponding to the updated data state parameter, the identification information in the sorting list is reordered according to the value of the data state parameter according to the preset rule.
步骤 207, 删除排序列表中最后一个标识信息, 并将与已更新的数据 状态参数对应的主数据的标识信息按照预设的排序规则加入到排序列表 中。 Step 207: Delete the last identifier information in the sorted list, and add the identifier information of the master data corresponding to the updated data state parameter to the sorted list according to a preset sorting rule.
根据本实施例排序的方法,通过将已更新的数据状态参数与 TOP N索 引数据中最后一个索引数据对应的数据状态参数进行比较, 即可判断出是 否需要将已更新的数据对应的索引数据加入 TOP N索引数据集中, 重新 排序也仅是对已更新的数据和 TOP N索引数据集对应的数据状态参数进
行排序, 需要操作的数据较少, 减轻了排序系统的负担。 此外, 由于排序 列表是位于排序装置的内存中的,排序列表中可包括的标识信息和 /或每个 标识信息对应的数据状态参数也是位于排序装置的内存中的, 可以尽量减 少磁盘读写操作。 According to the method of the embodiment, by comparing the updated data state parameter with the data state parameter corresponding to the last index data in the TOP N index data, it can be determined whether the index data corresponding to the updated data needs to be added. In the TOP N index data set, reordering is only for the data status parameters corresponding to the updated data and the TOP N index data set. Row sorting requires less data to operate, reducing the burden on the sorting system. In addition, since the sorted list is located in the memory of the sorting device, the identification information that can be included in the sorted list and/or the data state parameter corresponding to each of the identification information is also located in the memory of the sorting device, and the disk read and write operations can be minimized. .
此外, 步骤 202也可以放在步骤 204与步骤 207之间进行。 In addition, step 202 can also be performed between step 204 and step 207.
需要指出的是, 以上 TOP N排序索引、 TOP N数据状态 和 TOP N索引数 据均可以釆用列表的方式,相应的 TOPN主数据也可以釆用列表(column )的方式, 彼此之间可以釆用映射的方式以根据某一项内容查找到所需的另外一项内容。这样, 创建 TOPN索引数据可^ ΐ]如下的语言形式: It should be noted that the above TOP N sort index, TOP N data status and TOP N index data can all be used in the form of a list, and the corresponding TOPN main data can also use a column (column) manner, and can be used with each other. The way to map to find another item you want based on an item. In this way, creating TOPN index data can be as follows:
CREATE TOPN {topn_name} CREATE TOPN {topn_name}
ON {table | view} {(column [ ASC | DESC ] [, ...m])} ON {table | view} {(column [ ASC | DESC ] [, ...m])}
WITH N— VALUE {n} WITH N— VALUE {n}
{} : 必选语法项, 实际语句中不必键入大括号。 {} : Required grammar items, you do not have to type braces in the actual statement.
[]:可选语法项, 实际语句中不必键入方括号。 []: Optional syntax item, you do not have to type square brackets in the actual statement.
{column [ ASC | DESC ], [, ...m]} :表示可以使用多个 column进行排 序,各个 column之间使用逗号分隔,可以为每个字段设定 ASC ( Ascending Order, 升序排列) 和 DESC ( Descending Order, 降序排列)排序规则, 不指定时默认使用 ASC。 关键字 WITH N— VALUE后面指定了 TOP N索 引数据的个数, 即 N的值。 {column [ ASC | DESC ], [, ...m]} : Indicates that multiple columns can be used for sorting. Each column is separated by a comma. ASC (Ascending Order) can be set for each field. DESC (Descending Order) sorting rules, ASC is used by default when not specified. The keyword WITH N- VALUE is followed by the number of TOP N index data, which is the value of N.
实施例三 Embodiment 3
本实施例基于实施例二的排序的方法做进一步举例说明。 This embodiment is further illustrated based on the method of sequencing in the second embodiment.
数据库中的数据状态参数之一为 "小说下载量", 预设的 TOP N排序 索引为 "小说下载量最大的前 3个小说" , 相应的 TOP N索引数据如排 序列表 1所示, 本实施例的 TOP N索引数据中每个索引数据均包括排序 排序列表 1 One of the data state parameters in the database is "fiction download volume", the default TOP N sort index is "the first three novels with the largest download volume of the novel", and the corresponding TOP N index data is shown in the sorting list 1, this implementation For example, each index data in the TOP N index data includes a sorted sort list 1
根据上述地址首先获取数据状态参数, 然后根据数据状态参数获取到 相应地书名。 其中, 地址 1对应的书名为 A, 点击量为 100; 地址 2对应 的书名为 B, 点击量为 50; 地址 3对应的书名为 C, 点击量为 30, 地址 4 对应的书名为 D, 其点击量为 20, 未列入该 TOP N索引数据中。 According to the above address, the data state parameter is first obtained, and then the corresponding book name is obtained according to the data state parameter. The book name corresponding to address 1 is A, the click volume is 100; the book name corresponding to address 2 is B, and the click volume is 50; the book name corresponding to address 3 is C, the click volume is 30, and the book name corresponding to address 4 For D, the number of hits is 20, which is not included in the TOP N index data.
当数据库某一书名的点击量发生变化时,例如 D的点击量变为 40时, 判断对应的索引数据并不在预设的 TOP N索引数据中, 则先与 C的点击 量进行比较, 发现其大于 C的点击量, 则删除 C, 比较 A、 B和 D的点击 量, 按照从大到小的顺序进行排序。 更新后的 TOP N索引数据如排序列 表 2所示。 When the click volume of a certain book name in the database changes, for example, when the click amount of D becomes 40, it is judged that the corresponding index data is not in the preset TOP N index data, and then the amount of click of C is compared first and found. If the amount of clicks is greater than C, C is deleted, and the clicks of A, B, and D are compared, and the order is sorted in descending order. The updated TOP N index data is shown in Table 2.
排序列表 2 Sort list 2
当数据库某一书名的点击量发生变化时,例如 C的点击量变为 35时, 判断出 C对应的索引数据位于预设的 TOP N索引数据中, 则将 C的点击 量分别与 A和 B的点击量进行比较。 更新后的 TOP N索引数据仍与排序 列表 1相同。 When the click amount of a certain book name in the database changes, for example, when the click amount of C becomes 35, it is judged that the index data corresponding to C is located in the preset TOP N index data, and the click amount of C is respectively associated with A and B. The number of clicks is compared. The updated TOP N index data is still the same as Sort List 1.
当数据库某一书名的点击量发生变化时,例如 B的点击量变为 120时, 判断出 B对应的索引数据位于预设的 TOP N索引数据中, 则可以将 B的 点击量仅与排在 B之前的点击量进行比较, 即仅与 A进行比较, 发现 B 的点击量已经超过 A的点击量,则更新后的 TOP N索引数据如排序列表 3 所示。 When the click amount of a certain book name in the database changes, for example, when the click amount of B becomes 120, it is judged that the index data corresponding to B is located in the preset TOP N index data, and the click amount of B can be ranked only The number of clicks before B is compared, that is, only compared with A, and it is found that the click volume of B has exceeded the hit amount of A, and the updated TOP N index data is shown in the sorted list 3.
排序列表 3 Sort list 3
从以上内容可以看出, 当某一书名的点击量发生变化时, 排序系统不 需要遍历数据库中所有书名对应的点击量进行排序, 仅根据更新的点击量 和预设的 TOP N主数据的点击量进行排序, 所操作的数据量小, 排序速 度快, 且排序系统负担较轻。 As can be seen from the above, when the click volume of a certain book name changes, the sorting system does not need to traverse the click volume corresponding to all book titles in the database for sorting, only based on the updated click volume and the preset TOP N main data. The number of clicks is sorted, the amount of data manipulated is small, the sorting speed is fast, and the sorting system is lighter.
实施例四 Embodiment 4
本实施例对上述实施例的排序的方法做进一步补充说明。 This embodiment further supplements the method of sorting in the above embodiment.
本实施例仅对发生删除主数据以及主数据对应的数据状态参数的操 作进行具体说明。 This embodiment only specifies the operation of deleting the main data and the data state parameters corresponding to the main data.
当需删除的主数据的标识信息时, 从排序列表中删除需删除主数据的 标识信息, 当更新排序列表时, 可以釆用以下任一方式进行更新: When the identification information of the primary data to be deleted is deleted, the identification information of the primary data to be deleted is deleted from the sorted list. When the sorted list is updated, the update may be performed by any of the following methods:
方式一, 惰性更新方式: 遍历主数据所在的数据库中的数据状态参数并更 新排序列表, 以使标识信息集中所包含的标识信息的数目 iiJij预设阈值。 Method 1, lazy update mode: traverse the data status parameter in the database where the main data is located and update the sorted list so that the number of identification information included in the identification information set is iiJij preset threshold.
从 TOP N索引数据中删除需删除主数据的索引数据, 此时不进行增 加索引数据的操作, 这样, TOP N索引数据中的索引数据的个数要小于预 设阈值。 当更新数据库中的数据状态 时,首先判断该更新的主数据对应的索引 数据是否位于 TOPN索引数据中, 当判断结果为否时,将已更新的数据的对应的索 引数据加入 TOPN索引数据中作为更新后的 TOPN索引数据。 The index data of the main data to be deleted is deleted from the TOP N index data, and the operation of adding the index data is not performed at this time, so that the number of index data in the TOP N index data is smaller than a preset threshold. When updating the data status in the database, first determining whether the index data corresponding to the updated main data is located in the TOPN index data, and when the determination result is no, adding the corresponding index data of the updated data to the TOPN index data as Updated TOPN index data.
釆用以上惰性更新方式, 即 TOPN索引数据的个数减少时, 并不立即 ( 增加 索弓 ]数据的操作, 而是当数据库中的索引数据对应的数据状态参数更新且该索弓 ]数 据不位于 TOPN索引数据中时,将该索引数据加入 TOPN索引数据中,补足 TOPN 索引数据中的索引数据的个数。 虽然这种方式补入的索引数据不一^^真正的 TOP N索引数据, 但是可以避免对整个数据库的遍历。 而且由于真正的 TOPN索引数据 都是最活跃的数据, 其所对应的数据状态参数很快就会进行更新, 这样真正应该位 于 TOPN索引数据中的索引数据很快就会 ¾ ^入 TOPN索引数据中。 釆Using the above lazy update method, that is, when the number of TOPN index data is reduced, the operation of the data is not immediately (increased), but the data state parameter corresponding to the index data in the database is updated and the data is not When it is located in the TOPN index data, the index data is added to the TOPN index data to make up the number of index data in the TOPN index data. Although the index data added in this way is not a true TOP N index data, It can avoid traversal of the entire database. And since the real TOPN index data is the most active data, the corresponding data state parameters will be updated very quickly, so the index data that should really be in the TOPN index data will soon be updated. Will be entered into the TOPN index data.
方式二、 快速更新方式: 当更新所述排序列表时, 判断所述每个标识信息 对应的主数据中是否包含所述已更新的数据状态参数对应的主数据, 当判 断结果为否时, 将所述已更新的数据状态参数对应的主数据的标识信息按 照所述预设的排序规则加入到所述排序列表中。 Method 2: Fast update mode: when updating the sorted list, determining whether the main data corresponding to each identifier information includes the main data corresponding to the updated data state parameter, and when the judgment result is no, The identification information of the primary data corresponding to the updated data state parameter is added to the sorted list according to the preset sorting rule.
从 TOP N索引数据中删除需删除数据状态参数对应的索引数据, 立 即遍历数据库中的数据状态参数, 找出应该进入 TOP N数据状态参数中
的数据状态参数, 并将其对应的索引数据加入到 TOP N索引数据中。 当 TOP N索引数据中的索引数据减少时,釆用快速更新方式能够使用户每次 都获得准确的 TOP N主数据。 Delete the index data corresponding to the data state parameter from the TOP N index data, immediately traverse the data state parameter in the database, and find out that it should enter the TOP N data state parameter. The data status parameter, and its corresponding index data is added to the TOP N index data. When the index data in the TOP N index data is reduced, the fast update method enables the user to obtain accurate TOP N master data each time.
在实际运用中, 可将预设的 TOP N索引数据中索引数据的个数设置 为 N+S个, 即预设阈值为 N+S个, 其中 S为大于 0的整数。 用户在请求 TOP N主数据时, 根据 TOP N索引数据向用户返回 TOP N索引数据中的 前 N个索引数据对应的数据。 这样, 当发生删除操作时, 例如删除 M个 索引数据,用户还是可以看到 N个 TOP N主数据,其中 1 ^1 8且^1为 整数。 In practical applications, the number of index data in the preset TOP N index data may be set to N+S, that is, the preset threshold is N+S, where S is an integer greater than 0. When the user requests the TOP N main data, the user returns the data corresponding to the first N index data in the TOP N index data according to the TOP N index data. Thus, when a delete operation occurs, such as deleting M index data, the user can still see N TOP N main data, where 1 ^1 8 and ^1 are integers.
此外, TOP N 索引数据中预设阈值一般不进行修改, 当预设阈值减 小时, 删除 TOP N索引数据中多余的索引数据, 例如, 当前预设阈值为 10, 将预设阈值修改为 8时, 删除 TOP N索引数据中第 9项索引数据和 第 10项索引数据。 当预设阈值增大时, 可以釆用上面的惰性更新方式和 快速更新方式来更新 TOP N索引数据, 在此不再赘述。 In addition, the preset threshold in the TOP N index data is generally not modified. When the preset threshold is decreased, the excess index data in the TOP N index data is deleted. For example, the current preset threshold is 10, and the preset threshold is modified to 8 , delete the ninth index data and the tenth index data in the TOP N index data. When the preset threshold is increased, the TOP N index data can be updated by using the lazy update method and the fast update method, and will not be described here.
修改预设阈值可以釆用如下的形式语言: Modify the preset threshold to use the following formal language:
UPDATE TOPN {topn_name} UPDATE TOPN {topn_name}
WITH N— VALUE {n} WITH N— VALUE {n}
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机 可读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程 序代码的介质。 A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
实施例五 Embodiment 5
本实施例提供一种排序装置, 用于执行实施例一的排序的方法。 如图 3A所示, 为根据本实施例的排序装置的结构示意图。 该排序装 置 300包括第一获取单元 301、 第二获取单元 302和第一更新单元 303。 据主数据的已更新的 t据^ 态 获取与所述已更新的数据状态 对应的排序 列表, 排序列表包括按照预设的排序规则进行排序的标识信息集; The embodiment provides a sorting apparatus for performing the sorting method of the first embodiment. As shown in FIG. 3A, it is a schematic structural view of the sorting apparatus according to the present embodiment. The sorting device 300 includes a first obtaining unit 301, a second obtaining unit 302, and a first updating unit 303. Obtaining, according to the updated t data state of the main data, a sorting list corresponding to the updated data state, and the sorting list includes an identifier information set sorted according to a preset sorting rule;
第二获取单元 302用于根据所述第一获取单元 301获取的标识信息集中的每个
标识信息, 获取与所述每个标识信息对应的数据状态概 The second obtaining unit 302 is configured to use each of the identifier information sets acquired by the first acquiring unit 301. Identifying information, obtaining a data state corresponding to each of the identification information
第一更新单元 303用于根据所述已更新的数据状态参数以及所述第二获取 单元 302获取的数据状态参数, 更新所述排序列表。 The first update unit 303 is configured to update the sorted list according to the updated data state parameter and the data state parameter acquired by the second obtaining unit 302.
本实施例的排序装置 300的具体操作与实施例——致,在此不再赘述。 根据本实施例的排序装置 300, 当数据库中主数据的数据状态参数发 生变化时, 仅需要根据排序列表获取 N个数据状态参数即可, 并根据已更 新的数据状态参数和排序列表对应的 N个数据状态参数进行排序,以更新 排序列表, 克服了当主数据的数据状态参数进行更新时需要遍历整个数据 库获取用户所关心的前 N个主数据的运行效率低和处理时间长的问题,提 升了用户的体验。 Specific operations and embodiments of the sorting apparatus 300 of this embodiment are not described herein. According to the sorting apparatus 300 of the embodiment, when the data state parameter of the main data in the database changes, only N data state parameters need to be acquired according to the sorted list, and according to the updated data state parameter and the N corresponding to the sorted list. The data state parameters are sorted to update the sorted list, which overcomes the problem of low efficiency and long processing time of traversing the entire database to obtain the first N main data of interest to the user when the data state parameter of the main data is updated. User experience.
本实施例中, 优选地将排序列表存在排序装置 300的内存中, 即根据 已更新的数据状态参数获取预设的排序列表包括: 根据已更新的数据状态参数获 排序装置 300的内存中预设的排序列表。 这样能够尽量减少磁盘读写操作。 可选地, 如图 3B所示, 本实施例的排序装置还包括判断预设阈值单 元 310, 该判断预设阈值单元 310用于: In this embodiment, the sorted list is preferably stored in the memory of the sorting device 300, that is, the preset sorted list is obtained according to the updated data state parameter, including: the in-memory preset of the sorting device 300 according to the updated data state parameter. Sorted list. This minimizes disk read and write operations. Optionally, as shown in FIG. 3B, the sorting apparatus of this embodiment further includes a determining preset threshold unit 310, where the determining preset threshold unit 310 is configured to:
判断所述第一获取单元 301获取的标识信息集中所包含的标识信息的 数目是否小于预设阈值; Determining whether the number of the identification information included in the identifier information set acquired by the first acquiring unit 301 is less than a preset threshold;
若所述数目小于所述预设阈值时, 则将所述已更新的数据状态参数的 标识信息直接加入所述排序列表, 否则, 触发所述第一更新单元 303。 And if the number is less than the preset threshold, the identifier information of the updated data state parameter is directly added to the sorting list, otherwise, the first updating unit 303 is triggered.
实施例六 Embodiment 6
本实施例基于实施例五提供一种排序装置, 用于执行实施例二、 实施 例三或实施例四的 4#序的方法。 This embodiment provides a sorting apparatus for performing the method of the 4# sequence of the second embodiment, the third embodiment or the fourth embodiment based on the fifth embodiment.
如图 4所示, 为根据本实施例的排序装置的结构示意图。 该排序装置 300包括与实施例五一致的第一获取单元 301、 第二获取单元 302和第一 更新单元 303 , 还可以包括判断预设阈值单元 310, 具体在此不再赘述。 As shown in FIG. 4, it is a schematic structural view of the sorting apparatus according to the present embodiment. The sorting device 300 includes a first obtaining unit 301, a second obtaining unit 302, and a first updating unit 303, which are consistent with the fifth embodiment, and may further include a determining preset threshold unit 310, which is not described herein.
其中, 第一更新单元 303包括比较子单元 401和更新子单元 402。 比 较子单元 401用于将所述已更新的数据状态参数与所述第一获取单元 301 获取的标识信息集中最后一个标识信息对应的数据状态参数进行比较; 更 新子单元 402用于当根据所述比较子单元 401的比较结果确定需根据所述 已更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参数,
按照所述预设的排序规则进行排序时, 更新所述排序列表。 The first update unit 303 includes a comparison subunit 401 and an update subunit 402. The comparison subunit 401 is configured to compare the updated data state parameter with a data state parameter corresponding to the last identifier information in the identifier information set acquired by the first obtaining unit 301; the update subunit 402 is configured to The comparison result of the comparison subunit 401 determines that the updated data state parameter and the data state parameter corresponding to each of the identification information are required, When sorting according to the preset sorting rule, the sorted list is updated.
可选地, 更新子单元 402包括判断模块 403和排序模块 404。 其中, 判断模块 403用于当根据所述比较子单元 401的比较结果确定需根据所述 已更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参数, 按照所述预设的排序规则进行排序时, 判断与所述每个标识信息对应的主 数据是否包含所述已更新的数据状态参数对应的主数据, 并当判断结果为 否时, 触发排序模块 404; 排序模块 404用于删除所述标识信息集中最后 一个标识信息, 并将与所述已更新的数据状态参数对应的主数据的标识信 息按照预设的排序规则加入到所述排序列表中。 Optionally, the update subunit 402 includes a decision module 403 and a sort module 404. The determining module 403 is configured to determine, according to the comparison result of the comparing subunit 401, according to the updated data state parameter and the data state parameter corresponding to each identifier information, according to the preset When the sorting rule is sorted, it is determined whether the main data corresponding to each of the identification information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the sorting module 404 is triggered; the sorting module 404 And deleting the last identifier information in the identifier information set, and adding the identifier information of the master data corresponding to the updated data state parameter to the sorted list according to a preset sorting rule.
可选地, 本实施例的排序装置 300还包括第二更新单元 405 , 该第二 更新单元 405用于: Optionally, the sorting apparatus 300 of this embodiment further includes a second updating unit 405, where the second updating unit 405 is configured to:
当需删除主数据的标识信息时, 从所述排序列表中删除所述需删除的 主数据的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
遍历所述数据库中的数据状态 并更新所述排序列表, 以使所标识信息集所 包含的标识信息的个数 所述预设阈值。 Traversing the state of the data in the database and updating the sorted list such that the number of pieces of identification information included in the identified set of information is the predetermined threshold.
可选地, 本实施例的排序装置还包括第三更新单元 406, 该第三更新单元 406 用于: Optionally, the sorting apparatus of this embodiment further includes a third updating unit 406, where the third updating unit 406 is configured to:
当需删除主数据的标识信息时, 从所述排序列表中删除需删除的主数据 的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
当更新所述排序列表时, 判断所述每个标识信息对应的主数据中是否包含所 述已更新的数据状态参数对应的主数据, 当判断结果为否时, 将所述已更 新的数据状态参数对应的主数据的标识信息按照所述预设的排序规则加 入到所述排序列表中。 When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
需要指出的是,排序装置 300可以只需要第二更新单元 405和第三更新单元 406 中的一个, 当然, 第二更新单元 405和第三更新单元 406可以同时存在,
实际需要确定启动哪一个更新单元。 It should be noted that the sorting device 300 may only need one of the second update unit 405 and the third update unit 406. Of course, the second update unit 405 and the third update unit 406 may exist at the same time. It is actually necessary to determine which update unit to start.
本实施例的第一获取单元 301可具体用于: The first obtaining unit 301 of this embodiment may be specifically configured to:
当更新主数据的数据状态械时, 根据已更新的数据状态 获林排序装置 300的内存中的与已更新的数据状态 对应的排序列表,排序列表包括按照预设的 排序规则进行排序的标识信息集, 标识信息集包括 N个标识信息, 根据该 N个标识
信息可以获取 TOP N主数据, 其中, N为大于 0的整数。 When the data state of the main data is updated, the sorted list corresponding to the updated data state in the memory of the forest sorting apparatus 300 is obtained according to the updated data state, and the sorted list includes the identification information sorted according to the preset sorting rule. Set, the identification information set includes N identification information, according to the N identifiers The information can obtain TOP N main data, where N is an integer greater than zero.
本实施例的排序装置 300的具体操作方^目应地与实施例二、 实施例三或实施 例四一致, 在此不再赞述。 The specific operation of the sorting apparatus 300 of this embodiment is consistent with the second embodiment, the third embodiment, or the fourth embodiment, and will not be further described herein.
根据本实施例排序装置 300, 通过将已更新的数据与根据排序列表中 最后一个标识信息获取的数据状态参数进行比较即可判断出是否需要将 已更新的数据对应的索引数据加入排序列表中, 重新排序也仅是对已更新 的数据和排序列表对应的各数据状态参数进行排序, 需要操作的数据较 少, 减轻了排序系统的负担。 According to the sorting apparatus 300 of the present embodiment, by comparing the updated data with the data state parameters acquired according to the last identifier information in the sorted list, it can be determined whether the index data corresponding to the updated data needs to be added to the sorted list. Reordering only sorts the data state parameters corresponding to the updated data and the sorted list, and requires less data to operate, which reduces the burden on the sorting system.
实施例七 Example 7
如图 5A所示, 为本发明实施例提供的另一种排序装置的结构图。该排序装 置包括至少一个处理器 601、通信总线 602、存储器 603以及至少一个通信接口 604。 FIG. 5A is a structural diagram of another sorting apparatus according to an embodiment of the present invention. The sequencing device includes at least one processor 601, a communication bus 602, a memory 603, and at least one communication interface 604.
其中, 所述通信总线 602用于实现上述组件之间的连接并通信, 所述通信接口 604用于与外部设备连接并通信。 The communication bus 602 is configured to implement a connection and communication between the components, and the communication interface 604 is configured to connect and communicate with an external device.
其中, 所述存储器 603用于存储需要执行的程序代码, 这些程序代马 可以 包括: 第一获取单元 6301、 第二获取单元 6302和第一更新单元 6303; 所述 处理器 601用于 亍所述 诸器 603中 诸的单元, 当上述单元 理器 601 亍时, 实现如下功能: 数据的已更新的数据状态 获取与所述已更新的数据状态 对应的排序列表, 排序列表包括按照预设的排序规则进行排序的标识信息集; The memory 603 is configured to store program code that needs to be executed, and the program may include: a first obtaining unit 6301, a second obtaining unit 6302, and a first updating unit 6303; The units in the plurality of units 603, when the unit processor 601 is ,, implement the following functions: the updated data state of the data acquires a sorted list corresponding to the updated data state, and the sorted list includes sorting according to a preset An identification information set in which the rules are sorted;
第二获取单元 6302用于根据所述第一获取单元 6301获取的标识信息集中的每 个标识信息, 获取与所述每个标识信息对应的^:据状态 The second obtaining unit 6302 is configured to obtain, according to each identifier information in the identifier information set acquired by the first acquiring unit 6301, a status of the data corresponding to each identifier information.
第一更新单元 6303用于根据所述已更新的数据状态参数以及所述第二获 取单元 6302获取的数据状态参数, 更新所述排序列表。 The first update unit 6303 is configured to update the sorted list according to the updated data state parameter and the data state parameter acquired by the second obtaining unit 6302.
根据本实施例的排序装置, 当数据库中主数据的数据状态参数发生变 化时, 仅需要根据排序列表获取 N个数据状态参数, 并根据已更新的数据 状态参数和排序列表中的 N个数据状态参数进行排序,以更新排序列表即 可, 克服了当主数据的数据状态参数进行更新时需要遍历整个数据库获取 用户所关心的前 N个主数据的运行效率低和处理时间长的问题,提升了用 户的体 #r。
可选地, 如图 5B所示, 所述存储器 603用于存 要执行的程序代码还可 以包括判断预设阈值单元 6310, 该判断预设阈值单元 6310用于: According to the sorting apparatus of the embodiment, when the data state parameter of the main data in the database changes, only N data state parameters need to be acquired according to the sorted list, and according to the updated data state parameter and the N data states in the sorted list. The parameters are sorted to update the sorted list, which overcomes the problem that when the data state parameter of the main data is updated, the entire database needs to be traversed to obtain the first N main data of the user, and the operation efficiency is low and the processing time is long, thereby improving the user. Body #r. Optionally, as shown in FIG. 5B, the program code 603 for storing the program code to be executed may further include determining a preset threshold unit 6310, where the determining preset threshold unit 6310 is configured to:
判断所述第一获取单元 6301 获取的标识信息集中所包含的标识信息 的数目是否小于预设阈值; Determining whether the number of the identification information included in the identifier information set acquired by the first acquiring unit 6301 is less than a preset threshold;
若所述数目小于所述预设阈值时, 则将所述已更新的数据状态参数的 标识信息直接加入所述排序列表, 否则, 触发所述第一更新单元 6303。 And if the number is less than the preset threshold, the identifier information of the updated data state parameter is directly added to the sorting list, otherwise, the first updating unit 6303 is triggered.
实施例八 Example eight
本实施例为基于实施例七提供的又一种排序装置的结构。 This embodiment is a structure of still another sorting apparatus provided based on Embodiment 7.
如图 6所示,该排序装置中 诸器 603中的第一更新单元 6303包括比较子单元 6401和更新子单元 6402。 As shown in Fig. 6, the first update unit 6303 in the sorting means 603 includes a comparison subunit 6401 and an update subunit 6402.
比较子单元 6401 用于将所述已更新的数据状态参数与所述第一获取单 元 6301 获取的标识信息集中最后一个标识信息对应的数据状态参数进行 比较; The comparing subunit 6401 is configured to compare the updated data state parameter with a data state parameter corresponding to the last identifier information in the identifier information set acquired by the first acquiring unit 6301;
更新子单元 6402用于当根据所述比较子单元 6401的比较结果确定需 根据所述已更新的数据状态参数以及所述与所述每个标识信息对应的数据状 态参数, 按照所述预设的排序规则进行排序时, 更新所述排序列表。 The update subunit 6402 is configured to determine, according to the comparison result of the comparison subunit 6401, according to the updated data state parameter and the data state parameter corresponding to each identifier information, according to the preset When the collation is sorted, the sorted list is updated.
可选地,更新子单元 6402包括判断模块 6403和排序模块 6404。其中, 判断模块 6403用于当根据所述比较子单元 6401的比较结果确定需根据所 述已更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参 数, 按照所述预设的排序规则进行排序时, 判断与所述每个标识信息对应 的主数据是否包含所述已更新的数据状态参数对应的主数据, 并当判断结 果为否时, 触发排序模块 6404; Optionally, the update subunit 6402 includes a decision module 6403 and a sort module 6404. The determining module 6403 is configured to determine, according to the comparison result of the comparing subunit 6401, according to the updated data state parameter and the data state parameter corresponding to each identifier information, according to the preset When the sorting rule is sorted, it is determined whether the main data corresponding to each of the identification information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the sorting module 6404 is triggered;
排序模块 6404用于删除所述标识信息集中最后一个标识信息, 并与 所述已更新的数据状态参数对应的主数据的标识信息按照预设的排序规 则加入到所述排序列表中。 The sorting module 6404 is configured to delete the last identifier information in the identifier information set, and the identifier information of the master data corresponding to the updated data state parameter is added to the sorted list according to a preset sorting rule.
可选地, 本实施例的排序装置中的存储器 603 还包括第二更新单元 6405 , 该第二更新单元 6405用于: Optionally, the memory 603 in the sorting apparatus of this embodiment further includes a second updating unit 6405, where the second updating unit 6405 is configured to:
当需删除主数据的标识信息时, 从所述排序列表中删除所述需删除的 主数据的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
遍历所述数据库中的数据状态 并更新所述排序列表, 以使所标识信息集所
包含的标识信息的个数 所述预设阈值。 Traversing the state of the data in the database and updating the sorted list to cause the identified information set The number of pieces of identification information included is the preset threshold.
可选地, 本实施例的排序装置中的存储器 603 还包括第三更新单元 6406 , 该第三更新单元 6406用于: Optionally, the memory 603 in the sorting apparatus of this embodiment further includes a third updating unit 6406, where the third updating unit 6406 is configured to:
当需删除主数据的标识信息时, 从所述排序列表中删除需删除的主数据 的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
当更新所述排序列表时, 判断所述每个标识信息对应的主数据中是否包含所 述已更新的数据状态参数对应的主数据, 当判断结果为否时, 将所述已更 新的数据状态参数对应的主数据的标识信息按照所述预设的排序规则加 入到所述排序列表中。 When the sorting list is updated, it is determined whether the main data corresponding to each of the identifier information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state is The identification information of the primary data corresponding to the parameter is added to the sorted list according to the preset sorting rule.
本实施例的存储器 603中的第一获取单元 6301可具体用于: 当更新主数据的数据状态械时, 根据已更新的数据状态 获林排序装置 的内存中的与已更新的数据状态 对应的排序列表, 排序列表包括按照预设的排 序规则进行排序的标识信息集, 标识信息集包括 N个标识信息, 根据该 N个标识信 息可以获取 TOP N主数据。 The first obtaining unit 6301 in the memory 603 of the embodiment may be specifically configured to: when updating the data state of the main data, obtain the corresponding data state in the memory of the forest sorting device according to the updated data state. The sorting list includes an identifier information set that is sorted according to a preset sorting rule, and the identifier information set includes N pieces of identification information, and the TOP N master data can be obtained according to the N pieces of identification information.
根据本实施例排序装置, 通过将已更新的数据与根据排序列表中最后一 个标识信息获取的数据状态参数进行比较即可判断出是否需要将更新的 数据对应的索引数据加入排序列表中, 重新排序也仅是对更新的数据和排 序列表对应的各数据状态参数进行排序, 需要操作的数据较少, 减轻了排 序系统的负担。 According to the sorting apparatus of the embodiment, by comparing the updated data with the data state parameters obtained according to the last identifier information in the sorted list, it can be determined whether the index data corresponding to the updated data needs to be added to the sorted list, and reordering It also only sorts the updated data and the data state parameters corresponding to the sorted list, and requires less data to operate, which reduces the burden on the sorting system.
实施例九 Example nine
本实施例还提供一种终端, 其包括至少一个处理器, 以及存储器, 存储器 用于存储可 #^亍程序代码, 其中, 处理器通过读 中存储的可批行程序代马 行与可 ^亍呈序^ ^马?于应的呈序, 以用于: The embodiment further provides a terminal, which includes at least one processor, and a memory, where the memory is used to store the program code, wherein the processor can perform the batch process by reading the stored batch program. In the order ^ ^ horse? In the order of the application, for:
当更新数据库中主数据的数据状态 时, 根据所 数据的已更新的数据状 态 获取与所述已更新的数据状态 对应的排序列表, 所述排序列表包括按 照预设的排序规则进行排序后的标识信息集; When updating the data status of the primary data in the database, obtaining an ordered list corresponding to the updated data status according to the updated data status of the data, where the sorted list includes the identifiers sorted according to a preset sorting rule Information set
根据所述标识信息集中的每个标识信息, 获取与所述每个标识信息对应的数据 状态参数; Acquiring, according to each identifier information in the identifier information set, a data status parameter corresponding to each identifier information;
根据所述已更新的数据状态参数以及所述与所述每个标识信息对应的数 据状态参数, 更新所述排序列表。
可选地, 当处理器通过读 Μ¾器中 诸的可 亍程序^^马来 艮据所 述已更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参 数, 更新所述排序列表之前, 还通过读 M¾器中 诸的可 亍程序 来执 行: Updating the sorted list according to the updated data state parameter and the data state parameter corresponding to each of the identification information. Optionally, when the processor updates the data by reading the updated data state parameter and the data state parameter corresponding to each of the identification information by reading the configurable program in the device Before sorting the list, it is also executed by reading the executable programs in the M3⁄4 device:
判断所述标识信息集中所包含的标识信息的数目是否小于预设阈值; 若所述数目小于所述预设阈值, 则将所述已更新的数据状态参数的标 识信息直接加入所述排序列表, 否则, 根据所述已更新的数据状态参数以 及与所述每个标识信息对应的数据状态参数, 更新所述排序列表。 Determining whether the number of the identification information included in the identifier information set is less than a preset threshold; if the number is less than the preset threshold, adding the identifier information of the updated data state parameter directly to the sorting list, Otherwise, the sorted list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identification information.
可选地, 当处理器通过读耳^诸器中 诸的可 亍程序 ^ ^έ行与可 亍 程序代码对应的程序, 以用于根据已更新的数据状态参数和 N个已排序的数 据状态参数更新排序列表时, 具体可以是: Optionally, when the processor reads the program corresponding to the executable program code by reading the executable program in the ear device, the program is used according to the updated data state parameter and the N sorted data states. When the parameter updates the sorted list, the specifics can be:
将所述已更新的数据状态参数与所述标识信息集中最后一个标识信 息对应的数据状态参数进行比较; Comparing the updated data state parameter with a data state parameter corresponding to the last identification information in the identification information set;
当根据比较结果确定需根据所述已更新的数据状态参数以及所述与 所述每个标识信息对应的数据状态参数, 按照所述预设的排序规则进行排序 时, 更新所述排序列表。 。 And determining, according to the comparison result, that the sorted list is updated according to the updated data state parameter and the data state parameter corresponding to each of the identifier information, according to the preset sorting rule. .
可选地, 当处理器根据比较结果判断出需根据已更新的数据状态参数 和根据每个标识信息获取到的数据状态参数按照预设的排序规则进行排 序时, 具体可以是: Optionally, when the processor determines, according to the comparison result, that the data state parameter that is updated according to the updated data state parameter and the data state parameter that is obtained according to each identifier information is sorted according to a preset sorting rule, specifically:
判断与所述每个标识信息对应的主数据是否包含所述已更新的数据状态 参数对应的主数据; Determining whether the main data corresponding to each of the identification information includes main data corresponding to the updated data status parameter;
当与所述每个标识信息对应的主数据未包含所述已更新的数据状态参数 对应的主数据, 则删除所述标识信息集中最后一个标识信息, 并将与所述 已更新的数据状态参数对应的主数据的标识信息按照预设的排序规则加 入到所述排序列表中。 When the main data corresponding to each of the identification information does not include the main data corresponding to the updated data state parameter, deleting the last identifier information in the identifier information set, and the updated data state parameter The identification information of the corresponding primary data is added to the sorted list according to a preset sorting rule.
可选地, 处理器还可通过读取 诸器中存储的可执行程序代码来运行与可执 ^^呈序^^马对应的呈序, 以用于: Optionally, the processor can also run the sequence corresponding to the executable by reading the executable program code stored in the devices for:
当需删除主数据的标识信息时, 从所述排序列表中删除需删除的主数据 的标识信息; When the identification information of the primary data needs to be deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
遍历所述数据库中的数据状态 并更新所述排序列表, 以使所述标识信息集
所包含的标识信息的数目达到所述预设阈值; 或者是: Traversing the state of the data in the database and updating the sorted list to cause the set of identification information The number of the included identification information reaches the preset threshold; or
当需删除的主数据的标识信息时, 从所述排序列表中删除需删除的主数 据的标识信息; When the identification information of the primary data to be deleted is deleted, the identification information of the primary data to be deleted is deleted from the sorted list;
当更新所述排序列表时, 判断所述每个标识信息对应的主数据中是否包含所 述已更新的数据状态参数对应的主数据, 当判断结果为否时, 将已更新的 数据状态参数对应的主数据的标识信息按照预设的排序规则加入到排序 列表中。 根据本实施例的终端, 当数据库中主数据的数据状态参数发生变化 时, 仅需要根据排序列表获取 N个数据状态参数即可, 并根据已更新的数 据状态参数和排序列表中的 N 个数据状态参数进行排序, 以更新排序列 表, 克服了当主数据的数据状态参数进行更新时需要遍历整个数据库获取 用户所关心的前 N个主数据的运行效率低和处理时间长的问题,提升了用 户的体马全。 When the sorting list is updated, it is determined whether the main data corresponding to each of the identification information includes the main data corresponding to the updated data state parameter, and when the determination result is no, the updated data state parameter is corresponding. The identification information of the primary data is added to the sorted list according to a preset sorting rule. According to the terminal of the embodiment, when the data state parameter of the main data in the database changes, only N data state parameters need to be obtained according to the sorted list, and according to the updated data state parameter and the N data in the sorted list. The state parameters are sorted to update the sorted list, which overcomes the problem that when the data state parameter of the main data is updated, the entire database needs to be traversed to obtain the first N main data of the user, and the operation efficiency is low and the processing time is long, thereby improving the user's Full body.
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的范围。
It should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; and the modifications or substitutions do not deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1、 一种排序的方法, 其特征在于, 包括: 1. A sorting method, characterized by including:
当更新数据库中主数据的数据状态 时, 排序装置根据所述主数据的已更新 的数据状态 获取与所述已更新的数据状态 对应的排序列表, 所述排序列 表包括按照预设的排序规则进行排序后的标识信息集; When updating the data status of the master data in the database, the sorting device obtains a sorting list corresponding to the updated data status according to the updated data status of the main data, and the sorting list includes performing the sorting according to the preset sorting rules. Sorted identification information set;
根据所述标识信息集中的每个标识信息, 获取与所述每个标识信息对应的数据 状态参数; According to each identification information in the identification information set, obtain the data status parameter corresponding to each identification information;
根据所述已更新的数据状态参数以及所述与所述每个标识信息对应的数 据状态参数, 更新所述排序列表。 The sorting list is updated according to the updated data status parameter and the data status parameter corresponding to each of the identification information.
2、 根据权利要求 1 所述的排序的方法, 其特征在于, 在根据所述已 更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参数, 更 新所述排序列表之前, 所述方法还包括: 2. The sorting method according to claim 1, characterized in that, before updating the sorting list according to the updated data status parameters and the data status parameters corresponding to each of the identification information, The method also includes:
判断所述标识信息集中所包含的标识信息的数目是否小于预设阈值; 若所述数目小于所述预设阈值, 则将所述已更新的数据状态参数的标 识信息直接加入所述排序列表, 否则, 根据所述已更新的数据状态参数以 及与所述每个标识信息对应的数据状态参数, 更新所述排序列表。 Determine whether the number of identification information contained in the identification information set is less than the preset threshold; if the number is less than the preset threshold, directly add the identification information of the updated data status parameter to the sorting list, Otherwise, the sorting list is updated according to the updated data status parameter and the data status parameter corresponding to each identification information.
3、 根据权利要求 1或 2所述的排序的方法, 其特征在于, 所述根据 所述已更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参 数, 更新所述排序列表, 包括: 3. The sorting method according to claim 1 or 2, characterized in that: updating the sorting according to the updated data status parameters and the data status parameters corresponding to each of the identification information. List, including:
将所述已更新的数据状态参数与所述标识信息集中最后一个标识信 息对应的数据状态参数进行比较; Compare the updated data status parameter with the data status parameter corresponding to the last identification information in the identification information set;
当根据比较结果确定需根据所述已更新的数据状态参数以及所述与 所述每个标识信息对应的数据状态参数, 按照所述预设的排序规则进行排序 时, 更新所述排序列表。 When it is determined according to the comparison result that the updated data status parameter and the data status parameter corresponding to each identification information need to be sorted according to the preset sorting rule, the sorting list is updated.
4、 根据权利要求 1〜3 中任一项所述的方法, 其特征在于, 所述根据 所述已更新的数据状态参数以及与所述每个标识信息对应的数据状态参数, 更新所述排序列表, 包括: 4. The method according to any one of claims 1 to 3, wherein the sorting is updated according to the updated data status parameters and the data status parameters corresponding to each of the identification information. List, including:
判断与所述每个标识信息对应的主数据是否包含所述已更新的数据状态 参数对应的主数据; Determine whether the master data corresponding to each identification information includes the master data corresponding to the updated data status parameter;
当与所述每个标识信息对应的主数据未包含所述已更新的数据状态参数
对应的主数据, 则删除所述标识信息集中最后一个标识信息, 并将与所述 已更新的数据状态参数对应的主数据的标识信息按照预设的排序规则加 入到所述排序列表中。 When the master data corresponding to each identification information does not contain the updated data status parameter corresponding master data, then delete the last identification information in the identification information set, and add the identification information of the master data corresponding to the updated data status parameter to the sorting list according to the preset sorting rules.
5、 根据权利要求 2〜4 中任一项所述的排序的方法, 其特征在于, 还 包括: 5. The sorting method according to any one of claims 2 to 4, further comprising:
当需删除主数据的标识信息时, 从所述排序列表中删除需删除的主数据 的标识信息; When the identification information of the master data needs to be deleted, delete the identification information of the master data that needs to be deleted from the sorting list;
遍历所述数据库中的数据状态 并更新所述排序列表, 以使所述标识信息集 所包含的标识信息的数目达到所述预设阈值。 Traverse the data status in the database and update the sorted list so that the number of identification information contained in the identification information set reaches the preset threshold.
6、 根据权利要求 24中任一项所述的排序的方法, 其特 ί球于, 还包括: 当需删除的主数据的标识信息时, 从所述排序列表中删除需删除的主数 据的标识信息; 6. The method of sorting according to any one of claims 24, further comprising: when the identification information of the main data that needs to be deleted is identified, deleting the information of the main data that needs to be deleted from the sorting list. identification information;
当更新所述排序列表时, 判断所述每个标识信息对应的主数据中是否包含所 述已更新的数据状态参数对应的主数据, 当判断结果为否时, 将所述已更 新的数据状态参数对应的主数据的标识信息按照所述预设的排序规则加 入到所述排序列表中。 When updating the sorting list, it is judged whether the master data corresponding to each identification information contains the master data corresponding to the updated data status parameter. When the judgment result is no, the updated data status is The identification information of the main data corresponding to the parameters is added to the sorting list according to the preset sorting rules.
7、 一种排序装置, 其特 于, 包括: 7. A sorting device, which is characterized by:
第一获取单元, 用于当更新数据库中主数据的数据状态 时, 根据所 数 据的已更新的数据状态 获取与所述已更新的数据状态 对应的排序列表, 所述排序列表包括按照预设的排序规则进行排序的标识信息集; The first acquisition unit is configured to, when updating the data status of the master data in the database, obtain a sorting list corresponding to the updated data status according to the updated data status of the data, where the sorting list includes: A set of identification information sorted by a sorting rule;
第二获取单元, 用于根据所述第一获取单元获取的标识信息集中的每个标识信 息, 获取与所述每个标识信息对应的^:据状态 The second acquisition unit is configured to acquire the data status corresponding to each identification information according to each identification information in the identification information set obtained by the first acquisition unit.
第一更新单元,用于根据所述已更新的数据状态参数以及所述第二获取单 元获取的数据状态参数, 更新所述排序列表。 A first update unit, configured to update the sorting list according to the updated data status parameter and the data status parameter obtained by the second acquisition unit.
8、 根据权利要求 7所述的排序装置, 其特征在于, 还包括: 判断预 设阈值单元, 所述判断预设阈值单元用于: 判断所述第一获取单元获取的 标识信息集中所包含的标识信息的数目是否小于预设阈值; 8. The sorting device according to claim 7, further comprising: a preset threshold judgment unit, the preset threshold judgment unit is used to: judge whether the identification information contained in the set of identification information obtained by the first acquisition unit is Whether the number of identification information is less than the preset threshold;
若所述数目小于所述预设阈值时, 则将所述已更新的数据状态参数的 标识信息直接加入所述排序列表, 否则, 触发所述第一更新单元。 If the number is less than the preset threshold, then the identification information of the updated data status parameter is directly added to the sorting list; otherwise, the first update unit is triggered.
9、 根据权利要求 7或 8所述的排序装置, 其特征在于, 所述第一更
新单元包括: 9. The sorting device according to claim 7 or 8, characterized in that, the first update New units include:
比较子单元, 用于将所述已更新的数据状态参数与所述第一获取单元 获取的标识信息集中最后一个标识信息对应的数据状态参数进行比较; 更新子单元, 用于当根据所述比较子单元的比较结果确定需根据所述 已更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参数, 按照所述预设的排序规则进行排序时, 更新所述排序列表。 a comparison subunit, used to compare the updated data status parameter with the data status parameter corresponding to the last identification information in the identification information set obtained by the first acquisition unit; an update subunit, used to compare the updated data status parameter according to the comparison The comparison result of the subunit determines that the sorting list needs to be updated when sorting according to the preset sorting rule based on the updated data status parameter and the data status parameter corresponding to each identification information.
10、 根据权利要求 9所述的排序装置, 其特征在于, 所述更新子单元 包括: 10. The sorting device according to claim 9, characterized in that the update subunit includes:
判断模块, 用于当根据所述比较子单元的比较结果确定需根据所述已 更新的数据状态参数以及所述与所述每个标识信息对应的数据状态参数, 按 照所述预设的排序规则进行排序时, 判断与所述每个标识信息对应的主数 据是否包含所述已更新的数据状态参数对应的主数据, 并当判断结果为否 时, 触发排序模块; A judgment module, configured to determine according to the updated data status parameter and the data status parameter corresponding to each identification information according to the preset sorting rule according to the comparison result of the comparison subunit. When performing sorting, determine whether the master data corresponding to each identification information includes the master data corresponding to the updated data status parameter, and when the judgment result is no, trigger the sorting module;
所述排序模块, 用于删除所述标识信息集中最后一个标识信息, 并将 与所述已更新的数据状态参数对应的主数据的标识信息按照预设的排序 规则加入到所述排序列表中。 The sorting module is configured to delete the last identification information in the identification information set, and add the identification information of the master data corresponding to the updated data status parameter to the sorting list according to the preset sorting rules.
1 1、 根据权利要求 8〜10中任一项所述的排序装置, 其特征在于, 还 包括第二更新单元, 所述第二更新单元用于: 11. The sorting device according to any one of claims 8 to 10, further comprising a second update unit, the second update unit is used for:
当需删除主数据的标识信息时, 从所述排序列表中删除所述需删除的 主数据的标识信息; When the identification information of the master data needs to be deleted, delete the identification information of the master data that needs to be deleted from the sorting list;
遍历所述数据库中的数据状态 并更新所述排序列表, 以使所标识信息集所 包含的标识信息的个数 所述预设阈值。 Traverse the data status in the database and update the sorted list so that the number of identification information contained in the identified information set exceeds the preset threshold.
12、 根据权利要求 8〜10中^^项所述的排序装置, 夺 于, 还包括第三 更新单元, 所述第三更新单元用于: 12. The sorting device according to claim 8 to claim 10, further comprising a third update unit, the third update unit being used for:
当需删除主数据的标识信息时, 从所述排序列表中删除需删除的主数据 的标识信息; When the identification information of the master data needs to be deleted, delete the identification information of the master data that needs to be deleted from the sorting list;
当更新所述排序列表时, 判断所述每个标识信息对应的主数据中是否包含所 述已更新的数据状态参数对应的主数据, 当判断结果为否时, 将所述已更 新的数据状态参数对应的主数据的标识信息按照所述预设的排序规则加 入到所述排序列表中。
When updating the sorting list, it is judged whether the master data corresponding to each identification information contains the master data corresponding to the updated data status parameter. When the judgment result is no, the updated data status is The identification information of the main data corresponding to the parameters is added to the sorting list according to the preset sorting rules.
13、 一种终端, 其特征在于, 包括: 至少一个处理器, 以及存储器, 所述存储 器用于 诸可 亍程序 ^ , 其中, 所 理器通过读取所述 诸器中 诸的可执 行程序 ^行与所述可 亍程序^ ^马对应的程序, 以用于: 13. A terminal, characterized in that it includes: at least one processor, and a memory, the memory being used for executable programs, wherein the processor reads the executable programs in the processors. Execute a program corresponding to the available program for:
当更新数据库中主数据的数据状态 时, 根据所 数据的已更新的数据状 态 获取与所述已更新的数据状态 对应的排序列表, 所述排序列表包括按 照预设的排序规则进行排序后的标识信息集; When the data status of the master data in the database is updated, a sorting list corresponding to the updated data status is obtained according to the updated data status of the data. The sorting list includes the identifiers sorted according to the preset sorting rules. information set;
根据所述标识信息集中的每个标识信息, 获取与所述每个标识信息对应的数据 状态参数; According to each identification information in the identification information set, obtain the data status parameter corresponding to each identification information;
根据所述已更新的数据状态参数以及所述与所述每个标识信息对应的数 据状态参数, 更新所述排序列表。
The sorting list is updated according to the updated data status parameter and the data status parameter corresponding to each of the identification information.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201280001356.6A CN103098056B (en) | 2012-10-26 | 2012-10-26 | A kind of method of sequence, device and terminal |
PCT/CN2012/083582 WO2014063351A1 (en) | 2012-10-26 | 2012-10-26 | Ranking method, device and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2012/083582 WO2014063351A1 (en) | 2012-10-26 | 2012-10-26 | Ranking method, device and terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014063351A1 true WO2014063351A1 (en) | 2014-05-01 |
Family
ID=48208634
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2012/083582 WO2014063351A1 (en) | 2012-10-26 | 2012-10-26 | Ranking method, device and terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103098056B (en) |
WO (1) | WO2014063351A1 (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104252455B (en) * | 2013-06-25 | 2018-05-01 | 北大方正集团有限公司 | A kind of data reordering method and device |
CN103793245B (en) * | 2014-01-21 | 2016-08-17 | 浙江大学 | The generation method of delta file in the renewal of a kind of embedded system |
CN104794137B (en) * | 2014-01-22 | 2019-01-22 | 腾讯科技(深圳)有限公司 | The processing method and sorting query method and relevant apparatus and system of order recording |
CN105095461A (en) * | 2015-07-29 | 2015-11-25 | 张阳 | Family karaoke ordering method and system |
CN108932236B (en) * | 2017-05-22 | 2021-05-07 | 北京金山云网络技术有限公司 | File management method and device |
CN107609126B (en) * | 2017-09-15 | 2019-03-29 | 北京邮电大学 | A kind of evaluation method and device of the spatial retrieval word inquiry based on crowdsourcing |
CN109697480B (en) * | 2017-10-23 | 2022-06-03 | 阿里巴巴集团控股有限公司 | Data processing method, device and system |
CN108304492B (en) * | 2018-01-09 | 2020-07-31 | 武汉斗鱼网络科技有限公司 | Search list updating method, storage medium, device and system |
CN108509529A (en) * | 2018-03-14 | 2018-09-07 | 武汉斗鱼网络科技有限公司 | Data page sort method, device and readable storage medium storing program for executing |
CN110837412B (en) * | 2019-11-15 | 2022-08-26 | 中国建设银行股份有限公司 | Method, device, equipment and storage medium for judging operation ready state |
CN112035201B (en) * | 2020-08-24 | 2021-08-24 | 珠海格力电器股份有限公司 | Device parameter display method and device, computer device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1389811A (en) * | 2002-02-06 | 2003-01-08 | 北京造极人工智能技术有限公司 | Intelligent search method of search engine |
CN1842977A (en) * | 2003-08-25 | 2006-10-04 | 富士通天株式会社 | Music database updating system, music database transmitter apparatus, terminal apparatus having function of updating music database, music database updating method, transmission method of music databa |
US20090313031A1 (en) * | 2008-06-11 | 2009-12-17 | Jensen Lee | Systems and Methods To sort Listings of Different Types |
CN101860597A (en) * | 2009-04-10 | 2010-10-13 | 北京闻言科技有限公司 | Method for ranking online time of mobile phone client in real time |
CN102088627A (en) * | 2011-01-19 | 2011-06-08 | 深圳创维数字技术股份有限公司 | Program data information updating system and data updating method |
-
2012
- 2012-10-26 WO PCT/CN2012/083582 patent/WO2014063351A1/en active Application Filing
- 2012-10-26 CN CN201280001356.6A patent/CN103098056B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1389811A (en) * | 2002-02-06 | 2003-01-08 | 北京造极人工智能技术有限公司 | Intelligent search method of search engine |
CN1842977A (en) * | 2003-08-25 | 2006-10-04 | 富士通天株式会社 | Music database updating system, music database transmitter apparatus, terminal apparatus having function of updating music database, music database updating method, transmission method of music databa |
US20090313031A1 (en) * | 2008-06-11 | 2009-12-17 | Jensen Lee | Systems and Methods To sort Listings of Different Types |
CN101860597A (en) * | 2009-04-10 | 2010-10-13 | 北京闻言科技有限公司 | Method for ranking online time of mobile phone client in real time |
CN102088627A (en) * | 2011-01-19 | 2011-06-08 | 深圳创维数字技术股份有限公司 | Program data information updating system and data updating method |
Also Published As
Publication number | Publication date |
---|---|
CN103098056B (en) | 2016-11-16 |
CN103098056A (en) | 2013-05-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014063351A1 (en) | Ranking method, device and terminal | |
US11354356B1 (en) | Video segments for a video related to a task | |
JP6553649B2 (en) | Clustering storage method and apparatus | |
US8661023B1 (en) | Optimizing search query logic to speed retrieval | |
US10635668B2 (en) | Intelligently utilizing non-matching weighted indexes | |
US20150161266A1 (en) | Systems and methods for more efficient source code searching | |
JP2016532173A (en) | Semantic information, keyword expansion and related keyword search method and system | |
JP5969697B2 (en) | Completing the application interface using search query keywords | |
WO2020215692A1 (en) | Page generation method, device, terminal and storage medium | |
US10417210B2 (en) | Multi-token matching scheme | |
US9043321B2 (en) | Enhancing cluster analysis using document metadata | |
US20150081690A1 (en) | Network sourced enrichment and categorization of media content | |
US20150154294A1 (en) | Suggested domain names positioning based on term frequency or term co-occurrence | |
US20180060362A1 (en) | Method and system for implementing distributed lobs | |
US10936611B2 (en) | Search promotion systems and method | |
CN111611471A (en) | Searching method and device and electronic equipment | |
CN106844406B (en) | Search method and search device | |
CN108959584B (en) | Community structure-based method and device for processing graph data | |
WO2017059293A1 (en) | Single table multi-schema data store in a key value store | |
US20190163810A1 (en) | Search User Interface | |
US10324991B2 (en) | Search promotion systems and method | |
US10198249B1 (en) | Accessing schema-free databases | |
JP6221593B2 (en) | Data management method, data management program, and data management apparatus | |
CN113239258B (en) | Method, device, electronic equipment and storage medium for providing query suggestion | |
WO2022165629A1 (en) | Control method and apparatus for determining reverse order list data on basis of forward order list |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WWE | Wipo information: entry into national phase |
Ref document number: 201280001356.6 Country of ref document: CN |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 12887269 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 12887269 Country of ref document: EP Kind code of ref document: A1 |