Search method, device, storage medium and computer equipment

By screening based on keyword spacing in the search method, the problem of keyword spacing being far apart in the prior art is solved, and the accuracy of search results and user experience are improved.

CN114880545BActive Publication Date: 2025-09-12HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210693376.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2025-09-12
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

When existing search methods return search results, the keywords are far apart, resulting in search results that do not meet user needs and lack accuracy and coherence.

Method used

Search for candidate objects through the keyword sequence after word segmentation and filter based on keyword spacing to ensure that the distribution of keywords in the target objects meets user needs and avoid the problem of keywords being far apart.

Benefits of technology

It improves the accuracy of search results, enhances the user search experience, ensures that the distribution of keywords in the target objects is consistent with the search content, and avoids the problem of keywords being far apart.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880545B_ABST
    Figure CN114880545B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure relate to the field of search technology, and more specifically, to search methods, devices, storage media, and computer equipment. The search method includes: in response to search content, obtaining a keyword sequence after the search content is segmented; searching for candidate objects based on the keyword sequence, each candidate object containing at least some of the keywords in the keyword sequence; and screening target objects from the candidate objects based on the spacing between the keywords contained in each candidate object. The search solution disclosed in the present disclosure can search for search results that match user needs, ensure that the distribution of keywords in the target object is consistent with the search content, and thus enhance the user's search experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of search technology, and more specifically, to a search method, apparatus, storage medium, and computer device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims, and no statement herein is admitted to be prior art by inclusion in this section.

[0003] The current search method segments the search content input by the user, and returns the object found based on the segmented keywords to the user, which has the problem of inaccurate search results. Summary of the Invention

[0004] The embodiments of the present disclosure provide a search method, apparatus, storage medium, and computer device, which can further filter objects with close distances between keywords after searching for objects based on keywords, to ensure that the search results match user needs.

[0005] According to one aspect of the present disclosure, a search method is provided, comprising: in response to search content, obtaining a keyword sequence after segmentation of the search content; searching for candidate objects based on the keyword sequence, each of the candidate objects containing at least some of the keywords in the keyword sequence; and screening target objects from the candidate objects based on the spacing between the keywords contained in each of the candidate objects.

[0006] According to one aspect of the present disclosure, a search device is provided, comprising: a search content segmentation module for obtaining a keyword sequence after segmentation of the search content in response to search content; a candidate object search module for searching candidate objects based on the keyword sequence, each candidate object containing at least some of the keywords in the keyword sequence; and a target object screening module for screening target objects from the candidate objects based on the spacing between the keywords contained in each candidate object.

[0007] According to one aspect of the present disclosure, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the search method as described in any of the above embodiments is implemented.

[0008] According to one aspect of the present disclosure, a computer device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the search method as described in any of the above embodiments by executing the executable instructions.

[0009] The search method, apparatus, storage medium and computer equipment of the embodiments of the present disclosure search for search content based on the keyword sequence after word segmentation to ensure that candidate objects can be searched and avoid search errors caused by inaccurate or incoherent search content; for candidate objects, further screening is performed based on the keyword spacing to obtain target objects with close distances between keywords, ensuring that the distribution of keywords in the target objects conforms to the search content and avoiding the problem of keywords being far apart and completely irrelevant to the search content; thus, the search solution of the present disclosure can search for search results that match user needs and improve the user search experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings, in which several embodiments of the present disclosure are shown by way of example and not limitation, wherein:

[0011] Figure 1 A schematic diagram schematically illustrates a flow chart of a search method according to an embodiment of the present disclosure;

[0012] Figure 2 A schematic diagram schematically illustrates an implementation scenario of a search method according to an embodiment of the present disclosure;

[0013] Figure 3 The following schematically illustrates a flow chart of determining target keywords according to an embodiment of the present disclosure;

[0014] Figure 4 Schematically illustrating a flow chart of determining target keywords according to yet another embodiment of the present disclosure;

[0015] Figure 5 Schematically illustrating a flow chart of determining target keywords according to yet another embodiment of the present disclosure;

[0016] Figure 6 The following schematically illustrates a flow chart of determining a starting keyword according to an embodiment of the present disclosure;

[0017] Figure 7 A schematic diagram schematically illustrates a flow chart of a search method using a search cycle according to an embodiment of the present disclosure;

[0018] Figure 8 A schematic diagram illustrating a module architecture of a search device according to an embodiment of the present disclosure is shown;

[0019] Figure 9 A schematic diagram schematically illustrates a storage medium according to an embodiment of the present disclosure;

[0020] Figure 10 The module architecture diagram of a computer device according to one embodiment of the present disclosure is schematically shown.

[0021] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts. DETAILED DESCRIPTION

[0022] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. Rather, 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.

[0023] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.

[0024] According to an embodiment of the present disclosure, a search method, apparatus, storage medium, and computer device are provided.

[0025] In this document, any number of elements in the drawings is for illustration and not for limitation, and any naming is for distinction only and does not have any limiting meaning.

[0026] The principles and spirit of the present disclosure are described in detail below with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION

[0028] In search scenarios such as song search, video search, and article search, users enter search content in the search bar of the search engine and expect the search engine to return search results that match the search content they entered.

[0029] The current search method segments the search content input by the user, and returns the objects found based on the segmented keywords to the user. However, there is a problem that the keywords of the searched objects are far apart, and the search results are not what the user needs.

[0030] Taking the song search scenario as an example, a user enters the search content "love distance and freedom" in the search bar of the search engine, hoping to obtain songs whose lyrics contain "love distance and freedom". The current search method uses a word segmenter to segment the search content to obtain the three keywords "love", "distance" and "freedom"; based on the three keywords, the corresponding songs are searched and merged to obtain songs whose lyrics contain "love", "distance" and "freedom", and then returned to the user. Since the current search method only cares about whether the three keywords are contained in the lyrics, but not the distribution of the three keywords in the lyrics, there is a problem that in the songs returned to the user, "love", "distance" and "freedom" are far apart in the lyrics, which obviously does not meet the user's needs.

[0031] Therefore, a new search solution is needed to overcome the problem that the search results of the current search method do not match the user's needs.

[0032] In view of the above, the basic idea of ​​this disclosure is:

[0033] The search solution disclosed in the present invention is based on the fact that the search results that users expect to obtain have high correlation between keywords, that is, the distribution of keywords is as close as possible to the search requirements of the search content input by them; for the search content, the search is performed according to the keyword sequence after word segmentation to ensure that candidate objects can be searched, avoiding search errors caused by problems such as inaccurate and incoherent search content; for the candidate objects, further screening is performed based on the keyword spacing to obtain target objects with close distances between keywords, ensuring that the distribution of keywords in the target objects is consistent with the search content, avoiding the problem that keywords are far apart and have nothing to do with the search content; thus, the search solution disclosed in the present invention can search for search results that match user needs, improve the accuracy of search results, and enhance the user search experience.

