Resource searching method and device, electronic equipment and storage medium

By performing sequence correction of the pinyin information input by the user, a corrected string that conforms to the spelling rules is generated, which solves the problem that the user input information cannot accurately represent the search intention, and improves the accuracy and user experience of the search results.

CN119166862APending Publication Date: 2024-12-20BEIJING IQIYI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411285777.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In a specific type of terminal (such as a TV), due to the accuracy of the pinyin information input by the user, the information input by the user cannot accurately represent the user's search intention, resulting in inaccurate search results and low user experience.

Method used

By obtaining the string representing the pinyin, modifying the to-be-processed string according to the preset sequence correction relationship, and generating the modified string to match the pre-stored alternative resource index, thereby improving the accuracy of the search results. This sequence correction relationship includes a sequence of character of a single syllable or multiple syllables that does not conform to the Chinese pinyin spelling rules, and a sequence of character used to represent multiple syllables with preset semantics. The modified character sequence corresponds one by one to be corrected. .

Benefits of technology

Improve the accuracy of search results, so that the obtained search results meet the user's real search intention and enhance the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166862A_ABST
    Figure CN119166862A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a resource searching method and device, electronic equipment and a storage medium, and relates to the technical field of resource retrieval. The method comprises the steps of obtaining a to-be-processed character string; according to a preset sequence correction relationship, correcting a character sequence in the to-be-processed character string to obtain a corrected character string, and taking the corrected character string as a to-be-matched character string; the sequence correction relation comprises a plurality of to-be-corrected character sequences and a corrected character sequence corresponding to each to-be-corrected character sequence; the to-be-corrected character sequence comprises a character sequence corresponding to a single syllable which does not conform to a pinyin spelling rule, and / or a character sequence corresponding to a plurality of syllables used for representing preset semantics, and at least one spelling error syllable exists in the character sequence corresponding to the plurality of syllables; and determining an alternative resource of which the corresponding index is matched with the to-be-matched character string from pre-stored alternative resources, and taking the alternative resource as a search result of the to-be-processed character string. Therefore, the accuracy of the search result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of resource retrieval technology, and in particular to a resource search method, device, electronic equipment and storage medium. Background Art

[0002] For all kinds of websites, resource search is an important function. Users can enter the information they want to search in the search box provided by the terminal. The website can search according to the information entered by the user in the terminal, obtain the corresponding search results and feedback to the user.

[0003] At present, in the application scenarios of certain types of terminals (for example, TV terminals), due to the limitations of the input methods of certain types of terminals, websites mainly rely on the pinyin letters entered by users for search. However, due to the limitations of the accuracy of the information entered by users, the information entered by users cannot represent the user's true search intention. Only using the information entered by users for search may result in the inability to search for the resources that the user actually wants to search, resulting in a low user experience. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a resource search method, device, electronic device and storage medium to improve the accuracy of search results. The specific technical solution is as follows:

[0005] In a first aspect of the present invention, a resource search method is provided, the method comprising:

[0006] Get the string representing the pinyin as the string to be processed;

[0007] According to a preset sequence correction relationship, the character sequence in the character string to be processed is corrected to obtain a corrected character string as the character string to be matched; wherein the sequence correction relationship includes: a plurality of character sequences to be corrected, and a corrected character sequence corresponding to each character sequence to be corrected; the character sequence to be corrected in the preset sequence correction relationship includes: a character sequence corresponding to a single syllable that does not conform to the Chinese phonetic spelling rule, and / or a character sequence corresponding to a plurality of syllables used to represent preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the plurality of syllables, and the plurality of syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond one-to-one to the plurality of syllables contained in the character sequence to be corrected;

[0008] From the pre-stored candidate resources, a candidate resource whose corresponding index matches the to-be-matched string is determined as a search result of the to-be-processed string; wherein each pre-recorded candidate resource corresponds to at least one index.

[0009] In some embodiments, the character sequence in the to-be-processed string is modified according to a preset sequence modification relationship to obtain a modified string as the to-be-matched string, including:

[0010] Determine, in the character string to be processed, a character sequence that is consistent with the character sequence to be corrected in the preset sequence correction relationship as the first character sequence;

[0011] For each first character sequence in the character string to be processed, if the first character sequence has redundant characters relative to the second character sequence corresponding to the first character sequence, the redundant characters in the first character sequence are deleted so that the first character sequence after correction is consistent with the second character sequence corresponding to the first character sequence; wherein the second character sequence corresponding to a first character sequence is: the revised character sequence corresponding to the character sequence to be corrected that is consistent with the first character sequence;

[0012] If the first character sequence lacks characters relative to the second character sequence corresponding to the first character sequence, adding the missing characters to the first character sequence so that the modified first character sequence is consistent with the second character sequence corresponding to the first character sequence;

[0013] If there are inconsistent characters in the first character sequence relative to the second character sequence corresponding to the first character sequence, the inconsistent characters are replaced in the first character sequence so that the modified first character sequence is consistent with the second character sequence corresponding to the first character sequence.

[0014] In some embodiments, before modifying the character sequence in the to-be-processed string according to a preset sequence modification relationship to obtain a modified string as the to-be-matched string, the method further includes:

[0015] Obtain all subsequences contained in the character string to be processed as the first subsequence;

[0016] Determine the first subsequence to be used currently in descending order of the number of characters contained;

[0017] Determine whether there is a candidate resource with a corresponding index consistent with the first subsequence to be currently used in the pre-recorded candidate resources;

[0018] If so, the candidate resource whose corresponding index is consistent with the first subsequence to be used is determined as the first candidate resource;

[0019] If not, return to the step of determining the first subsequence to be used in descending order of the number of characters contained;

[0020] The step of correcting the character sequence in the character string to be processed according to the preset sequence correction relationship to obtain a corrected character string as the character string to be matched includes:

[0021] If the number of the determined first candidate resources is not greater than a preset threshold, the character sequence in the character string to be processed is corrected according to a preset sequence correction relationship to obtain a corrected character string as the character string to be matched.

[0022] In some embodiments, the obtaining, as the first subsequence, all subsequences contained in the character string to be processed includes:

[0023] Determine the i-th character in the string to be processed in order from front to back, and determine the j-th character in the string to be processed in order from back to front; wherein the value range of i is 1 to N, N represents the total number of characters contained in the string to be processed; the value range of j is i to N;

[0024] A sequence consisting of all characters between the ith character and the jth character is obtained as a first subsequence.

[0025] In some embodiments, before obtaining all subsequences contained in the to-be-processed string as the first subsequence, the method further includes:

[0026] Searching for a candidate resource whose corresponding index is consistent with the character string to be processed from pre-recorded candidate resources;

[0027] The step of obtaining all subsequences contained in the character string to be processed as the first subsequence includes:

[0028] If the number of candidate resources obtained through the search is less than a preset threshold, all subsequences contained in the character string to be processed are obtained as the first subsequence.

[0029] In some embodiments, the index corresponding to the pre-recorded candidate resource is established by at least one of the following methods:

[0030] For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the full pinyin of each Chinese character in the identification information of the candidate resource, and obtain the full pinyin of the identification information of the candidate resource as the index corresponding to the candidate resource;

[0031] For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the pinyin initials of each Chinese character in the identification information of the candidate resource, and obtain the pinyin initials of the identification information of the candidate resource as the index corresponding to the candidate resource;

[0032] For any candidate resource, perform word segmentation processing on the identification information of the candidate resource according to a preset granularity to obtain multiple word segments corresponding to the identification information of the candidate resource, and use the full pinyin of each word segment as the index corresponding to the candidate resource;

[0033] For any candidate resource, the identification information of the candidate resource is segmented according to a preset granularity to obtain multiple segmented words corresponding to the identification information of the candidate resource, and the first pinyin letter of each segmented word is used as the index corresponding to the candidate resource.

