Retrieval method and device
The retrieval method addresses limitations of single-round operations by enabling adaptive single-round and multi-round searches, enhancing efficiency and accuracy through dynamic feedback-based operations and storage mechanisms.
Patent Information
- Application Number
- CN202411748188.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing data retrieval methods are limited to single-round operations and a single use scenario, failing to meet diverse user needs and adapt to various retrieval scenarios, leading to inefficiencies and inaccuracies.
Implementing a retrieval method that allows for both single-round and multi-round search operations based on feedback duration, utilizing a storage pool for results, and employing multi-level search and scoring mechanisms to enhance matching and accuracy.
Improves retrieval efficiency and accuracy by dynamically adapting to user needs, ensuring timely and comprehensive retrieval results.
Smart Images

Figure CN119226581A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a retrieval method and device. Background Art
[0002] Data retrieval is mainly used to find and extract information required by users from databases or data sets. In related technologies, most of them perform a single round of retrieval operations and store the retrieval results in the database for subsequent retrieval at any time. The above method has the technical problems of a single retrieval method and a single use scenario of the retrieval results, which cannot meet the diverse retrieval needs of users and cannot be applied to a variety of retrieval scenarios.
[0003] Therefore, a new technical solution is urgently needed to solve the above technical problems. Summary of the invention
[0004] According to an embodiment of the present application, a retrieval method and device are provided, which can execute corresponding single-round retrieval operations or multiple-round retrieval operations according to the target retrieval content and the target retrieval result feedback duration, so as to improve the matching of the retrieval process with the actual needs of the user, and improve the retrieval efficiency and retrieval accuracy.
[0005] In a first aspect of the present application, a retrieval method is proposed, comprising: obtaining a target retrieval instruction of a target client, wherein the target retrieval instruction comprises: target retrieval content and target retrieval result feedback duration; Based on the target search instruction, a corresponding target search operation is executed to return the target search result to the target client, wherein the target search operation includes: a single-round search operation and a multi-round search operation; In some feasible implementations, when the target search result feedback duration is less than or equal to the first preset duration, the above method includes: According to the target search content, search the target search result storage pool; If the target search result storage pool contains the target search result corresponding to the target search content, returning the target search result to the target client; In the case that the target search result storage pool does not have the target search result corresponding to the target search content, a single round of search operation is performed according to the target search content to return the target search result to the target client; Write the target search results to the target search result storage pool.
[0006] In some feasible implementations, when the target search result feedback time is longer than the first preset time and shorter than the second preset time, the above method includes: According to the target search content, search the target search result storage pool; In the case that the target search result storage pool has historical search results corresponding to the target search content, multiple rounds of search operations are performed according to the historical search results to return the target search results to the target client; In the case that the target search result storage pool does not have the historical search results corresponding to the target search content, performing multiple rounds of search operations according to the target search content to return the target search results to the target client; Write target search results, and / or multiple rounds of search results to the target search result storage pool.
[0007] In some feasible implementations, the above method further includes: When the storage time of the target retrieval result and / or the multiple rounds of retrieval results in the target retrieval result storage pool is greater than a preset storage time threshold, the target retrieval result and / or the multiple rounds of retrieval results are deleted.
[0008] In some feasible implementations, the search content input by the second search operation corresponds to the search results generated by the first search operation, wherein the occurrence timing of the first search operation and the second search operation are adjacent, and the occurrence timing of the first search operation is earlier than the occurrence timing of the second search operation.
[0009] In some feasible implementations, the above method further includes: Determine a first word segmentation result according to the first search result; Determine a second word segmentation result according to the second search result; When the similarity between the first word segmentation result and the second word segmentation result is greater than a preset similarity, stopping the execution of the multiple rounds of search operations; The first search result is a search result generated by a first search operation, and the second search result is a search result generated by a second search operation.
[0010] In some feasible implementations, the above-mentioned multi-round search operation includes: a multi-level search operation, and the above-mentioned method further includes: Determine the target word segmentation result according to the target search content and target characters; According to the target word segmentation results, multi-level retrieval operations are performed to generate hierarchical target retrieval results.
[0011] In some feasible implementations, the above method further includes: Determine the score of the pre-retrieval data according to a preset scoring function; When the score of the pre-retrieval data is greater than the first preset score, determining the pre-retrieval data as the target retrieval data; Generate target retrieval results based on target retrieval data.
[0012] In some feasible implementations, the above method further includes: Determine the score of the target search result according to the score of the target search data, the target word segmentation repetition rate information corresponding to each target level in the target search data, and the weight information corresponding to the target level information; When the score of the target search result is greater than the second preset score, returning the target search result to the target client; Among them, when the round information is greater than 1, the final score of the current round of target retrieval data is the product of the score of the current round of target retrieval data and the score of the previous round of target retrieval data.
[0013] In a second aspect of the present application, a search device is provided, characterized in that it includes: An acquisition unit, configured to acquire a target search instruction of a target client, wherein the target search instruction includes: target search content and target search result feedback duration; An execution unit, configured to execute a corresponding target search operation based on the target search instruction to return a target search result to a target client, wherein the target search operation includes: a single-round search operation and a multi-round search operation; In the case where the target search result feedback duration is less than or equal to the first preset duration, the method further includes: According to the target search content, search the target search result storage pool; If the target search result corresponding to the target search content exists in the target search result storage pool, returning the target search result to the target client; In the case that the target search result storage pool does not have the target search result corresponding to the target search content, performing the single round search operation according to the target search content to return the target search result to the target client; The target search result is written to the target search result storage pool.
[0014] The retrieval method and device provided by the embodiment of the present application, wherein the method includes: obtaining a target retrieval instruction of a target client, wherein the target retrieval instruction includes: target retrieval content and target retrieval result feedback duration; based on the target retrieval instruction, executing a corresponding target retrieval operation to return the target retrieval result to the target client, wherein the target retrieval operation includes: a single-round retrieval operation and a multi-round retrieval operation. The present application can realize the execution of a corresponding single-round retrieval operation or a multi-round retrieval operation according to the target retrieval content and the target retrieval result feedback duration, so as to improve the matching of the retrieval process with the actual needs of the user, and improve the retrieval efficiency and retrieval accuracy.
[0015] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein: Figure 1 A schematic diagram of a process of a search method provided in an embodiment of the present application; Figure 2 A structural schematic diagram of a retrieval device provided in an embodiment of the present application; Figure 3 It is a schematic diagram of the structure of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0018] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0019] According to a first aspect of the embodiments of the present application, a retrieval method is proposed. Figure 1 A schematic diagram of a process of a search method 100 provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method 100 includes: Step S110, obtaining a target search instruction of a target client, wherein the target search instruction includes: target search content and target search result feedback duration.
[0020] Exemplarily, the target search content and the target search result feedback duration may be input by the user in real time through the control set by the target client. The target search result feedback duration may also be estimated and calculated based on the clock information of the current target client and the schedule information of the target client user.
[0021] Specifically, when the current clock information of the target client is 10:00 and the schedule information of the target client user is 10:15, it can be determined that the target search result feedback time is 15 minutes.
[0022] It should be noted that the above target search content may include: target search text, target search image, etc., which are not specifically limited here.
[0023] Step S120, based on the target search instruction, executing a corresponding target search operation to return a target search result to the target client, wherein the target search operation includes: a single-round search operation and a multi-round search operation.
[0024] Exemplarily, the target search result may be returned to the target client based on an HTTP response mechanism or other communication protocols. The target search result may be a single target search result or a set of a preset number of target search data. The preset number may be defined by the user according to actual needs.
[0025] Exemplarily, the above-mentioned target client may include: a web browser, a mobile application, etc.
[0026] Exemplarily, the single-round search operation is to complete the search operation once and feed back the target search result within the target search result feedback time.
[0027] Exemplarily, the above-mentioned multiple rounds of search operations are multiple searches within the above-mentioned target search result feedback time, until the above-mentioned target search result feedback time is approaching or the above-mentioned target search result that meets the preset requirements is retrieved. Among them, the above-mentioned preset requirements can be pre-set, and specifically can include: scoring requirements, accuracy requirements, search quantity requirements, etc. It should be noted that the number of searches in the above-mentioned multiple rounds of search operations is positively correlated with the above-mentioned target search result feedback time, and negatively correlated with the complexity of the above-mentioned target search content.
[0028] Specifically, when the target search instruction is parsed and it is determined that the target search result feedback time is less than or equal to the preset time, the single-round search operation can be performed to return the target search result to the target client. When the target search result feedback time is determined to be greater than the preset time, the multiple-round search operation can be performed to return the target search result to the target client. The preset time can be pre-set and is not specifically limited here.
[0029] Based on this, the retrieval method provided by the embodiment of the present application includes: obtaining the target retrieval instruction of the target client, wherein the target retrieval instruction includes: the target retrieval content and the target retrieval result feedback time; based on the target retrieval instruction, executing the corresponding target retrieval operation to return the target retrieval result to the target client, wherein the target retrieval operation includes: a single-round retrieval operation and a multi-round retrieval operation. The present application can realize the corresponding execution of a single-round retrieval operation or a multi-round retrieval operation according to the target retrieval content and the target retrieval result feedback time, which is conducive to improving the matching of the retrieval method with the target retrieval content and the target retrieval result feedback time, thereby improving the matching of the retrieval process with the actual needs of the user; when the target retrieval result feedback time is short, executing a single-round retrieval operation is conducive to improving the retrieval efficiency; when the target retrieval result feedback time is long, executing a multi-round retrieval operation is conducive to the accuracy of the retrieval results.
[0030] In some feasible implementations, when the target search result feedback duration is less than or equal to the first preset duration, the above method includes: Step S130: Search the target search result storage pool according to the target search content.
[0031] Step S140: When the target search result storage pool contains the target search result corresponding to the target search content, the target search result is returned to the target client.
[0032] Step S150: When the target search result storage pool does not contain the target search result corresponding to the target search content, a single round of search operation is performed according to the target search content to return the target search result to the target client.
[0033] Step S160: Write the target search result to the target search result storage pool.
[0034] Exemplarily, the first preset duration may be pre-set and is not specifically limited here.
[0035] Exemplarily, when it is determined according to the target retrieval instruction that the target retrieval result feedback time is less than or equal to the first preset time, the target retrieval result storage pool can be searched based on the target retrieval content based on the POST request, and the target retrieval result corresponding to the above target retrieval content can be queried in the background. When the target retrieval result corresponding to the target retrieval content exists in the target retrieval result storage pool, the corresponding Key and target retrieval result are returned to the above target client.
[0036] Exemplarily, when the target retrieval result corresponding to the target retrieval content does not exist in the target retrieval result storage pool, a single-round retrieval operation is performed based on the target retrieval content, the target retrieval result corresponding to the above target retrieval content is queried in the target database and / or the target data set, and the above target retrieval result is returned to the target client. At the same time, the above target retrieval result is cached to the above target retrieval result storage pool.
[0037] It should be noted that, when the target search content is a target search text, the target search result may include: relevant information of the article corresponding to the target search text, such as: article title information, release time information, author information, article body information, etc. The article title information may include: multi-level title information, such as: first-level title, second-level title, etc.
[0038] Based on this, the above method can be implemented to search for the target search result corresponding to the above target search content in the target search result storage pool in priority according to the above target search content when the target search result feedback time is less than or equal to the first preset time. If the target search result corresponding to the target search content exists in the target search result storage pool, the target search result in the target search result storage pool is directly returned to the target client; if the target search result corresponding to the target search content does not exist in the target search result storage pool, a single round of search operation is performed based on the target database or data set, and the target search result is returned to the target client, which is conducive to improving the response speed for the user's more urgent search needs, improving the feedback efficiency of the target search results, and thus improving the user's search experience; if the target search result corresponding to the target search content does not exist in the target search result storage pool, the target search result is written into the target search result storage pool, which is conducive to providing data support for the subsequent retrieval of the target search results, providing convenience for the user to perform a secondary search for the target search content, and improving the data retrieval efficiency.
[0039] It should be noted that the above-mentioned returning the target search result to the target client can be implemented synchronously, and the above-mentioned writing the target search result to the target search result storage pool can be implemented asynchronously to improve the response efficiency.
[0040] In some feasible implementations, when the target retrieval result feedback duration is greater than the first preset duration and less than the second preset duration, the above method includes: searching the target retrieval result storage pool according to the target retrieval content; when the target retrieval result storage pool contains historical retrieval results corresponding to the target retrieval content, performing multiple rounds of retrieval operations based on the historical retrieval results to return the target retrieval results to the target client; when the target retrieval result storage pool does not contain historical retrieval results corresponding to the target retrieval content, performing multiple rounds of retrieval operations based on the target retrieval content to return the target retrieval results to the target client; writing the target retrieval result, and / or multiple rounds of retrieval results to the target retrieval result storage pool.
[0041] Exemplarily, the second preset duration may be pre-set and is not specifically limited here.
[0042] By way of example, the following description will be made using the target search content as "quantum entanglement". When, according to the target search instruction, it is determined that the target search result feedback time is greater than the first preset time and less than the second preset time, the target search result storage pool is searched according to "quantum entanglement". When there are historical search results corresponding to "quantum entanglement" in the target search result storage pool, the above historical search results are used as the target search content, and multiple rounds of search operations are performed to return the target search results to the target client.
[0043] Exemplarily, when there are no historical retrieval results corresponding to "quantum entanglement" in the target retrieval result storage pool, multiple rounds of retrieval operations are performed directly based on "quantum entanglement" to return the target retrieval result and the Key corresponding to the target retrieval result to the target client, and the final target retrieval result and the Key corresponding to the target retrieval result, and / or, multiple rounds of retrieval results and the Key corresponding to the multiple rounds of retrieval results are cached in the above-mentioned target retrieval result storage pool.
[0044] Specifically, in the process of performing multiple rounds of search operations, a corresponding lincenseKey may be generated in each round of search, and the lincenseKey and the search results corresponding to the lincenseKey may be cached in the target search result storage pool.
[0045] It should be noted that the remaining search time can be determined based on the target search result feedback time. When the remaining search time is less than the average time of multiple completed search operations, the current search result is returned to the target client as the target search result.
[0046] Based on this, the above method can be implemented in the case where the target retrieval result feedback time is greater than the first preset time and less than the second preset time, and the historical retrieval results corresponding to the above target retrieval content are searched in the target retrieval result storage pool in priority according to the above target retrieval content. When the target retrieval result storage pool has the historical retrieval results corresponding to the target retrieval content, the historical retrieval results are used as the target retrieval content to perform multiple rounds of retrieval operations to return the target retrieval results to the target retrieval client; when the target retrieval result storage pool does not have the historical retrieval results corresponding to the target retrieval content, multiple rounds of retrieval operations are directly performed according to the above target retrieval content to return the target retrieval results to the target client, which is beneficial to improve the accuracy of the target retrieval results when the target retrieval result feedback time is long and the user's retrieval demand is less urgent. When the target retrieval result storage pool does not have the historical retrieval results corresponding to the target retrieval content, the target retrieval results and / or multiple rounds of retrieval results are written into the target retrieval result storage pool, which is beneficial to provide data support for the subsequent retrieval of the target retrieval results, provide convenience for the user to perform a secondary search for the target retrieval content, and improve the data retrieval efficiency.
[0047] It should be noted that the above-mentioned returning the target search results to the target client can be implemented synchronously, and the above-mentioned writing of the target search results, and / or multiple rounds of search results to the target search result storage pool can be implemented asynchronously to improve response efficiency.
[0048] In some feasible implementations, the above method also includes: when the storage time of the target retrieval result and / or the multiple-round retrieval result in the target retrieval result storage pool is greater than a preset storage time threshold, deleting the target retrieval result and / or the multiple-round retrieval result.
[0049] Exemplarily, the preset storage time threshold may be pre-set. Specifically, the preset storage time threshold may be 30 minutes.
[0050] In some feasible implementations, after writing the above-mentioned target retrieval results, and / or multiple-round retrieval results, into the target retrieval result storage pool, the timestamp information of writing the above-mentioned target retrieval results, and / or multiple-round retrieval results into the target retrieval result storage pool is also correspondingly written into the above-mentioned target retrieval result storage pool. When it is determined that the storage time of the above-mentioned target retrieval results, and / or multiple-round retrieval results, is greater than 30 minutes based on the clock information of the above-mentioned target client and the above-mentioned timestamp information, a deletion operation is performed on the above-mentioned target retrieval results, and / or multiple-round retrieval results.
[0051] Based on this, the above method can realize automatic cleaning of target retrieval results and / or multiple rounds of retrieval results when the storage time of the target retrieval results and / or multiple rounds of retrieval results in the target retrieval result storage pool is greater than the preset storage time threshold, so as to release the available space of the target retrieval result storage pool, provide available space for writing the target retrieval results corresponding to the subsequently performed retrieval operations, and improve the throughput efficiency and data retrieval efficiency of the target retrieval result storage pool.
[0052] In some feasible implementations, the search content input by the second search operation corresponds to the search results generated by the first search operation, wherein the occurrence timing of the first search operation and the second search operation are adjacent, and the occurrence timing of the first search operation is earlier than the occurrence timing of the second search operation.
[0053] Exemplarily, during the process of performing multiple rounds of search operations, if there are historical search results corresponding to the target search content in the target search result storage pool, then during the first search in the multiple rounds of search operations, the historical search results are used as the first round of target search content, and the first round of search operations are performed to generate the first round of target search results, and the first round of search results are written into the target search result storage pool. The second round of search uses the first round of target search results as the second round of target search content, performs the second round of search operations, and writes the second round of search results into the target search result storage pool until the target search result feedback time is approaching or the target search result that meets the preset requirements is retrieved.
[0054] Exemplarily, when there is no historical search result corresponding to the target search content in the target search result storage pool, in the first search process of the multiple rounds of search operations, the target search content is used as the first round of target search content, and the first round of search operations are performed to generate the first round of target search results, and the first round of search results are written into the target search result storage pool. The second round of search uses the first round of target search results as the second round of target search content, performs the second round of search operations, and writes the second round of search results into the target search result storage pool until the target search result feedback time is approaching or the target search result that meets the preset requirements is retrieved.
[0055] Based on this, the above method uses the search results generated by the first search operation as the search content corresponding to the second search operation, which is conducive to implementing iterative search based on the search results generated by multiple search operations, which is conducive to improving the accuracy and extension of the target search content, and is conducive to improving the value of the target search results.
[0056] In some feasible implementations, the above method also includes: determining a first word segmentation result based on the first search result; determining a second word segmentation result based on the second search result; and stopping executing multiple rounds of search operations when the similarity between the first word segmentation result and the second word segmentation result is greater than a preset similarity; wherein the first search result is the search result generated by the first search operation, and the second search result is the search result generated by the second search operation.
[0057] It should be noted that the first search result and the second search result may be a single search result or a set of a preset number of search data, which is not specifically limited here.
[0058] Exemplarily, the preset similarity can be determined according to the user's accuracy requirement for the target search result, and the preset similarity is positively correlated with the accuracy requirement, that is, the higher the user's accuracy requirement for the target search result, the higher the preset similarity. Specifically, the preset similarity can be set to 85%.
[0059] Exemplarily, the part-of-speech information of the first search result can be identified based on a natural language processing algorithm, and a first word segmentation result can be generated based on the part-of-speech information. The part-of-speech information of the second search result can be identified based on a natural language processing algorithm, and a second word segmentation result can be generated based on the part-of-speech information. When the similarity between the first word segmentation result and the second word segmentation result is greater than 85%, the multiple rounds of search operations are stopped.
[0060] Specifically, the first word segmentation result may include: the first noun set , the first verb set , and the first adjective set .
[0061] Specifically, the second word segmentation result may include: the second noun set , the second verb set , and the second adjective set .
[0062] Specifically, the first noun set can be calculated separately Set with the second noun The first similarity , the first verb set Set with the second verb The second similarity , and the first adjective set The third similarity with the second adjective set , to determine the similarity between the first word segmentation result and the second word segmentation result.
[0063] Specifically, the first similarity can be determined according to the following formula: : (1) in, is the first similarity, is the first noun set, For the second noun set.
[0064] Specifically, the second similarity can be determined according to the following formula: : (2) in, is the second similarity, is the first verb set, For the second verb set.
[0065] Specifically, the third similarity can be determined according to the following formula: : (3) in, is the second similarity, is the first adjective set, For the second adjective set.
[0066] Specifically, the similarity between the first word segmentation result and the second word segmentation result can be determined according to the following formula: (4) in, is the similarity between the first segmentation result and the second segmentation result, The first similarity The corresponding first weight is The second similarity The corresponding second weight is, The third similarity The corresponding third weight, is the first similarity, is the second similarity, is the third similarity. It should be noted that the above , , In descending order.
[0067] It should be noted that different levels of word segmentation results can be generated according to the user's requirements for the accuracy of similarity determination. In the case where the user has a high requirement for the accuracy of similarity determination, the above word segmentation results can further include: adverb sets, pronoun sets, numeral sets, place name sets, institutional group sets, other proper noun sets, idiom sets, idiom sets, foreign language sets, non-morpheme sets, and / or punctuation mark sets, etc., to accurately determine the above similarity. Among them, the specific calculation process can refer to the above formula (1) to formula (4), which will not be repeated here.
[0068] Based on this, the above method can accurately determine the timing to stop executing multiple rounds of retrieval operations based on the comparison results of the similarity between the first word segmentation result and the second word segmentation result and the preset similarity, which is beneficial to improving the generation efficiency of the target retrieval results while ensuring the accuracy and scalability of the target retrieval results, avoiding the execution of redundant and invalid multiple rounds of retrieval operations that are not beneficial to improving the reliability of the target retrieval results to save computing power.
[0069] In some feasible implementations, the above-mentioned multiple rounds of search operations include: multi-level search operations, and the above-mentioned method also includes: determining the target word segmentation results based on the target search content and target characters; and performing multi-level search operations based on the target word segmentation results to generate hierarchical target search results.
[0070] Exemplarily, the multi-level search operation includes: performing multiple rounds of search operations according to the level information of the target text. Specifically, the level information of the target text may include: chapter level, paragraph level, author level, and / or title level.
[0071] Exemplarily, the target characters may include: target symbols and target linking words. The target symbols may include: "space", ";", "*", "#", ",", etc. The target linking words may include: "and", "or", "and", "or", "and", etc.
[0072] Exemplarily, when the target search content input by the user is "disease, steel and guns", a target word segmentation result is generated according to the target characters, wherein the target word segmentations include: "disease", "steel", and "guns".
[0073] In some feasible implementations, the multi-level search operation on "disease", "steel", and "guns" may be performed synchronously or asynchronously.
[0074] For example, the following will be described by performing a multi-level search operation on "steel". Specifically, a multi-level search operation such as title, author, and text field can be performed on "steel" to generate hierarchical target search results. The hierarchical target search results can be returned to the target client in the form of logical text or logical mind map, and written into the target search result storage pool.
[0075] It should be noted that the specific process of the multi-level search operation for "disease" and "guns" is the same as the multi-level search operation process for "steel", which will not be repeated here.
[0076] Based on this, the above method can accurately generate the target word segmentation results of the target search content according to the target characters, and then perform multi-level search operations on the target word segmentation results, which can accurately generate hierarchical target search results, which is conducive to improving the precision, structure and logic of the target search results, and is conducive to improving the intuitiveness of the target search results, which is conducive to helping users quickly understand and grasp the information contained in the target search results.
[0077] In some feasible implementations, the above method also includes: determining scoring information of the pre-retrieval data based on a preset scoring function; when the score of the pre-retrieval data is greater than a first preset score, determining the pre-retrieval data as target retrieval data; and generating a target retrieval result based on the target retrieval data.
[0078] Exemplarily, the preset scoring function can be determined based on the function_score mechanism of elasticsearch, wherein the preset scoring function can be written into the cache and return the corresponding lincensKey for subsequent retrieval. The preset scoring function is positively correlated with the matching degree of the user's needs.
[0079] Exemplarily, the first preset score may be pre-defined. Specifically, the score interval of the pre-retrieval data score may be greater than or equal to 0 and less than or equal to 1. The first preset score may be set to 0.5.
[0080] Specifically, when it is determined according to the preset scoring function that the score corresponding to the pre-retrieval data is greater than 0.5, the pre-retrieval data is determined to be the target retrieval data, and a target retrieval result is generated according to the target retrieval data.
[0081] Based on this, the above method can implement screening of retrieval data according to the above preset scoring function and the above first preset score to improve the accuracy of the target retrieval data used to generate the target retrieval result, thereby improving the accuracy of the target retrieval result.
[0082] In some feasible implementations, the above method also includes: determining the score of the target retrieval result based on the score of the target retrieval data, the target word repetition rate information corresponding to each target level in the target retrieval data, and the weight information corresponding to the target level information; when the score of the target retrieval result is greater than a second preset score, returning the target retrieval result to the target client; wherein, when the round information is greater than 1, the final score of the current round of target retrieval data is the product of the score of the current round of target retrieval data and the score of the previous round of target retrieval data.
[0083] Exemplarily, in the case of performing the above single-round search operation, the score of the above target search result can be determined according to the following formula: (5) in, It is used to indicate the score of the target retrieval result of a single round of retrieval operation. Used to represent target retrieval data Ratings, Used to represent target retrieval data The first limit of the interval, Used to represent target retrieval data The second limit of the interval, Used to indicate the target level. Used to indicate the target level The corresponding weight, Used to indicate the target level The repetition rate of the target word segmentation, Used to indicate the target level The first limit of the interval, Used to indicate the target level The second limit of the interval.
[0084] Exemplarily, the preset score may be set to 70%. Specifically, when performing a single round of search operation, if it is determined that the score of the target search result is greater than 70%, the target search result is returned to the target client.
[0085] It should be noted that, in the case of performing a single round of search operations, the target search data in the target search results can be displayed in descending order on the target client to give priority to displaying target search data with higher scores, thereby improving the user's browsing experience. Among them, when the score of the target search data belongs to an interval greater than or equal to 0 and less than or equal to 1, the score of the target search data is positively correlated with the matching degree of the user's needs, that is, the higher the score of the target search data, the higher the matching degree of the target search data with the user's needs.
[0086] Exemplarily, in the case of performing multiple rounds of search operations, the score of the target search data is determined according to the following formula: (6) in, It is used to indicate the final score of the target retrieval data in the current round. It is used to indicate the score of the target retrieval data in the current round. Used to indicate the score of the target retrieval data in the previous round.
[0087] It should be noted that, when the score interval of the target retrieval data is greater than or equal to 0 and less than or equal to 1, the final score of the target retrieval data is negatively correlated with the matching degree of the user needs, that is, the lower the score of the target retrieval data, the higher the matching degree of the target retrieval data with the user needs.
[0088] Based on this, when performing multiple rounds of search operations, that is, when the round information is greater than 1, the score of the target search result can be determined according to the following formula: (7) in, It is used to indicate the score of the target retrieval results of multiple rounds of retrieval operations. It is used to indicate the final score of the target retrieval data in the current round. Used to represent target retrieval data The first limit of the interval, Used to represent target retrieval data The second limit of the interval, Used to indicate the target level. Used to indicate the target level The corresponding weights, Used to indicate the target level The repetition rate of the target word segmentation, Used to indicate the target level The first limit of the interval, Used to indicate the target level The second limit of the interval.
[0089] It should be noted that, when performing multiple rounds of retrieval operations, that is, the round information is greater than 1, and the score interval of the target retrieval data is greater than or equal to 0 and less than or equal to 1, the target retrieval data in the above target retrieval results can be arranged in ascending order and displayed on the above target client to give priority to displaying the target retrieval data that has a higher degree of match with the user's actual needs, thereby improving the user's browsing experience.
[0090] Based on this, the above method can accurately determine the scores of target retrieval results corresponding to single-round retrieval operations and multi-round retrieval operations based on the scores of the target retrieval data, the target word repetition rate information corresponding to each target level in the target retrieval data, and the weight information corresponding to the target level information. When the score of the target retrieval result is greater than the second preset score, the target retrieval result is returned to the target client, which is conducive to improving the matching degree between the target retrieval result and the actual retrieval needs of the user, enhancing the reference value of the target retrieval result, and thus improving the accuracy of the retrieval.
[0091] It should be noted that, in some feasible implementations, the target search operation can be stopped according to a quantity threshold of the target search data corresponding to the target search result, wherein the quantity threshold can be set by oneself.
[0092] Exemplarily, when it is determined that the number of target search data corresponding to the target search result is greater than or equal to the above-mentioned number threshold, and the score of the target search result is greater than the above-mentioned second preset score, the target search result is returned to the target client, and the target search operation is stopped, wherein the target search data in the above-mentioned target search result needs to include: the target search data corresponding to all target word segments corresponding to the target search content. The number of target search data corresponding to the above-mentioned target search result can be determined according to the counting information of lincensKey.
[0093] It should be noted that when the number of target retrieval data corresponding to the target retrieval result is less than the above-mentioned quantity threshold, the score of the target retrieval result is less than or equal to the above-mentioned second preset score, and / or the target retrieval data in the target retrieval result does not completely contain the target retrieval data of all target word segmentations corresponding to the target retrieval content, the target retrieval operation will continue to be executed.
[0094] Based on this, the above method can ensure that the target retrieval data in the target retrieval results matches the user's actual retrieval needs while ensuring that the data volume of the target retrieval data in the target retrieval results reaches the above-mentioned quantity threshold, thereby achieving full coverage of the target retrieval results for all target word segments in the target retrieval content, thereby further improving the data availability and data integrity of the target retrieval results, and enhancing the reference value of the above-mentioned target retrieval results.
[0095] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0096] The above is an introduction to the method embodiment. The following is a further explanation of the scheme described in this application through an apparatus embodiment.
[0097] According to a second aspect of the embodiments of the present application, a retrieval device is provided. Figure 2 A structural diagram of a search device 200 provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the device 200 includes: an acquisition unit 210 and an execution unit 220 .
[0098] The acquisition unit 210 is used to acquire a target search instruction of a target client, wherein the target search instruction includes: target search content and target search result feedback duration; The execution unit 220 is used to execute the corresponding target search operation based on the target search instruction to return the target search result to the target client, wherein the target search operation includes: a single-round search operation and a multi-round search operation; In the case where the target search result feedback duration is less than or equal to the first preset duration, the method further includes: According to the target search content, search the target search result storage pool; If the target search result corresponding to the target search content exists in the target search result storage pool, returning the target search result to the target client; In the case that the target search result storage pool does not have the target search result corresponding to the target search content, performing the single-round search operation according to the target search content to return the target search result to the target client; The target search result is written to the target search result storage pool.
[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0100] Figure 3 A schematic diagram of the structure of a terminal device or server suitable for implementing an embodiment of the present application is shown.
[0101] like Figure 3 As shown, the electronic device 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 508 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the terminal device or the server are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other through the bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.
[0102] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
[0103] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the above-mentioned functions defined in the system of the present application are executed.
[0104] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0106] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0107] As another aspect, the present application further provides a storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently and not be assembled into the electronic device. The above storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application.
[0108] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.
Claims
1. A search method, characterized in that: include: Obtaining a target search instruction of a target client, wherein the target search instruction includes: target search content and target search result feedback duration; Based on the target search instruction, a corresponding target search operation is executed to return the target search result to the target client, wherein the target search operation includes: a single-round search operation and a multi-round search operation; In the case where the target search result feedback duration is less than or equal to a first preset duration, the method includes: According to the target search content, search the target search result storage pool; If the target search result corresponding to the target search content exists in the target search result storage pool, returning the target search result to the target client; In the case that the target search result storage pool does not have the target search result corresponding to the target search content, performing the single round search operation according to the target search content to return the target search result to the target client; The target search result is written to the target search result storage pool.
2. The search method according to claim 1, characterized in that: When the target search result feedback time is longer than a first preset time and shorter than a second preset time, the method includes: According to the target search content, search the target search result storage pool; In the case where the target search result storage pool contains historical search results corresponding to the target search content, performing the multiple rounds of search operations according to the historical search results to return the target search results to the target client; In the case that the target search result storage pool does not have the historical search result corresponding to the target search content, performing the multiple rounds of search operations according to the target search content to return the target search result to the target client; Write the target search result, and / or multiple rounds of search results to the target search result storage pool.
3. The search method according to claim 2, characterized in that: Also includes: When the storage time of the target retrieval result and / or the multiple rounds of retrieval results in the target retrieval result storage pool is greater than a preset storage time threshold, the target retrieval result and / or the multiple rounds of retrieval results are deleted.
4. The search method according to claim 2, characterized in that: The search content input by the second search operation corresponds to the search result generated by the first search operation, wherein the occurrence timings of the first search operation and the second search operation are adjacent, and the occurrence timing of the first search operation is earlier than the occurrence timing of the second search operation.
5. The search method according to claim 4, characterized in that: The method further comprises: Determine a first word segmentation result according to the first search result; Determine a second word segmentation result according to the second search result; When the similarity between the first word segmentation result and the second word segmentation result is greater than a preset similarity, stopping the multiple rounds of search operations; The first search result is a search result generated by the first search operation, and the second search result is a search result generated by the second search operation.
6. The search method according to any one of claims 1 to 5, characterized in that: The multi-round search operation includes: a multi-level search operation, and the method further includes: Determine a target word segmentation result according to the target search content and the target characters; According to the target word segmentation result, the multi-level search operation is performed to generate a hierarchical target search result.
7. The search method according to claim 6, further comprising: Determine the score of the pre-retrieval data according to a preset scoring function; In a case where the score of the pre-retrieval data is greater than a first preset score, determining the pre-retrieval data as target retrieval data; The target search result is generated according to the target search data.
8. The search method according to claim 7, characterized in that: Also includes: Determine the score of the target search result according to the score of the target search data, the target word segmentation repetition rate information corresponding to each target level in the target search data, and the weight information corresponding to the target level information; When the score of the target search result is greater than a second preset score, returning the target search result to the target client; Wherein, when the round information is greater than 1, the final score of the target retrieval data of the current round is the product of the score of the target retrieval data of the current round and the score of the target retrieval data of the previous round.
9. A search device, characterized in that: include: An acquisition unit, configured to acquire a target search instruction of a target client, wherein the target search instruction includes: target search content and target search result feedback duration; An execution unit, configured to execute a corresponding target search operation based on the target search instruction to return a target search result to a target client, wherein the target search operation includes: a single-round search operation and a multi-round search operation; In the case where the target search result feedback duration is less than or equal to the first preset duration, the method further includes: According to the target search content, search the target search result storage pool; If the target search result corresponding to the target search content exists in the target search result storage pool, returning the target search result to the target client; In the case that the target search result storage pool does not have the target search result corresponding to the target search content, performing the single round search operation according to the target search content to return the target search result to the target client; The target search result is written to the target search result storage pool.
Citation Information
Patent Citations
Text retrieval method and device
CN110895563A
Information retrieval method and device, equipment and storage medium
CN114880447A
Information query method and device, equipment and storage medium
CN116775977A
Method and terminal for improving RAG retrieval generation efficiency and accuracy
CN118626513A
Dynamic label retrieval method and system, and electronic device and storage medium
WO2024148837A1