[0034] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0035] Exemplary Methods

[0036] The following combination Figure 1 The search method according to the exemplary embodiment of the present disclosure is described. Figure 1 As shown, the search method of this embodiment may include the following steps:

[0037] S110 , in response to the search content, obtaining a keyword sequence after the search content is segmented.

[0038] Search content refers to the content entered by the user into the search bar of a search engine. Existing word segmentation methods can be used to segment the search content. Typically, search engines have a built-in word segmenter. Upon receiving the search content entered by the user, the search engine uses the word segmenter to segment the search content into keywords.

[0039] S120: Search candidate objects according to the keyword sequence, each candidate object at least contains some keywords in the keyword sequence.

[0040] The search method of this embodiment is applicable to various search scenarios, including song search, video search, and article search. In a song search scenario, the candidate objects searched for are candidate songs whose lyrics contain at least some of the keywords in the keyword sequence; in a video search scenario, the candidate objects searched for are candidate videos whose video descriptions contain at least some of the keywords in the keyword sequence; and in an article search scenario, the candidate objects searched for are candidate articles whose content contains at least some of the keywords in the keyword sequence.

[0041] S130 , screening target objects from the candidate objects according to the intervals between the keywords contained in each candidate object.

[0042] If the keywords in a candidate object are far apart and the correlation between the keywords is extremely weak, the candidate object does not actually meet the user's needs. The search method of this embodiment is based on the user's desired search results, which are highly correlated between keywords, that is, the distribution of keywords is as close as possible to the search requirements of the input search content. After searching for candidate objects, the candidate objects are further screened based on the distance between keywords to ensure that the target objects obtained meet the user's needs.

[0043] Therefore, the above-mentioned search method searches for the search content according to the keyword sequence after word segmentation, ensuring that candidate objects can be searched, avoiding search errors caused by inaccurate or incoherent search content; for candidate objects, further screening is performed based on the keyword spacing to obtain target objects with close distances between keywords, ensuring that the distribution of keywords in the target objects conforms to the search content, avoiding the problem of keywords being far apart and completely irrelevant to the search content; thus, the search solution disclosed in this disclosure can search for search results that match user needs, thereby improving the user search experience.

[0044] Figure 2 The implementation scenario of the search method according to an embodiment of the present disclosure is illustrated. Figure 1 and Figure 2As shown, in a specific implementation scenario, the search engine may include a front-end interaction module 220a and a back-end processing module 220b. The front-end interaction module 220a is used to interact with the user terminal 210, receive the search content entered by the user, and return the search results to the user. The back-end processing module 220b is used to segment the search content, search for candidate objects from the object library 230 based on the keyword sequence, and filter the target objects from the candidate objects to generate search results for return to the user.

[0045] In an exemplary embodiment of the present disclosure, screening target objects from candidate objects may specifically include: determining target keywords that meet spacing requirements in each candidate object; and determining candidate objects whose number of target keywords meets the quantity requirement as target objects.

[0046] Based on the spacing and quantity requirements, target objects with closely distributed and sufficient target keywords can be screened out from the candidate objects. In specific implementation, a greedy algorithm can be used to screen target objects with the closest keyword distance and the largest number possible from the candidate objects.

[0047] Figure 3 The process of determining target keywords according to an embodiment of the present disclosure is illustrated. Figure 3 As shown, determining the target keywords that meet the spacing requirements in each candidate object includes the following steps:

[0048] S310: Determine a starting keyword of a current candidate object according to the keyword sequence.

[0049] When determining the starting keyword, it is possible to determine in sequence whether the corresponding keyword exists in the current candidate objects according to the keyword order of the keyword sequence.

[0050] S320: Searching for subsequent keywords of the starting keyword in the context of the starting keyword according to the keyword sequence; wherein the context is determined according to the position and spacing requirements of the starting keyword.

[0051] The starting keyword may be located at multiple positions in the current candidate object. In actual operation, subsequent keywords may be searched in the context of the starting keyword at each position in series or in parallel.

[0052] When determining the context content, the number of words that match the spacing requirement can be taken forward and backward from the position of the starting keyword to form the context content of the starting keyword at the corresponding position.

[0053] S330: When adjacent subsequent keywords of the starting keyword are found, the starting keyword and the adjacent subsequent keywords are determined as target keywords.

[0054] The adjacent subsequent keyword is the next keyword adjacent to the start keyword in the keyword sequence.

[0055] S340: Using the adjacent subsequent keyword as a new starting keyword, continue searching for subsequent keywords of the new starting keyword in the context of the new starting keyword according to the keyword sequence.

[0056] When adjacent subsequent keywords of the starting keyword are found, the starting keyword and the adjacent subsequent keywords are determined as target keywords, and the adjacent subsequent keywords are used as new starting keywords, and the process returns to step S320; until the number of determined target keywords meets the quantity requirement, the current candidate object is determined as the target object.

[0057] In the process of determining the target keyword, there may be a situation where no adjacent keywords are found. Figure 4 The process of determining target keywords according to another embodiment of the present disclosure is illustrated. Figure 4 The target keyword determination plan can be based on Figure 3 The plan to determine the target keywords is Figure 3 The features and principles that have been explained in the previous section will not be repeated.

[0058] Reference Figure 4 As shown, determining the target keywords that meet the spacing requirements in each candidate object also includes the following steps:

[0059] S430: When no adjacent subsequent keyword is found, the adjacent subsequent keyword is discarded from the keyword sequence to obtain a first updated keyword sequence.

[0060] The first updated keyword sequence is formed by discarding at least the adjacent subsequent keywords in the keyword sequence. In fact, in the first updated keyword sequence, the keywords before the starting keyword in the keyword sequence are also discarded, which will be combined with Figure 6 Provide explanation.

[0061] S440: Count the number of keywords in the first updated keyword sequence.

[0062] S450: When the number of keywords in the first updated keyword sequence meets the quantity requirement, the subsequent keywords of the starting keyword are searched in sequence according to the first updated keyword sequence in the context of the starting keyword.

[0063] If no adjacent subsequent keywords of the starting keyword are found, the adjacent subsequent keywords are discarded, and if the number of remaining keywords after discarding meets the quantity requirement, return to step S320; until the number of determined target keywords meets the quantity requirement, the current candidate object is determined as the target object.

[0064] In the process of determining target keywords, there may be situations where the initial keyword has no matching subsequent keywords. Figure 5 The process of determining target keywords according to another embodiment of the present disclosure is illustrated. Figure 5 The target keyword determination plan can be based on Figure 4 The plan to determine the target keywords is Figure 4 The features and principles that have been explained in the previous section will not be repeated.

[0065] Reference Figure 5 As shown, determining the target keywords that meet the spacing requirements in each candidate object also includes the following steps:

[0066] S550: When the number of keywords in the first updated keyword sequence does not meet the quantity requirement, the starting keyword is discarded from the keyword sequence to obtain a second updated keyword sequence.