[0034] In some embodiments, the character string to be processed is: received through a search window of a terminal.

[0035] In a second aspect of the present invention, a resource search device is provided, the device comprising:

[0036] A module for obtaining a character string to be processed is used to obtain a character string representing pinyin as a character string to be processed;

[0037] A correction module, used for correcting the character sequence in the character string to be processed according to a preset sequence correction relationship, obtaining a corrected character string as the character string to be matched; wherein the sequence correction relationship includes: a plurality of character sequences to be corrected, and a corrected character sequence corresponding to each character sequence to be corrected; the character sequence to be corrected in the preset sequence correction relationship includes: a character sequence corresponding to a single syllable that does not conform to the Chinese phonetic spelling rule, and / or a character sequence corresponding to a plurality of syllables for representing preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the plurality of syllables, and the plurality of syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond one-to-one with the plurality of syllables contained in the character sequence to be corrected;

[0038] The recall module is used to determine, from the pre-stored candidate resources, a candidate resource whose corresponding index matches the to-be-matched string as the search result of the to-be-processed string; wherein each pre-recorded candidate resource corresponds to at least one index.

[0039] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, including:

[0040] Memory, used to store computer programs;

[0041] The processor is used to implement any of the resource search methods described above when executing a program stored in the memory.

[0042] In another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the resource search methods described above is implemented.

[0043] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the resource search methods described above.

[0044] An embodiment of the present invention provides a resource search method, which includes: obtaining a character string representing pinyin as a character string to be processed; correcting a character sequence in the character string to be processed according to a preset sequence correction relationship to obtain a corrected character string as a character string to be matched; wherein the sequence correction relationship includes: multiple character sequences to be corrected, and a corrected character sequence corresponding to each character sequence to be corrected; the character sequence to be corrected in the preset sequence correction relationship includes: a character sequence corresponding to a single syllable that does not conform to the Chinese pinyin spelling rule, and / or a character sequence corresponding to multiple syllables used to represent preset semantics, and there is at least one misspelled syllable in the character sequences corresponding to the multiple syllables, and the multiple syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond to the multiple syllables contained in the character sequence to be corrected one-to-one; from pre-stored candidate resources, determine a candidate resource whose corresponding index matches the character string to be matched as the search result of the character string to be processed; wherein each pre-recorded candidate resource corresponds to at least one index.

[0045] Based on the above processing, after obtaining the character string representing the pinyin (i.e., the character string to be processed), the electronic device can correct the character sequence in the character string to be processed according to the preset sequence correction relationship. In the preset sequence correction relationship, a character sequence to be corrected represents the character sequence corresponding to a single syllable that does not conform to the Chinese Pinyin spelling rules, indicating that there is no Chinese character whose pinyin is consistent with the character sequence to be corrected. Therefore, when there is a character sequence consistent with the character sequence to be corrected in the character string to be processed, the character sequence corresponding to the single syllable in the character string to be processed can be corrected according to the corrected character sequence corresponding to the character sequence to be corrected. In the preset sequence correction relationship, a character sequence to be corrected represents the character sequence corresponding to multiple syllables of the preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the multiple syllables, indicating that the at least one syllable is misspelled in the semantics represented by the character sequence to be corrected, and the multiple syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond to the multiple syllables contained in the character sequence to be corrected. Therefore, when there is a character sequence in the character string to be processed that is consistent with the character sequence to be corrected, the character sequence corresponding to each of the multiple syllables contained in the character string to be processed can be corrected according to the corrected character sequence corresponding to the character sequence to be corrected. In this way, the corrected character string (i.e., the character string to be matched) can meet the user's real search intention, and then, the character string to be matched is matched with the index corresponding to each alternative resource to obtain the search result of the character string to be processed, which can ensure that the obtained search result meets the user's real search intention and improve the accuracy of the search result. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0047] Figure 1 A first flow chart of a resource search method provided by an embodiment of the present invention;

[0048] Figure 2 A second flow chart of the resource search method provided by an embodiment of the present invention;

[0049] Figure 3 A third flow chart of the resource search method provided by an embodiment of the present invention;

[0050] Figure 4 A flowchart of sorting searched candidate resources provided by an embodiment of the present invention;

[0051] Figure 5 A schematic diagram of a resource search process provided by an embodiment of the present invention;

[0052] Figure 6 A structural diagram of a resource search device provided by an embodiment of the present invention;

[0053] Figure 7 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0055] For all kinds of websites, resource search is an important function. Users can enter the information they want to search in the search box provided by the terminal. The website can search according to the information entered by the user in the terminal, obtain the corresponding search results and feedback to the user.

[0056] At present, in the application scenarios of specific types of terminals, due to the limitation of the terminal input method, the website mainly relies on the pinyin letters input by the user for search. For example, the specific type of terminal may be a TV (television) terminal. For example, when the user wants to search for "news channel", the user needs to enter the pinyin initials "xwpd" or the full pinyin "xinwenpindao" of "news channel" to search for resources.

[0057] However, due to the accuracy limitation of the information input by the user, the information input by the user may not represent the user's true search intention. Searching using only the information input by the user may result in failure to search for the resources that the user actually wants to search for, resulting in a poor user experience.

[0058] In order to solve the above problem, an embodiment of the present invention provides a resource search method, which can be applied to any electronic device for searching resources, such as a server, a search device, etc. A user can input information about a resource to be obtained in a terminal of a specific type, and the electronic device can communicate with the terminal of the specific type to obtain the information input by the user.

[0059] See also Figure 1 , Figure 1 A first flow chart of a resource search method provided by an embodiment of the present invention, the method may include the following steps:

[0060] S101: Obtain a character string representing pinyin as a character string to be processed.

[0061] S102: Correcting the character sequence in the character string to be processed according to a preset sequence correction relationship to obtain a corrected character string as the character string to be matched.

[0062] Among them, the sequence correction relationship includes: multiple character sequences to be corrected, and a corrected character sequence corresponding to each character sequence to be corrected; the character sequence to be corrected in the preset sequence correction relationship includes: a character sequence corresponding to a single syllable that does not conform to the Chinese Pinyin spelling rules, and / or a character sequence corresponding to multiple syllables used to represent preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the multiple syllables, and the multiple syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond one-to-one to the multiple syllables contained in the character sequence to be corrected.

[0063] S103: Determine, from the pre-stored candidate resources, a candidate resource whose corresponding index matches the character string to be matched as a search result of the character string to be processed.

[0064] Each pre-recorded candidate resource corresponds to at least one index.

[0065] Based on the above processing, after obtaining the character string representing the pinyin (i.e., the character string to be processed), the electronic device can correct the character sequence in the character string to be processed according to the preset sequence correction relationship. In the preset sequence correction relationship, a character sequence to be corrected represents a character sequence corresponding to a single syllable that does not conform to the Chinese Pinyin spelling rules, indicating that there is no Chinese character whose pinyin is consistent with the character sequence to be corrected. Therefore, when there is a character sequence in the character string to be processed that is consistent with the character sequence to be corrected, the character sequence corresponding to the single syllable in the character string to be processed can be corrected according to the corrected character sequence corresponding to the character sequence to be corrected. In a preset sequence correction relationship, a character sequence to be corrected represents a character sequence corresponding to multiple syllables of preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the multiple syllables, indicating that the at least one syllable is misspelled in the semantics represented by the character sequence to be corrected, and because the multiple syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond one-to-one with the multiple syllables contained in the character sequence to be corrected, therefore, when there is a character sequence consistent with the character sequence to be corrected in the character string to be processed, the character sequence corresponding to each of the multiple syllables contained in the character string to be processed can be corrected according to the corrected character sequence corresponding to the character sequence to be corrected. In this way, the corrected character string (i.e., the character string to be matched) can meet the user's real search intention, and then, the character string to be matched is matched with the index corresponding to each alternative resource to obtain the search result of the character string to be processed, which can ensure that the obtained search result meets the user's real search intention and improve the accuracy of the search result.

