Reverse sequence retrieval method, device and equipment and storage medium
By defining the target range in the Elastic Search system and searching from back to front, the problem of low performance in reverse order retrieval is solved, enabling efficient retrieval of the last k target objects and improving retrieval efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-12-15
- Publication Date
- 2026-05-01
AI Technical Summary
In Elastic Search-based retrieval systems, reverse retrieval performance is low, especially when it is necessary to retrieve the latest or earliest objects that meet the search criteria. This requires reversing the search process, which leads to a decrease in retrieval performance.
By determining the target interval where the target object is located and performing a search in reverse order within the target interval, the entire traversal of the candidate objects to be searched is avoided, and only a portion of the candidate objects are searched to obtain the last k target objects.
It improves the performance of reverse retrieval, reduces the number of times candidate objects are traversed, and improves retrieval efficiency.
Smart Images

Figure CN116263793B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a reverse retrieval method, apparatus, device, and storage medium. Background Technology
[0002] Elastic Search (ES) provides distributed full-text search capabilities, thereby improving retrieval efficiency. In an ES-based search system, each object to be searched is assigned a unique document ID (docid). When indexing, an inverted index is created for each search condition to indicate the docids that satisfy that condition, such as the docids that meet a specific search value. This method accelerates retrieval. After specifying a search value (e.g., a timestamp), the ES-based search system can retrieve the corresponding inverted list from the inverted index. The inverted list includes the docids of the objects to be searched that meet the search value, thus obtaining the objects that satisfy the search value.
[0003] In scenarios involving searching by timestamp range, the above method has limited effect on improving search efficiency. This is because inverted indexes only involve a limited number of inverted items (search conditions), while timestamp searches can involve tens of millions of search conditions. For example, if the timestamp range is one day and the time unit is milliseconds, the number of search conditions involved could be: 24 * 60 * 60 * 1000 = 86.4 million. To address the performance issues of timestamp-based searches, by sorting the objects to be searched by their timestamps and setting a docid for the sorted objects, timestamp range searches can be simplified to searches only at the two endpoints of the timestamp range, thereby improving search performance.
[0004] However, the aforementioned time-series-based indexes introduce the problem of reverse order retrieval. For example, when the objects to be retrieved are sorted in ascending order by timestamp, a retrieval request that needs to retrieve the latest k objects that meet the retrieval criteria requires a reverse order retrieval of the objects to be retrieved. However, Elasticsearch-based retrieval systems need to first traverse the objects to be retrieved in ascending order when performing a reverse order retrieval, resulting in low retrieval performance. Summary of the Invention
[0005] This application provides a reverse order retrieval method, apparatus, device, and storage medium, which can improve the performance of reverse order retrieval. The technical solution is as follows:
[0006] According to one aspect of this application, a reverse retrieval method is provided, the method comprising:
[0007] Receive a reverse search request, the reverse search request is used to indicate to search the last k target objects in the candidate search objects, the reverse search request includes search conditions, start position and end position, and k is a positive integer;
[0008] Among the candidate objects to be retrieved between the start position and the end position, a target interval containing the target object is determined. The positions of the candidate objects to be retrieved are obtained by sorting the candidate objects according to their attributes. The target object is a candidate object to be retrieved that satisfies the retrieval conditions.
[0009] Within the target interval, the last k target objects are retrieved in reverse order.
[0010] According to another aspect of this application, a reverse retrieval device is provided, the device comprising:
[0011] The receiving module is used to receive a reverse retrieval request, which is used to instruct the retrieval of the last k target objects in the candidate objects to be retrieved. The reverse retrieval request includes retrieval conditions, a start position and an end position, where k is a positive integer.
[0012] The determining module is used to determine the target interval where the target object exists among the candidate objects to be retrieved between the start position and the end position. The positions of the candidate objects to be retrieved are obtained by sorting the candidate objects to be retrieved according to their attributes. The target object is a candidate object to be retrieved that satisfies the retrieval conditions.
[0013] The retrieval module is used to retrieve the last k target objects in the target interval in a backward order.
[0014] In an optional design, the determining module is used for:
[0015] Determine the midpoint between the start position and the end position;
[0016] Using the middle position as the search start point and the end position as the search end point, the target object between the search start point and the search end point is determined from the candidate objects to be searched between the start position and the end position;
[0017] If the target object exists between the search start point and the search end point, update the search start point with the midpoint between the midpoint and the search end point, and continue to execute the step of determining the target object between the search start point and the search end point until there is no target object between the updated search start point and the search end point; or, if there is no target object between the search start point and the search end point, complete the step of determining the target interval.
[0018] In an optional design, the determining module is used for:
[0019] Among the candidate objects to be retrieved between the start position and the end position, determine the position of the nearest target object starting from the retrieval starting point;
[0020] If the location of the most recent target object is not after the search endpoint, it is determined that there is a target object between the search start point and the search endpoint; or, if the location of the most recent target object is after the search endpoint, it is determined that there is no target object between the search start point and the search endpoint.
[0021] In an optional design, the determining module is used for:
[0022] Determine the remaining number of candidate objects to be searched between the search start point and the search end point;
[0023] If the remaining quantity is less than k, the step of determining the target interval is completed; or, if the remaining quantity is not less than k, the step of determining the target interval continues.
[0024] In an optional design, the retrieval module is used for:
[0025] Determine the number of target objects between the start and end positions of the last target interval;
[0026] If the quantity equals k, the retrieval of the last k target objects is completed; or, if the quantity is greater than k, the starting position is set as the starting point of the last target interval, and the steps of determining the target interval and retrieving the last k target objects through the target interval are executed again; or, if the quantity is less than k, k = km, and the ending position is set as the starting point of the last target interval, and the steps of determining the target interval and retrieving the last k target objects through the target interval are executed again, where m is the quantity.
[0027] In an optional design, the retrieval module is used for:
[0028] If no target interval exists before the start of the last target interval, let k = km, and let the end position be the start of the last target interval, then perform the steps of determining the target interval and retrieving the last k target objects through the target interval again.
[0029] In an optional design, the retrieval module is used for:
[0030] If a target interval exists before the starting point of the last target interval, let the starting point of the last target interval be the starting point of the target interval preceding the last target interval, and continue to execute the step of retrieving the last k target objects through the target interval.
[0031] According to another aspect of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the reverse retrieval method as described above.
[0032] According to another aspect of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the reverse retrieval method as described above.
[0033] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the reverse retrieval method provided in various alternative implementations of the above aspects.
[0034] The beneficial effects of the technical solution provided in this application include at least the following:
[0035] By determining the target interval containing the target object, and then retrieving the k-th retrieval of the target object in reverse order within that interval, it is possible to retrieve the last k target objects. In this process, it is not necessary to iterate through all candidate objects sequentially based on their order. Only a subset of candidate objects needs to be retrieved to obtain the target interval, and further retrieval based on this interval yields the last k target objects. This improves the performance of reverse order retrieval. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a schematic diagram of the log before sorting provided in an exemplary embodiment of this application;
[0038] Figure 2 This is a schematic diagram of a sorted log provided in an exemplary embodiment of this application;
[0039] Figure 3 This is a schematic diagram illustrating an iterator provided in an exemplary embodiment of this application;
[0040] Figure 4 This is a schematic diagram illustrating the implementation process of reverse retrieval provided in an exemplary embodiment of this application;
[0041] Figure 5 This is a flowchart illustrating a reverse retrieval method provided in an exemplary embodiment of this application;
[0042] Figure 6 This is a flowchart illustrating a reverse retrieval method provided in an exemplary embodiment of this application;
[0043] Figure 7 This is a schematic diagram of the structure of a reverse retrieval device provided in an exemplary embodiment of this application;
[0044] Figure 8 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application.
[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0047] First, let's introduce the terms used in the embodiments of this application:
[0048] Reverse order retrieval: Reverse order retrieval refers to a retrieval direction that is the opposite of the sorting order in which the index of the object to be retrieved was created. For example, if the index of the object to be retrieved is 0, 1, 2, 3, 4, 6, then reverse order retrieval means searching for the object in descending order of the index.
[0049] Sequential retrieval: Sequential retrieval refers to a retrieval direction that is the same as the sorting method used when the index of the object to be retrieved was created. For example, if the index of the object to be retrieved is 0, 1, 2, 3, 4, 6 in sequence, sequential retrieval means searching for the object in ascending order of the index.
[0050] Elastic Search: Elastic Search is a distributed, RESTful (a design and development style for web applications) search and data analytics engine. It enables the rapid storage, searching, and analysis of massive amounts of data. Elastic Search has the following characteristics:
[0051] • Distributed, real-time document storage where each field can be indexed and searched;
[0052] • Distributed real-time analytics search engine;
[0053] It can handle the expansion of hundreds of service nodes and supports petabytes (PB) level structured or unstructured data.
[0054] Elasticsearch (ES) is suitable for text search scenarios but not for numeric search scenarios, especially for high-cardinality numeric range searches. Log timestamps are high-cardinality numeric data, and searches of logs typically require specifying a timestamp range. High cardinality refers to a field having a very large number of distinct values. For example, a timestamp in milliseconds can have 24 * 60 * 60 * 1000 different values within a single day.
[0055] An introduction to the index structure of Elasticsearch:
[0056] In an Elasticsearch-based retrieval system, each log entry is assigned a unique number. For example, with 1000 log entries, the system would assign each entry a number from 0 to 999, called a docid. When building the index, the system creates an inverted index for each search condition (e.g., a search value) to specify which log entries contain that value. The timestamp index of the logs can be viewed as a series of inverted tables where timestamps are the keys and docids are the values. For example, timestamp → [docid1, docid2]. [docid1, docid2] is called the posting list, and it is typically sorted in ascending order of docid values.
[0057] For example, 2021-09-28 10:10:39T1234→[1,5] means that the logs with docids 1 and 5 used the timestamp "2021-09-28 10:10:39T1234".
[0058] An introduction to the search algorithm of Elasticsearch:
[0059] Elasticsearch uses the inverted index described above to expedite retrieval. For example, by specifying a timestamp, the corresponding posting list can be retrieved, thus obtaining the logs under that timestamp. In many retrieval scenarios, this method is highly efficient; by specifying a timestamp, the corresponding posting list can be quickly retrieved, and the corresponding docid can be obtained.
[0060] This section introduces the problem of high-dimensional retrieval:
[0061] For timestamp range searches in logs, inverted indexes offer limited speed improvements. This is because timestamp searches involve high-dimensional range searches, potentially involving hundreds of millions of index entries, making searches of inverted indexes (index entries) slow. For example, consider a timestamp range of timestmap>2021-09-28:00:00T00000 and timestamp<2021-09-29:00:00T000000, which represents one day. Assuming the time unit is milliseconds and logs exist for every millisecond, the number of index entries involved could be 24 * 60 * 60 * 1000 = 86.4 million. To complete this search, every single one of these 86.4 million index entries would need to be scanned. To illustrate, in an index of 10 billion log entries, the data size of each index entry is approximately 30GB. In this search scenario, using a speed of 100MB / s, loading the index entries would take 300 seconds, resulting in slow search speed.
[0062] This paper introduces a log retrieval scheme based on time-series indexing:
[0063] The performance issues mentioned above in log retrieval can be resolved by using a log retrieval scheme based on time-series indexing. This scheme speeds up searches within a time range by sorting logs by timestamp. In the previous index, log timestamps were unordered, requiring the processing of a large number of timestamp index entries (e.g., hundreds of thousands to hundreds of millions) for a specific time range. By sorting logs by timestamp, the time range retrieval is simplified to searching only the two endpoints of the time range (reducing the number of timestamp index entries from hundreds of thousands to hundreds of millions to just two), thus improving retrieval efficiency.
[0064] For example, Figure 1 This is a schematic diagram of a log before sorting provided in an exemplary embodiment of this application. For example... Figure 1 As shown, in log 101 before sorting, each log entry corresponds to a time index 102 (time stamp). Figure 1The arrow between log 101 and time index 102 indicates the correspondence between log 101 and time index 102 before sorting. Search condition 103 is to search for logs with timestamps ts1, ts91, and timestamps between ts1 and ts91. Because log 101 before sorting is not sorted by timestamp, the system needs to process each timestamp (ts1, ts91, and timestamps between ts1 and ts91) to retrieve the corresponding logs, resulting in low search efficiency.
[0065] For example, Figure 2 This is a schematic diagram of a sorted log provided in an exemplary embodiment of this application. For example... Figure 2 As shown, in the sorted log 104, each log entry corresponds to a time index 102 (time stamp). Figure 2 The arrow between log 101 and time index 102 indicates the correspondence between the sorted log 104 and time index 102. Search condition 103 is to search for logs with timestamps ts1, ts91, and timestamps between ts1 and ts91. Since the sorted log 104 is already sorted by timestamp, the system only needs to find the logs corresponding to ts1 and ts91, and determine the logs between the corresponding logs of ts1 and ts91 as logs with timestamps between ts1 and ts91, thereby improving search efficiency.
[0066] However, time-series indexes introduce the problem of reverse-order retrieval. For example, if logs are sorted in ascending order by timestamp, a retrieval request that needs to find the latest k logs that meet the search criteria requires a reverse-order retrieval of the logs. Elasticsearch-based systems, however, need to traverse all logs in sorted order to reach the end during retrieval, resulting in low performance. An intuitive solution is to traverse backwards starting from the last log, but the iterators provided by Elasticsearch only support forward traversal.
[0067] For example, Figure 3 This is a schematic diagram illustrating an exemplary embodiment of an iterator provided in this application. Figure 3 As shown, when performing a reverse search on log 301, the Elasticsearch-based system uses a one-way iterator to traverse log 301 according to its original order, thereby locating log 302, which contains the last k entries of log 301 that satisfy the search criteria. Reverse search is inefficient.
[0068] Furthermore, since most index data is stored on disk, the operating system has significantly optimized the forward traversal access pattern, greatly improving performance through caching. However, if accessing from back to front, the operating system's cache will not be effective, leading to a decrease in retrieval performance. Because logs are sorted in ascending order by timestamp, retrieving the latest logs involves reverse retrieval, causing a performance decrease. Similarly, when logs are sorted in descending order by timestamp, retrieving the oldest logs also involves reverse retrieval, resulting in a performance decrease.
[0069] The method provided in this application embodiment can improve retrieval performance in the above-mentioned reverse retrieval scenario.
[0070] The following description uses an example of the method provided in this application being applied to a log retrieval scenario. The logs are timestamped, and the computer device has sorted the logs according to their timestamps. Figure 4 This is a schematic diagram illustrating the implementation process of reverse retrieval provided in an exemplary embodiment of this application, as shown below. Figure 4 As shown, the computer device receives a reverse retrieval request. This request includes retrieval criteria, a start position, and an end position. The retrieval request instructs the computer device to retrieve the last k target logs from log 101 between the start and end positions. The target logs are logs 101 that satisfy the retrieval criteria.
[0071] The computer device determines the target interval containing the target log from the start position to the end position using a binary search method. Specifically, it determines the midpoint between the start and end positions, using this midpoint as the search start point and the end position as the search end point, and determines whether a target log exists between the search start point and the search end point. If a target log exists, the target interval is obtained. If a target log exists, the computer device continues to recursively determine the target interval containing the target log using the previously determined midpoint as the search start point and the search end point, based on the binary search method, until no target log exists between the last determined search start point and search end point. During this process, the computer device records the midpoint determined by the binary search method each time.
[0072] After determining the target interval, the computer device determines the number of target logs between the start point and the end point of the last target interval. If the number equals k, the computer device determines that the retrieval of the last k target logs is complete. If the number is greater than k (the interval is too large), the computer device sets the starting position to the start point of the last target interval and repeats the steps of determining the target interval and retrieving the last k target logs through the target interval. If the number is less than k (the interval is too small), the computer device sets k = km and the ending position to the start point of the last target interval, and repeats the steps of determining the target interval and retrieving the last k target logs through the target interval, where m is the number of target logs between the start point and the end point of the last target interval. The computer device recursively executes the steps of determining the target interval and retrieving the last k target logs through the target interval based on the results of the above determinations until the last k target logs are retrieved.
[0073] For example, continue to refer to Figure 4 There are 22 logs sorted by timestamp, with docid (position) ranging from 1 to 22. The search request starts at position 1 and ends at position 22. The computer determines that the midpoint between position 1 and position 22 is position 12, and searches to confirm that a target log exists between positions 12 and 22. Next, it determines that the midpoint between positions 12 and 22 is position 17, and searches to confirm that a target log exists between positions 17 and 22. Then, it determines that the midpoint between positions 17 and 22 is position 20, and searches to confirm that a target log exists between positions 20 and 22. Finally, it determines that the midpoint between positions 20 and 22 is position 21, and searches to confirm that a target log exists between positions 21 and 22. Since positions 21 and 22 cannot be bisected, the step of determining the target interval ends. The computer then performs a first reverse iteration to determine the number of target logs between positions 21 and 22, which is less than k. After updating k, the computer performs a second reverse iteration to determine the number of target logs between positions 20 and 21, which is also less than k. After updating k again, the computer device performs a third reverse iteration to determine the number of target logs between positions 17 and 20, which equals k. At this point, the computer device determines to end the process of retrieving the derivative k target logs.
[0074] By determining the target interval containing the target object (target log), and then retrieving the last k target objects in reverse order within that interval, it's possible to obtain the last k target objects. In this process, it's unnecessary to iterate through all candidate objects (logs) sequentially based on their order. Only a subset of candidate objects needs to be retrieved to obtain the target interval, and further searching within that interval yields the last k target objects. This improves the performance of reverse order retrieval.
[0075] Figure 5 This is a flowchart illustrating a reverse retrieval method provided in an exemplary embodiment of this application. This method can be used on a computer device or a client on a computer device. Figure 5 As shown, the method includes:
[0076] Step 502: Receive reverse search request.
[0077] A reverse search request includes search criteria, a start position, and an end position. Search criteria are used to filter candidate objects to be searched, and the target object is the candidate object that meets the search criteria; that is, the candidate object that meets the search criteria is the target object of the search.
[0078] The start position indicates the position where the search for the target object begins among the candidate objects, and the end position indicates the position where the search for the target object ends among the candidate objects. The positions of the candidate objects are obtained by sorting them according to their attributes. For example, in a log retrieval scenario, the candidate object is a log. The candidate object can also be other types of information. The attributes of the candidate object include its timestamp, storage space occupied, and name. Optionally, the position of the candidate object refers to its index or identifier, such as docid. The position of the candidate object corresponds to its sorting result. For example, in the sorted candidate objects, the first position is 0, and the second position is 1.
[0079] Optionally, the computer device may sort the candidate search objects by attributes before receiving the reverse search. Alternatively, the computer device may sort the candidate search objects by attributes when it receives the reverse search. Or, the computer device may have already sorted the candidate search objects by attributes before receiving the reverse search, and then further sort them by attributes when it receives the reverse search. The computer device may sort the candidate search objects in ascending or descending order of their attributes. For example, it may sort them in ascending order (later timestamps are closer to the current time) or descending order (later timestamps are farther from the current time).
[0080] A reverse search request is used to instruct the retrieval of the last k target objects from the candidate search objects, where k is a positive integer. The desired direction of a reverse search is opposite to the direction in which the candidate search objects are sorted. This computer device does not support direct retrieval in the reverse order (from back to front), or reverse search is less efficient than forward search.
[0081] Step 504: Among the candidate objects to be retrieved between the start position and the end position, determine the target interval where the target object exists.
[0082] Upon receiving the aforementioned reverse retrieval request, the computer device will determine the candidate objects to be retrieved at the start position and the end position, and determine the candidate objects to be retrieved between the candidate objects to be retrieved at the start position and the candidate objects to be retrieved at the end position, in order to retrieve the target objects that meet the retrieval conditions based on the reverse retrieval request.
[0083] The computer device divides the interval from the start position to the end position into multiple intervals and, starting from the beginning of the last interval, sequentially searches for the target object. If a target object exists, the computer device designates that interval as the target interval. It then continues to divide that interval into multiple intervals and continues to determine target intervals. The computer device recursively executes these steps until it determines that no target interval exists, or that the divided intervals exceed the end position, or that the distance between the divided intervals and the end position is less than k.
[0084] Optionally, the computer device divides the interval from the start position to the end position using interpolation. For example, if the number of candidate objects to be retrieved in the interval formed by the start and end positions is 10,000, and the estimated number of target objects that meet the retrieval criteria is 1,000, then k = 10. The computer device estimates the position of the interval division as 10 / 1000*10000*ratio. Here, ratio is set by the computer device; for example, if it is set to 2, then the position of the interval division determined by the computer device is 200, which is the 200th position from the end. After determining that a target object exists in the interval formed by this position and the end position, the computer device can continue to recursively determine the target interval in the above manner.
[0085] Optionally, the computer device divides the interval from the start position to the end position using a skip list. A skip list is a hierarchical multi-level linked list. The bottom-level list contains all data (candidate objects to be retrieved), and each level is an index to the next level. The computer device can build multi-level linked lists based on the bottom-level list using a probability function. Whether each element in the next level's linked list is copied to the previous level's linked list depends on this probability function. The computer device divides the interval from the start position to the end position based on the nodes in the skip list corresponding to the candidate objects in the interval formed by the start and end positions, except for the bottom-level linked list, thus obtaining multiple intervals.
[0086] Optionally, the computer device uses a binary search method to determine the midpoint between the start and end positions. Then, using this midpoint as the search start point and the end position as the search end point, it determines whether a target object exists between the search start and end points. If a target object is found to exist, the computer device updates the midpoint using the midpoint between the midpoint and end positions, and continues to determine the target interval in the same manner until the step of determining the target interval is completed.
[0087] It should be noted that the computer device can divide the interval from the start position to the end position into multiple intervals in various ways to determine the target interval, and then recursively divide the target interval to obtain all target intervals. The above-described interval division methods are only used as examples and are not intended to limit the interval division methods in this application embodiment. Optionally, the computer device may use the same or different methods for each interval division.
[0088] Step 506: Retrieve the last k target objects in the target interval in reverse order.
[0089] After determining the target intervals, the computer device will start from the beginning of the last target interval and search for target objects sequentially. The end of the last target interval is the aforementioned ending position. If fewer than k target objects are found, the computer device will update k, subtracting the number of target objects already found. Then, starting from the beginning of the target interval preceding the last target interval and ending at the beginning of the last target interval, the search for target objects continues, and it is determined whether the number of retrieved target objects satisfies the updated k. The computer device will then recursively execute the above steps until the last k target objects are retrieved. Optionally, if all target intervals are used but the last k target objects are not retrieved, the computer device will keep the starting position unchanged, determine the ending position as the starting point of the first target interval, and, based on the last updated k, re-execute the steps of determining the target intervals and retrieving the last k target objects based on the target intervals.
[0090] It should be noted that the method provided in this application embodiment is illustrated using a computer device that performs retrieval based on Elasticsearch as an example. The method provided in this application embodiment can also be applied to the process of reverse retrieval using computer devices based on other retrieval methods.
[0091] In summary, the method provided in this embodiment, by determining the target interval where the target object is located, can retrieve the last k target objects in reverse order within the target interval. In this process, it is not necessary to traverse all candidate objects sequentially based on their order. Only a portion of the candidate objects need to be retrieved to obtain the target interval, and further retrieval based on this interval yields the last k target objects. This improves the performance of reverse order retrieval.
[0092] Figure 6 This is a flowchart illustrating a reverse retrieval method provided in an exemplary embodiment of this application. This method can be used on a computer device or a client on a computer device. Figure 6 As shown, the method includes:
[0093] Step 602: Receive reverse search request.
[0094] A reverse search request includes search criteria, a start position, and an end position. Search criteria are used to filter candidate objects to be searched, and the target object is the candidate object that meets the search criteria; that is, the candidate object that meets the search criteria is the target object of the search.
[0095] The start position indicates the position where the search for the target object begins among the candidate objects, and the end position indicates the position where the search for the target object ends among the candidate objects. The positions of the candidate objects are obtained by sorting them according to their attributes. The reverse search request indicates that the search should retrieve the last k target objects among the candidate objects, where k is a positive integer.
[0096] Step 604: Determine the midpoint between the start and end positions.
[0097] The middle position is calculated as: p = (begin + end) / 2. Here, p is the middle position between the start and end positions, begin is the start position, and end is the end position. When the result of (begin + end) / 2 is not an integer, the computer will round the result. Rounding methods include rounding up, rounding down, and rounding to the nearest integer.
[0098] Step 606: Using the middle position as the search start point and the end position as the search end point, determine the target object between the search start point and the search end point from the candidate objects to be searched between the start position and the end position to obtain the target interval.
[0099] Upon receiving the aforementioned reverse retrieval request, the computer device determines the candidate objects to be retrieved at the start and end positions, and further determines the candidate objects to be retrieved between the start and end positions. These candidate objects are used to retrieve the target object that meets the search criteria based on the reverse retrieval request. The computer device then determines the target interval containing the target object from the start to the end position among the candidate objects to be retrieved.
[0100] The computer device searches for the target object between the search start point and the search end point. If the target object is found between the search start point and the search end point, the computer device defines the interval formed by the search start point and the search end point as the target interval.
[0101] Step 608: Determine whether a target object exists between the search start point and the search end point.
[0102] Optionally, among the candidate objects to be retrieved between the start and end positions, the computer device determines the position of the nearest target object starting from the retrieval start point. Then, it determines whether the position of the nearest target object is after the retrieval end point, thereby determining whether a target object exists between the start and end positions, and further determining whether the interval formed by the start and end positions is the target interval. Optionally, the retrieval process is a sequential retrieval, implemented using a one-way iterator in Elasticsearch. The retrieval results are as follows:
[0103] (1) If the location of the most recent target object is not after the search endpoint, the computer device determines that there is a target object between the search start point and the search endpoint. That is, the interval formed by the search start point and the search endpoint is the target interval.
[0104] (2) If the location of the most recent target object is after the search endpoint, the computer device determines that there is no target object between the search start point and the search endpoint. That is, the interval formed by the search start point and the search endpoint is not a target interval.
[0105] Optionally, the computer device implements the above process using the function advance(n). The input to advance(n) is position n, and the output is the next position that meets the search criteria, starting from position n. This includes the following cases:
[0106] • If the candidate object at position n meets the search criteria, then return n;
[0107] • If the candidate object at position n does not meet the search criteria, return the position of the first candidate object that meets the search criteria, starting from n.
[0108] If no candidate object matching the search criteria is found, the system will return "not found".
[0109] Optionally, the input to the function advance(n) also includes end (the search endpoint). If no candidate object is found by end, end will be returned, indicating that no candidate object has been found by end.
[0110] p is the midpoint between the start and end positions. If advance(p) > end, the computer determines that the position of the most recent target object is after the retrieval endpoint. If advance(p) ≤ end, the computer determines that the position of the most recent target object is not after the retrieval endpoint.
[0111] Step 610: If there is a target object between the search start point and the search end point, update the search start point with the midpoint between the midpoint and the search end point, and continue to execute the steps to determine the target object between the search start point and the search end point until there is no target object between the updated search start point and the search end point.
[0112] After determining whether a target object exists between the search start point and the search end point in step 606, the computer device, if a target object exists, will define the target interval as the interval formed by the search start point and the search end point. After determining a target interval, the computer device will update the search start point again, keeping the search end point unchanged, and continue to determine the target object between the search start point and the search end point using the method in step 606, i.e., recursively determining the target interval until no target object exists between the updated search start point and the search end point. Optionally, the computer device will store the start point of the target interval during the process of determining the target interval. The start point of each target interval can be called a binary search trajectory.
[0113] Optionally, the computer device may also determine the remaining number of candidate objects to be retrieved between the search start point and the search end point (including the search start point and the search end point). If the remaining number is less than k, meaning the number of remaining candidate objects does not support retrieving the last k target objects, the computer device will complete the step of determining the target interval. If the remaining number is not less than k, meaning the number of remaining candidate objects supports retrieving the last k target objects, the computer device will continue to execute the step of determining the target interval.
[0114] Step 612: If there is no target object between the search start point and the search end point, complete the step of determining the target interval.
[0115] In the process of recursively determining the target interval based on the above steps 606 and 608, if the target object is not found in a certain search based on the search start point (or the updated search start point) and the search end point, the computer device completes the step of determining the target interval.
[0116] Step 614: Retrieve the last k target objects in the target interval in reverse order.
[0117] The computer device determines the number of target objects between the start and end positions of the last target interval, and retrieves the last k target objects based on the relationship between this number and k. This includes the following cases:
[0118] (1) When the number is equal to k, the computer device completes the retrieval of the last k target objects.
[0119] (2) When the number is greater than k (the interval is too large), the computer device sets the starting position to the starting point of the last target interval, and executes the steps of determining the target interval and retrieving the last k target objects through the target interval again.
[0120] (3) If the number is less than k (the interval is too small), the computer device sets k = km and the end position to the start position of the last target interval, and then executes the steps of determining the target interval and retrieving the last k target objects through the target interval again. Here, m is the number of target objects between the start and end positions of the last target interval.
[0121] Optionally, when determining the number of target objects between the start and end positions of the last target interval, the computer device will perform a sequential search of the target objects from the start to the end position of the last target interval. To improve the efficiency of the judgment, if the number of target objects determined during the sequential search process is greater than k, the search will stop and the number will be confirmed to be greater than k.
[0122] For example, the starting point of each target interval is [t1, t2, t3…tm], and the starting point of the last target interval is tm. The computer device determines t_current = tm. Then, it determines the number of target objects (hit_count) between t_current and end. It then compares hit_count with k. In the first case, hit_count = k. In the second case, hit_count > k, the computer device sets begin = t_current and repeats the steps of determining the target interval and retrieving the last k target objects from the target interval. In the third case, hit_count < k, the computer device updates k to k - hit_count and end = t_current, and repeats the steps of determining the target interval and retrieving the last k target objects from the target interval.
[0123] Optionally, the third scenario described above is executed by the computer device when there is no target interval before the starting point of the last target interval. Even when a target interval exists before the starting point of the last target interval, the computer device can still set the starting point of the last target interval as the starting point of the previous target interval and continue executing the step of retrieving the last k target objects through the target interval. That is, the computer device uses the target interval preceding the last target interval as the last target interval and again determines the last k target objects through step 612.
[0124] In a specific example, a computer device receives a reverse retrieval request to retrieve the k = 2 reciprocal target logs that satisfy the retrieval criteria. The logs located between the start and end positions, as determined by the computer device, are represented by the following sequence: [1,1,1,0,0,0,0,1,0,1,1,1,0,0,0,0,0,0,0,1,0], where 1 indicates that the logs satisfy the retrieval criteria, and 0 indicates that they do not. The log positions are 1-22.
[0125] In step S1, the computer device determines the midpoint between the start position (1) and the end position (22) as position 12. Using position 12 as the starting point and position 22 as the ending point, it retrieves the target log. The log at position 12 is determined as the target log, resulting in the first target interval [12, 22].
[0126] In step S2, the computer device determines the midpoint between positions 12 and 22 as position 17, and uses position 17 as the retrieval starting point and position 22 as the retrieval ending point to retrieve the target log. The log at position 12 is determined as the target log, resulting in the first target interval [12, 22]. The log at position 21 is determined as the target log, resulting in the second target interval [21, 22].
[0127] In step S3, the computer device determines that the number of remaining logs between position 21 and position 22 is 1 < k = 2, thus completing the determination of the target interval.
[0128] In step S4, the computer device determines that the number of target logs between the start point (position 21) and the end point (position 22) of the second target interval is 1. The computer device sets k = 2 - 1 = 1.
[0129] In step S5, the computer device determines that a target interval exists before the second target interval. It then determines the number of target logs between positions 12 and 21. At this point, only the log at position 12 is identified as a target log, and the number of target logs is 1 = the updated k. The computer device then completes the retrieval of the last two target logs.
[0130] It should be noted that the above examples are only used to illustrate the implementation process of the method provided in the embodiments of this application. The number of logs is only used as an example. In practical applications, the number of logs is much larger than the number in the above examples, and the method provided in the embodiments of this application can significantly improve the efficiency of reverse retrieval. For example, when the method provided in the embodiments of this application was tested on 20 million data points, the reverse retrieval based on Elasticsearch before optimization took 1300ms. Keeping the conditions unchanged, after optimization according to the method provided in the embodiments of this application, the reverse retrieval based on Elasticsearch took about 30ms.
[0131] In summary, the method provided in this embodiment, by determining the target interval where the target object is located, can retrieve the last k target objects in reverse order within the target interval. In this process, it is not necessary to traverse all candidate objects sequentially based on their order. Only a portion of the candidate objects need to be retrieved to obtain the target interval, and further retrieval based on this interval yields the last k target objects. This improves the performance of reverse order retrieval.
[0132] The method provided in this embodiment also determines the target interval by using the midpoint between the start and end positions as the retrieval starting point and the end position as the retrieval ending point. The binary search method can quickly determine the target interval where the target object exists.
[0133] The method provided in this embodiment also determines whether a target object exists between the search start point and the search end point by judging the relationship between the location of the most recent target object and the search endpoint. This provides a way to quickly determine whether a target object exists between the search start point and the search endpoint.
[0134] The method provided in this embodiment further determines whether to end the determination of the target interval based on the relationship between the remaining number of candidate objects to be retrieved and k. This avoids the waste of computational resources caused by continuing to determine the target interval when the remaining number is less than k.
[0135] The method provided in this embodiment further determines the last k target objects by using a target interval based on the relationship between the number of target objects and k. This provides a convenient way to determine the last k target objects.
[0136] The method provided in this embodiment further updates k and the ending position when no target interval exists before the start of the last target interval. It then re-determines the target interval and the k-th to last target objects. This allows for the continued retrieval of target objects while considering already retrieved ones, thereby achieving the retrieval of all k-th to last target objects.
[0137] The method provided in this embodiment also retrieves the k-th retrieval target objects by using the target interval preceding the last target interval when a target interval exists before the start of the last target interval. This enables the efficient use of the retrieved target intervals to retrieve the k-th retrieval target objects.
[0138] It should be noted that the order of the method steps provided in the embodiments of this application can be appropriately adjusted, and the steps can also be added or removed as appropriate. Any method variations that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application, and therefore will not be elaborated further.
[0139] The method provided in this application is illustrated using a log retrieval scenario as an example. The client, which supports information retrieval, sends a reverse retrieval request to the server based on the retrieval operation. This reverse retrieval request instructs the retrieval of the latest k target logs from the start position to the end position. Target logs are logs that satisfy the retrieval conditions in the reverse retrieval request. Before receiving the request, the server has already sorted the logs in ascending order by timestamp to determine their positions. After receiving the request, the server uses the midpoint between the start and end positions as the retrieval start point and the end position as the retrieval end point, and retrieves the target logs using the method described above. If a target log is found between the start and end points, the midpoint is updated, and the retrieval continues until no target logs exist between them, thus obtaining a series of target intervals. Then, the computer device determines the number of target logs between the start and end positions of the last target interval, and based on the relationship between this number and k, retrieves the latest k target logs using the target interval using the method described above. If the number equals k, the server completes the retrieval of the latest k target logs. If the quantity is greater than k, the server sets the starting position to the beginning of the last target interval and executes the steps of determining the target interval and retrieving the latest k target logs through the target interval again. If the quantity is less than k, the server updates k according to the quantity, sets the ending position to the beginning of the last target interval, and executes the steps of determining the target interval and retrieving the latest k target logs through the target interval again. After retrieving the latest k target logs, the computer device sends the latest k target logs to the client. Optionally, the method provided in this application embodiment can also be used to retrieve information that supports sorting by attributes (e.g., time), such as chat logs, consumption records, game records, public account messages, and orders.
[0140] Figure 7 This is a schematic diagram of a reverse retrieval device provided in an exemplary embodiment of this application. This device can be used in computer equipment, such as a server. Figure 7 As shown, the device includes:
[0141] The receiving module 701 is used to receive a reverse retrieval request. The reverse retrieval request is used to instruct the retrieval of the last k target objects among the candidate objects to be retrieved. The reverse retrieval request includes the retrieval conditions, the start position and the end position, where k is a positive integer.
[0142] The determination module 702 is used to determine the target interval where the target object exists among the candidate objects to be retrieved between the start position and the end position. The positions of the candidate objects to be retrieved are obtained by sorting the candidate objects to be retrieved according to their attributes. The target object is the candidate object to be retrieved that meets the retrieval conditions.
[0143] The retrieval module 703 is used to retrieve the last k target objects in the target interval based on a backward order.
[0144] In an optional design, module 702 is defined for:
[0145] Determine the midpoint between the start and end positions. Using the midpoint as the search starting point and the end position as the search ending point, identify the target object between the search starting point and the search ending point from among the candidate objects to be searched between the start and end positions.
[0146] If a target object exists between the search start point and the search end point, update the search start point to the midpoint between the midpoint and the search end point, and continue executing the steps to determine the target object between the search start point and the search end point until no target object exists between the updated search start point and the search end point. Alternatively, if no target object exists between the search start point and the search end point, complete the steps to determine the target interval.
[0147] In an optional design, module 702 is defined for:
[0148] Among the candidate objects to be searched between the start and end positions, determine the position of the nearest target object starting from the search start point. If the position of the nearest target object is not after the search end point, determine that there are target objects between the search start point and the search end point. Alternatively, if the position of the nearest target object is after the search end point, determine that there are no target objects between the search start point and the search end point.
[0149] In an optional design, module 702 is defined for:
[0150] Determine the remaining number of candidate objects to be searched between the search start point and the search end point. If the remaining number is less than k, complete the step of determining the target interval. Alternatively, if the remaining number is not less than k, continue with the step of determining the target interval.
[0151] In an optional design, the retrieval module 703 is used for:
[0152] Determine the number of target objects between the start and end positions of the last target interval.
[0153] If the quantity equals k, retrieve the last k target objects. Alternatively, if the quantity is greater than k, set the starting position to the beginning of the last target interval, and repeat the steps for determining the target interval and retrieving the last k target objects within that interval. Alternatively, if the quantity is less than k, set k = km, and the ending position to the beginning of the last target interval, and repeat the steps for determining the target interval and retrieving the last k target objects within that interval, where m is the quantity.
[0154] In an optional design, the retrieval module 703 is used for:
[0155] If no target interval exists before the start of the last target interval, let k = km, and let the end position be the start of the last target interval. Then, execute the steps to determine the target interval and retrieve the k-th reciprocal target objects through the target interval again.
[0156] In an optional design, the retrieval module 703 is used for:
[0157] If there is a target interval before the starting point of the last target interval, set the starting point of the last target interval to the starting point of the target interval preceding the last target interval, and continue to execute the step of retrieving the last k target objects through the target interval.
[0158] It should be noted that the reverse retrieval device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the reverse retrieval device and the reverse retrieval method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0159] Embodiments of this application also provide a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the reverse retrieval method provided in the above-described method embodiments.
[0160] Alternatively, the computer device is a server. For example, Figure 8 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application.
[0161] The computer device 800 includes a central processing unit (CPU) 801, a system memory 804 including random access memory (RAM) 802 and read-only memory (ROM) 803, and a system bus 805 connecting the system memory 804 and the CPU 801. The computer device 800 also includes a basic input / output system (I / O system) 806 to facilitate information transfer between various components within the computer device, and a mass storage device 807 for storing the operating system 813, application programs 814, and other program modules 815.
[0162] The basic input / output system 806 includes a display 808 for displaying information and an input device 809 for user input, such as a mouse or keyboard. Both the display 808 and the input device 809 are connected to the central processing unit 801 via an input / output controller 810 connected to the system bus 805. The basic input / output system 806 may also include the input / output controller 810 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 810 also provides output to a display screen, printer, or other types of output devices.
[0163] The mass storage device 807 is connected to the central processing unit 801 via a mass storage controller (not shown) connected to the system bus 805. The mass storage device 807 and its associated computer-readable storage media provide non-volatile storage for the computer device 800. That is, the mass storage device 807 may include computer-readable storage media (not shown), such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0164] Without loss of generality, the computer-readable storage medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable storage instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage devices, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the above-mentioned types. The system memory 804 and mass storage device 807 described above can be collectively referred to as memory.
[0165] The memory stores one or more programs, which are configured to be executed by one or more central processing units 801. The one or more programs contain instructions for implementing the above method embodiments, and the central processing unit 801 executes the one or more programs to implement the methods provided by the above method embodiments.
[0166] According to various embodiments of this application, the computer device 800 can also be connected to a remote computer device on a network, such as the Internet. That is, the computer device 800 can be connected to a network 812 via a network interface unit 811 connected to the system bus 805, or the network interface unit 811 can be used to connect to other types of networks or remote computer device systems (not shown).
[0167] The memory further includes one or more programs stored in the memory, and the one or more programs include steps performed by a computer device in the methods provided in the embodiments of this application.
[0168] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set. When the at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor of a computer device, the reverse retrieval method provided in the above-described method embodiments is implemented.
[0169] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the reverse retrieval method provided in the above-described method embodiments.
[0170] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0171] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent switching, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A reverse order retrieval method, characterized in that, The method includes: Receive a reverse search request, the reverse search request is used to indicate to search the last k target objects in the candidate search objects, the reverse search request includes search conditions, start position and end position, and k is a positive integer; Determine the midpoint between the start position and the end position; Using the middle position as the search start point and the end position as the search end point, among the candidate objects to be searched between the start position and the end position, the target object between the search start point and the search end point is determined. The positions of the candidate objects to be searched are obtained by sorting the attributes of the candidate objects to be searched. The target object is the candidate object to be searched that meets the search conditions. If the target object exists between the search start point and the search end point, update the search start point with the midpoint between the midpoint and the search end point, and continue to execute the step of determining the target object between the search start point and the search end point until there is no target object between the updated search start point and the search end point; or, if there is no target object between the search start point and the search end point, complete the step of determining the target interval where the target object exists. Within the target interval, the last k target objects are retrieved in reverse order.
2. The method according to claim 1, characterized in that, The step of determining the target object between the search start point and the search end point from the candidate objects to be searched between the start point and the search end point, using the middle position as the search start point and the end position as the search end point, includes: Among the candidate objects to be retrieved between the start position and the end position, determine the position of the nearest target object starting from the retrieval starting point; If the location of the most recent target object is not after the search endpoint, it is determined that there is a target object between the search start point and the search endpoint; or, if the location of the most recent target object is after the search endpoint, it is determined that there is no target object between the search start point and the search endpoint.
3. The method according to claim 1, characterized in that, The method further includes: Determine the remaining number of candidate objects to be searched between the search start point and the search end point; If the remaining quantity is less than k, the step of determining the target interval is completed; or, if the remaining quantity is not less than k, the step of determining the target interval continues.
4. The method according to any one of claims 1 to 3, characterized in that, The step of retrieving the k last target objects in the target interval in a backward order includes: Determine the number of target objects between the start and end positions of the last target interval; If the quantity equals k, complete the retrieval of the last k target objects; or, if the quantity is greater than k, set the starting position as the starting point of the last target interval, and execute the step of determining the target interval and the step of retrieving the last k target objects through the target interval again; or, if the quantity is less than k, set k = km, and set the ending position as the starting point of the last target interval, and execute the step of determining the target interval and the step of retrieving the last k target objects through the target interval again, where m is the quantity.
5. The method according to claim 4, characterized in that, When the number is less than k, let k = km, and let the ending position be the starting point of the last target interval, then perform the step of determining the target interval again, and the step of retrieving the last k target objects through the target interval, where m is the number, including: If no target interval exists before the start of the last target interval, let k = km, and let the end position be the start of the last target interval. Then, perform the steps of determining the target interval and retrieving the last k target objects through the target interval again.
6. The method according to claim 4, characterized in that, The method further includes: If a target interval exists before the starting point of the last target interval, let the starting point of the last target interval be the starting point of the target interval preceding the last target interval, and continue to execute the step of retrieving the last k target objects through the target interval.
7. A reverse retrieval device, characterized in that, The device includes: The receiving module is used to receive a reverse retrieval request, which is used to instruct the retrieval of the last k target objects in the candidate objects to be retrieved. The reverse retrieval request includes retrieval conditions, a start position and an end position, where k is a positive integer. The determination module is used to determine the midpoint between the start position and the end position; using the midpoint as the search start point and the end position as the search end point, among the candidate objects to be searched between the start position and the end position, determine the target object between the search start point and the search end point, wherein the positions of the candidate objects to be searched are obtained by sorting the candidate objects to be searched according to their attributes, and the target object is a candidate object to be searched that satisfies the search conditions; if the target object exists between the search start point and the search end point, update the search start point with the midpoint between the midpoint and the search end point, and continue to execute the step of determining the target object between the search start point and the search end point until there is no target object between the updated search start point and the search end point; or, if there is no target object between the search start point and the search end point, complete the step of determining the target interval where the target object exists; The retrieval module is used to retrieve the last k target objects in the target interval in a backward order.
8. The apparatus according to claim 7, characterized in that, The determining module is used for: Among the candidate objects to be retrieved between the start position and the end position, determine the position of the nearest target object starting from the retrieval starting point; If the location of the most recent target object is not after the search endpoint, it is determined that there is a target object between the search start point and the search endpoint; or, if the location of the most recent target object is after the search endpoint, it is determined that there is no target object between the search start point and the search endpoint.
9. The apparatus according to claim 7, characterized in that, The determining module is used for: Determine the remaining number of candidate objects to be searched between the search start point and the search end point; If the remaining quantity is less than k, the step of determining the target interval is completed; or, if the remaining quantity is not less than k, the step of determining the target interval continues.
10. The apparatus according to any one of claims 7 to 9, characterized in that, The retrieval module is used for: Determine the number of target objects between the start and end positions of the last target interval; If the quantity equals k, complete the retrieval of the last k target objects; or, if the quantity is greater than k, set the starting position as the starting point of the last target interval, and execute the step of determining the target interval and the step of retrieving the last k target objects through the target interval again; or, if the quantity is less than k, set k = km, and set the ending position as the starting point of the last target interval, and execute the step of determining the target interval and the step of retrieving the last k target objects through the target interval again, where m is the quantity.
11. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the reverse retrieval method as described in any one of claims 1 to 6.
12. A computer-readable storage medium, characterized in that, The readable storage medium stores at least one program segment, which is loaded and executed by a processor to implement the reverse retrieval method as described in any one of claims 1 to 6.
13. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to cause the computer device to perform the reverse retrieval method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Quick retrieval method and system, storage medium and electronic equipment
CN111339094A