[0067] The second updated keyword sequence is formed by discarding at least the starting keyword from the keyword sequence. In fact, in the second updated keyword sequence, the keyword before the starting keyword in the keyword sequence is also discarded, which will be discussed below in conjunction with Figure 6 Provide explanation.

[0068] S560: Count the number of keywords in the second updated keyword sequence.

[0069] S570: When the number of keywords in the second updated keyword sequence meets the quantity requirement, the starting keyword of the current candidate object is re-determined according to the second updated keyword sequence.

[0070] If the starting keyword has no matching subsequent keyword, the starting keyword is discarded, and if the number of remaining keywords after the discarding meets the quantity requirement, the process returns to step S310 to redetermine the starting keyword.

[0071] S580: When the number of keywords in the second updated keyword sequence does not meet the quantity requirement, the current candidate object is discarded.

[0072] After discarding the starting keyword, if the number of remaining keywords does not meet the quantity requirement, it can be determined that there is no longer a target keyword meeting the spacing requirement and the quantity requirement in the current candidate object, so the current candidate object is discarded.

[0073] By using the above method for determining target keywords, it is possible to maintain a certain degree of integrity between target keywords in the target object, better match the search content, and meet the user's search needs.

[0074] Figure 6 The process of determining the starting keyword according to an embodiment of the present disclosure is illustrated. Figure 6As shown, determining a starting keyword of a current candidate object includes the following steps:

[0075] S610: Search for the first keyword in the keyword sequence in the current candidate object.

[0076] S620: When the first keyword is found, the first keyword is determined as the starting keyword.

[0077] S630: When the first keyword is not found, the first keyword is discarded from the keyword sequence to obtain a third updated keyword sequence.

[0078] S640: Count the number of keywords in the third updated keyword sequence.

[0079] S650: When the number of keywords in the third updated keyword sequence meets the quantity requirement, continue searching for the first keyword in the third updated keyword sequence in the current candidate objects.

[0080] If the first keyword of the keyword sequence does not exist in the current candidate object, the first keyword is discarded, and if the number of remaining keywords after discarding meets the quantity requirement, the process returns to step S610 to continue determining the starting keyword of the current candidate object.

[0081] In both the first updated keyword sequence and the second updated keyword sequence, the keywords preceding the start keyword in the keyword sequence have been discarded.

[0082] S660: When the number of keywords in the third updated keyword sequence does not meet the quantity requirement, the current candidate object is discarded.

[0083] When the number of keywords in the third updated keyword sequence does not meet the quantity requirement, it can be determined that there is no target keyword meeting the spacing requirement and the quantity requirement in the current candidate object, and thus the current candidate object is discarded.

[0084] The following describes the process of determining whether a candidate object (referred to as a candidate song in this example) is a target object (referred to as a target song in this example) in conjunction with a song search scenario.

[0085] Assume the search content is "you alone drink outside the mountain small flower building", the keyword sequence obtained after word segmentation contains 8 keywords, namely: you, alone, drink, outside, mountain, small, flower, building. It should be noted that the word segmentation method for the search content can be set as needed and is not limited to the ones listed here.

[0086] The lyrics of the candidate songs are: Counting the ripe red beans as spring goes by, no one is around after dusk; the cold courtyard in late autumn makes me thin for whom; only my shadow is cast under the moon, with whom should I stay? The wine goes down my throat but cannot relieve my sorrow; the hibiscus flowers are all over the branches again, but the butterflies are hard to keep; drifting like the river flowing eastward; looking at the willows on the other side of the bank in front of the door, the loneliness still persists; [8th sentence] You are speechless and let the tears flow; [9th sentence] I drink alone in the small attic outside the mountain, listening to the sorrow of lovesickness all night; being drunk makes people worry, and it is hard to let go of the worries; in the small attic outside the mountain, I ride a small boat; letting my thoughts go with the wind Drifting; hibiscus flowers are all over the branches again, but butterflies are hard to stay; drifting like the river flowing eastward; looking at the willows on the other side of the river, the loneliness still does not stop; you let the tears flow silently; I drink alone in the small attic outside the mountain, listening to the lovesickness all night long; being drunk makes people worried, and it is difficult to control the worries; in the small attic outside the mountain, I take a small boat; let my thoughts drift with the wind; I drink alone in the small attic outside the mountain, with the fishing lights outside the window as small as beans; the evening breeze by the river blows the willows, telling all the sorrows of parting; when the moonlight warms the small building, who is playing again; that song of longing always stays; that song of longing always stays; that song of longing always stays.

[0087] The spacing requirement (denoted as slop) is: 1 word (the word segmentation method for obtaining "words" here is the same as the word segmentation method for obtaining keywords mentioned above); that is, if the interval between one keyword and another keyword is within 1 word, the two keywords can be determined as target keywords.

[0088] The quantity requirement is: 6 target keywords; that is, in the process of determining the target keywords, a maximum of 8-6=2 keywords can be discarded in the keyword sequence.

[0089] The process of determining whether the candidate song is the target song is as follows:

[0090] First, determine the starting keyword of the candidate song based on the keyword sequence. First, search for the first keyword "you" in the keyword sequence in the candidate song, and find "you" in [Sentence 8] as the starting keyword of the candidate song; then use the position ±(slop+1) of the starting keyword to determine the context of the starting keyword, which is "Buxiu Ni Wuyan". Then, search for the adjacent subsequent keyword "alone" of the starting keyword "you" in the context; if "alone" is not found, discard the keyword "alone" from the keyword sequence (this is the first discarded keyword) to obtain the first updated keyword sequence "you, zhuo, wai, shan, xiao, hua, lou". Continue to search for the adjacent subsequent keyword "zhuo" of the starting keyword "you" in the context "Buxiu Ni Wuyan" based on the first updated keyword sequence; if "zhuo" is not found, discard the keyword "zhuo" from the first keyword sequence (this is the second discarded keyword) to obtain the first updated keyword sequence "you, wai, shan, xiao, hua, lou" again. Continue to search for the adjacent subsequent keyword "outside" of the starting keyword "you" in the context content "Bu Xi Ni Wu Yan" according to the first updated keyword sequence that has been updated again; "outside" is not found. At this time, since two keywords have been discarded, the number of keywords in the first updated keyword sequence no longer meets the quantity requirement after discarding the keyword "outside", so the starting keyword "you" is discarded from the keyword sequence to obtain the second updated keyword sequence "alone, drink, outside, mountain, small, flower, building".