[0066] The resource search method provided by the present invention is particularly suitable for application scenarios where the character string input by the user is pinyin letters.

[0067] For step S101, when the user wants to search for resources such as TV programs, TV series, music videos (MVs), etc., the resource search can be performed based on the information of the required resources. For example, the resource information can be the resource name, actor name, character name, publisher name, etc.

[0068] The user can enter a character string representing the information of the required resource in the search window provided by the terminal. The character string representing the information of the required resource is: the pinyin of the information of the required resource. That is, the user can enter the first letter of the pinyin or the full pinyin of the information of the required resource in the search box provided by the terminal.

[0069] For example, when a user wants to search for a TV program named "Lunchtime News", the user can enter the pinyin initials "wjxw" or the full pinyin "wujianxinwen" of "Lunchtime News". Or, when a user wants to search for a TV series "The Legend of Li Si" starring Zhang, the user can enter the pinyin initials "lsz" or the full pinyin "lisizhuan" of "The Legend of Li Si".

[0070] In one implementation, the character string to be processed is: received through a search window of a terminal.

[0071] In an embodiment of the present invention, the electronic device can obtain a character string representing pinyin input by the user at the terminal as a character string to be processed. For example, the terminal can be a TV terminal logged in by the user. Due to the limitation of the input method of the TV terminal, the user can only search by inputting letters (i.e., pinyin letters).

[0072] Correspondingly, the electronic device can obtain the character string input by the user and perform resource search according to the above steps S101 to S103.

[0073] In this way, the pinyin of the information of the required resources input by the user in the terminal can be processed according to the resource search method provided by the present invention to ensure that the search results obtained meet the user's real search intention and improve the accuracy of the search results.

[0074] Regarding step S102, it is understandable that due to the accuracy of the information input by the user, for example, due to the difference between dialects and Mandarin, when the user needs to input pinyin containing easily confused front and back nasal sounds, flat and retroflex tongue sounds, etc., there may be single or multiple syllable spelling errors in the string input by the user; or, the user may make an accidental touch operation when inputting the string, which may also cause single or multiple syllable spelling errors in the string input by the user. Therefore, there may be at least one of the following situations in the string input by the user, resulting in the string to be processed failing to represent the user's true search intent:

[0075] In the first case, there may be a character sequence corresponding to a single syllable that does not conform to the Chinese Pinyin spelling rule in the character string to be processed.

[0076] For example, the name of the resource required by the user is "Crazy Zootopia", and the pinyin of the information is "fengkuangdongwucheng", while the character string actually input by the user (i.e., the character string to be processed) is "fongkuangdongwucheng". And since there is no Chinese character with the pinyin "fong" in Chinese, that is, there is a character sequence "fong" corresponding to a syllable in the character string to be processed that does not conform to the Chinese pinyin spelling rules.

[0077] In the second case, the multiple syllables contained in the character string to be processed are used to represent a fixed semantics, and there is at least one misspelled syllable in the character sequence corresponding to the multiple syllables.

[0078] For example, the name of the resource required by the user contains the Chinese characters "Fujian", the pinyin of which is "fujian", and the character string actually input by the user (i.e., the character string to be processed) is "hujianxinwen". It can be seen that there are no syllables in the character string to be processed that do not conform to the Chinese pinyin spelling rules, but because the user confuses the pronunciation of "hu" and "fu", there is a misspelled syllable in the character sequence corresponding to the multiple syllables contained in the character string to be processed.

[0079] Accordingly, the electronic device can pre-count the character sequences corresponding to single syllables of the first case in the character string input by the user in the past, and / or the character sequences corresponding to multiple syllables of the second case in the character string input by the user in the past, as multiple character sequences to be corrected included in the preset sequence correction relationship, and then the technician can determine the corrected character sequence corresponding to each character sequence to be corrected.

[0080] Alternatively, the plurality of character sequences to be corrected included in the preset sequence correction relationship, and the corrected character sequence corresponding to each character sequence to be corrected, may also be preset by a technician based on experience.

[0081] For example, the preset sequence correction relationship may be recorded in the form of a table. Accordingly, the preset sequence correction relationship may be shown in the following table (1):

[0082] Table (1)

[0083] Character sequence to be corrected The corrected character sequence corresponding to the character sequence to be corrected fong Feng nv nü wxya f hepin heping pingdao pindao … …

[0084] The character sequences to be corrected in the preset sequence correction relationship include: a character sequence corresponding to a single syllable that does not conform to the Chinese Pinyin spelling rule, and a corrected character sequence corresponding to each character sequence to be corrected.

[0085] For example, the character sequence to be corrected is "fong", and the corrected character sequence corresponding to "fong" is "feng"; the character sequence to be corrected is "nv", and the corrected character sequence corresponding to "nv" is "n ü "wait.

[0086] The character sequence to be corrected in the preset sequence correction relationship further includes: a character sequence corresponding to multiple syllables for representing preset semantics, wherein the character sequence corresponding to the multiple syllables contains at least one misspelled syllable, and a corrected character sequence corresponding to each character sequence to be corrected. The multiple syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond to the multiple syllables contained in the character sequence to be corrected one by one.

[0087] For example, the character sequence to be revised "hjxw" representing the semantics of "Fujian News", and the revised character sequence "fjxw" corresponding to "hjxw"; the character sequence to be revised "hepin" representing the semantics of "peace", and the revised character sequence "heping" corresponding to "hepin"; the character sequence to be revised "pingdao" representing the semantics of "channel", and the revised character sequence "pindao" corresponding to "pingdao", etc.

[0088] In order to make the search results obtained based on the character string to be processed meet the user's actual search intention, the electronic device can correct the character sequence in the character string to be processed according to a preset sequence correction relationship to obtain a corrected character string for matching with a pre-recorded alternative resource, that is, the character string to be matched.

[0089] In some embodiments, see Figure 2 , Figure 2 A second flow chart of the resource search method provided by the embodiment of the present invention, in Figure 1 On the basis of, step S102 comprises:

[0090] S1021: Determine a character sequence in the character string to be processed that is consistent with the character sequence to be corrected in the preset sequence correction relationship, as the first character sequence.

[0091] S1022: For each first character sequence in the character string to be processed, if the first character sequence has redundant characters relative to the second character sequence corresponding to the first character sequence, the redundant characters in the first character sequence are deleted so that the corrected first character sequence is consistent with the second character sequence corresponding to the first character sequence.

[0092] The second character sequence corresponding to a first character sequence is: a corrected character sequence corresponding to a character sequence to be corrected that is consistent with the first character sequence.

[0093] S1023: If the first character sequence lacks characters relative to the second character sequence corresponding to the first character sequence, add the missing characters to the first character sequence so that the corrected first character sequence is consistent with the second character sequence corresponding to the first character sequence.

[0094] S1024: If there are inconsistent characters in the first character sequence relative to the second character sequence corresponding to the first character sequence, replace the inconsistent characters in the first character sequence to make the corrected first character sequence consistent with the second character sequence corresponding to the first character sequence.

[0095] In the embodiment of the present application, after obtaining the character string input by the user (i.e., the character string to be processed), it can be determined whether the character string to be processed contains: a character sequence that is consistent with the character sequence to be corrected in the preset sequence correction relationship. If so, it means that there is a character sequence corresponding to the pinyin that needs to be corrected in the character string to be processed. Therefore, the electronic device can determine the character sequence in the character string to be processed that is consistent with the character sequence to be corrected in the preset sequence correction relationship as the first character sequence.

