Data processing method, apparatus, computing device, and medium
By first identifying the first data identifier whose frequency reaches a set threshold during the multimedia data retrieval process, and then retrieving its corresponding second data identifier, the problem of low data processing efficiency caused by dense inverted lists is solved, thereby improving retrieval efficiency and user experience.
Patent Information
- Application Number
- CN202210002157.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-01-04
AI Technical Summary
In existing technologies, the dense inverted indexes result in low data processing efficiency during multimedia data retrieval.
By obtaining multiple inverted chains corresponding to multiple target search terms, the first data identifiers included in the multiple inverted chains are searched to determine the target first data identifiers whose occurrence frequency reaches a set threshold. Then, the second data identifiers corresponding to the target first data identifiers are searched to obtain the target multimedia data.
It improves data processing efficiency in the multimedia data retrieval process and enhances the user experience.
Smart Images

Figure CN114443866B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the field of computer technology, and more particularly, to a data processing method, device, computing equipment and medium. BACKGROUND
[0002] This section is intended to provide background or context to the embodiments of the disclosure set forth in the claims. The description herein does not constitute admission that the prior art is prior art nor does it constitute an admission of any description in this section as prior art to an application.
[0003] In a multimedia Application (APP), a user can search for multimedia data (such as video, audio, etc.) through a search function built in the multimedia APP, so as to find multimedia data of interest. As the core execution engine of the search function, the search engine usually uses an inverted index to achieve high query performance. In essence, the user's search is a merge of inverted chains in the inverted index, and each inverted chain stores multiple document identifiers (docIDs) so that at least M occurrences of a document can be found in N inverted chains.
[0004] In related technologies, when merging inverted chains, a merge algorithm using a heap structure is mainly used. That is, a heap with N entries is established for N inverted chains, the docIDs in the N inverted chains are sequentially traversed using the heap structure, and the number of occurrences of each docID is counted during traversal, so as to output the docIDs with M occurrences.
[0005] In the above implementation process, when the number of occurrences of the search term is relatively frequent, that is, the inverted chain is relatively dense, each docID in the inverted chain still needs to be extracted from the heap, and the number of occurrences of the docID is counted, thereby resulting in low data processing efficiency. SUMMARY
[0006] In view of the problem of low data processing efficiency when searching multimedia data through a search function in related technologies, embodiments of the present disclosure at least provide a data processing method, device, computing equipment and medium.
[0007] In a first aspect of the embodiments of the present disclosure, a data processing method is provided, which comprises:
[0008] Obtaining a plurality of inverted chains corresponding to a plurality of target search terms, wherein each inverted chain includes data identifiers of multimedia data corresponding to a target search term, and each data identifier includes a first data identifier and a second data identifier;
[0009] Searching a plurality of first data identifiers included in the plurality of inverted chains to obtain a target first data identifier with a number of occurrences reaching a set number threshold.
[0010] The second data identifier corresponding to the target first data identifier is searched, and a target second data identifier whose occurrence frequency reaches a set frequency threshold is obtained.
[0011] Based on the target second data identifier and the corresponding target first data identifier, the target multimedia data is obtained.
[0012] In a second aspect of the embodiments of the present disclosure, a data processing apparatus is provided, which comprises:
[0013] The first obtaining module is configured to obtain a plurality of inverted chains corresponding to a plurality of target search terms, wherein each inverted chain comprises data identifiers of multimedia data corresponding to a target search term, and each data identifier comprises a first data identifier and a second data identifier.
[0014] The first searching module is configured to search a plurality of first data identifiers included in the plurality of inverted chains, and obtain a target first data identifier whose occurrence frequency reaches a set frequency threshold.
[0015] The second searching module is configured to search second data identifiers corresponding to the target first data identifier, and obtain a target second data identifier whose occurrence frequency reaches a set frequency threshold.
[0016] The second obtaining module is configured to obtain target multimedia data based on the target second data identifier and the corresponding target first data identifier.
[0017] In a third aspect of the embodiments of the present disclosure, a computing device is provided, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the operations performed by the data processing method when executing the computer program.
[0018] In a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores a program, and the program is executed by a processor to implement the operations performed by the data processing method.
[0019] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, which comprises a computer program, and the program is executed by a processor to implement the operations performed by the data processing method.
[0020] According to the data processing method, device, computing equipment and medium provided in the embodiments of the present disclosure, after the plurality of inverted chains corresponding to the plurality of target search terms are acquired, the plurality of first data identifiers included in the plurality of inverted chains are searched first to determine the target first data identifier whose occurrence frequency reaches the set frequency threshold, so that the second data identifier corresponding to the target first data identifier is searched to determine the target second data identifier whose occurrence frequency reaches the set frequency threshold, and the multimedia data is acquired based on the target second data identifier and the corresponding target first data identifier, without searching the second data identifier corresponding to all the first data identifiers, so that the data processing efficiency in the searching process is improved, the efficiency of acquiring the multimedia data in the searching process is improved, and a better experience is provided for the user. BRIEF DESCRIPTION OF DRAWINGS
[0021] The above and other objects, features and advantages of the present disclosure exemplary embodiments will be more apparent from the following detailed description read in conjunction with the accompanying drawings, in which:
[0022] Figure 1 is a schematic diagram of an implementation environment of a data processing method according to an exemplary embodiment of the present disclosure;
[0023] Figure 2 is a flowchart of a data processing method according to an exemplary embodiment of the present disclosure;
[0024] Figure 3 is a schematic diagram of a storage manner of a first data identifier and a second data identifier according to an exemplary embodiment of the present disclosure;
[0025] Figure 4 is a schematic diagram of a first search heap according to an exemplary embodiment of the present disclosure;
[0026] Figure 5 is a schematic diagram of an updated first search heap according to an exemplary embodiment of the present disclosure;
[0027] Figure 6 is a schematic diagram of a first data identifier searching process according to an exemplary embodiment of the present disclosure;
[0028] Figure 7 is a schematic diagram of a result bitmap according to an exemplary embodiment of the present disclosure;
[0029] Figure 8 is a schematic diagram of the effect of a data processing method according to an exemplary embodiment of the present disclosure;
[0030] Figure 9is a structural schematic diagram of a data processing apparatus according to an exemplary embodiment of the present disclosure.
[0031] Figure 10 is a schematic diagram of a computer readable storage medium according to an exemplary embodiment of the present disclosure.
[0032] Figure 11 is a structural schematic diagram of a computing device according to an exemplary embodiment of the present disclosure.
[0033] In the drawings, identical or corresponding reference signs indicate identical or corresponding parts. DETAILED DESCRIPTION
[0034] The principles and spirits of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present disclosure, and do not limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0035] Those skilled in the art know that the embodiments of the present disclosure can be implemented as a system, apparatus, device, method or computer program product. Therefore, the present disclosure can be embodied in the form of entire hardware, entire software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0036] According to the embodiments of the present disclosure, a data processing method, apparatus, computing device and medium are provided. In this document, it should be understood that any number of elements in the drawings is used for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.
[0037] The data processing method provided by the present disclosure can be used to acquire multimedia data based on the target search term carried by the search request when receiving the search request of the user. The data processing method can be executed by a computing device, which can be a server.
[0038] Taking the computing device as a server for example, referring to Figure 1 , Figure 1 is an implementation environment schematic diagram of a data processing method according to an exemplary embodiment of the present disclosure, which can include a terminal 101 and a server 102.
[0039] The terminal 101 can be a desktop computer, a laptop computer, a notebook computer, a smart phone, a smart watch, a multi-functional integrated machine, etc., and the server 102 can be a server, a plurality of servers, a server cluster, a cloud computing platform, etc. The number and types of the terminal 101 and the server 102 are not limited in the present disclosure.
[0040] The terminal 101 can provide a search function for a user. For example, the terminal can display an input control and a search control through a visual interface. The user can input a search statement in the input control and trigger the search control after the input is completed. The terminal 101 can obtain the search statement input by the user in the input control in response to the triggering operation of the search control, generate a search request for searching based on the search statement, and send the generated search request to the server 102.
[0041] The server 102 determines a plurality of target search terms in response to receiving the search request sent by the terminal 101 and based on the search statement corresponding to the search request, and obtains multimedia data corresponding to the target search terms based on the determined target search terms through the data processing method provided by the present disclosure.
[0042] The above process is described by taking an example that the user inputs a search statement through the terminal 101 to trigger a subsequent search process. In more possible implementation manners, the user can also directly input a plurality of search terms through the terminal 101. The search terms can be separated by spaces. The terminal 101 can generate a search request for searching based on the plurality of search terms based on the input operation of the user, so that the server 102 can directly take the plurality of search terms corresponding to the search request as target search terms to perform a subsequent search process. The present disclosure does not limit which way is used to trigger the search process.
[0043] The data processing method provided by the present disclosure will be described below in combination with the above application scenario and with reference to Figure 2 It should be noted that the above application scenario is only shown for the purpose of facilitating understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0044] Referring to Figure 2 , Figure 2 is a flowchart of a data processing method according to an exemplary embodiment of the present disclosure. The method includes the following steps.
[0045] In step 201, a plurality of inverted chains corresponding to a plurality of target search terms are obtained. The inverted chain includes a data identifier of multimedia data corresponding to the target search term. The data identifier includes a first data identifier and a second data identifier.
[0046] In a search engine for searching multimedia data, each multimedia data corresponds to a data identity (ID), and the data identity can be in the form of an integer identity representing each multimedia data stored in the search engine.
[0047] In addition, each multimedia data also corresponds to a plurality of keywords, which can be keywords corresponding to the content of the multimedia data, or the name of the creator of the multimedia data, the data type corresponding to the multimedia data, and the like.
[0048] Taking audio as an example of multimedia data, the keywords corresponding to the multimedia data can include words included in the lyrics of the audio, the name of the audio singer, the name of the audio lyricist, the audio type (such as jazz, rock, folk, etc.), and the like. Taking video as an example of multimedia data, the keywords corresponding to the multimedia data can include words included in the video script, the name of the video performer, the name of the video director, the video type (such as comedy, horror, suspense, etc.), and the like.
[0049] As one of the core data structures of the search engine, the inverted link can record the keywords stored in the search engine and the data identity set corresponding to each keyword, thereby realizing the recording of the data identity of each multimedia data and the corresponding keywords.
[0050] The structure of the inverted link can be as follows:
[0051] Keyword 1: data identity of multimedia data corresponding to keyword 1;
[0052] Keyword 2: data identity of multimedia data corresponding to keyword 2;
[0053] …
[0054] Keyword n: data identity of multimedia data corresponding to keyword n.
[0055] Taking audio as an example of multimedia data, and taking words included in the lyrics of the audio as an example of keywords, the corresponding inverted link structure can be:
[0056] Keyword 1→ data identity of audio 1→ data identity of audio 3→ data identity of audio 6→…;
[0057] Keyword 2→ data identity of audio 3→ data identity of audio 5→ data identity of audio 8→…;
[0058] …
[0059] Keyword n→ data identity of audio 2→ data identity of audio 4→ data identity of audio 7→….
[0060] In a possible implementation, when constructing the inverted list corresponding to any keyword, the data identifiers of the multimedia data corresponding to the keyword can be acquired first, and then the acquired data identifiers are stored in a chain according to the ascending order, to obtain the inverted list corresponding to the keyword.
[0061] Taking the keywords included in the audio lyrics as an example, if the inverted list corresponding to the keywords in the lyrics "You send the doll face, landing beside" is to be constructed, the data identifiers of the songs containing "you", "send", "doll face", "landing", "in", and "beside" can be acquired respectively, and then the data identifiers corresponding to each keyword are stored in a chain according to the ascending order, to obtain the inverted list corresponding to the keywords in the lyrics "You send the doll face, landing beside".
[0062] If the data identifiers of the songs containing "you" are 1, 2, 3, 4, 5, 6,..., the data identifiers of the songs containing "send" are 1, 4, 5, 10, 11, 15,..., the data identifiers of the songs containing "doll face" are 2, 6, 8, 10, 12, 19,..., the data identifiers of the songs containing "landing" are 3, 5, 6, 13, 15, 17,..., the data identifiers of the songs containing "in" are 1, 2, 3, 4, 5, 6,..., and the data identifiers of the songs containing "beside" are 1, 4, 9, 10, 11, 14,..., the inverted list structure corresponding to the inverted list corresponding to the keywords in the lyrics "You send the doll face, landing beside" can be as follows:
[0063] You→1→2→3→4→5→6→……;
[0064] Send→1→4→5→10→11→15……;
[0065] Doll face→2→6→8→10→12→19……;
[0066] Landing→3→5→6→13→15→17……;
[0067] In→1→2→3→4→5→6→……;
[0068] Beside→1→4→9→10→11→14→…….
[0069] Optionally, the keyword and the corresponding inverted list are in a mapping relationship, so that the corresponding inverted list can be determined based on the acquired keyword subsequently.
[0070] It should be noted that the data identifier corresponding to each multimedia resource can be regarded as a combination of a first data identifier and a second data identifier.
[0071] Step 202, search the first data identifiers included in the plurality of inverted lists to obtain a target first data identifier whose occurrence frequency reaches a set frequency threshold.
[0072] Step 203, search the second data identifiers corresponding to the target first data identifier to obtain a target second data identifier whose occurrence frequency reaches a set frequency threshold.
[0073] The set frequency threshold in the above steps 202 and 203 can be any value, and optionally, the set frequency threshold in the steps 202 and 203 can be the same or different, which is not limited in the present disclosure.
[0074] Step 204, obtain the target multimedia data based on the target second data identifier and the corresponding target first data identifier.
[0075] The present disclosure first searches the first data identifiers included in the plurality of inverted lists to determine the target first data identifier whose occurrence frequency reaches the set frequency threshold after obtaining the plurality of inverted lists corresponding to the plurality of target search terms, so as to only search the second data identifiers corresponding to the target first data identifier to determine the target second data identifier whose occurrence frequency reaches the set frequency threshold, and then obtain the multimedia data based on the target second data identifier and the corresponding target first data identifier, without searching the second data identifiers corresponding to all first data identifiers, thereby improving the data processing efficiency in the search process and the efficiency of obtaining the multimedia data in the search process, and providing a better experience for the user.
[0076] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure will be specifically introduced.
[0077] In some embodiments, before obtaining the inverted list corresponding to the target search term through step 201, the plurality of target search terms can be obtained first.
[0078] In a possible implementation, in response to the search operation of the user, a search statement corresponding to the search operation is obtained, and then the plurality of target search terms are determined based on the search statement.
[0079] When the plurality of target search terms are determined based on the search statement, two or more adjacent characters in the search statement can be combined, and then the combined string is matched with the words included in the dictionary. In the case where any combined string is found in the dictionary, the string is determined as one target search term included in the search statement.
[0080] Since the inverted chain is stored by the chain structure, the keyword and the multimedia data identifier corresponding to the keyword, for step 201, when obtaining the plurality of inverted chains corresponding to the plurality of target search terms, the plurality of target search terms determined can be based on the plurality of inverted chains stored in the determined inverted chain, the inverted chain of the keyword and the target search term matching, thereby obtaining the plurality of inverted chains corresponding to the plurality of target search terms. Wherein, a target search term corresponds to an inverted chain.
[0081] In some embodiments, the first data identifier included in the data identifier in the inverted chain can be composed of the high bit part of the data identifier, and the second data identifier can be composed of the low bit part of the data identifier, that is, the first data identifier can be the high bit data identifier in the data identifier, and the second data identifier can be the low bit data identifier in the data identifier.
[0082] In the computing device, the data identifier can be represented in the form of a 32-bit binary number, so as to realize the storage of the data identifier by storing each 32-bit binary number. In the case of a 32-bit binary number, the first data identifier can be a high 16-bit data identifier, and the second data identifier can be a low 16-bit data identifier.
[0083] For example, the data identifier in the inverted chain can be 43, and the computing device can store the 32-bit binary number corresponding to the data identifier 43, that is, (16 zeros) 0000000000101011, thereby realizing the storage of the data identifier 43. Based on this, the decimal representation of the high 16 bits of the data identifier 43, that is, 0000000000000000, is the first data identifier, and the decimal representation of the low 16 bits of the data identifier 43, that is, 0000000000101011, is the second data identifier.
[0084] For example, the data identifier in the inverted chain can be 65536, and the computing device can store the 32-bit binary number corresponding to the data identifier 65536, that is, (15 zeros) 1 (16 zeros), thereby realizing the storage of the data identifier 65536. Based on this, the decimal representation of the high 16 bits of the data identifier 65536, that is, 0000000000000001, is the first data identifier, and the decimal representation of the low 16 bits of the data identifier 65536, that is, 0000000000000000, is the second data identifier.
[0085] For example, the data identifier in the inverted list can be 65537, and the computing device can store the 32-bit binary number corresponding to the data identifier 65537, i.e., (15 zeros)1(15 zeros)1, to store the data identifier 65537. Based on this, the first data identifier is 1 corresponding to the high 16 bits 0000000000000001 of the data identifier 65537, and the second data identifier is 1 corresponding to the low 16 bits 0000000000000001 of the data identifier 65537.
[0086] In a possible implementation, when storing the data identifier by using the inverted list, for any inverted list, each data identifier can be grouped according to the first data identifier, so that the second data identifiers corresponding to the same first data identifier are stored correspondingly.
[0087] Optionally, a high-efficiency compressed bitmap (Roaring Bitmap) can be used to store the 32-bit binary number. The Roaring Bitmap stores the data identifier by using a double-layer structure, groups the high 16-bit data identifiers included in each data identifier, and stores the low 16-bit data identifiers corresponding to the same high 16-bit data identifiers correspondingly.
[0088] When storing the first data identifier and the second data identifier, the first data identifier can be used as a key (Key), and the second data identifier can be used as a value (Value), so that the first data identifier and the second data identifier are stored correspondingly.
[0089] For example, the inverted list can include at least one container, the first data identifier is used as the Key of the container, and the container is used to store the second data identifier of the multimedia data, i.e., the second data identifier is used as the Value stored in the container. The second data identifiers stored in the same container correspond to the same first data identifier, and different containers correspond to different first data identifiers.
[0090] That is, the high 16-bit data identifier can be used as the Key of the container, different containers in the same inverted list correspond to different high 16-bit data identifiers, and the low 16-bit data identifier is stored in the container corresponding to the corresponding high 16-bit data identifier, so that the low 16-bit data identifiers stored in the same container correspond to the same high 16-bit data identifier.
[0091] It should be noted that when storing the second data identifiers corresponding to the first data identifiers, in the case that the number of second data identifiers corresponding to the same first data identifier is not greater than the set number threshold, the second data identifiers are stored in the form of an array, and in the case that the number of second data identifiers corresponding to the same first data identifier is greater than the set number threshold, the second data identifiers are stored in the form of a bitmap.
[0092] For example, when K low 16-bit data identifiers are to be stored, the array requires 2K bytes, and the bitmap requires 65536 / 8=8192 bytes. In the case that 2K is less than 8192, that is, K is less than 4096, the K low 16-bit data identifiers can be stored in the form of an array, otherwise, the K low 16-bit data identifiers are stored in the form of a bitmap.
[0093] In the case that the second data identifiers are stored in the form of a bitmap, the low 16-bit data identifiers require 65536 binary bits, that is, 65536 bits, for storage. Each bit is represented by 1 or 0. Since the minimum storage unit of the computing device is a byte (that is, 8 bits), in the case that the central processing unit (CPU) of the computing device is a 64-bit CPU, that is, the computing device can perform parallel processing of 64-bit bit operations, 1024 64-bit integers can be used to represent the 65536 binary bits.
[0094] The above is described by taking a 64-bit CPU of a computing device as an example. In more possible implementation manners, a single instruction multiple data (SIMD) instruction set such as an MMX instruction set, an SSE instruction set, an AVX instruction set, a NEON instruction set, etc. can be used to optimize the processing performance of the CPU, so that the CPU can perform parallel processing of 128 / 256 / 512-bit bit operations. In the case that the CPU can perform parallel processing of 128-bit bit operations, 512 128-bit integers can be used to represent the 65536 binary bits; in the case that the CPU can perform parallel processing of 256-bit bit operations, 256 256-bit integers can be used to represent the 65536 binary bits, and in the case that the CPU can perform parallel processing of 512-bit bit operations, 128 512-bit integers can be used to represent the 65536 binary bits.
[0095] By determining the storage manner of the first data identifiers and the second data identifiers according to the number of second data identifiers corresponding to the same first data identifier, the space occupation can be minimized, thereby reducing the storage pressure of the computing device.
[0096] Referring to Figure 3 , Figure 3 is a schematic diagram of a storage manner of a first data identifier and a second data identifier according to an exemplary embodiment of the present disclosure, as Figure 3 indicated, a Roaring Bitmap can be used to store the first data identifier (i.e., a high 16-bit data identifier) and the second data identifier (i.e., a low 16-bit data identifier). Figure 3 indicated in the figure is a storage structure in an inverted list, the high 16-bit data identifier is used as the Key of each container in the inverted list, and the low 16-bit is stored as the Value in the container corresponding to the high 16-bit data identifier. Among them, 0x12, 0x34, 0x56, 0x78 are the high 16-bit data identifiers represented in hexadecimal form, the number of low 16-bit data identifiers with a high 16-bit of 0x12 is not greater than the set number threshold, so the container with a high 16-bit of 0x12 is an array container, and the low 16-bit data identifiers 123, 456, 789 represented in decimal form are stored in the container with a high 16-bit of 0x12 in an array form, while the number of low 16-bit data identifiers with a high 16-bit of 0x56 is greater than the set number threshold, so the container with a high 16-bit of 0x56 is a bitmap container, and a plurality of low 16-bit data identifiers are stored in the container with a high 16-bit of 0x56 in a bitmap form.
[0097] It should be noted that in the Roaring Bitmap shown in Figure 3 , although hexadecimal numbers are used to represent the first data identifier and decimal numbers are used to represent the second data identifier, in the actual storage process, the first data identifier and the second data identifier are still stored in binary form.
[0098] In some embodiments, for the above step 202, when the plurality of first data identifiers included in the plurality of inverted lists are searched to obtain a target first data identifier whose occurrence frequency reaches a set frequency threshold, the following steps can be used to achieve the target first data identifier:
[0099] Step 2021, based on the plurality of inverted lists, a first search heap is constructed, wherein a first node in the first search heap is used to store a first pointer, and the first pointer points to a currently searched first data identifier in the corresponding inverted list.
[0100] It should be noted that each postings list corresponds to a target search term, and different postings lists correspond to different target search terms. For any postings list, when storing first data identifiers, the postings list may store the first data identifiers in a predetermined order. For example, the first data identifiers may be stored in descending order, or in ascending order. This disclosure does not limit the specific method employed.
[0101] In a possible implementation, when constructing the first search heap based on multiple postings lists, a maximum heap or a minimum heap may be constructed in the order of the first first data identifiers in each postings list, and the constructed heap is used as the first search heap.
[0102] That is, a maximum heap can be constructed in descending order of the first data identifiers in each postings list, and the constructed maximum heap can be used as the first search heap. Alternatively, a minimum heap can be constructed in descending order of the first data identifiers in each postings list, and the constructed minimum heap can be used as the first search heap.
[0103] Optionally, when the first first data identifiers in two or more postings lists are both the maximum or minimum values, any first data identifier in the two or more postings lists may be selected as the first data identifier pointed to by the first pointer in the parent node.
[0104] For example, if the search statement entered by the user includes three target search terms, then three postings lists corresponding to the three target search terms can be obtained through step 201. For ease of explanation, these three postings lists are respectively recorded as postings list A, postings list B, and postings list C. If the first data identifiers included in postings list A are 1, 3, and 4, respectively, the first data identifiers included in postings list B are 2, 4, and 6, respectively, and the first data identifiers included in postings list C are 1, 5, and 6, respectively, then when constructing the first search heap, the first search heap can be constructed in the order of the first first data identifier in postings list A (that is, 1), the first first data identifier in postings list B (that is, 2), and the first data identifier in postings list C (that is, 1). Taking the example of constructing a minimum heap as the first search heap according to the order of the first first data identifiers in postings list A, postings list B, and postings list C from smallest to largest, the following can be obtained: Figure 4 The first search stack shown, see Figure 4 , Figure 4 is a schematic diagram of a first search stack according to an exemplary embodiment of the present disclosure.
[0105] Still Figure 4 Taking the first search stack as an example,Figure 4 Each node in the postings list stores a first pointer. The first pointer in the node corresponding to postings list A points to the first first data identifier 1 in postings list A. The first pointer in the node corresponding to postings list B points to the first first data identifier 2 in postings list B. The first pointer in the node corresponding to postings list C points to the first first data identifier 1 in postings list C.
[0106] Optionally, the first pointer may also point to the sequence number of the first data identifier currently retrieved in the corresponding postings list. For example, the first data identifiers 1, 3, and 4 in postings list A correspond to sequence numbers 1, 2, and 3 respectively; the first data identifiers 2, 4, and 6 in postings list B correspond to sequence numbers 1, 2, and 3 respectively; and the first data identifiers 1, 5, and 6 in postings list C correspond to sequence numbers 1, 2, and 3 respectively. In this case, the sequence number of the first data identifier pointed to by the first pointers corresponding to postings lists A, B, and C is all 1.
[0107] Step 2022: Search based on the first search heap to obtain the target first data identifier.
[0108] In a possible implementation, step 2022 may be implemented by the following steps:
[0109] Step 2022-1: traverse the multiple first nodes included in the first search heap, output the first data identifier pointed to by the first pointer in the parent node of the multiple first nodes, and record the number of occurrences of the output first data identifier.
[0110] It should be noted that, since the first data identifier pointed to by the first pointer in the parent node is the largest or smallest first data identifier among the first data identifiers in each postings link, the first data identifier output during each traversal process is the largest or smallest first data identifier among all the first data identifiers.
[0111] Still Figure 4 Taking the first search heap as an example, Figure 4 The first search heap shown is a minimum heap, that is, Figure 4 The first data identifier pointed to by the first pointer in the parent node of the first search heap in is the smallest data identifier among the first data identifiers pointed to by the first pointers in the plurality of first nodes. Figure 4 When the first search heap shown is traversed, the first data identifier outputted is the first first data identifier in the postings list A, that is, 1, and the number of occurrences of the outputted first data identifier 1 is recorded as 1.
[0112] It should be noted that when outputting a first data identifier, the corresponding second data identifier can be recorded. For example, if the second data identifier corresponding to the first data identifier 1 in postings list A is (0, 4, 5, 8), then when outputting the first data identifier 1 in postings list A, the corresponding second data identifier can be recorded, that is, (0, 4, 5, 8).
[0113] Step 2022-2: Update the first data identifier pointed to by the first pointer in the parent node, and update the first search heap based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes to obtain an updated first search heap.
[0114] In one possible implementation, the first data identifier pointed to by the first pointer in the parent node is updated to the first data identifier that is next to the output first data identifier on the corresponding postings link; a first target node corresponding to the largest or smallest first data identifier among the first data identifiers pointed to by the first pointers in multiple first nodes is determined; and the first pointer in the first target node is swapped with the first pointer in the current parent node to obtain an updated first search heap.
[0115] Still Figure 4 Taking the first search heap shown as an example, after the first data identifier pointed to by the first pointer in the parent node is output in step 2022-1, that is, the first first data identifier 1 in postings list A, the first data identifier pointed to by the first pointer in the parent node can be updated to the second first data identifier in postings list A, that is, the first data identifier 3.
[0116] Because Figure 4 The first search heap shown is a minimum heap, and thus the smallest first data identifier among the first data identifiers pointed to by the first pointers in the plurality of first nodes can be determined. Figure 4 The first search stack shown is updated. Figure 4 After the first data marker pointed to by the first pointer in the parent node in the first search heap shown in FIG. Figure 4 In the first search heap shown, the first data identifiers pointed to by the first pointers in the current nodes are the second first data identifier 3 in postings list A, the first first data identifier 2 in postings list B, and the first first data identifier 1 in postings list C. The smallest first data identifier is the first first data identifier 1 in postings list C.
[0117] Therefore, the first pointer stored in the parent node can be updated to point to the first first data identifier 1 in postings list C, and the first pointer originally stored in the parent node pointing to the second first data identifier 3 in postings list A can be stored in the first node where the first pointer pointing to the first first data identifier 1 in postings list C originally resides. This gives the following: Figure 5 The first search stack shown, see Figure 5 , Figure 5 is a schematic diagram of an updated first search stack according to an exemplary embodiment of the present disclosure.
[0118] Optionally, if the first pointer points to the sequence number of the first data identifier currently retrieved in the corresponding postings list, the following method can be used to update the first search stack:
[0119] Increment the sequence number of the postings list pointed to by the first pointer in the parent node by 1, so that the first pointer in the parent node points to the next sequence number in the corresponding postings list; determine that the first pointers in multiple first nodes point to the target node corresponding to the largest or smallest first data identifier among the first data identifiers corresponding to the corresponding sequence numbers in the postings list; swap the first pointer in the target node with the first pointer in the current parent node to obtain an updated first search heap.
[0120] Still Figure 4 Take the first search stack as an example, Figure 4 In the first search heap shown, the sequence number of the first data identifier pointed to by the first pointer in the parent node is 1. After the first data identifier pointed to by the first pointer in the parent node is output in step 2022-1, that is, the first first data identifier 1 in postings list A, the sequence number of the first data identifier pointed to by the first pointer in the parent node can be updated to 2, so that the first pointer in the parent node points to the second first data identifier in postings list A, that is, the first data identifier 3.
[0121] After the first pointer is updated, the first pointer stored in each node in the current first search heap points to the first data identifier with sequence number 2 in postings index A, the first data identifier with sequence number 1 in postings index B, and the first data identifier with sequence number 1 in postings index C. That is, the second first data identifier 3 in postings index A, the first first data identifier 2 in postings index B, and the first first data identifier 1 in postings index C. The smallest first data identifier is the first first data identifier 1 in postings index C, i.e., the first data identifier with sequence number 1 in postings index C.
[0122] Thus, the first pointer stored in the parent node can be updated to point to the first data identifier with the sequence number of 1 in the inverted list C, and the first pointer originally stored in the parent node, which points to the first data identifier with the sequence number of 2 in the inverted list A, is stored in the first node where the first pointer originally pointing to the first data identifier with the sequence number of 1 in the inverted list C is located. As shown in the updated first search heap. Figure 5
[0123] It should be noted that, in the case that each first data identifier included in the inverted list corresponding to any target search term has been output, the updated first search heap is constructed based on the inverted list corresponding to other target search terms. That is, in the case that each first data identifier included in any inverted list has been output, the first search heap is constructed based on the inverted list in which the first data identifiers have not been all output. Or, in the case that the output first data identifier has reached the tail of the inverted list corresponding thereto, the first search heap is constructed based on the inverted list in which the first data identifiers have not been all output.
[0124] Still taking the first search heap as shown in Figure 4 If each first data identifier in the inverted list A has been output, the first search heap can be constructed based on only the inverted list B and the inverted list C.
[0125] In step 2022-3, the search is continued based on the updated first search heap until the search termination condition is met, and each first data identifier arranged in the set order and the occurrence number of each first data identifier are obtained.
[0126] In a possible implementation, the plurality of first nodes included in the updated first search heap are traversed, the first data identifier pointed to by the first pointer in the parent node in the plurality of first nodes included in the updated first search heap is output, and the occurrence number of the output first data identifier is recorded.
[0127] Optionally, when the occurrence number of the output first data identifier is recorded, if the currently output first data identifier is the same as the previously output first data identifier, the occurrence number can be directly increased by 1; if the currently output first data identifier is different from the previously output first data identifier, the occurrence number of the output first data identifier is recorded as 1.
[0128] Taking the updated first search heap as shown in Figure 5 the plurality of first nodes included in the updated first search heap are traversed, the first data identifier pointed to by the first pointer in the parent node in the plurality of first nodes included in the updated first search heap is output, and the occurrence number of the output first data identifier is recorded. Figure 5 The first data identifier 1 pointed by the first pointer in the parent node in the first search stack is outputted, and since the first data identifier outputted by the step 2022-1 is also 1, the number of occurrences of the recorded first data identifier 1 is updated to 2.
[0129] It should be noted that when the first data identifier 1 in the inverted list C is outputted, the second data identifier corresponding to the first data identifier 1 in the inverted list C can also be recorded. For example, the second data identifier corresponding to the first data identifier 1 in the inverted list C is (2, 7, 8, 10), and when the first data identifier 1 in the inverted list C is outputted, the second data identifier corresponding to the first data identifier 1, that is, (2, 7, 8, 10), can be recorded, so that the second data identifier corresponding to the recorded first data identifier 1 includes (0, 4, 5, 8) and (2, 7, 8, 10).
[0130] Alternatively, the computing device can maintain a list of identifiers for storing the second data identifier corresponding to the currently outputted first data identifier. For example, the second data identifier (0, 4, 5, 8) and (2, 7, 8, 10) corresponding to the first data identifier 1 can be recorded through the list of devices.
[0131] The steps 2022-1 to 2022-2 are iterative processes, that is, after the first data identifier pointed by the first pointer in the parent node in the current first search stack is outputted by traversing the current first search stack through the step 2022-1, the first search stack is updated through the step 2022-2 to obtain an updated first search stack, and then the updated first search stack is continuously traversed through the step 2022-3 in the same way as the step 2022-1 to obtain the first data identifier pointed by the first pointer in the parent node in the updated first search stack, and so on, until the retrieval termination condition is met, and the above iterative process is ended.
[0132] The retrieval termination condition can be that the updated search stack is empty, or the retrieval termination condition can also be that the retrieval time length reaches a preset time length, and the preset time length can be any time length. Alternatively, the retrieval termination condition can also be that the number of traversals reaches a target number, the number of target first data identifiers currently retrieved reaches a target number, and the like. The specific condition used as the retrieval termination condition is not limited in the present disclosure.
[0133] It should be noted that since the first data identifier outputted during each traversal process is the largest or smallest first data identifier among the first data identifiers, after the retrieval is completed, the first data identifiers can be obtained in a set order. If the largest first data identifier is outputted during each traversal process, the first data identifiers can be obtained in a descending order; if the smallest first data identifier is outputted during each traversal process, the first data identifiers can be obtained in a descending order.
[0134] Step 2022-4: Based on the number of occurrences of each first data identifier, determine a target first data identifier whose number of occurrences reaches a set number threshold.
[0135] Optionally, the set number threshold can be pre-set by relevant technical personnel and stored in the computing device, so that the computing device can obtain the stored set number threshold, and thereby determine the target first data identifier from the first data identifier based on the set number threshold.
[0136] It should be noted that in the above process, since each first identifier is output in a set order, if the first data identifier currently output (for the sake of convenience, recorded as the first data identifier P) is different from the first data identifier output last time (for the sake of convenience, recorded as the first data identifier Q), then the first data identifier identical to the first data identifier Q will not be output subsequently. At this time, whether the first data identifier Q is the target first data identifier can be determined based on whether the number of occurrences of the first data identifier Q reaches the set number threshold.
[0137] by Figure 5 The updated first search heap shown in FIG is taken as an example to continue the description. Figure 5 The first search heap shown continues to be updated, and then the search continues based on the updated first search heap. At this time, the first data identifier output is the first first data identifier 2 in the postings list B. At this time, the first data identifier output is no longer the first data identifier 1. Therefore, it can be determined that the number of occurrences of the first data identifier is 2. At this time, it can be determined whether the number of occurrences of the first data identifier 1 reaches the set number threshold.
[0138] It should be noted that if the first data identifier currently output is different from the first data identifier output last time, and the number of occurrences of the first data identifier output last time reaches the set threshold, the second data identifier recorded in the identifier list can be output, and the identifier list can be cleared, so as to re-record the second data identifier corresponding to the first data identifier currently output, to ensure that the second data identifiers recorded in the identifier list correspond to the same first data identifier.
[0139] Referring to Figure 6 , Figure 6 is a first data identifier retrieval process diagram according to an exemplary embodiment of the present disclosure, based on four inverted chains as shown in Figure 6 The first retrieval heap is constructed based on the four inverted chains, and retrieval is performed based on the constructed first retrieval heap, obtaining a plurality of first data identifiers output in a set order and the number of occurrences of each first data identifier, so as to determine a target first data identifier with a number of occurrences greater than or equal to M, so as to retrieve the second data identifier corresponding to the target first data identifier. Wherein, M is a set number threshold.
[0140] Through the above process, the target first data identifier with a number of occurrences reaching the set number threshold can be determined from the plurality of first data identifiers included in the plurality of inverted chains, so that subsequent retrieval can be directly based on the second data identifier corresponding to the target first data identifier, filtering the first data identifiers with a number of occurrences not reaching the set number threshold, so that the second data identifiers corresponding to these first data identifiers do not need to be retrieved in subsequent retrieval, reducing the processing pressure of the computing device, and thus the processing speed of the computing device can be improved, and the response speed of the computing device to the user's retrieval operation can be improved.
[0141] The above describes the process of retrieving the first data identifier to obtain the target first data identifier with a number of occurrences reaching the set number threshold, and the process of retrieving the second data identifier corresponding to the target first data identifier is described below.
[0142] In some embodiments, for any inverted chain, when storing data identifiers, the second data identifiers corresponding to the same first data identifier are stored in the inverted chain corresponding to the respective first data identifier in the form of a sub-inverted chain.
[0143] For example, the inverted chain can be 1(2,4,5)→3(3,4,5)→6(1,4,6), wherein (2,4,5), (3,4,5) and (1,4,6) are sub-inverted chains for storing second data identifiers. Alternatively, each sub-inverted chain can be stored in a container corresponding to each first data identifier, that is, the container corresponding to the first data identifier 1 can store the three second data identifiers 2, 4 and 5, the container corresponding to the first data identifier 3 can store the three second data identifiers 3, 4 and 5, and the container corresponding to the first data identifier 6 can store the three second data identifiers 1, 4 and 6.
[0144] After the target first data identifier is determined, the second data identifiers corresponding to the target first data identifier in different inverted chains can be obtained, so that the second data identifiers corresponding to the target first data identifier in different inverted chains can be searched to determine the target second data identifier whose occurrence frequency reaches the set frequency threshold.
[0145] It should be noted that it has been introduced above that when the second data identifiers are stored by means of the inverted chains, in the case that the number of the second data identifiers corresponding to the same first data identifier is not greater than the set number threshold, the second data identifiers are stored in the form of an array, and in the case that the number of the second data identifiers corresponding to the same first data identifier is greater than the set number threshold, the second data identifiers are stored in the form of a bitmap.
[0146] Thus, for the same first data identifier, the second data identifiers corresponding thereto can be stored in the form of an array in some inverted chains, and can be stored in the form of a bitmap in some other inverted chains. That is, for the same target first data identifier, the storage form of the second data identifiers corresponding thereto can be the same or different.
[0147] For any target first data identifier, in the case that the number of the second data identifiers corresponding to the target first data identifier in different inverted chains is not greater than the set number threshold, the second data identifiers corresponding to the target first data identifier are stored in the form of an array.
[0148] For any target first data identifier, in the case that the number of the second data identifiers corresponding to the target first data identifier in different inverted chains is greater than the set number threshold, the second data identifiers corresponding to the target first data identifier are stored in the form of a bitmap.
[0149] And in the case that the number of the second data identifiers corresponding to the target first data identifier in different inverted chains is both greater than the set number threshold and not greater than the set number threshold, the second data identifiers in the inverted chains not greater than the set number threshold are stored in the form of an array, and the second data identifiers in the inverted chains greater than the set number threshold are stored in the form of a bitmap.
[0150] And when the second data identifiers corresponding to the target first data identifier are searched, due to the different storage forms of the second data identifiers corresponding to the target first data identifier, the search methods used are also different, and the two search methods used in different cases will be introduced as follows.
[0151] Case one, for any target first data identifier, the number of the second data identifiers corresponding to the target first data identifier in different inverted chains is not greater than the set number threshold.
[0152] At this time, the second data identifiers corresponding to the target first data identifier are all stored in an array, that is, the container for storing the second data identifiers corresponding to the target first data identifier is an array container. In this case, when the second data identifiers corresponding to the target first data identifier are searched, the following steps can be used to achieve the search:
[0153] Step 2031(1), a heap structure is constructed based on the second data identifiers corresponding to the target first data identifier, and a second search heap is obtained, wherein the second nodes in the second search heap are used to store second pointers, and the second pointers point to the currently searched second data identifiers in the corresponding child inverted lists.
[0154] It should be noted that for any child inverted list, the second data identifiers can be stored in a set order when the child inverted list stores the second data identifiers. For example, the second data identifiers can be stored in descending order of data identifiers, or the second data identifiers can be stored in ascending order of data identifiers, and the specific manner is not limited in the present disclosure.
[0155] In a possible implementation, when the heap structure is constructed based on the second data identifiers corresponding to the target first data identifier, and the second search heap is obtained, a maximum heap or a minimum heap is constructed based on the size of the first second data identifier in the child inverted list corresponding to the target first data identifier, and the constructed heap is used as the second search heap.
[0156] That is, the maximum heap can be constructed in descending order of the first second data identifier in each child inverted list corresponding to the target first data identifier, and the constructed maximum heap is used as the second search heap; or the minimum heap can be constructed in ascending order of the first second data identifier in each child inverted list corresponding to the target first data identifier, and the constructed minimum heap is used as the second search heap.
[0157] Optionally, when the first second data identifier in two or more child inverted lists is a maximum or minimum value, one second data identifier can be randomly selected from the first second data identifiers in the two or more child inverted lists as the second data identifier pointed to by the second pointer in the parent node.
[0158] It should be noted that the structure of the constructed second search heap is similar to the structure of the first search heap as shown in FIG. 8, and details are not repeated here. Figure 4
[0159] Optionally, the second pointer stored in each second node of the second search heap can point to not only the currently searched second data identifier in the corresponding sub-inverted list, but also the serial number of the currently searched second data identifier in the corresponding sub-inverted list. For details, refer to the related description in step 2021, which will not be repeated here.
[0160] Step 2032(1), searching based on the second search heap to obtain a target second data identifier.
[0161] In a possible implementation, the step 2032(1) can be implemented by the following steps.
[0162] Step 2032(1)-1, for any second search heap, traversing the plurality of second nodes included in the second search heap, outputting the second data identifier pointed to by the second pointer in the parent node in the plurality of second nodes, and recording the number of occurrences of the output second data identifier.
[0163] It should be noted that, since the second data identifier pointed to by the second pointer in the parent node is the largest or smallest second data identifier in the first second data identifier in each sub-inverted list, the second data identifier output in each traversal process is the largest or smallest second data identifier in each second data identifier.
[0164] Step 2032(1)-2, updating the second data identifier pointed to by the second pointer in the parent node, updating the second search heap based on the size of the second data identifier pointed to by the second pointer in the plurality of second nodes, to obtain an updated second search heap.
[0165] In a possible implementation, the second data identifier pointed to by the second pointer in the parent node is updated to the next second data identifier of the output second data identifier in the corresponding sub-inverted list; the largest or smallest second data identifier in the second data identifier pointed to by the second pointer in the plurality of second nodes is determined to correspond to a second target node; the second pointer in the second target node and the second pointer in the current parent node are exchanged to obtain the updated second search heap.
[0166] Optionally, if the second pointer points to the serial number of the currently searched second data identifier in the corresponding sub-inverted list, the second search heap can also be updated in the following manner:
[0167] The sequence number of the child inverted list pointed to by the second pointer in the parent node is added 1, so that the second pointer in the parent node points to the next sequence number of the corresponding child inverted list; the second target node corresponding to the largest or smallest second data identifier in the second data identifiers corresponding to the respective sequence numbers of the second pointers in the plurality of second nodes is determined; the second pointer in the second target node and the second pointer in the current parent node are exchanged to obtain an updated second search heap.
[0168] The specific description of the above two implementation manners can be referred to step 2022-2, and details are not described herein.
[0169] Step 2032(1)-3, continue searching in the updated second search heap until the search termination condition is met, to obtain each second data identifier arranged in a set order and the occurrence number of each second data identifier.
[0170] In a possible implementation, the plurality of second nodes included in the updated second search heap are traversed, the second data identifier pointed to by the second pointer in the parent node in the plurality of second nodes included in the updated second search heap is output, and the occurrence number of the output second data identifier is recorded.
[0171] It should be noted that the specific implementation process of this step can be referred to step 2022-3, and details are not described herein.
[0172] Step 2032(1)-4, based on the occurrence number of each second data identifier, determining a target second data identifier whose occurrence number reaches a set number threshold.
[0173] The description of this step can be referred to step 2022-4, and details are not described herein.
[0174] Optionally, the value of the set data threshold used when determining the target second data identifier can be the same as or different from the value of the set data threshold used when determining the target first data identifier, and the present disclosure does not limit this.
[0175] Case two, for any target first data identifier, the number of second data identifiers corresponding to the target first data identifier in each inverted list is both greater than a set number threshold and not greater than the set number threshold.
[0176] At this time, the second data identifiers in the inverted list not greater than the set quantity threshold are stored in an array form, and the second data identifiers in the inverted list greater than the set quantity threshold are stored in a bitmap form, that is, the container for storing the second data identifiers corresponding to the target first data identifier includes both an array container and a bitmap container. In this case, the searching of the second data identifiers corresponding to the target first data identifier can be implemented through the following steps:
[0177] Step 2031(2), outputting the second data identifiers in the inverted list greater than the set quantity threshold stored in the bitmap form, and converting the second data identifiers stored in the array form into a partial bitmap form and outputting.
[0178] For example, the implementation process of converting the second data identifiers 80 stored in the array form into a partial bitmap form is taken as an example. The complete identifier of the second data identifiers 80 stored in the array form converted into the bitmap form is (64 zeros) 000……00010000……000 (65,408 zeros). In the case that the computing device adopts a 64-bit CPU, only the part of 000……0001000……000 needs to be converted into the bitmap form.
[0179] By converting only the second data identifiers stored in the array form into a partial bitmap form, the processing pressure of the computing device can be reduced while ensuring that the present scheme can be implemented.
[0180] Step 2032(2), for any target first data identifier, creating an array with a length required according to the set times threshold, and the array is used to record the occurrence times of each second data identifier.
[0181] It should be noted that when the occurrence times of the second data identifiers stored in the bitmap form are determined, the occurrence times of each bit need to be determined, and the determined occurrence times of each bit can be stored through an array. The occurrence times of each second data identifier are determined to determine whether the occurrence times of the second data identifier reach the set times threshold M, and thus log2M binary bits can be used to represent the occurrence times of each bit of the second data identifier, so as to obtain the occurrence times of each second data identifier.
[0182] In a possible implementation, an array A0, A1,…,A [log2M]-1 with a length of log2M can be created to record the occurrence times of each second data identifier. Each element in the array can represent 65,536 bits.
[0183] For example, if M is 21, the length of the array to be created can be determined by rounding up log2M to 5, so that the array A0, A1, A2, A3, A4 can be created to record the occurrence times of each second data identifier.
[0184] If the user array A0, A1, A2, A3, A4 is used to record the number 6, the binary representation of 6 is 00110, then A0 can be used to record the binary digit 0, A1 can be used to record the binary digit 1, A2 can be used to record the binary digit 1, A3 can be used to record the binary digit 0, and A4 can be used to record the binary digit 0.
[0185] If the second data identifier is a low 16-bit data identifier, when counting the occurrence times of each second data identifier, the count of 65536 bits is needed, that is, the count of 65536 binary digits, the count of 65536 binary tens digits, the count of 65536 binary hundreds digits, and so on, A0 can be used to represent the binary digit of 65536 numbers, A1 can be used to represent the binary tens digit of 65536 numbers, and so on.
[0186] Step 2033(2), initializing the occurrence times of each second data identifier recorded by the array to the complement of the set number threshold.
[0187] In a possible implementation, the elements in the array at the corresponding positions are initialized according to the complement of the set number threshold, so that the values of the array are initialized to -M.
[0188] For example, if M is 21, the binary number corresponding to 21 is 10101, and the complement is 11011, A4, A3, A2, A1, and A0 are initialized to 1, 1, 0, 1, and 1 respectively.
[0189] By initializing the values of each element in the array to the complement of the set number threshold, when the element in the array counts to 0, it is equivalent to that the value of the element reaches M, that is, the computing device only needs to determine whether the value in the array reaches 0, to determine whether the occurrence times of the second data identifier reaches M, so that the processing process of the computing device can be simplified.
[0190] In addition, the occurrence times of each second data identifier recorded by the array can also be initialized to 0, so that whether the occurrence times of the second data identifier reaches M can be determined by subsequently determining whether the values in each array reaches M.
[0191] Step 2034(2), traversing the second data identifier corresponding to the target first data identifier, generating a result bitmap based on the occurrence times of each second data identifier obtained through the traversal, the result bitmap being used to indicate whether the occurrence times of each data identifier reach the set number threshold.
[0192] In a possible implementation, the occurrence times of each second data identifier are obtained by traversing the second data identifier corresponding to the target first data identifier; for any second data identifier, the occurrence times of the second data identifier recorded in the array are updated based on the occurrence times of the second data identifier, to obtain the overflow bit corresponding to the second data identifier; and the result bitmap is determined based on the overflow bit corresponding to each second data identifier.
[0193] Optionally, a result bitmap meeting the bit number requirement of the second data identifier can be created first, and the result bitmap is initialized to 0, that is, each bit in the result bitmap is initialized to 0. Still taking the second data identifier as the low 16-bit data identifier as an example, a result bitmap of 65535 (2 16 ) bits can be created first, and the 35536 bits in the result bitmap are initialized to 0.
[0194] By creating the result bitmap in advance and initializing the result bitmap, the real-time update of whether the occurrence times of the second data identifier reach the set number threshold can be implemented by accumulating on the basis of the created result bitmap after each traversal.
[0195] In a possible implementation, the bitmap corresponding to each target first data identifier is traversed, and the element in the array corresponding to any bit being 1 in the bitmap is added by 1. For example, for the bitmap corresponding to any target first data identifier, the 132th bit in the bitmap is 1, and the other bits are all 0, which indicates that the second data identifier corresponding to the target first data identifier is 132, and if the initial value of the array corresponding to 132 is 11011, the array element can be updated by adding 1 to 11011.
[0196] Optionally, based on the parallel processing capability of the computing device, multiple array elements can be updated based on multiple bits in the bitmap. Taking the computing device using a 64-bit CPU as an example, the update of the array elements can be performed synchronously based on 64 bits in the bitmap.
[0197] It should be noted that, in the process of accumulating the array elements, a carry can be generated, and the carry generated by the highest bit of each array element is the overflow bit corresponding to each second data identifier.
[0198] In some embodiments, for the convenience of calculation, when calculating each bit, the result of the XOR operation between the current value in the array and the carry value of the previous bit of the current bit is determined as the result of the current bit, and the result of the AND operation between the current value in the array and the carry value of the previous bit of the current bit is determined as the carry value generated by the current bit.
[0199] After determining the overflow bit generated by the highest bit of each element, the determined overflow bit is ORed with the result bitmap initialized as 0, and the result bitmap for determining the occurrence frequency is obtained.
[0200] Step 2035(2), determining, based on the result bitmap, a target second data identifier whose occurrence frequency reaches a set frequency threshold.
[0201] In a possible implementation, the second data identifier corresponding to the bit being 1 in the result bitmap is determined as the target second data identifier whose occurrence frequency reaches the set frequency threshold.
[0202] Referring to Figure 7 , Figure 7 is a schematic diagram of a result bitmap according to an exemplary embodiment of the present disclosure, taking the array A initialized as 1010101010 as an example, 2 0 bit final recorded occurrence frequency is 1010100010, 2 1 bit final recorded occurrence frequency is 1010101010, 2 2 bit final recorded occurrence frequency is 0101010101, and the result bitmap for recording the overflow bit is 010101001.
[0203] Case three, for any target first data identifier, the number of second data identifiers corresponding to the target first data identifier in different inverted lists is greater than a set number threshold.
[0204] At this time, the second data identifiers corresponding to the target first data identifier are stored in the form of bitmaps, that is, the containers for storing the second data identifiers corresponding to the target first data identifier are all bitmap containers. In this case, when searching for the second data identifiers corresponding to the target first data identifier, the following steps can be implemented:
[0205] Step 2031(3), outputting the second data identifiers in the inverted list greater than the set number threshold and stored in the form of bitmaps.
[0206] Step 2032(3), for any target first data identifier, creating an array with a length meeting the requirement of the set frequency threshold, and the array is used to record the occurrence frequency of each second data identifier.
[0207] Step 2033(3), initializing the occurrence times of each second data identifier recorded by the array to the complement of the set number threshold.
[0208] Step 2034(3), traversing the second data identifiers corresponding to the target first data identifier, and generating a result bitmap based on the occurrence times of each second data identifier obtained by the traversal, the result bitmap being used to indicate whether the occurrence times of each data identifier reach the set number threshold.
[0209] Step 2035(3), determining the target second data identifier whose occurrence times reach the set number threshold based on the result bitmap.
[0210] For specific introduction of each step, please refer to steps 2031(2) to 2035(2), which will not be repeated here.
[0211] It should be noted that, in the introduction of the above various cases, how to search the second data identifiers corresponding to the target first data identifier is exemplified by the search process of the second data identifiers corresponding to one target first data identifier, and the search processes of other target first data identifiers are the same, which will not be repeated here.
[0212] Optionally, after the result bitmap is determined, in the case that the result bitmap meets the set condition, the result bitmap can be converted into an array form for storage, and in the case that the result bitmap does not meet the set condition, the bitmap form can still be used for storage.
[0213] The set condition can be that the data amount of the stored result bitmap is less than the set data amount, and the set data amount can be determined based on the structure performance of the high-efficiency compressed bitmap structure.
[0214] In some embodiments, for step 204, when the target multimedia data is obtained based on the target second data identifier and the corresponding target first data identifier, the target second data identifier and the corresponding first data identifier can be combined together, so as to obtain the complete data identifier of the multimedia data, so that the corresponding multimedia data can be determined based on the complete data identifier.
[0215] By using the data processing method provided by the present disclosure and various optional embodiments of the present disclosure, the fuzzy query performance can be effectively improved when searching multimedia data based on high-frequency items under the condition of limiting the minimum matching number. For example, Figure 8 , Figure 8 is an effect schematic diagram of a data processing method according to an exemplary embodiment of the present disclosure, as shown in Figure 8As shown, experiments show that, by using the data processing method provided by the present disclosure, the number of slow requests (i.e. requests with response time exceeding 100 milliseconds) under fuzzy query is reduced from 35 per minute to about 1 per minute, the search timeout rate is significantly reduced, and the query performance and user experience are effectively improved.
[0216] To implement the data processing method of any embodiment of the present disclosure, the present embodiment further provides a data processing device. Referring to Figure 9 , Figure 9 FIG. 1 is a structural schematic diagram of a data processing device according to an exemplary embodiment of the present disclosure, which comprises:
[0217] The first acquisition module 901 is configured to acquire a plurality of inverted lists corresponding to a plurality of target search terms, wherein the inverted list includes data identifiers of multimedia data corresponding to the target search term, and the data identifier includes a first data identifier and a second data identifier.
[0218] The first search module 902 is configured to search the plurality of first data identifiers included in the plurality of inverted lists to obtain a target first data identifier with a number of occurrences reaching a set number threshold.
[0219] The second search module 903 is configured to search the second data identifier corresponding to the target first data identifier to obtain a target second data identifier with a number of occurrences reaching a set number threshold.
[0220] The second acquisition module 904 is configured to acquire the target multimedia data based on the target second data identifier and the corresponding target first data identifier.
[0221] In an embodiment of the present disclosure, the first search module 902, when searching the plurality of first data identifiers included in the plurality of inverted lists to obtain a target first data identifier with a number of occurrences reaching a set number threshold, includes a construction submodule and a search submodule.
[0222] The construction submodule is configured to construct a first search heap based on the plurality of inverted lists, wherein a first node in the first search heap is used to store a first pointer, and the first pointer points to the currently searched first data identifier in the corresponding inverted list.
[0223] The search submodule searches based on the first search heap to obtain the target first data identifier.
[0224] In an embodiment of the present disclosure, for any inverted list, when storing the data identifier, the first data identifier is stored in a set order;
[0225] The construction submodule, when constructing the first search heap based on the plurality of inverted lists, is configured to:
[0226] According to the size order of the first data identifiers in each inverted chain, a maximum heap or a minimum heap is constructed, and the constructed heap is taken as the first search heap.
[0227] In an embodiment of the present disclosure, the search sub-module comprises a traversal unit, an updating unit, a search unit and a determination unit when used for searching based on the first search heap to obtain the target first data identifier.
[0228] The traversal unit is configured to traverse the plurality of first nodes comprised in the first search heap, output the first data identifier pointed to by the first pointer in the parent node in the plurality of first nodes, and record the occurrence times of the output first data identifier.
[0229] The updating unit is configured to update the first data identifier pointed to by the first pointer in the parent node, update the first search heap based on the size of the first data identifier pointed to by the first pointer in the plurality of first nodes, and obtain the updated first search heap.
[0230] The search unit is configured to continue searching based on the updated first search heap until the search termination condition is met, and obtain the first data identifiers arranged in the set order and the occurrence times of the first data identifiers.
[0231] The determination unit is configured to determine the target first data identifier whose occurrence times reach the set number threshold based on the occurrence times of the first data identifiers.
[0232] In an embodiment of the present disclosure, when the updating unit is used for updating the first data identifier pointed to by the first pointer in the parent node, updating the first search heap based on the size of the first data identifier pointed to by the first pointer in the plurality of first nodes, and obtaining the updated first search heap, the updating unit is configured to:
[0233] update the first data identifier pointed to by the first pointer in the parent node to the next first data identifier of the output first data identifier in the corresponding inverted chain;
[0234] determine the first target node corresponding to the maximum or minimum first data identifier among the first data identifiers pointed to by the first pointers in the plurality of first nodes;
[0235] exchange the first pointer in the first target node and the first pointer in the current parent node to obtain the updated first search heap.
[0236] In an embodiment of the present disclosure, the first pointer points to the serial number of the currently searched first data identifier in the corresponding inverted chain.
[0237] the updating unit, when the first search heap is updated based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes, and the updated first search heap is obtained, is configured to:
[0238] increment the sequence number of the inverted list pointed to by the first pointer in the parent node by 1, so that the first pointer in the parent node points to the next sequence number of the corresponding inverted list;
[0239] determine a target node corresponding to the largest or smallest first data identifier among the first data identifiers corresponding to the respective sequence numbers of the inverted lists pointed to by the first pointers in the plurality of first nodes;
[0240] exchange the first pointer in the target node and the first pointer in the current parent node to obtain the updated first search heap.
[0241] In an embodiment of the present disclosure, the construction submodule is further configured to, when each first data identifier included in the inverted list corresponding to any target search term has been output, construct an updated first search heap based on the inverted list corresponding to another target search term.
[0242] In an embodiment of the present disclosure, for any inverted list, when storing the data identifiers, the second data identifiers corresponding to the same first data identifier are stored in the inverted list corresponding to the respective first data identifiers in the form of sub-inverted lists;
[0243] The second search module 903 includes a construction submodule and a search submodule when searching for a target second data identifier corresponding to a target first data identifier, and the target second data identifier is obtained when the number of occurrences reaches a set number threshold.
[0244] The construction submodule is configured to, for any target first data identifier, when the number of second data identifiers corresponding to the target first data identifier in different inverted lists is not greater than a set number threshold, construct a heap structure based on the second data identifiers corresponding to the target first data identifier to obtain a second search heap, wherein the second nodes in the second search heap are configured to store second pointers, and the second pointers point to the currently searched second data identifiers in the corresponding sub-inverted lists.
[0245] The search submodule is configured to search based on the second search heap to obtain the target second data identifier.
[0246] In an embodiment of the present disclosure, the construction submodule is configured to, when constructing a heap structure based on the second data identifiers corresponding to the target first data identifier to obtain a second search heap, perform the following operations:
[0247] constructing a maximum heap or a minimum heap based on sizes of the first second data identifiers in the sub-inverted list corresponding to the target first data identifier, and taking the constructed heap as a second search heap.
[0248] In one embodiment of the present disclosure, the search sub-module, when used for searching based on the second search heap to obtain a target second data identifier, comprises:
[0249] a traversal unit configured to, for any second search heap, traverse a plurality of second nodes included in the second search heap, output a second data identifier pointed to by a second pointer in a parent node of the plurality of second nodes, and record a number of occurrences of the output second data identifier;
[0250] an update unit configured to update the second data identifier pointed to by the second pointer in the parent node, update the second search heap based on sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes, and obtain an updated second search heap;
[0251] a search unit configured to continue searching in the updated second search heap until a search termination condition is met, and obtain each second data identifier arranged in a set order and a number of occurrences of each second data identifier;
[0252] a determination unit configured to determine, based on the number of occurrences of each second data identifier, a target second data identifier whose number of occurrences reaches a set number threshold.
[0253] In one embodiment of the present disclosure, the update unit, when used for updating the second data identifier pointed to by the second pointer in the parent node, updating the second search heap based on the sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes, and obtaining the updated second search heap, is configured to:
[0254] update the second data identifier pointed to by the second pointer in the parent node to a next second data identifier of the output second data identifier in the corresponding sub-inverted list;
[0255] determine a second target node corresponding to a largest or smallest second data identifier among the second data identifiers pointed to by the second pointers in the plurality of second nodes;
[0256] exchange the second pointer in the second target node and the second pointer in the current parent node to obtain the updated second search heap.
[0257] In one embodiment of the present disclosure, the second pointer points to a serial number of the currently searched second data identifier in the corresponding sub-inverted list.
[0258] updating the second search heap based on sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes, obtaining an updated second search heap, and when the updated second search heap is obtained, the updating unit is configured to:
[0259] incrementing a sequence number of the child inverted list pointed to by the second pointer in the parent node by 1, so that the second pointer in the parent node points to a next sequence number of the corresponding child inverted list;
[0260] determining a second target node corresponding to a largest or smallest second data identifier among the second data identifiers corresponding to the respective sequence numbers of the child inverted lists pointed to by the second pointers in the plurality of second nodes;
[0261] swapping the second pointer in the second target node and the second pointer in the current parent node, to obtain the updated second search heap.
[0262] In an embodiment of the present disclosure, the search termination condition comprises that the updated search heap is empty, and / or the search duration reaches a preset duration.
[0263] In an embodiment of the present disclosure, the apparatus further comprises a storage module configured to perform any of the following:
[0264] For any target first data identifier, when the number of the second data identifiers corresponding to the target first data identifier in different inverted lists is greater than a set number threshold, the second data identifiers corresponding to the target first data identifier are stored in a bitmap form.
[0265] When the number of the second data identifiers corresponding to the target first data identifier in different inverted lists includes both a case greater than the set number threshold and a case not greater than the set number threshold, the second data identifiers in the inverted list not greater than the set number threshold are stored in an array form, and the second data identifiers in the inverted list greater than the set number threshold are stored in a bitmap form.
[0266] In an embodiment of the present disclosure, the second search module 903, when used to search the second data identifiers corresponding to the target first data identifier and obtain the target second data identifier with a number of occurrences reaching a set number threshold, comprises an output sub-module, a creation sub-module, an initialization sub-module, a traversal sub-module and a determination sub-module:
[0267] The output sub-module is configured to, when the number of the second data identifiers corresponding to the target first data identifier in different inverted lists includes both a case greater than the set number threshold and a case not greater than the set number threshold, output the second data identifiers in the inverted list greater than the set number threshold stored in a bitmap form, and convert the second data identifiers stored in an array form into a partial bitmap form and output.
[0268] an output submodule, configured to, in a case where a quantity of second data identifiers corresponding to the target first data identifier in different inverted lists is greater than a set quantity threshold, output the second data identifiers corresponding to the target first data identifier in a bitmap form;
[0269] a creation submodule, configured to, for any target first data identifier, create an array required for a length to conform to a set frequency threshold, the array being used to record a frequency of occurrence of each second data identifier;
[0270] an initialization submodule, configured to initialize the frequency of occurrence of each second data identifier recorded by the array as a complement of the set frequency threshold;
[0271] a traversal submodule, configured to traverse the second data identifiers corresponding to the target first data identifier, and generate a result bitmap based on the frequency of occurrence of each second data identifier obtained through the traversal, the result bitmap being used to indicate whether the frequency of occurrence of each data identifier reaches the set frequency threshold;
[0272] a determination submodule, configured to determine the target second data identifier whose frequency of occurrence reaches the set frequency threshold based on the result bitmap.
[0273] In an embodiment of the present disclosure, the traversal submodule, when used to traverse the second data identifiers corresponding to the target first data identifier and generate the result bitmap based on the frequency of occurrence of each second data identifier obtained through the traversal, is configured to:
[0274] traverse the second data identifiers corresponding to the target first data identifier to obtain the frequency of occurrence of each second data identifier;
[0275] for any second data identifier, update the frequency of occurrence of the second data identifier recorded in the array based on the frequency of occurrence of the second data identifier, to obtain an overflow bit corresponding to the second data identifier;
[0276] determine the result bitmap based on the overflow bit corresponding to each second data identifier.
[0277] In an embodiment of the present disclosure, the determination submodule, when used to determine the target second data identifier whose frequency of occurrence reaches the set frequency threshold based on the result bitmap, is configured to:
[0278] determine, as the target second data identifier whose frequency of occurrence reaches the set frequency threshold, the second data identifier corresponding to a bit being 1 in the result bitmap.
[0279] In one embodiment of the present disclosure, for any inverted list corresponding to any target search word, at least one container is included in the inverted list, and the container is used to store the second data identifier of the multimedia data corresponding to the target search word. The second data identifiers stored in the same container correspond to the same first data identifier, and different containers correspond to different first data identifiers.
[0280] In one embodiment of the present disclosure, the first data identifier is composed of the high-order part of the data identifier, and the second data identifier is composed of the low-order part of the data identifier.
[0281] In one embodiment of the present disclosure, the apparatus further comprises:
[0282] The third obtaining module is configured to obtain a search statement corresponding to a search operation of a user in response to the search operation of the user.
[0283] The determining module is configured to determine a plurality of target search words based on the search statement.
[0284] It should be noted that although several modules / sub-modules / units of the apparatus are mentioned in the foregoing detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules / sub-modules / units described above can be embodied in one module / sub-module / unit. Conversely, the features and functions of one module / sub-module / unit described above can be further divided into a plurality of modules / sub-modules / units.
[0285] The present disclosure also provides a computer readable storage medium. Figure 10 is a schematic diagram of a computer readable storage medium according to an exemplary embodiment of the present disclosure, as Figure 10 shown, the storage medium stores a computer program 1001, and the computer program 1001 can execute the data processing method provided by any embodiment of the present disclosure when executed by a processor.
[0286] The present disclosure also provides a computing device, which can include a memory for storing computer instructions executable on a processor, and the processor for implementing the data processing method provided by any embodiment of the present disclosure when executing the computer instructions. Referring to Figure 11 , Figure 11 is a structural schematic diagram of a computing device according to an exemplary embodiment of the present disclosure, which can include but is not limited to a processor 1110, a memory 1120, and a bus 1130 connecting different system components including the memory 1120 and the processor 1110.
[0287] The memory 1120 stores computer instructions that can be executed by the processor 1110, so that the processor 1110 can perform the data processing method provided by any embodiment of the present disclosure. The memory 1120 can include a random access memory unit RAM 1121, a cache memory unit 1122, and / or a read-only memory unit ROM 1123. The memory 1120 can also include a program tool 1125 having a set of program modules 1124, which include but are not limited to an operating system, one or more application programs, other program modules, and program data, which can include one or more combinations of network environment implementations.
[0288] The bus 1130 can include, for example, a data bus, an address bus, and a control bus, etc. The computing device 1100 can also communicate with an external device 1150, which can be, for example, a keyboard, a Bluetooth device, etc., through an I / O interface 1140. The computing device 1100 can also communicate with one or more networks, such as a local area network, a wide area network, a public network, etc., through a network adapter 1160. As shown, the network adapter 1160 can also communicate with other modules of the computing device 1100 through the bus 1130. Figure 11
[0289] The embodiments of the present disclosure also provide a computer program product including a computer program, which can implement the data processing method provided by any embodiment of the present disclosure when executed by the processor 1110 of the computing device 1100.
[0290] In addition, although the operations of the method of the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in that specific order, or that all of the shown operations must be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, combined into a single step, and / or divided into multiple steps.
[0291] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not mean that the features in these aspects cannot be combined to benefit. Such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Obtaining a plurality of postings links corresponding to a plurality of target search terms, wherein the postings links include data identifiers of multimedia data corresponding to the target search terms, the data identifiers including a first data identifier and a second data identifier, wherein the first data identifier is composed of a high-order portion of the data identifier, and the second data identifier is composed of a low-order portion of the data identifier; Searching the plurality of first data identifiers included in the plurality of postings links to obtain a target first data identifier whose number of appearances reaches a set number threshold; Searching for the second data identifier corresponding to the target first data identifier to obtain the target second data identifier whose occurrence times reaches a set threshold; Target multimedia data is acquired based on the target second data identifier and the corresponding target first data identifier.
2. The method according to claim 1, characterized in that The searching of the plurality of first data identifiers included in the plurality of postings links to obtain a target first data identifier whose number of appearances reaches a set number threshold includes: constructing a first search heap based on the multiple postings lists, wherein a first node in the first search heap is used to store a first pointer, the first pointer pointing to a first data identifier currently retrieved in the corresponding postings list; A search is performed based on the first search stack to obtain the target first data identifier.
3. The method according to claim 2, characterized in that For any postings link, when storing data identifiers, the postings link stores the first data identifiers in a set order; The step of constructing a first search heap based on the multiple postings lists includes: A maximum heap or a minimum heap is constructed according to the size order of the first first data identifiers in each postings list, and the constructed heap is used as the first search heap.
4. The method according to claim 2, characterized in that The searching based on the first search heap to obtain the target first data identifier includes: Traversing a plurality of first nodes included in the first search heap, outputting a first data identifier pointed to by a first pointer in a parent node of the plurality of first nodes, and recording a number of occurrences of the outputted first data identifier; updating the first data identifier pointed to by the first pointer in the parent node, and updating the first search heap based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes to obtain an updated first search heap; Continuing to search based on the updated first search heap until a search cutoff condition is met, thereby obtaining each first data identifier arranged in a set order and the number of occurrences of each first data identifier; Based on the number of occurrences of the respective first data identifiers, the target first data identifier whose number of occurrences reaches a set number threshold is determined.
5. The method according to claim 4, characterized in that The updating of the first data identifier pointed to by the first pointer in the parent node, and updating the first search heap based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes to obtain an updated first search heap, includes: Update the first data identifier pointed to by the first pointer in the parent node to the first data identifier next to the output first data identifier in the corresponding postings link; Determine a first target node corresponding to the largest or smallest first data identifier among the first data identifiers pointed to by the first pointers in the plurality of first nodes; The first pointer in the first target node is exchanged with the first pointer in the current parent node to obtain an updated first search heap.
6. The method according to claim 4, characterized in that The first pointer points to the sequence number of the first data identifier currently retrieved in the corresponding postings list; The updating of the first data identifier pointed to by the first pointer in the parent node, and updating the first search heap based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes to obtain an updated first search heap, includes: Increment the postings index pointed to by the first pointer in the parent node by 1, so that the first pointer in the parent node points to the next index in the corresponding postings index. Determine that the first pointers in the plurality of first nodes point to the target node corresponding to the largest or smallest first data identifier among the first data identifiers corresponding to the corresponding sequence numbers in the postings link; The first pointer in the target node is exchanged with the first pointer in the current parent node to obtain an updated first search heap.
7. The method according to claim 4, characterized in that The method further comprises: When all first data identifiers included in the postings list corresponding to any target search term have been output, an updated first search heap is constructed based on the postings lists corresponding to other target search terms.
8. The method according to claim 1, characterized in that For any postings link, when storing data identifiers, the postings link stores the second data identifier corresponding to the same first data identifier in the form of a child postings link in the postings link corresponding to the first data identifier; The searching of the second data identifier corresponding to the target first data identifier to obtain the target second data identifier whose occurrence times reaches a set threshold value includes: For any target first data identifier, if the number of second data identifiers corresponding to the target first data identifier in different postings links is not greater than a set threshold, a heap structure is constructed based on the second data identifier corresponding to the target first data identifier to obtain a second search heap, wherein the second node in the second search heap is used to store a second pointer, and the second pointer points to the second data identifier currently retrieved in the corresponding child postings link; A search is performed based on the second search stack to obtain the target second data identifier.
9. The method according to claim 8, characterized in that The step of constructing a heap structure based on the second data identifier corresponding to the target first data identifier to obtain a second search heap includes: Based on the size of the first second data identifier in the child postings chain corresponding to the target first data identifier, a maximum heap or a minimum heap is constructed, and the constructed heap is used as the second search heap.
10. The method according to claim 8, characterized in that The performing a search based on the second search stack to obtain the target second data identifier includes: For any second search heap, traverse the plurality of second nodes included in the second search heap, output the second data identifier pointed to by the second pointer in the parent node of the plurality of second nodes, and record the number of occurrences of the output second data identifier; updating the second data identifier pointed to by the second pointer in the parent node, and updating the second search heap based on the sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes to obtain an updated second search heap; Continue searching in the updated second search stack until a search cutoff condition is met, and obtain the second data identifiers arranged in a set order and the number of occurrences of the second data identifiers; Based on the number of occurrences of the respective second data identifiers, the target second data identifier whose number of occurrences reaches a set number threshold is determined.
11. The method according to claim 10, characterized in that The updating of the second data identifier pointed to by the second pointer in the parent node, and updating the second search heap based on the sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes to obtain an updated second search heap, includes: Update the second data identifier pointed to by the second pointer in the parent node to the second data identifier next to the output second data identifier in the corresponding child postings link; Determine a second target node corresponding to the largest or smallest second data identifier among the second data identifiers pointed to by the second pointers in the plurality of second nodes; The second pointer in the second target node is exchanged with the second pointer in the current parent node to obtain an updated second search heap.
12. The method according to claim 10, characterized in that The second pointer points to the sequence number of the second data identifier currently retrieved in the corresponding child postings list; The updating of the second data identifier pointed to by the second pointer in the parent node, and updating the second search heap based on the sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes to obtain an updated second search heap, includes: Increment the sequence number of the child postings link pointed to by the second pointer in the parent node by 1, so that the second pointer in the parent node points to the next sequence number in the corresponding child postings link; Determine that the second pointers in the plurality of second nodes point to the second target node corresponding to the largest or smallest second data identifier among the second data identifiers corresponding to the corresponding sequence numbers in the child postings chain; The second pointer in the second target node is exchanged with the second pointer in the current parent node to obtain an updated second search heap.
13. The method according to claim 4 or 10, characterized in that The retrieval deadline condition includes that the updated retrieval stack is empty, and / or that the retrieval duration reaches a preset duration.
14. The method according to claim 1, wherein The method further comprises any of the following: For any target first data identifier, if the number of second data identifiers corresponding to the target first data identifier in different postings chains is greater than a set number threshold, the second data identifiers corresponding to the target first data identifier are stored in bitmap form; If the number of second data identifiers corresponding to the target first data identifier in each postings list is both greater than a set threshold and less than the set threshold, the second data identifiers in the postings list whose number is less than the set threshold are stored in array form, and the second data identifiers in the postings list whose number is greater than the set threshold are stored in bitmap form.
15. The method according to claim 14, characterized in that The searching of the second data identifier corresponding to the target first data identifier to obtain the target second data identifier whose occurrence times reaches a set threshold value includes: If the number of second data identifiers corresponding to the target first data identifier in each postings list is both greater than a set threshold and less than a set threshold, the second data identifiers in the postings list that are greater than the set threshold are stored in bitmap form and output, and the second data identifiers stored in array form are converted into a partial bitmap form and output; If the number of second data identifiers corresponding to the target first data identifier in different postings chains is greater than a set threshold, the second data identifiers corresponding to the target first data identifier are stored and output in bitmap format; For any target first data identifier, create an array whose length meets the set number threshold, and the array is used to record the number of occurrences of each second data identifier; Initializing the number of occurrences of each second data identifier recorded in the array to the complement of the set number threshold; Traversing the second data identifiers corresponding to the target first data identifier, and generating a result bitmap based on the number of occurrences of each second data identifier obtained through the traversal, wherein the result bitmap is used to indicate whether the number of occurrences of each data identifier reaches a set number threshold; Based on the result bitmap, the target second data identifier whose occurrence number reaches a set number threshold is determined.
16. The method according to claim 15, characterized in that The traversing the second data identifiers corresponding to the target first data identifier and generating a result bitmap based on the number of occurrences of each second data identifier obtained through the traversal includes: Traversing the second data identifiers corresponding to the target first data identifier to obtain the number of occurrences of each second data identifier; For any second data identifier, based on the number of occurrences of the second data identifier, updating the number of occurrences of the second data identifier recorded in the array to obtain an overflow bit corresponding to the second data identifier; The result bitmap is determined based on the overflow bits corresponding to the respective second data identifiers.
17. The method according to claim 15, characterized in that The determining, based on the result bitmap, the target second data identifier whose occurrence number reaches a set number threshold, includes: The second data identifier whose corresponding bitmap in the result bitmap is 1 is determined as the target second data identifier whose occurrence number reaches the set number threshold.
18. The method according to claim 1, wherein For any postings link corresponding to any target search term, the postings link includes at least one container, which is used to store the second data identifier of the multimedia data corresponding to the target search term. The second data identifiers stored in the same container correspond to the same first data identifier, and different containers correspond to different first data identifiers.
19. The method according to claim 1, wherein Before obtaining a plurality of postings links corresponding to a plurality of target search terms, the method further includes: In response to a search operation by a user, obtaining a search statement corresponding to the search operation; Based on the search sentence, the plurality of target search terms are determined.
20. A data processing device, characterized in that: The device comprises: A first acquisition module is configured to acquire a plurality of postings links corresponding to a plurality of target search terms, wherein the postings links include data identifiers of multimedia data corresponding to the target search terms, the data identifiers including a first data identifier and a second data identifier, wherein the first data identifier is composed of a high-order portion of the data identifier, and the second data identifier is composed of a low-order portion of the data identifier; A first search module is configured to search the plurality of first data identifiers included in the plurality of postings links to obtain a target first data identifier whose number of appearances reaches a set number threshold; A second search module is used to search for the second data identifier corresponding to the target first data identifier to obtain the target second data identifier whose number of occurrences reaches a set number threshold; The second acquisition module is configured to acquire target multimedia data based on the target second data identifier and the corresponding target first data identifier.
21. The device according to claim 20, characterized in that The first search module, when used to search the plurality of first data identifiers included in the plurality of postings links to obtain a target first data identifier whose number of occurrences reaches a set number threshold, includes a construction submodule and a search submodule; The construction submodule is configured to construct a first search heap based on the multiple postings lists, wherein a first node in the first search heap is configured to store a first pointer, the first pointer pointing to a first data identifier currently retrieved in the corresponding postings list; The retrieval submodule performs a search based on the first retrieval stack to obtain the target first data identifier.
22. The device according to claim 21, characterized in that For any postings link, when storing data identifiers, the postings link stores the first data identifiers in a set order; The construction submodule, when used to construct a first search heap based on the multiple postings lists, is configured to: A maximum heap or a minimum heap is constructed according to the size order of the first first data identifiers in each postings list, and the constructed heap is used as the first search heap.
23. The device according to claim 21, characterized in that The retrieval submodule, when used to perform retrieval based on the first retrieval stack to obtain the target first data identifier, includes a traversal unit, an update unit, a retrieval unit, and a determination unit; a traversal unit, configured to traverse the plurality of first nodes included in the first search heap, output the first data identifiers pointed to by the first pointers in the parent nodes of the plurality of first nodes, and record the number of occurrences of the outputted first data identifiers; an updating unit, configured to update the first data identifier pointed to by the first pointer in the parent node, and update the first search heap based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes to obtain an updated first search heap; a retrieval unit, configured to continue searching based on the updated first search stack until a search cutoff condition is satisfied, and obtain the first data identifiers arranged in a set order and the number of occurrences of the first data identifiers; The determining unit is configured to determine, based on the number of occurrences of the respective first data identifiers, the target first data identifier whose number of occurrences reaches a set number threshold.
24. The device according to claim 23, characterized in that The updating unit, when used to update the first data identifier pointed to by the first pointer in the parent node, updates the first search heap based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes to obtain an updated first search heap, is used to: Update the first data identifier pointed to by the first pointer in the parent node to the first data identifier next to the output first data identifier in the corresponding postings link; Determine a first target node corresponding to the largest or smallest first data identifier among the first data identifiers pointed to by the first pointers in the plurality of first nodes; The first pointer in the first target node is exchanged with the first pointer in the current parent node to obtain an updated first search heap.
25. The device according to claim 23, characterized in that The first pointer points to the sequence number of the first data identifier currently retrieved in the corresponding postings list; The updating unit, when used to update the first data identifier pointed to by the first pointer in the parent node, updates the first search heap based on the sizes of the first data identifiers pointed to by the first pointers in the plurality of first nodes to obtain an updated first search heap, is used to: Increment the postings index pointed to by the first pointer in the parent node by 1, so that the first pointer in the parent node points to the next index in the corresponding postings index. Determine that the first pointers in the plurality of first nodes point to the target node corresponding to the largest or smallest first data identifier among the first data identifiers corresponding to the corresponding sequence numbers in the postings link; The first pointer in the target node is exchanged with the first pointer in the current parent node to obtain an updated first search heap.
26. The device according to claim 23, characterized in that The construction submodule is further configured to construct an updated first search heap based on postings links corresponding to other target search terms when all first data identifiers included in the postings links corresponding to any target search term have been output.
27. The device according to claim 20, characterized in that For any postings link, when storing data identifiers, the postings link stores the second data identifier corresponding to the same first data identifier in the form of a child postings link in the postings link corresponding to the first data identifier; The second retrieval module, when used to retrieve the second data identifier corresponding to the target first data identifier and obtain the target second data identifier whose number of occurrences reaches a set number threshold, includes a construction submodule and a retrieval submodule; The construction submodule is configured to, for any target first data identifier, construct a heap structure based on the second data identifier corresponding to the target first data identifier when the number of second data identifiers corresponding to the target first data identifier in different postings links is not greater than a set threshold, thereby obtaining a second search heap, wherein the second node in the second search heap is configured to store a second pointer, the second pointer pointing to the second data identifier currently retrieved in the corresponding child postings link; The retrieval submodule is configured to perform a search based on the second retrieval stack to obtain the target second data identifier.
28. The device according to claim 27, characterized in that The construction submodule, when used to construct a heap structure based on the second data identifier corresponding to the target first data identifier to obtain a second search heap, is used to: Based on the size of the first second data identifier in the child postings chain corresponding to the target first data identifier, a maximum heap or a minimum heap is constructed, and the constructed heap is used as the second search heap.
29. The device according to claim 27, characterized in that The retrieval submodule, when used to perform a search based on the second retrieval stack to obtain the target second data identifier, includes: a traversal unit, configured to traverse, for any second search heap, a plurality of second nodes included in the second search heap, output a second data identifier pointed to by a second pointer in a parent node of the plurality of second nodes, and record a number of occurrences of the output second data identifier; an updating unit, configured to update the second data identifier pointed to by the second pointer in the parent node, and update the second search heap based on the sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes to obtain an updated second search heap; A retrieval unit, configured to continue searching in the updated second search stack until a search cutoff condition is satisfied, and obtain the second data identifiers arranged in a set order and the number of occurrences of the second data identifiers; The determining unit is configured to determine, based on the number of occurrences of the respective second data identifiers, the target second data identifier whose number of occurrences reaches a set number threshold.
30. The device according to claim 29, characterized in that The updating unit, when updating the second data identifier pointed to by the second pointer in the parent node, updates the second search heap based on the sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes to obtain an updated second search heap, is configured to: Update the second data identifier pointed to by the second pointer in the parent node to the second data identifier next to the output second data identifier in the corresponding child postings link; Determine a second target node corresponding to the largest or smallest second data identifier among the second data identifiers pointed to by the second pointers in the plurality of second nodes; The second pointer in the second target node is exchanged with the second pointer in the current parent node to obtain an updated second search heap.
31. The device according to claim 29, characterized in that The second pointer points to the sequence number of the second data identifier currently retrieved in the corresponding child postings list; The updating unit, when updating the second data identifier pointed to by the second pointer in the parent node, updates the second search heap based on the sizes of the second data identifiers pointed to by the second pointers in the plurality of second nodes to obtain an updated second search heap, is configured to: Increment the sequence number of the child postings link pointed to by the second pointer in the parent node by 1, so that the second pointer in the parent node points to the next sequence number in the corresponding child postings link; Determine that the second pointers in the plurality of second nodes point to the second target node corresponding to the largest or smallest second data identifier among the second data identifiers corresponding to the corresponding sequence numbers in the child postings chain; The second pointer in the second target node is exchanged with the second pointer in the current parent node to obtain an updated second search heap.
32. The device according to claim 23 or 29, characterized in that The retrieval deadline condition includes that the updated retrieval stack is empty, and / or that the retrieval duration reaches a preset duration.
33. The device according to claim 20, characterized in that The device further includes a storage module, wherein the storage module is configured to: For any target first data identifier, if the number of second data identifiers corresponding to the target first data identifier in different postings chains is greater than a set number threshold, the second data identifiers corresponding to the target first data identifier are stored in bitmap form; If the number of second data identifiers corresponding to the target first data identifier in each postings list is both greater than a set threshold and less than the set threshold, the second data identifiers in the postings list whose number is less than the set threshold are stored in array form, and the second data identifiers in the postings list whose number is greater than the set threshold are stored in bitmap form.
34. The device according to claim 33, characterized in that The second retrieval module, when used to retrieve the second data identifier corresponding to the target first data identifier and obtain the target second data identifier whose number of occurrences reaches a set number threshold, includes an output submodule, a creation submodule, an initialization submodule, a traversal submodule, and a determination submodule: The output submodule is configured to, when the number of second data identifiers corresponding to the target first data identifier in each postings list is both greater than a set threshold and less than the set threshold, output the second data identifiers in the postings list that are greater than the set threshold and stored in bitmap form, and convert the second data identifiers stored in array form into a partial bitmap form and output the converted form. The output submodule is configured to, when the number of second data identifiers corresponding to the target first data identifier in different postings links is greater than a set number threshold, store the second data identifiers corresponding to the target first data identifier in a bitmap format and output them; The creation submodule is used to create, for any target first data identifier, an array whose length meets the set number threshold, and the array is used to record the number of occurrences of each second data identifier; The initialization submodule is configured to initialize the number of occurrences of each second data identifier recorded in the array to the complement of the set number threshold; The traversal submodule is used to traverse the second data identifiers corresponding to the target first data identifier, and generate a result bitmap based on the number of occurrences of each second data identifier obtained through the traversal, wherein the result bitmap is used to indicate whether the number of occurrences of each data identifier reaches a set number threshold; The determining submodule is configured to determine, based on the result bitmap, the target second data identifier whose occurrence times reaches a set threshold.
35. The device according to claim 34, characterized in that The traversal submodule, when used to traverse the second data identifiers corresponding to the target first data identifier and generate a result bitmap based on the number of occurrences of each second data identifier obtained through the traversal, is used to: Traversing the second data identifiers corresponding to the target first data identifier to obtain the number of occurrences of each second data identifier; For any second data identifier, based on the number of occurrences of the second data identifier, updating the number of occurrences of the second data identifier recorded in the array to obtain an overflow bit corresponding to the second data identifier; The result bitmap is determined based on the overflow bits corresponding to the respective second data identifiers.
36. The device according to claim 34, characterized in that The determining submodule, when used to determine the target second data identifier whose number of occurrences reaches a set number threshold based on the result bitmap, is used to: The second data identifier whose corresponding bitmap in the result bitmap is 1 is determined as the target second data identifier whose occurrence number reaches the set number threshold.
37. The device according to claim 20, characterized in that For any postings link corresponding to any target search term, the postings link includes at least one container, which is used to store the second data identifier of the multimedia data corresponding to the target search term. The second data identifiers stored in the same container correspond to the same first data identifier, and different containers correspond to different first data identifiers.
38. The device according to claim 20, characterized in that The device further comprises: A third acquisition module is used to respond to a user's search operation and obtain a search statement corresponding to the search operation; A determination module is used to determine the multiple target search terms based on the search statement.
39. A computing device, characterized in that The computing device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the operations performed by the data processing method according to any one of claims 1 to 19 when executing the program.
40. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program, and the processor uses the program to execute the operations performed by the data processing method according to any one of claims 1 to 19.
Citation Information
Patent Citations
deep network POI data acquisition method and system based on search words and a spatial range
CN109657131A