[0091] If the second updated keyword sequence meets the quantity requirement at this time, the starting keyword of the candidate song is re-determined according to this second updated keyword sequence, and the "alone" in [Sentence 9] is matched as the starting keyword. Then, the context content of the starting keyword "alone" is determined, that is, "I drink alone on the mountain"; the adjacent subsequent keyword "drink" is searched in this context content. The "drink" is found, and the starting keyword "alone" and the adjacent subsequent keyword "drink" are determined as the target keywords (at this time, 2 target keywords are matched in the candidate song). Then, taking the adjacent subsequent keyword "drink" as the new starting keyword, continue to search for the adjacent subsequent keyword "outside" in the context content of this new starting keyword "drink" (that is, "I drink alone outside the mountain") according to the above second updated keyword sequence. The "outside" is found and determined as the target keyword (at this time, 3 target keywords are matched in the candidate song), and taking "outside" as the new starting keyword, continue to search for the adjacent subsequent keyword "mountain" in the context content of this new starting keyword "outside" (that is, "drink outside the small pavilion on the mountain"). The "mountain" is found and determined as the target keyword (at this time, 4 target keywords are matched in the candidate song), and taking "mountain" as the new starting keyword, continue to search for the adjacent subsequent keyword "small" in the context content of this new starting keyword "mountain" (that is, "drink alone outside the small mountain"). The "small" is found and determined as the target keyword (at this time, 5 target keywords are matched in the candidate song), and taking "small" as the new starting keyword, continue to search for the adjacent subsequent keyword "flower" in the context content of this new starting keyword "small" (that is, "small pavilion outside the mountain"). The "flower" is not found, and the "flower" is discarded from the above second updated keyword sequence "alone, drink, outside, mountain, small, flower, building" (this is the second discarded keyword), and the second updated keyword sequence "alone, drink, outside, mountain, small, building" is obtained after re-updating. Continue, search for the adjacent subsequent keyword "building" in the context content (small pavilion outside the mountain) of the starting keyword "small". The "building" is found and determined as the target keyword; at this time, 6 target keywords are matched in the candidate song, and the candidate song can be determined as the target song.

[0092] Further, in an exemplary embodiment of the present disclosure, screening the target object from the candidate objects further includes: determining the quantity of the target object; when the quantity of the target object does not reach the preset quantity (the preset quantity is not a fixed value and can be adaptively adjusted according to factors such as the used search time, the screened candidate objects, etc.), the spacing requirement and / or the quantity requirement are adjusted.

[0093] The quantity of the target object can be statistically counted periodically. For example, every set time period, count the quantity of the determined target objects. Another example is to count the quantity of the determined target objects every time a search cycle is completed, which will be described below in combination with Figure 7 for illustration.

[0094] The spacing requirement may be gradually relaxed. In an exemplary embodiment, adjusting the spacing requirement includes adjusting the spacing requirement by a predetermined step size until the spacing requirement is adjusted from an initial spacing to a maximum spacing; wherein the maximum spacing is greater than the initial spacing.

[0095] For example, the initial spacing is recorded as slop ini (For example, 0), the maximum spacing is recorded as slop max (For example, 3), the preset step size is assumed to be 1 word, then the adjustment process of the spacing requirement slop is: slop = slop ini =0→slop=1→slop=2→slop=slop max =3.

[0096] The quantity requirement can be gradually reduced. In one exemplary embodiment, adjusting the quantity requirement includes adjusting the quantity requirement by a predetermined step size until the quantity requirement is adjusted from a first quantity to a second quantity; wherein the first quantity is the number of keywords included in the keyword sequence, and the second quantity is the product of the first quantity and a predetermined ratio, and the first quantity is greater than the second quantity.

[0097] For example, let the quantity requirement be denoted as min_match, the number of keywords in the keyword sequence as N, and the preset ratio as C. Then, the first quantity is N, and the second quantity is N*C (C<1; if N*C is not an integer, it can be rounded up). Assuming the preset step size is 1 word, the process for adjusting the quantity requirement min_match is: min_match = N → min_match = N-1 → ... → min_match = N*C.

[0098] By adjusting the spacing requirement and / or the quantity requirement based on the number of target objects, it is possible to ensure that a sufficient number of target objects are acquired.

[0099] In an exemplary embodiment of the present disclosure, before determining the target keywords that meet the spacing requirements in each candidate object, it also includes: sorting the candidate objects according to the number of keywords contained in each candidate object; and determining the target keywords that meet the spacing requirements in each candidate object sequentially or in batches according to the sorting order of the candidate objects.

[0100] The candidate objects may be sorted in descending order to ensure that the target keywords are determined first for the candidate objects containing more keywords.

[0101] In an exemplary embodiment of the present disclosure, filtering target objects from candidate objects further includes: when the search time reaches a time threshold, stopping the filtering and returning the determined target object; when the search time does not reach the time threshold, continuing the filtering.

[0102] For search engines, both accuracy and search speed are crucial. If a search takes too long, even the most accurate results will be unusable, severely impacting the user's search experience. By using a time threshold, we can control search duration within a reasonable range. Combined with the aforementioned search process of first searching for candidate objects and then filtering for target objects, we can efficiently and accurately find search results that match user needs within a given timeframe.

[0103] Furthermore, in an exemplary embodiment of the present disclosure, a search loop can be used to obtain candidate objects in batches according to the number of keywords they contain, from most to least, and the target objects can be screened after each candidate object is obtained, so as to first screen the candidate objects containing more keywords within a given time, and ensure that the target objects with the closest distance to the keywords and the largest number possible are obtained.

[0104] Figure 7 A search method using a search cycle according to an embodiment of the present disclosure is illustrated. Figure 7 The search method can be based on Figure 1 The search method is mainly to Figure 1 The search step of S120 is replaced by the cyclic search steps S720a and S720b; Figure 1 The features and principles that have been explained in the previous section will not be repeated.

[0105] Reference Figure 7 As shown, in this exemplary embodiment, the search method includes the following steps:

[0106] S110 , in response to the search content, obtaining a keyword sequence after the search content is segmented.

[0107] S720a: According to the keyword sequence, candidate objects are obtained in batches based on a search cycle with a decreasing number of keywords.

[0108] Assuming that the keyword sequence contains N keywords in total, candidate objects containing N keywords → N-1 keywords → N-2 keywords... can be obtained in batches according to a search cycle with decreasing keyword numbers of N keywords → N-1 keywords → N-2 keywords...

[0109] S130 , screening target objects from the candidate objects according to the intervals between the keywords contained in each candidate object.

[0110] That is, each time a corresponding candidate object is obtained based on a current keyword number, a target object is screened from the candidate objects. The target object screening process can refer to the description of the above exemplary embodiments and will not be repeated here.

[0111] S720b: Determine whether the search time exceeds a time threshold.

[0112] The time threshold can be set as needed, as long as the search response speed is kept within a reasonable range.

[0113] S720b1: When the loop condition including at least the search time not exceeding the time threshold is satisfied, continue the search loop.

[0114] When the loop condition is met, return to step S720a to continue obtaining the next batch of candidate objects.

[0115] S720b2: If the loop condition is not met, return the determined target object.