[0096] For example, based on the above table (1), if the character string 1 to be processed is: "hepinfandian", then there is a character sequence in the character string 1 to be processed that is consistent with the character sequence to be corrected "hepin". Accordingly, the character sequence "hepin" in the character string 1 to be processed can be determined as the first character sequence.

[0097] If the character string 2 to be processed is: "fongkuangdongwucheng", then there is a character sequence in the character string 2 to be processed that is consistent with the character sequence to be corrected "fong". Accordingly, the character sequence "fong" in the character string 2 to be processed can be determined as the first character sequence.

[0098] If the character string 3 to be processed is: "nongyepingdao", then there is a character sequence in the character string 3 to be processed that is consistent with the character sequence to be corrected "pingdao". Accordingly, the character sequence "pingdao" in the character string 3 to be processed can be determined as the first character sequence.

[0099] For each first character sequence in the character string to be processed, a second character sequence corresponding to the first character sequence can be determined, wherein a second character sequence corresponding to a first character sequence is: a corrected character sequence corresponding to a character sequence to be corrected that is consistent with the first character sequence.

[0100] Correspondingly, for each first character sequence in the character string to be processed, correction can be performed in one of the following three ways according to the difference between the first character sequence and the second character sequence corresponding to the first character sequence, so that the corrected first character sequence is consistent with the second character sequence corresponding to the first character sequence.

[0101] Method 1: If the first character sequence has redundant characters relative to the second character sequence corresponding to the first character sequence, the redundant characters in the first character sequence are deleted to make the modified first character sequence consistent with the second character sequence corresponding to the first character sequence.

[0102] For example, for the first character sequence "pingdao" in the character string 3 to be processed, it can be determined that the corrected character sequence corresponding to the character sequence to be corrected that is consistent with the first character sequence is "pindao", and correspondingly, the second character sequence corresponding to the first character sequence is "pindao". At this time, the first character sequence has an extra character "g" relative to the second character sequence corresponding to the first character sequence, then the extra character "g" in the first character sequence can be deleted, and the corrected first character sequence is "pindao", and correspondingly, the corrected character string 3 to be processed is "nongyepindao".

[0103] Method 2: If the first character sequence lacks characters relative to the second character sequence corresponding to the first character sequence, the missing characters are added to the first character sequence so that the corrected first character sequence is consistent with the second character sequence corresponding to the first character sequence.

[0104] For example, for the first character sequence "hepin" in the character string 1 to be processed, it can be determined that the corrected character sequence corresponding to the character sequence to be corrected that is consistent with the first character sequence is "heping", and accordingly, the second character sequence corresponding to the first character sequence is "heping". At this time, the first character sequence lacks the character "g" relative to the second character sequence corresponding to the first character sequence, and the missing character "g" can be added to the first character sequence to obtain the corrected first character sequence "heping", and accordingly, the corrected character string 1 to be processed is "hepingfandian".

[0105] Method three: if there are inconsistent characters in the first character sequence relative to the second character sequence corresponding to the first character sequence, replace the inconsistent characters in the first character sequence so that the corrected first character sequence is consistent with the second character sequence corresponding to the first character sequence.

[0106] For example, for the first character sequence "fong" in the character string to be processed 2, it can be determined that the corrected character sequence corresponding to the character sequence to be corrected that is consistent with the first character sequence is "feng", and accordingly, the second character sequence corresponding to the first character sequence is "feng". At this time, the first character sequence has an inconsistent character "o" relative to the second character sequence corresponding to the first character sequence, and the inconsistent character "o" can be replaced in the first character sequence to obtain the corrected first character sequence "feng", and accordingly, the corrected character string to be processed 1 is "fengkuangdongwucheng".

[0107] Based on the above processing, the character sequence (i.e., the first character sequence) in the character string to be processed that is consistent with the character sequence to be corrected in the preset sequence correction relationship can be corrected by adding characters, deleting characters, or replacing characters, so that each corrected first character sequence is consistent with the second character sequence corresponding to the first character sequence, so that the accuracy of the corrected character string can be improved. Furthermore, when searching for resources through the replaced character string, the resources required by the user can be searched, thereby improving the accuracy of the resource search.

[0108] With respect to step S103, after obtaining the corrected string (ie, the string to be matched), the electronic device may obtain, from pre-recorded candidate resources, candidate resources whose corresponding indexes match the string to be matched as search results of the string to be processed.

[0109] The process of obtaining candidate resources whose corresponding indexes match the character string to be matched may also be referred to as a resource recall process, and the specific recall process will be described in subsequent embodiments.

[0110] The electronic device may obtain pre-recorded candidate resources and at least one index corresponding to each candidate resource. For example, the candidate resources and at least one index corresponding to each candidate resource may be recorded in a database. Accordingly, the electronic device may obtain data recorded in the database.

[0111] For a candidate resource, the index corresponding to the candidate resource is: established according to the identification information of the candidate resource. For example, the identification information of a candidate resource may include at least one of the following: name, actor name, role name, publisher name, etc.

[0112] In some embodiments, the index corresponding to the pre-recorded candidate resource is established by at least one of the following methods:

[0113] Method 1: For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the full pinyin of each Chinese character in the identification information of the candidate resource to obtain the full pinyin of the identification information of the candidate resource as the index corresponding to the candidate resource.

[0114] In the embodiment of the present invention, for any candidate resource, if the identification information of the candidate resource includes Chinese characters, the pinyin of each Chinese character can be obtained.

[0115] In one implementation, the electronic device may determine the pinyin of each Chinese character included in the identification information of the candidate resource according to a preset database recording the correspondence between Chinese characters and pinyin.

[0116] In another implementation, the electronic device may also input each Chinese character in the identification information of the candidate resource into a preset Chinese character to pinyin conversion model to obtain the pinyin of each Chinese character. For example, the Chinese character to pinyin conversion model may be a large language model (LLM).

[0117] Furthermore, the full pinyin of each Chinese character can be used to replace each Chinese character in the identification information of the candidate resource to obtain the full pinyin corresponding to the identification information of the candidate resource as the index corresponding to the candidate resource.

[0118] For example, the identification information of candidate resource 1 includes: the name of the candidate resource "Li Si Chuan 01", then "Li Si Chuan" can be replaced with "lisizhuan", and then the replaced "lisizhuan01" can be used as the index corresponding to the candidate resource.

[0119] The identification information of candidate resource 2 includes: the name of the candidate resource "First News Channel", then "diyixinwenpindao" can be used to replace "First News Channel", and then the replaced "diyixinwenpindao" can be used as the index corresponding to the candidate resource.

[0120] In this way, for any alternative resource, an index corresponding to the identification information of the alternative resource can be established based on the full pinyin of the Chinese characters contained in the identification information of the alternative resource, so that when the character string to be processed input by the user contains the full pinyin of the identification information of the alternative resource, the alternative resource can be used as the search result of the character string to be processed.

[0121] Method 2: For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the pinyin initials of each Chinese character in the identification information of the candidate resource to obtain the pinyin initials of the identification information of the candidate resource as the index corresponding to the candidate resource.

[0122] In an embodiment of the present invention, for any alternative resource, if the identification information of the alternative resource contains Chinese characters, the pinyin of each Chinese character can be obtained. The process of obtaining the pinyin of each Chinese character can refer to the above embodiment and will not be elaborated here.

[0123] Correspondingly, after obtaining the pinyin of each Chinese character in the identification information of the alternative resource, the first letters of the pinyin of each Chinese character can be used to replace each Chinese character in the identification information of the alternative resource, and the corresponding initials of the pinyin of the identification information of the alternative resource are obtained as the index corresponding to the alternative resource.

[0124] It can be understood that the initials of the pinyin of the identification information of an alternative resource refer to the initials of each syllable in the full pinyin of the identification information of the alternative resource. Among them, one Chinese character corresponds to one syllable.

[0125] For example, if the identification information of alternative resource 1 includes the name "Li Sichuan 01" of the alternative resource, then the Chinese characters "Li Sichuan" can be replaced with the initials "lsz" of each syllable in "lisizhuan". Furthermore, the replaced "lsz01" can be used as the index corresponding to the alternative resource.

[0126] If the identification information of alternative resource 2 includes the name "First News Channel" of the alternative resource, then "dyxwpd" can be used to replace "First News Channel". Furthermore, the replaced "dyxwpd" can be used as the index corresponding to the alternative resource.

[0127] In this way, for any alternative resource, an index corresponding to the identification information of the alternative resource can be established according to the initials of the pinyin of the Chinese characters included in the identification information of the alternative resource, so that when the input string to be processed by the user includes the initials of the pinyin of the identification information of the alternative resource, the alternative resource can be used as the search result of the string to be processed.

[0128] Method 3: For any alternative resource, the identification information of the alternative resource is segmented according to a preset granularity to obtain multiple segments corresponding to the identification information of the alternative resource, and the full pinyin of each segment is used as the index corresponding to the alternative resource.

[0129] In an embodiment of the present invention, for any alternative resource, if the identification information of the alternative resource contains Chinese characters, the identification information of the alternative resource can be segmented according to a preset granularity. The preset granularity is set by those skilled in the art according to actual needs. For example, the granularity of segmentation can be a word (basic vocabulary unit), or a phrase (a fixed collocation composed of multiple words), etc.

[0130] In one implementation, for the identification information of an alternative resource, the electronic device can input the identification information of the alternative resource into a preset word segmentation model, and the word segmentation model can perform word segmentation processing on the identification information of the alternative resource according to a preset granularity, and output multiple word segments corresponding to the identification information of the alternative resource.

[0131] Correspondingly, after obtaining multiple word segments corresponding to the identification information of an alternative resource, for any word segment, the pinyin of the Chinese characters contained in the word segment can be obtained to obtain the full pinyin of the word segment. Furthermore, the full pinyin of each word segment corresponding to the identification information of the alternative resource can be used as the index corresponding to the alternative resource. The process of obtaining the pinyin of each Chinese character can refer to the above embodiment and will not be repeated here.

[0132] For example, the identification information of candidate resource 3 includes: the name of the candidate resource "TV Noon News", then "TV Noon News" is segmented according to the preset granularity to obtain multiple segmented words corresponding to "TV Noon News": "TV Noon", "Noon", "News". Then, the full pinyin of each segmented word can be obtained: "diyidianshitai", "wujian", "xinwen", as the index corresponding to the candidate resource.

[0133] In this way, for any candidate resource, the identification information of the candidate resource can be segmented, and based on the full pinyin of each segmented word, an index corresponding to the identification information of the candidate resource can be established. When the character string to be processed input by the user contains the full pinyin of a segmented word corresponding to the candidate resource, the alternative resource can be used as the search result of the character string to be processed. In other words, the character string input by the user does not need to be completely consistent with the character string representing the identification information of the candidate resource, and the alternative resource can also be retrieved, which can improve the flexibility and accuracy of the search.

[0134] Method 4: For any candidate resource, perform word segmentation processing on the identification information of the candidate resource according to a preset granularity to obtain multiple word segments corresponding to the identification information of the candidate resource, and use the first pinyin letter of each word segment as the index corresponding to the candidate resource.

[0135] In an embodiment of the present invention, for any candidate resource, if the identification information of the candidate resource contains Chinese characters, after the identification information of the candidate resource is segmented according to a preset granularity to obtain multiple segmented words corresponding to the identification information of the candidate resource, for any segmented word, the pinyin first letter of the Chinese character contained in the segmented word can be obtained to obtain the pinyin first letter of the segmented word. Furthermore, the pinyin first letter of each segmented word corresponding to the identification information of the candidate resource can be used as the index corresponding to the candidate resource. Among them, the process of segmenting the identification information of the candidate resource according to the preset granularity and the process of obtaining the pinyin first letter of each Chinese character can refer to the above embodiment and will not be repeated here.

[0136] It is understandable that the first letter of the pinyin of a word segment represents: the first letter of each syllable in the full pinyin of the word segment, wherein one Chinese character corresponds to one syllable.

[0137] For example, the identification information of candidate resource 4 includes: the name of the candidate resource is "TV Noon News", then "TV Noon News" is segmented according to the preset granularity to obtain multiple segmented words corresponding to "TV Noon News": "TV Noon", "Noon", "News". Then, the first letter of each syllable in the full pinyin of each segmented word can be obtained to obtain the pinyin first letter of each segmented word: "dydst", "wj", "xw", as the index corresponding to the candidate resource.

[0138] In this way, for any candidate resource, the identification information of the candidate resource can be segmented, and an index corresponding to the identification information of the candidate resource can be established based on the first pinyin letter of each segmented word. When the character string to be processed input by the user contains the first pinyin letter of a segmented word corresponding to the candidate resource, the candidate resource can be used as the search result of the character string to be processed. In other words, the character string input by the user does not need to be completely consistent with the character string representing the identification information of the candidate resource, and the candidate resource can also be retrieved, which can improve the flexibility and accuracy of the search.

[0139] It is understandable that, for any candidate resource, when establishing an index of the candidate resource, at least one method can be selected from the above indexing methods according to actual needs to establish the index of the candidate resource.

[0140] Based on the above processing, an index corresponding to the alternative resources can be established according to at least one of the above methods, based on the pinyin of the Chinese characters in the identification information of the pre-recorded alternative resources. In this way, it can be ensured that when the user searches for resources through the pinyin input method, the corresponding index can be obtained from the pre-recorded alternative resources that matches the character string to be matched input by the user, thereby improving the accuracy of the search.

[0141] In addition, when establishing indexes corresponding to alternative resources in accordance with multiple methods among the above-mentioned methods, the indexes corresponding to each alternative resource can be enriched. When the information represented by the string input by the user is not completely consistent with the identification information of the alternative resource, resources that meet the user's needs can also be searched. In this way, the flexibility of retrieval can be improved.

[0142] In some embodiments, before modifying the character sequence in the string to be processed, a resource search may be performed based on a subsequence in the string to be processed. Figure 3 , Figure 3 A third flow chart of the resource search method provided by the embodiment of the present invention, in Figure 1 On the basis of, before step S102, the method further includes:

[0143] S104: Obtain all subsequences contained in the character string to be processed as the first subsequence.

[0144] S105: Determine the first subsequence to be used currently in descending order of the number of characters included.

[0145] S106: Determine whether there is a candidate resource whose corresponding index is consistent with the first subsequence to be currently used in the pre-recorded candidate resources.

[0146] If it exists, execute step S107; if it does not exist, return to execute step S105.

[0147] S107: Determine the candidate resource whose corresponding index is consistent with the first subsequence to be currently used as the first candidate resource.

[0148] Step S102 includes:

[0149] S102a: If the number of the determined first candidate resources is not greater than a preset threshold, the character sequence in the character string to be processed is corrected according to a preset sequence correction relationship to obtain a corrected character string as the character string to be matched.

[0150] In the embodiment of the present invention, the electronic device may obtain all subsequences contained in the character string to be processed as the first subsequence.

[0151] In one implementation, step S104 includes:

[0152] Step 1: Determine the i-th character in the string to be processed in order from front to back, and determine the j-th character in the string to be processed in order from back to front.

[0153] Among them, the value range of i is 1 to N, N represents the total number of characters contained in the character string to be processed; the value range of j is i to N.

[0154] Step 2: Get a sequence consisting of all characters between the ith character and the jth character as the first subsequence.