[0116] When the loop condition is not met, the search loop ends and all identified target objects are recalled and returned to the user.

[0117] When the search engine is actually running, a variable called "start_time" records the search start time, and a variable called "now_time" records the current time. After each search cycle, the search is determined to see if the elapsed search time exceeds the set time threshold based on the current time "now_time" and the search start time "start_time." If so, the search is stopped to ensure the smooth operation of the search engine, preventing a single search timeout from delaying other searches.

[0118] Furthermore, before continuing each search cycle, it is also possible to count whether the number of identified target objects reaches a preset number (the preset number is not a fixed value and can be adaptively adjusted according to factors such as the number of search cycles and the elapsed search time); if the number of identified target objects does not reach the corresponding preset number, the spacing requirements and / or quantity requirements for screening target objects during the next search cycle can be adjusted to improve the matching rate of target objects in the next search cycle.

[0119] In addition, in an exemplary embodiment of the present disclosure, when counting the number of determined target objects, if the number of determined target objects exceeds a preset expected number (the expected number is greater than the above-mentioned preset number), the search can be stopped immediately and the determined target objects can be returned to the user.

[0120] In an exemplary embodiment of the present disclosure, candidate objects are obtained in batches, including: searching for objects hit by each keyword in a keyword sequence to obtain an inverted index for each keyword; and extracting objects common to a corresponding number of keywords from the inverted index of each keyword in batches as candidate objects based on the corresponding number of keywords.

[0121] An inverted index is one of the core data structures of a search engine. For example, if the keyword sequence is "love, distance, freedom," the object library is searched for objects matching the keywords "love," "distance," and "freedom," respectively, and their respective inverted indices are constructed. An inverted index is typically formed as a list containing object IDs. For example, using letters as the object ID, the inverted index for the keyword "love" might be {ABCDEF}, the inverted index for the keyword "distance" might be {ABDEFG}, and the inverted index for the keyword "freedom" might be {ABCFGH}.

[0122] When extracting objects shared by a corresponding number of keywords in a search cycle, if the number of keywords in the current search cycle (e.g., 3) equals the total number of keywords in the keyword sequence, then the objects shared by all keywords can be extracted from the inverted index of each keyword. For example, in the inverted index of the aforementioned keywords "love," "distant," and "freedom," the object {ABF} shared by these three keywords is extracted as a candidate object for this search cycle.

[0123] After this search cycle, the inverted index of the keyword "love" is updated to {CDE}, the inverted index of the keyword "far away" is updated to {DEG}; and the inverted index of the keyword "freedom" is updated to {CGH}.

[0124] When extracting objects shared by keywords of a corresponding number of keywords in batches, when the number of keywords in this search cycle is less than the total number of keywords in the keyword sequence, all combinations of keywords of a corresponding number of keywords in the keyword sequence are obtained, and objects shared by keywords of a corresponding number of keywords are extracted based on each combination.

[0125] For example, the number of keywords in this search cycle is 2; first, all combinations of keywords with 2 keyword numbers in the keyword sequence (love, distance, freedom) are obtained, recorded as the first combination "love, distance", the second combination "love, freedom" and the third combination "distance, freedom"; then based on the first combination, the common object {DE} is extracted from the updated inverted index of the keywords "love" and "distance", based on the second combination, the common object {C} is extracted from the updated inverted index of the keywords "love" and "freedom", and based on the third combination, the common object {G} is extracted from the updated inverted index of the keywords "distance" and "freedom"; after merging, the candidate object {CDEG} of this search cycle is obtained.

[0126] In an exemplary embodiment of the present disclosure, the loop condition further includes: a ratio of a current keyword number after decrement to a total keyword number of the keyword sequence is less than a preset keyword hit rate.

[0127] The preset keyword hit rate is, for example, R. When executing a search loop with decreasing number of keywords from N keywords → N-1 keywords → N-2 keywords..., once it is determined that the number of keywords corresponding to the search loop to be executed is less than N*R, the search loop is ended to avoid searching and screening candidate objects with too low keyword hit rates and wasting search resources.

[0128] In summary, the search method of the embodiment of the present invention searches for the search content based on the keyword sequence after word segmentation to ensure that candidate objects can be searched and avoid search errors caused by inaccurate or incoherent search content; for candidate objects, further screening is performed based on the keyword spacing to obtain target objects with close distances between keywords, ensuring that the distribution of keywords in the target objects conforms to the search content, so as to improve the accuracy of search results and avoid the problem that keywords are far apart and have nothing to do with the search content; in the process of candidate object search and target object screening, based on the controllable and adjustable keyword hit rate, spacing requirements and quantity requirements, choices are made within a given search time to ensure the search response speed and keyword hit rate, and to recall as many search results as possible with small keyword spacing and a large number, thereby providing as accurate search results as possible without affecting the overall efficiency of the search engine, making the search results more in line with user needs, improving the user search experience, and increasing the user's positive feedback on the search function, thereby improving the reliability of the system.

[0129] Exemplary devices

[0130] After introducing the search method of the exemplary embodiment of the present disclosure, the following will be combined with Figure 8 A search device according to an exemplary embodiment of the present disclosure is described.

[0131] The search device provided in the embodiments of the present disclosure can be used to implement the search methods described in the above embodiments. The features and principles of the search methods described in any of the above embodiments can be applied to the corresponding search device embodiments below. In the following search device embodiments, the features and principles regarding candidate object search and target object screening that have already been explained will not be repeated.

[0132] Reference Figure 8As shown, the search device 800 of the exemplary embodiment of the present disclosure may include a search content segmentation module 810, a candidate object search module 820, and a target object screening module 830. The search content segmentation module 810 is used to obtain a keyword sequence after the search content is segmented in response to the search content; the candidate object search module 820 is used to search for candidate objects based on the keyword sequence, each candidate object containing at least some of the keywords in the keyword sequence; and the target object screening module 830 is used to screen target objects from the candidate objects based on the spacing between the keywords contained in each candidate object.

[0133] The above-mentioned search device 800 searches for the search content based on the keyword sequence after word segmentation to ensure that candidate objects can be searched, avoiding search errors caused by inaccurate or incoherent search content; for candidate objects, further screening is performed based on the keyword spacing to obtain target objects with close distances between keywords, ensuring that the distribution of keywords in the target objects is consistent with the search content, avoiding the problem of keywords being far apart and completely irrelevant to the search content; thus, using the above-mentioned search device 800, search results that match user needs can be searched, thereby improving the user search experience.

[0134] According to an exemplary embodiment of the present disclosure, the target object screening module 830 includes: a target keyword determination module for determining the target keywords that meet the spacing requirements in each candidate object; and a target object determination module for determining the candidate objects whose number of target keywords meets the quantity requirements as target objects.