[0155] In the embodiment of the present application, the i-th character in the string to be processed is determined in order from front to back, and the j-th character in the string to be processed is determined in order from back to front, and the total number of characters contained in the string to be processed can be expressed as N. Then, the sequence consisting of all characters between the i-th character and the j-th character is taken as the first subsequence. Among them, the value range of i is 1 to N, N represents the total number of characters contained in the string to be processed; the value range of j is i to N.

[0156] It can be understood that according to the above steps 1-2, the first subsequence obtained (ie, i is 1 and j is N) is the sequence corresponding to the string to be processed itself, and is also the longest subsequence among the subsequences contained in the string to be processed.

[0157] For example, the string to be processed is "ts06". According to the above steps 1-2, all subsequences contained in the string to be processed are obtained as follows: "ts06", "ts0", "s06", "ts", "s0", "06", "t", "s", "0", "6". Accordingly, the 10 subsequences can be used as the first subsequence.

[0158] Furthermore, the electronic device can determine the first subsequence to be used currently in the order of the number of characters contained from large to small, and search for resources based on the first subsequence to be used currently. That is, the electronic device can sort the characters contained in each first subsequence in descending order, and search for resources one by one according to the sorted first subsequences. If there are multiple first subsequences containing the same number of characters, the order between the multiple first subsequences can be random.

[0159] Whenever a resource search is performed according to the first subsequence to be currently used, the electronic device may determine whether there is an alternative resource whose corresponding index is consistent with the first subsequence to be currently used among the pre-recorded alternative resources.

[0160] If there is at least one candidate resource whose corresponding index is consistent with the first subsequence to be currently used, the at least one candidate resource is determined as the first candidate resource.

[0161] That is, after obtaining the candidate resource whose corresponding index matches the first subsequence according to the first subsequence to be used, the electronic device will stop the next resource search. That is, the first subsequence used to obtain the search result of the string to be processed is: among all the subsequences contained in the string to be processed, the subsequence with the largest number of characters and an index consistent with the subsequence (which can be called the longest search subsequence).

[0162] If there is no alternative resource whose corresponding index is consistent with the first subsequence to be used currently, a first subsequence whose number of characters is not greater than the first subsequence to be used currently and for which no resource search has been performed can be obtained from all first subsequences to update the first subsequence to be used currently, and a resource search can be performed based on the updated first subsequence to be used currently.

[0163] For example, for each first subsequence obtained for the above-mentioned string "ts06" to be processed, the first subsequence to be used can be determined in the order of "ts06", "ts0", "s06", "ts", "s0", "06", "t", "s", "0", and "6", and a resource search can be performed based on the first subsequence to be used. That is to say, when performing a resource search for the first time, "ts06" can be determined as the first subsequence to be used, and then it can be determined whether there is an alternative resource with a corresponding index consistent with "ts06" in the pre-recorded alternative resources. If so, the alternative resource with a corresponding index consistent with "ts06" can be obtained as the search result of the string to be processed. If not, "ts0" or "s06" can be determined as the first subsequence to be used, and the above-mentioned resource search steps are repeated until it is determined that there is an alternative resource with a corresponding index consistent with the first subsequence to be used in the pre-recorded alternative resources.

[0164] That is to say, if the first subsequence currently to be used is "ts0" when the resource search is performed for the second time, and there is an alternative resource with a corresponding index consistent with "ts0", then the alternative resource with a corresponding index consistent with "ts0" can be obtained as the search result of the string to be processed ("ts06").

[0165] The number of the determined first candidate resources is not greater than the preset threshold, indicating that the number of the determined first candidate resources is small, or there is no candidate resource with a corresponding index consistent with each first subsequence in the pre-recorded candidate resources, that is, the first candidate resource is not determined. At this time, in order to avoid inaccuracy of the character string to be processed due to an error in user input and failure to obtain resource search results, step S102 can be performed to correct the character sequence in the character string to be processed.

[0166] Based on the above processing, resource retrieval is performed according to each first subsequence in the order of the number of characters contained from large to small, and longer subsequences can be matched preferentially. Since longer subsequences can more accurately represent the resources required by the user, and the actual text meaning represented by longer subsequences is more unique than that represented by shorter subsequences, the resources required by the user can be located more quickly, thereby improving the search efficiency. When the number of first candidate resources obtained by the search is small, the character string to be processed can be corrected, which can improve the efficiency of the search and avoid the waste of calculation.

[0167] In some embodiments, before step S104, the method further includes:

[0168] From the pre-recorded candidate resources, search for the candidate resource whose corresponding index is consistent with the string to be processed.

[0169] Step S104 includes:

[0170] If the number of candidate resources obtained by searching is less than a preset threshold, all subsequences contained in the character string to be processed are obtained as the first subsequence.

[0171] In the embodiment of the present invention, after obtaining the character string input by the user (ie, the character string to be processed), the electronic device may search for a candidate resource whose corresponding index is consistent with the character string to be processed from pre-recorded candidate resources.

[0172] If the number of candidate resources obtained by the search is less than the preset threshold, it indicates that the number of candidate resources obtained by the current search is small. If the obtained candidate resources are directly returned to the user, the user's search needs may not be met, resulting in a poor user experience.

[0173] Correspondingly, when the number of candidate resources obtained through the search is less than a preset threshold, the electronic device may search for resources according to the above steps S104 to S107, and the specific search process will not be described in detail herein.

[0174] Based on the above processing, when a detailed search is performed on the string input by the user and fewer search results are obtained, the resource search method provided by the present invention can be used for correction to ensure that the search results obtained meet the user's actual search intent. In scenarios where there are no results for clear search intent, an incremental recommendation function can be provided to effectively improve the distribution of similar content and promote the improvement of overall distribution efficiency.

[0175] In some embodiments, see Figure 4 , Figure 4A flowchart for sorting searched candidate resources provided by an embodiment of the present invention, after obtaining the candidate resources whose corresponding indexes match the string to be matched according to the above steps S101 to S103, the candidate resources whose corresponding indexes match the string to be matched can be sorted according to the following steps:

[0176] S401: Based on a preset first sorting model, sort candidate resources whose corresponding indexes match the character string to be matched, and determine a first preset number of first resources to be sorted.

[0177] S402: Sort the first resources to be sorted based on a preset second sorting model to determine the first second preset number of second resources to be sorted.

[0178] S403: Sort the second resources to be sorted based on the preset third sorting model to obtain a specified order of each second resource to be sorted, and return the second resources to be sorted and the specified order of each second resource to be sorted to the user.

[0179] It is understandable that the search results of the string to be processed may contain thousands or tens of thousands of candidate resources. Therefore, the electronic device can further filter and sort the search results of the string to be processed to improve the accuracy of the search results while reducing the number of resources obtained by the search.

[0180] In an embodiment of the present invention, after obtaining the search results of the string to be processed, the candidate resources contained in the search results of the string to be processed can be roughly sorted based on a preset first sorting model (also referred to as a rough sorting model) to determine the first first preset number of first resources to be sorted. For example, the first sorting model can score the candidate resources whose corresponding index matches the string to be matched in multiple business target dimensions (such as click-through rate, etc.), and determine the first first preset number of candidate resources as the first resources to be sorted in descending order of scores.

[0181] Among them, the preset first sorting model can be a machine learning model such as a logistic regression (LR) model or a multilayer perceptron (MLP) model.

[0182] In this way, the number of resources required to be returned to the user can be reduced according to actual needs. In addition, when the first resources to be sorted are subsequently refined, the efficiency of the refined sorting can be improved, and a large amount of computing resources can be wasted during the refined sorting process.

[0183] The electronic device can further screen and sort the first resources to be sorted by a preset second sorting model (also called a refined sorting model) to determine the first second preset number of second resources to be sorted. For example, the second sorting model can score each candidate resource in multiple business target dimensions (such as click-through rate, conversion rate, etc.), and determine the first second preset number of first resources to be sorted as the second resources to be sorted in descending order of scores.