[0135] According to an exemplary embodiment of the present disclosure, a target keyword determination module includes: a starting keyword determination module, which is used to determine a starting keyword of a current candidate object according to a keyword sequence; a subsequent keyword search module, which is used to search for subsequent keywords of the starting keyword in the context content of the starting keyword according to the keyword sequence; wherein the context content is determined according to the position and spacing requirements of the starting keyword; a target keyword acquisition module, which is used to determine the starting keyword and the adjacent subsequent keywords as target keywords when adjacent subsequent keywords of the starting keyword are found; and a starting keyword update module, which is used to use the adjacent subsequent keywords as new starting keywords and continue to search for subsequent keywords of the new starting keyword in the context content of the new starting keyword according to the keyword sequence.

[0136] According to an exemplary embodiment of the present disclosure, the target keyword determination module also includes: a first discarding module, which is used to discard adjacent subsequent keywords from the keyword sequence when no adjacent subsequent keywords are found, and obtain a first updated keyword sequence; a first statistics module, which is used to count the number of keywords in the first updated keyword sequence; and a subsequent keyword replacement module, which is used to continue to search for subsequent keywords of the starting keyword in the context content of the starting keyword according to the first updated keyword sequence when the number of keywords in the first updated keyword sequence meets the quantity requirement.

[0137] According to an exemplary embodiment of the present disclosure, the target keyword determination module also includes: a second discarding module, which is used to discard the starting keyword from the keyword sequence when the number of keywords in the first updated keyword sequence does not meet the quantity requirement, and obtain a second updated keyword sequence; a second statistics module, which is used to count the number of keywords in the second updated keyword sequence; a starting keyword replacement module, which is used to re-determine the starting keyword of the current candidate object according to the second updated keyword sequence when the number of keywords in the second updated keyword sequence meets the quantity requirement; and a fourth discarding module, which is used to discard the current candidate object when the number of keywords in the second updated keyword sequence does not meet the quantity requirement.

[0138] According to an exemplary embodiment of the present disclosure, the starting keyword determination module includes: a first keyword search module, which is used to search for the first keyword of the keyword sequence in the current candidate object; a starting keyword acquisition module, which is used to determine the first keyword as the starting keyword when the first keyword is found; a third discarding module, which is used to discard the first keyword from the keyword sequence when the first keyword is not found, and obtain a third updated keyword sequence; a third statistics module, which is used to count the number of keywords in the third updated keyword sequence; a first keyword replacement module, which is used to continue to search for the first keyword of the third updated keyword sequence in the current candidate object when the number of keywords in the third updated keyword sequence meets the quantity requirement; and a fifth discarding module, which is used to discard the current candidate object when the number of keywords in the third updated keyword sequence does not meet the quantity requirement.

[0139] According to an exemplary embodiment of the present disclosure, the target object screening module 830 further includes: a quantity determination module for determining the number of target objects; and a requirement adjustment module for adjusting the spacing requirement and / or quantity requirement when the number of target objects does not reach a preset number.

[0140] According to an exemplary embodiment of the present disclosure, the requirement adjustment module includes: a spacing adjustment module for adjusting the spacing requirement by a preset step size until the spacing requirement is adjusted from an initial spacing to a maximum spacing; wherein the maximum spacing is greater than the initial spacing.

[0141] According to an exemplary embodiment of the present disclosure, the requirement adjustment module includes: a quantity adjustment module, which is used to adjust the quantity requirement through a preset step size until the quantity requirement is adjusted from a first quantity to a second quantity; wherein the first quantity is the number of keywords contained in the keyword sequence, and the second quantity is the product of the first quantity and a preset ratio, and the first quantity is greater than the second quantity.

[0142] According to an exemplary embodiment of the present disclosure, the search device also includes: a candidate object sorting module, which is used to sort the candidate objects according to the number of keywords contained in each candidate object; and a target keyword determination module, which is used to determine the target keywords that meet the spacing requirements in each candidate object in sequence or in batches according to the sorting order of the candidate objects.

[0143] According to an exemplary embodiment of the present disclosure, the target object screening module 830 also includes: a stop screening module, which is used to stop screening and return the determined target object when the search time reaches a time threshold; and a continue screening module, which is used to continue screening when the search time does not reach the time threshold.

[0144] According to an exemplary embodiment of the present disclosure, the candidate object search module 820 includes: a multi-stage search module for obtaining candidate objects in batches according to a keyword sequence and a search loop with a decreasing number of keywords; a search time determination module for determining whether the search time exceeds a time threshold each time a corresponding candidate object is obtained based on a current number of keywords and the target object is screened from the candidate objects; a search loop module for continuing the search loop when at least a loop condition including the search time not exceeding the time threshold is met; and a search end module for returning a determined target object when the loop condition is not met.

[0145] According to an exemplary embodiment of the present disclosure, the step-by-step search module includes: an inverted index module for searching for objects hit by each keyword in a keyword sequence to obtain an inverted index for each keyword; a candidate object extraction module for extracting objects common to a corresponding number of keywords from the inverted index of each keyword in steps as candidate objects based on the corresponding number of keywords.

[0146] According to an exemplary embodiment of the present disclosure, the candidate object extraction module includes: a combination extraction module, which is used to obtain all combinations of keywords with a corresponding number of keywords in the keyword sequence when the corresponding number of keywords is less than the total number of keywords in the keyword sequence, and extract objects common to the keywords with a corresponding number of keywords based on each combination.

[0147] According to an exemplary embodiment of the present disclosure, the loop condition further includes: a ratio of a current keyword number after decrement to a total number of keywords in the keyword sequence is less than a preset keyword hit rate.

[0148] The various functional modules of the search device of the above-mentioned embodiment of the present disclosure are the same as the principles and features of the search method described in detail in the above-mentioned embodiment of the present disclosure. Therefore, the specific features and principles of each functional module can refer to the description of the above-mentioned search method embodiments and will not be repeated here.

[0149] In summary, the search device of the embodiment of the present invention searches for the search content based on the keyword sequence after word segmentation to ensure that candidate objects can be searched, avoiding search errors caused by inaccurate or incoherent search content; for candidate objects, further screening is performed based on the keyword spacing to obtain target objects with close distances between keywords, ensuring that the distribution of keywords in the target objects conforms to the search content, so as to improve the accuracy of search results and avoid the problem that keywords are far apart and have nothing to do with the search content; in the process of candidate object search and target object screening, based on the controllable and adjustable keyword hit rate, spacing requirements and quantity requirements, choices are made within a given search time to ensure the search response speed and keyword hit rate, and to recall as many search results as possible with small keyword spacing and a large number, thereby providing as accurate search results as possible without affecting the overall efficiency of the search engine, making the search results more in line with user needs, improving the user search experience, and increasing the user's positive feedback on the search function, thereby improving the reliability of the system.

[0150] Exemplary Storage Media

[0151] After introducing the search method and apparatus according to the exemplary embodiment of the present disclosure, Figure 9 A storage medium according to an exemplary embodiment of the present disclosure is described.

[0152] Reference Figure 9 As shown, a storage medium 1000 for implementing the above-mentioned search method according to an embodiment of the present disclosure is described. The storage medium 1000 may be a portable compact disk read-only memory (CD-ROM) and includes program code, and can be run on a device such as a personal computer. However, the storage medium of the present disclosure is not limited thereto. In this document, a storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0153] The storage medium can be any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 thereof.

[0154] A readable signal medium may include a data signal transmitted in baseband or as part of a carrier wave, which carries readable program code. Such a transmitted data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0155] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0156] The program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0157] Exemplary Computer Devices

[0158] After introducing the storage medium of the exemplary embodiment of the present disclosure, next, referring to Figure 10 A computer device according to an exemplary embodiment of the present disclosure will be described.

[0159] Figure 10The computer device 900 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0160] like Figure 10 As shown, computer device 900 is implemented as a general-purpose computing device. Components of computer device 900 may include, but are not limited to, the at least one processing unit 910 described above, the at least one storage unit 920 described above, a bus 930 connecting various system components (including storage unit 920 and processing unit 910), and a display unit 940.

[0161] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps of the search method according to various exemplary embodiments of the present disclosure described in the above exemplary method part of this specification.

[0162] The storage unit 920 may include a volatile storage unit, such as a random access memory unit (RAM) 9201 and / or a cache memory unit 9202 , and may further include a read-only memory unit (ROM) 9203 .

[0163] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0164] The bus 930 may include a data bus, an address bus, and a control bus.

[0165] The computer device 900 can also communicate with one or more external devices (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), and such communication can be performed via an input / output (I / O) interface 950. The computer device 900 also includes a display unit 940, which is connected to the input / output (I / O) interface 950 for display. Furthermore, the computer device 900 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 960. As shown, the network adapter 960 communicates with other modules of the computer device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computer device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0166] It should be noted that although several modules or submodules of the inter-process communication system are mentioned in the detailed description above, this 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 units / modules described above can be embodied in a single unit / module. Conversely, the features and functions of a single unit / module described above can be further divided and embodied by multiple units / modules.

[0167] Furthermore, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all illustrated operations must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0168] 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 specific embodiments disclosed, and the division into various 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 search method, characterized in that: include: In response to the search content, obtaining a keyword sequence after word segmentation of the search content; Searching for candidate objects according to the keyword sequence, each candidate object at least contains some of the keywords in the keyword sequence; Filtering target objects from the candidate objects according to the spacing between the keywords contained in each of the candidate objects; The step of screening the target object from the candidate objects includes: Determine target keywords that meet spacing requirements in each candidate object; Determine the candidate objects whose number of target keywords meets the quantity requirement as the target objects; Determining the target keyword that meets the spacing requirement in each candidate object includes: Determining a starting keyword of a current candidate object according to the keyword sequence; In the context of the starting keyword, searching for subsequent keywords of the starting keyword in sequence according to the keyword sequence; wherein the context is determined according to the position of the starting keyword and the spacing requirement; When adjacent subsequent keywords of the starting keyword are found, the starting keyword and the adjacent subsequent keywords are determined as the target keywords; and The adjacent subsequent keyword is used as a new starting keyword, and the subsequent keywords of the new starting keyword are searched in sequence according to the keyword sequence in the context of the new starting keyword.

2. The search method according to claim 1, wherein: The step of determining the target keyword that meets the spacing requirement in each candidate object further includes: When the adjacent subsequent keyword is not found, discarding the adjacent subsequent keyword from the keyword sequence to obtain a first updated keyword sequence; Counting the number of keywords in the first updated keyword sequence; When the number of keywords in the first updated keyword sequence meets the quantity requirement, the subsequent keywords of the starting keyword are searched in sequence according to the first updated keyword sequence in the context of the starting keyword.

3. The search method according to claim 2, wherein: The step of determining the target keyword that meets the spacing requirement in each candidate object further includes: When the number of keywords in the first updated keyword sequence does not meet the quantity requirement, discarding the starting keyword from the keyword sequence to obtain a second updated keyword sequence; Counting the number of keywords in the second updated keyword sequence; When the number of keywords in the second updated keyword sequence meets the quantity requirement, re-determining the starting keyword of the current candidate object according to the second updated keyword sequence; When the number of keywords in the second updated keyword sequence does not meet the quantity requirement, the current candidate object is discarded.

4. The search method according to claim 1, wherein: The step of determining a starting keyword of a current candidate object includes: Searching for the first keyword of the keyword sequence in the current candidate object; When the first keyword is found, the first keyword is determined as the starting keyword; When the first keyword is not found, discarding the first keyword from the keyword sequence to obtain a third updated keyword sequence; Counting the number of keywords in the third updated keyword sequence; When the number of keywords in the third updated keyword sequence meets the quantity requirement, continue searching for the first keyword in the third updated keyword sequence in the current candidate object; When the number of keywords in the third updated keyword sequence does not meet the quantity requirement, the current candidate object is discarded.

5. The search method according to claim 1, wherein: The screening of the target object from the candidate objects further includes: determining the number of the target objects; When the number of the target objects does not reach a preset number, the spacing requirement and / or the number requirement is adjusted.

6. The search method according to claim 5, wherein: Adjust the spacing requirements, including: Adjusting the spacing requirement by a preset step size until the spacing requirement is adjusted from an initial spacing to a maximum spacing; The maximum spacing is greater than the initial spacing.

7. The search method according to claim 6, wherein: Adjustments to the stated quantity requirements include: Adjusting the quantity requirement by a predetermined step size until the quantity requirement is adjusted from a first quantity to a second quantity; The first number is the number of keywords included in the keyword sequence, the second number is the product of the first number and a preset ratio, and the first number is greater than the second number.

8. The search method according to claim 1, wherein: Before determining the target keyword that meets the spacing requirement in each candidate object, the method further includes: Sorting the candidate objects according to the number of keywords contained in each candidate object; According to the sorting order of the candidate objects, target keywords that meet the spacing requirement in each candidate object are determined sequentially or in batches.

9. The search method according to claim 1, wherein: The screening of the target object from the candidate objects further includes: When the search time reaches the time threshold, the screening stops and the determined target object is returned; When the search time does not reach the time threshold, the screening continues.

10. The search method according to any one of claims 1 to 9, wherein: The searching for candidate objects according to the keyword sequence includes: According to the keyword sequence, based on a search cycle with a decreasing number of keywords, the candidate objects are obtained in batches; Each time, a corresponding candidate object is obtained based on a current number of keywords, and the target object is screened from the candidate objects, and it is determined whether the search time exceeds a time threshold; Continuing the search loop if at least a loop condition including that the search time does not exceed the time threshold is satisfied; If the loop condition is not satisfied, the determined target object is returned.