[0184] The preset second sorting model can be a deep neural network (DNN , Deep Neural Networks) model, recurrent neural network (RNN) , Recurrent Neural Network) model, etc.

[0185] After obtaining the second resources to be sorted, the second resources to be sorted can be re-ranked based on the third sorting model (also called a re-ranking model) in combination with the actual needs of the business scenario (such as click-through rate, number of views, number of favorites, etc.) to obtain the specified order of each second resource to be sorted. The re-ranking can be a recurrent neural network model, a self-attention network (Self-Attention) model, etc.

[0186] After obtaining the designated sequence of each second resource to be sorted, each second resource to be sorted may be displayed on the terminal logged in by the user according to the designated sequence of each second resource to be sorted.

[0187] Based on the above processing, after obtaining the search results of the string input by the user, the search results can be filtered and sorted based on the first sorting model, the second sorting model and the third sorting model, so as to adjust the display order of the searched resources according to actual needs, give priority to recommending resources that meet user needs, improve user experience, and provide users with intelligent resource search services.

[0188] See also Figure 5 , Figure 5 A schematic diagram of a resource search process provided by an embodiment of the present invention. Figure 5In the text, TV (television) content source represents pre-recorded alternative resources, and offline service represents the process of establishing indexes corresponding to alternative resources and establishing preset sequence correction relationships. Accordingly, for each alternative resource, the Chinese-to-pinyin recognition service can be used to establish a full spelling index of the alternative resource in accordance with the above method 1, and an initial letter index of the alternative resource can be established in accordance with the above method 2. For each alternative resource, the word-granularity full spelling index of the alternative resource can also be established in accordance with the above method 3 through the word segmentation service, and an initial letter index of the alternative resource can be established in accordance with the above method 4. In addition, pinyin sequences with a high probability of spelling errors when input by users can also be collected and sorted in advance as character sequences to be corrected, as well as the corrected character sequences corresponding to each character sequence to be corrected. For example, the character sequence to be corrected may include: a character sequence corresponding to multiple syllables that are prone to incorrect pinyin, a character sequence corresponding to at least one syllable containing front and back nasal sounds, a character sequence corresponding to at least one syllable containing flat and retroflex tongue sounds, and a character sequence corresponding to at least one syllable of a word with the same pronunciation as pinyin letters and English letters (i.e., a pinyin sequence containing differences between pinyin and English), etc.

[0189] The recall service indicates the process of searching for resources. Accordingly, after obtaining the character string input by the user (ie, the character string to be processed, also referred to as a token), the electronic device can correct the character sequence in the character string to be processed and obtain the corrected character string as the character string to be matched.

[0190] In addition, after obtaining the character string to be processed, a resource search (i.e., longest subsequence matching) can also be performed according to steps S104 to S107. That is, all subsequences contained in the character string to be processed are matched with the indexes of each candidate resource (including the first letter index and the full spelling index) to obtain a subsequence (i.e., the longest subsequence) containing the largest number of characters and having an index consistent with the subsequence, and a first candidate resource whose corresponding index is consistent with the longest subsequence. When the number of the determined first candidate resources is not greater than the preset threshold, step S102 is executed.

[0191] Furthermore, the character sequence in the character string to be processed can be corrected according to the above steps S1021 to S1024. That is, matching is performed based on the corrected character string to be matched, and a candidate resource whose corresponding index matches the character string to be matched is obtained from the pre-recorded candidate resources.

[0192] Accordingly, the search results of the character string to be processed can be roughly sorted, finely sorted, and rearranged according to steps S401 to S403 to obtain the resources (i.e., the second resources to be sorted) and the specified order of each resource that are finally returned to the user. Subsequently, each second resource to be sorted can be displayed on the terminal logged in by the user according to the specified order of each second resource to be sorted.

[0193] Based on the same inventive concept, an embodiment of the present invention provides an image generating device, see Figure 6 , Figure 6 A structural diagram of a resource search device provided by an embodiment of the present invention. The device comprises:

[0194] The to-be-processed character string acquisition module 601 is used to acquire a character string representing pinyin as the to-be-processed character string;

[0195] The correction module 602 is used to correct the character sequence in the character string to be processed according to a preset sequence correction relationship to obtain a corrected character string as the character string to be matched; wherein the sequence correction relationship includes: a plurality of character sequences to be corrected, and a corrected character sequence corresponding to each character sequence to be corrected; the character sequence to be corrected in the preset sequence correction relationship includes: a character sequence corresponding to a single syllable that does not conform to the Chinese phonetic spelling rule, and / or a character sequence corresponding to a plurality of syllables for representing preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the plurality of syllables, and the plurality of syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond to the plurality of syllables contained in the character sequence to be corrected one-to-one;

[0196] The recall module 603 is used to determine, from the pre-stored candidate resources, a candidate resource whose corresponding index matches the to-be-matched string as the search result of the to-be-processed string; wherein each pre-recorded candidate resource corresponds to at least one index.

[0197] In some embodiments, the correction module 602 is specifically used to:

[0198] Determine, in the character string to be processed, a character sequence that is consistent with the character sequence to be corrected in the preset sequence correction relationship as the first character sequence;

[0199] For each first character sequence in the character string to be processed, if the first character sequence has redundant characters relative to the second character sequence corresponding to the first character sequence, the redundant characters in the first character sequence are deleted so that the first character sequence after correction is consistent with the second character sequence corresponding to the first character sequence; wherein the second character sequence corresponding to a first character sequence is: the revised character sequence corresponding to the character sequence to be corrected that is consistent with the first character sequence;

[0200] If the first character sequence lacks characters relative to the second character sequence corresponding to the first character sequence, adding the missing characters to the first character sequence so that the modified first character sequence is consistent with the second character sequence corresponding to the first character sequence;

[0201] If there are inconsistent characters in the first character sequence relative to the second character sequence corresponding to the first character sequence, the inconsistent characters are replaced in the first character sequence so that the modified first character sequence is consistent with the second character sequence corresponding to the first character sequence.

[0202] In some embodiments, the apparatus further comprises:

[0203] A subsequence acquisition module, used for acquiring all subsequences contained in the character string to be processed as a first subsequence before correcting the character sequence in the character string to be processed according to the preset sequence correction relationship to obtain the corrected character string as the character string to be matched;

[0204] A subsequence determination module, used to determine the first subsequence to be used currently in descending order of the number of characters contained;

[0205] A judgment module, used to determine whether there is a candidate resource with a corresponding index consistent with the first subsequence currently to be used in the pre-recorded candidate resources;

[0206] A first candidate resource determination module, configured to determine, if any, a candidate resource whose corresponding index is consistent with the first subsequence to be currently used as the first candidate resource;

[0207] A return module is used to return to the trigger subsequence determination module if it does not exist;

[0208] The correction module 602 is specifically used to: if the number of the determined first candidate resources is not greater than a preset threshold, correct the character sequence in the to-be-processed string according to a preset sequence correction relationship to obtain a corrected string as the to-be-matched string.

[0209] In some embodiments, the subsequence acquisition module is specifically used to: determine the i-th character in the string to be processed in order from front to back, and determine the j-th character in the string to be processed in order from back to front; wherein the value range of i is 1 to N, N represents the total number of characters contained in the string to be processed; the value range of j is i to N; obtain a sequence consisting of all characters between the i-th character and the j-th character as the first subsequence.

[0210] In some embodiments, the apparatus further comprises: a first search module, configured to search for a candidate resource whose corresponding index is consistent with the string to be processed from pre-recorded candidate resources before obtaining all subsequences contained in the string to be processed as the first subsequence;

[0211] The subsequence acquisition module is specifically configured to: if the number of candidate resources obtained through searching is less than a preset threshold, acquire all subsequences contained in the character string to be processed as the first subsequence.