11. The search method according to claim 10, wherein: The step of obtaining the candidate objects in batches includes: Searching for objects that are hit by each keyword in the keyword sequence to obtain an inverted index for each keyword; From the inverted index of each keyword, objects common to the corresponding number of keywords are extracted in batches as candidate objects based on the corresponding number of keywords.

12. The search method according to claim 11, wherein: The objects common to the keywords corresponding to the number of keywords are extracted in batches, including: When the number of corresponding keywords is less than the total number of keywords in the keyword sequence, all combinations of the corresponding number of keywords in the keyword sequence are obtained, and objects common to the corresponding number of keywords are extracted based on each combination.

13. The search method according to claim 10, wherein: The cycle conditions also include: The ratio of the value after the current number of keywords is decreased to the total number of keywords in the keyword sequence is less than a preset keyword hit rate.

14. A search device, characterized in that: include: A search content segmentation module, configured to obtain a keyword sequence after segmentation of the search content in response to the search content; a candidate object search module, configured to search for candidate objects according to the keyword sequence, each candidate object containing at least some of the keywords in the keyword sequence; a target object screening module, configured to screen a target object from the candidate objects based on the spacing between the keywords contained in each candidate object; The target object screening module includes: A target keyword determination module, configured to determine a target keyword that meets the spacing requirement in each candidate object; A target object determination module, configured to determine candidate objects whose number of target keywords meets the quantity requirement as the target objects; The target keyword determination module includes: A starting keyword determination module, configured to determine a starting keyword of a current candidate object according to the keyword sequence; A subsequent keyword search module, configured to search for subsequent keywords of the initial keyword in the context of the initial keyword according to the keyword sequence; Wherein, the context content is determined according to the position of the starting keyword and the spacing requirement; a target keyword acquisition module, configured to, when adjacent subsequent keywords of the starting keyword are found, determine the starting keyword and the adjacent subsequent keywords as the target keywords; and The starting keyword updating module is configured to use the adjacent subsequent keyword as a new starting keyword and continue searching for subsequent keywords of the new starting keyword in the context of the new starting keyword according to the keyword sequence.

15. The search device according to claim 14, wherein: The target keyword determination module also includes: a first discarding module, configured to discard the adjacent subsequent keyword from the keyword sequence when the adjacent subsequent keyword is not found, to obtain a first updated keyword sequence; a first statistics module, configured to count the number of keywords in the first updated keyword sequence; The subsequent keyword replacement module is configured to, when the number of keywords in the first updated keyword sequence meets the quantity requirement, continue to search for subsequent keywords of the starting keyword in the context of the starting keyword according to the first updated keyword sequence.

16. The search device according to claim 15, wherein: The target keyword determination module also includes: a second discarding module, configured to discard the starting keyword from the keyword sequence to obtain a second updated keyword sequence when the number of keywords in the first updated keyword sequence does not meet the quantity requirement; a second statistical module, configured to count the number of keywords in the second updated keyword sequence; a starting keyword replacing module, configured to re-determine the starting keyword of the current candidate object according to the second updated keyword sequence when the number of keywords in the second updated keyword sequence meets the quantity requirement; The fourth discarding module is configured to discard the current candidate object when the number of keywords in the second updated keyword sequence does not meet the quantity requirement.

17. The search device according to claim 14, wherein: The starting keyword determination module includes: A first keyword search module, configured to search the current candidate object for the first keyword of the keyword sequence; A starting keyword acquisition module, configured to, when finding the first keyword, determine the first keyword as the starting keyword; a third discarding module, configured to discard the first keyword from the keyword sequence when the first keyword is not found, to obtain a third updated keyword sequence; a third statistical module, configured to count the number of keywords in the third updated keyword sequence; a first keyword replacement module, configured to, when the number of keywords in the third updated keyword sequence meets the quantity requirement, continue searching for the first keyword in the third updated keyword sequence in the current candidate objects; The fifth discarding module is configured to discard the current candidate object when the number of keywords in the third updated keyword sequence does not meet the quantity requirement.

18. The search device according to claim 14, wherein: The target object screening module also includes: A quantity determination module, configured to determine the quantity of the target objects; The requirement adjustment module is configured to adjust the spacing requirement and / or the quantity requirement when the number of the target objects does not reach a preset number.

19. The search device according to claim 18, wherein: The requirement adjustment module includes: a spacing adjustment module, configured to adjust the spacing requirement by a preset step size until the spacing requirement is adjusted from an initial spacing to a maximum spacing; The maximum spacing is greater than the initial spacing.

20. The search device according to claim 18, wherein The requirement adjustment module includes: a quantity adjustment module, configured to adjust the quantity requirement by a preset step size until the quantity requirement is adjusted from a first quantity to a second quantity; The first number is the number of keywords included in the keyword sequence, the second number is the product of the first number and a preset ratio, and the first number is greater than the second number.

21. The search device according to claim 14, wherein: Also includes: A candidate object sorting module, configured to sort the candidate objects according to the number of keywords contained in each candidate object; The target keyword determination module is configured to determine the target keyword that meets the spacing requirement in each candidate object sequentially or in batches according to the sorting order of the candidate objects.

22. The search device according to claim 14, wherein: The target object screening module also includes: The stop filtering module is used to stop filtering and return the determined target object when the search time reaches a time threshold; The continuing screening module is used to continue screening when the search time does not reach the time threshold.

23. The search device according to any one of claims 14 to 22, wherein: The candidate object search module includes: A stepwise search module, configured to obtain the candidate objects in steps according to the keyword sequence and based on a search cycle with a decreasing number of keywords; A search time determination module is configured to determine whether the search time exceeds a time threshold each time a corresponding candidate object is obtained based on a current number of keywords and a target object is screened from the candidate objects; A search loop module, configured to continue the search loop if a loop condition including at least that the search time does not exceed the time threshold is satisfied; The search end module is used to return the determined target object if the loop condition is not met.

24. The search device according to claim 23, wherein: The stepwise search module includes: An inverted index module, configured to search for objects hit by each keyword in the keyword sequence and obtain an inverted index for each keyword; The candidate object extraction module is used to extract objects shared by a corresponding number of keywords from the inverted index of each keyword in batches as candidate objects based on the corresponding number of keywords.

25. The search device according to claim 24, wherein: The candidate object extraction module includes: The combination extraction module is used to obtain all combinations of keywords of the corresponding number of keywords in the keyword sequence when the corresponding number of keywords is less than the total number of keywords in the keyword sequence, and extract objects common to the keywords of the corresponding number of keywords based on each combination.

26. The search device according to claim 25, wherein: The cycle conditions also include: The ratio of the value after the current number of keywords is decreased to the total number of keywords in the keyword sequence is less than a preset keyword hit rate.

27. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the search method according to any one of claims 1 to 13 is implemented.

28. A computer device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to perform the search method according to any one of claims 1 to 13 by executing the executable instructions.

Citation Information

Patent Citations

  • Keyword acquisition method and device, electronic equipment and storage medium

    CN113392177A