[0212] In some embodiments, the index corresponding to the pre-recorded candidate resource is established by at least one of the following methods:

[0213] For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the full pinyin of each Chinese character in the identification information of the candidate resource, and obtain the full pinyin of the identification information of the candidate resource as the index corresponding to the candidate resource;

[0214] For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the pinyin initials of each Chinese character in the identification information of the candidate resource, and obtain the pinyin initials of the identification information of the candidate resource as the index corresponding to the candidate resource;

[0215] For any candidate resource, perform word segmentation processing on the identification information of the candidate resource according to a preset granularity to obtain multiple word segments corresponding to the identification information of the candidate resource, and use the full pinyin of each word segment as the index corresponding to the candidate resource;

[0216] For any candidate resource, the identification information of the candidate resource is segmented according to a preset granularity to obtain multiple segmented words corresponding to the identification information of the candidate resource, and the first pinyin letter of each segmented word is used as the index corresponding to the candidate resource.

[0217] In some embodiments, the character string to be processed is: received through a search window of a terminal.

[0218] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0219] Memory 703, used for storing computer programs;

[0220] The processor 701 is used to implement the steps of any resource search method in the above embodiments when executing the program stored in the memory 703.

[0221] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0222] The communication interface is used for communication between the above electronic device and other devices.

[0223] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0224] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0225] In another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the resource search method described in any one of the above embodiments is implemented.

[0226] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is executed on a computer, the computer executes the resource search method described in any one of the above embodiments.

[0227] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0228] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0229] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0230] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A resource search method, characterized in that: The method comprises: Get the string representing the pinyin as the string to be processed; According to a preset sequence correction relationship, the character sequence in the character string to be processed is corrected to obtain a corrected character string as the character string to be matched; wherein the sequence correction relationship includes: a plurality of character sequences to be corrected, and a corrected character sequence corresponding to each character sequence to be corrected; the character sequence to be corrected in the preset sequence correction relationship includes: a character sequence corresponding to a single syllable that does not conform to the Chinese phonetic spelling rule, and / or a character sequence corresponding to a plurality of syllables used to represent preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the plurality of syllables, and the plurality of syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond one-to-one to the plurality of syllables contained in the character sequence to be corrected; From the pre-stored candidate resources, a candidate resource whose corresponding index matches the to-be-matched string is determined as a search result of the to-be-processed string; wherein each pre-recorded candidate resource corresponds to at least one index.

2. The method according to claim 1, characterized in that The step of correcting the character sequence in the character string to be processed according to the preset sequence correction relationship to obtain a corrected character string as the character string to be matched includes: Determine, in the character string to be processed, a character sequence that is consistent with the character sequence to be corrected in the preset sequence correction relationship as the first character sequence; For each first character sequence in the character string to be processed, if the first character sequence has redundant characters relative to the second character sequence corresponding to the first character sequence, the redundant characters in the first character sequence are deleted so that the first character sequence after correction is consistent with the second character sequence corresponding to the first character sequence; wherein the second character sequence corresponding to a first character sequence is: the revised character sequence corresponding to the character sequence to be corrected that is consistent with the first character sequence; If the first character sequence lacks characters relative to the second character sequence corresponding to the first character sequence, adding the missing characters to the first character sequence so that the modified first character sequence is consistent with the second character sequence corresponding to the first character sequence; If there are inconsistent characters in the first character sequence relative to the second character sequence corresponding to the first character sequence, the inconsistent characters are replaced in the first character sequence so that the modified first character sequence is consistent with the second character sequence corresponding to the first character sequence.

3. The method according to claim 1, characterized in that: Before correcting the character sequence in the to-be-processed string according to the preset sequence correction relationship to obtain the corrected string as the to-be-matched string, the method further includes: Obtain all subsequences contained in the character string to be processed as the first subsequence; Determine the first subsequence to be used currently in descending order of the number of characters contained; Determine whether there is a candidate resource with a corresponding index consistent with the first subsequence to be currently used in the pre-recorded candidate resources; If so, the candidate resource whose corresponding index is consistent with the first subsequence to be used is determined as the first candidate resource; If not, return to the step of determining the first subsequence to be used in descending order of the number of characters contained; The step of correcting the character sequence in the character string to be processed according to the preset sequence correction relationship to obtain a corrected character string as the character string to be matched includes: If the number of the determined first candidate resources is not greater than a preset threshold, the character sequence in the character string to be processed is corrected according to a preset sequence correction relationship to obtain a corrected character string as the character string to be matched.

4. The method according to claim 3, characterized in that The step of obtaining all subsequences contained in the character string to be processed as the first subsequence includes: Determine the i-th character in the string to be processed in order from front to back, and determine the j-th character in the string to be processed in order from back to front; wherein the value range of i is 1 to N, N represents the total number of characters contained in the string to be processed; the value range of j is i to N; A sequence consisting of all characters between the ith character and the jth character is obtained as a first subsequence.

5. The method according to claim 3, characterized in that: Before obtaining all subsequences contained in the character string to be processed as the first subsequence, the method further includes: Searching for a candidate resource whose corresponding index is consistent with the character string to be processed from pre-recorded candidate resources; The step of obtaining all subsequences contained in the character string to be processed as the first subsequence includes: If the number of candidate resources obtained through the search is less than a preset threshold, all subsequences contained in the character string to be processed are obtained as the first subsequence.

6. The method according to claim 1, characterized in that The index corresponding to the pre-recorded candidate resource is established by at least one of the following methods: For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the full pinyin of each Chinese character in the identification information of the candidate resource, and obtain the full pinyin of the identification information of the candidate resource as the index corresponding to the candidate resource; For any candidate resource, replace each Chinese character in the identification information of the candidate resource according to the pinyin initials of each Chinese character in the identification information of the candidate resource, and obtain the pinyin initials of the identification information of the candidate resource as the index corresponding to the candidate resource; For any candidate resource, perform word segmentation processing on the identification information of the candidate resource according to a preset granularity to obtain multiple word segments corresponding to the identification information of the candidate resource, and use the full pinyin of each word segment as the index corresponding to the candidate resource; For any candidate resource, the identification information of the candidate resource is segmented according to a preset granularity to obtain multiple segmented words corresponding to the identification information of the candidate resource, and the first pinyin letter of each segmented word is used as the index corresponding to the candidate resource.

7. The method according to claim 1, characterized in that The character string to be processed is: received through the search window of the terminal.

8. A resource search device, characterized in that: The device comprises: A module for obtaining a character string to be processed is used to obtain a character string representing pinyin as a character string to be processed; A correction module, used for correcting the character sequence in the character string to be processed according to a preset sequence correction relationship, obtaining a corrected character string as the character string to be matched; wherein the sequence correction relationship includes: a plurality of character sequences to be corrected, and a corrected character sequence corresponding to each character sequence to be corrected; the character sequence to be corrected in the preset sequence correction relationship includes: a character sequence corresponding to a single syllable that does not conform to the Chinese phonetic spelling rule, and / or a character sequence corresponding to a plurality of syllables for representing preset semantics, and there is at least one misspelled syllable in the character sequence corresponding to the plurality of syllables, and the plurality of syllables contained in the corrected character sequence corresponding to a character sequence to be corrected correspond one-to-one with the plurality of syllables contained in the character sequence to be corrected; The recall module is used to determine, from the pre-stored candidate resources, a candidate resource whose corresponding index matches the to-be-matched string as the search result of the to-be-processed string; wherein each pre-recorded candidate resource corresponds to at least one index.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Pinyin searching method

    CN102567406A

  • Chinese word error correction method used in search and device thereof

    CN104750672A

  • Pinyin-based video file retrieval method and related equipment

    CN118170947A

  • Object searching method and IPPBX device

    CN118471205A

  • Method and system of intelligent information processing in a network

    WO2002001312A2