Search prompting method and device, electronic equipment and storage medium

By combining the Redis database and a large language model, and using grammatical rule matching to generate personalized suggestions, the problem of insufficient semantic understanding and personalized features in existing technologies is solved, and fast and accurate search suggestions are achieved.

CN121765129APending Publication Date: 2026-03-31BEIJING KNOWNSEC INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing search suggestion technologies have shortcomings in semantic understanding, personalization feature adaptation, and high concurrency processing capabilities, resulting in biased suggestion results and increased latency, which cannot meet the diverse business scenarios and personalized user needs.

Method used

The system uses a Redis database to retrieve the first prompt data from the user's input, combines it with a large language model for semantic understanding, generates a third prompt data that conforms to the specific scenario through grammatical rule matching, and performs comprehensive scoring and ranking to achieve personalized and context-sensitive prompt output.

Benefits of technology

It improves the accuracy and response speed of search suggestions, reduces latency, breaks through the semantic and personalization bottlenecks of traditional prefix matching, and realizes fast personalized suggestions in high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765129A_ABST
    Figure CN121765129A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a search prompting method and device, electronic equipment and a storage medium, and relates to the field of data processing.The method comprises the steps that user input data are determined, first prompting data corresponding to the user input data are obtained from a Redis database, the user input data are input into a large language model, and second prompting data are obtained, and performing grammar rule matching on the second prompt data to obtain the third prompt data, obtaining the candidate data of the user input data based on the first prompt data, the second prompt data and the third prompt data, and performing prompt output on the candidate data, so that the search prompt accuracy and the response speed can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and more specifically, to a search suggestion method, apparatus, electronic device, and storage medium. Background Technology

[0002] As the core entry point for user interaction with information, the search box has become an indispensable component of various application systems and websites. With users' increasing demands for search efficiency and experience, search boxes are often coupled with "input suggestions" functions to present candidate terms before the user has finished typing, thereby reducing input costs and shortening the search path.

[0003] In existing technologies, such suggestion functions typically follow three technical approaches: First, based on character prefix matching, the system has a pre-built thesaurus or database. When a user's input string is detected, the system searches for and returns words that match that string as a prefix. Second, based on historical data recall, the system caches the user's previously submitted query terms locally or remotely, prioritizing the display of previously used keywords when the user re-enters the information. Third, based on popular keyword statistics, the system calculates the entire site's search logs offline or in real-time, extracts the most frequently occurring terms to form a list, and prioritizes their presentation in the suggestion list. These solutions are simple to implement, respond quickly, and have been implemented in numerous scenarios.

[0004] However, with increasingly diverse business scenarios and rising user expectations, the aforementioned traditional solutions have revealed numerous shortcomings. First, character prefix matching can only handle literal matching, lacking an understanding of contextual semantics, leading to discrepancies between suggested results and the user's true intent. Second, the system fails to adequately consider the personalized characteristics of different users, unable to dynamically adjust the suggestion order based on user identity, interests, region, or time of day, resulting in low personalization. Third, when the business is vertically integrated into specialized fields such as healthcare, law, and industrial spare parts, general-purpose thesaurus struggles to cover domain terminology and expression habits, lacking support for industry grammar rules, thus limiting scalability. Finally, in high-concurrency scenarios, prefix fuzzy queries based on relational databases easily trigger full table scans, with disk I / O and CPU consumption increasing linearly with request volume, significantly increasing suggestion latency and severely impacting user experience. Therefore, a search suggestion technology solution that can understand semantics, adapt to individual needs, support domain expansion, and possess high-concurrency processing capabilities is urgently needed. Summary of the Invention

[0005] The purpose of this invention is to provide a search suggestion method, apparatus, electronic device, and storage medium that can improve the accuracy and response speed of search suggestions.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a semantic comparison method, the method comprising: Determine user input data; Retrieve the first prompt data corresponding to the user input data from the Redis database; The user input data is input into the large language model to obtain the second prompt data; The second prompt data is subjected to syntax rule matching to obtain the third prompt data; Based on the first prompt data, the second prompt data, and the third prompt data, candidate data for the user input data is obtained, and the candidate data is output as prompts.

[0007] In an optional implementation, the Redis database contains historical prompt data, and the step of retrieving the first prompt data corresponding to the user input data from the Redis database includes: Calculate the first similarity between each of the historical prompt data and the user input data; Obtain historical prompt data corresponding to each first similarity greater than the preset similarity, and use it as the first prompt data.

[0008] In an optional implementation, the step of inputting the user input data into a large language model to obtain the second prompt data includes: The user input data is preprocessed to obtain the first user input data; The intent information of the first user input data is determined based on the large language model; Obtain the historical user input data corresponding to the first user input data; The intent information is adjusted based on the historical user input data to obtain the adjusted intent information; The adjusted intent information is expanded to obtain the second prompt data corresponding to the user input data.

[0009] In an optional implementation, the step of performing syntax rule matching on the second prompt data to obtain the third prompt data includes: The second prompt data is filtered using regular expressions to obtain the second prompt data.

[0010] In an optional implementation, the step of performing syntax rule matching on the second prompt data to obtain the third prompt data includes: Keywords in the second prompt data; Convert the keywords into standard terminology; The third prompt data is obtained by replacing the keywords with the standard terms.

[0011] In an optional implementation, the step of performing syntax rule matching on the second prompt data to obtain the third prompt data includes: Identify the keywords in the second prompt data; Determine whether the keywords belong to sensitive terms; If so, the keyword is removed from the second prompt data to obtain the third prompt data.

[0012] In an optional implementation, the step of obtaining candidate data for the user input data based on the first prompt data, the second prompt data, and the third prompt data, and outputting the candidate data as prompts, includes: Determine the first weight of the first prompt data; Determine the second weight of the second prompt data; Determine the third weight of the third prompt data; Calculate the first product of the first prompt data and the first weight; Calculate the second product of the second prompt data and the second weight; Calculate the third product of the third prompt data and the third weight; Calculate the sum of the first product, the second product, and the third product to obtain the overall score; Obtain a target comprehensive score that is greater than the preset score from all comprehensive scores; Obtain the first, second, and third prompt data corresponding to the target comprehensive score as candidate data.

[0013] Secondly, embodiments of this application provide a search suggestion device, the device comprising: The determination module is used to determine user input data; The acquisition module is used to retrieve first prompt data corresponding to the user input data from the Redis database; input the user input data into a large language model to obtain second prompt data; perform grammatical rule matching on the second prompt data to obtain third prompt data; and obtain candidate data of the user input data based on the first prompt data, the second prompt data, and the third prompt data, and output the candidate data as prompts.

[0014] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the search suggestion method.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the search suggestion method.

[0016] This application has the following beneficial effects: This application initiates a three-tiered collaborative suggestion generation process upon user input: First, using the user input as the key, it directly retrieves cached matching results from the Redis database, generating millisecond-level suggestion data. Then, the same string of characters is fed into a large language model, which combines contextual semantics and global knowledge to infer and output intent-aware suggestion data in real time. Next, pre-defined grammar rules perform validity checks, industry terminology mapping, and security filtering on the second suggestion data, generating a third suggestion data that conforms to specific scenario constraints. Finally, the three candidate results are merged and sorted, and the optimal personalized, context-relevant, and compliant terms are returned to the front end for display. By combining the capabilities of AI semantic understanding, Redis's high-speed caching, and customizable grammar rules, suggestion latency is significantly reduced, and the bottlenecks of traditional prefix matching in semantic depth and personalization are overcome, thus achieving a simultaneous leap in search suggestion accuracy, response speed, and business adaptability. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A block diagram of an electronic device provided in an embodiment of the present invention; Figure 2 This is one of the flowcharts illustrating a search suggestion method provided in an embodiment of the present invention; Figure 3 A second schematic flowchart illustrating a search suggestion method provided in an embodiment of the present invention; Figure 4 The third flowchart illustrates a search suggestion method provided in an embodiment of the present invention; Figure 5 The fourth flowchart illustrates a search suggestion method provided in an embodiment of the present invention; Figure 6 The fifth flowchart illustrates a search suggestion method provided in an embodiment of the present invention; Figure 7 This is a structural block diagram of a search suggestion device provided in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0021] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0022] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0023] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0024] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0025] Extensive research by the inventors revealed numerous shortcomings in traditional solutions as business scenarios become increasingly diverse and user expectations rise. First, prefix matching can only handle literal matching, lacking an understanding of contextual semantics, leading to discrepancies between suggested results and the user's true intent. Second, the system fails to adequately consider the personalized characteristics of different users, unable to dynamically adjust the suggestion order based on user identity, interests, region, or time of day, resulting in low personalization. Third, when the business is vertically integrated into specialized fields such as healthcare, law, or industrial spare parts, general-purpose dictionaries struggle to cover domain terminology and expression habits, lacking support for industry grammar rules and limiting scalability. Finally, in high-concurrency scenarios, prefix fuzzy queries based on relational databases easily trigger full table scans, causing disk I / O and CPU consumption to increase linearly with request volume, significantly increasing suggestion latency and severely impacting user experience.

[0026] In view of the above-mentioned problems, this embodiment provides a search suggestion method, device, electronic device, and storage medium. It can determine user input data, retrieve first suggestion data corresponding to the user input data from a Redis database, input the user input data into a large language model to obtain second suggestion data, perform rule matching on the second suggestion data to obtain third suggestion data, and based on the first suggestion data, the second suggestion data, and the third suggestion data, obtain candidate data for the user input data, and output the candidate data as suggestions, thereby improving the accuracy and response speed of the suggestion data. The solution provided in this embodiment will be described in detail below.

[0027] This embodiment provides an electronic device capable of providing search suggestions. In one possible implementation, the electronic device can be a user terminal, such as, but not limited to, a server, smartphone, personal computer (PC), tablet computer, personal digital assistant (PDA), mobile internet device (MID), etc.

[0028] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application. The electronic device 100 may further include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.

[0029] The electronic device 100 includes a search prompting device 110, a memory 120, and a processor 130.

[0030] The components of the memory 120 and processor 130 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The search prompting device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or embedded in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the search prompting device 110.

[0031] The memory 120 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 120 is used to store programs, and the processor 130 executes the programs after receiving execution instructions.

[0032] Please refer to Figure 2 , Figure 2 For application Figure 1 The flowchart below shows a search suggestion method for an electronic device 100, and the method includes a detailed description of each step.

[0033] S201: Determine user input data.

[0034] S202: Retrieve the first prompt data corresponding to the user input data from the Redis database.

[0035] S203: Input the user input data into the large language model to obtain the second prompt data.

[0036] S204: Perform syntax rule matching on the second prompt data to obtain the third prompt data.

[0037] S205: Based on the first prompt data, the second prompt data, and the third prompt data, obtain candidate data for the user input data, and output the candidate data as prompts.

[0038] When a user enters characters in the search box, the input is sent to the background prompt service in real time. The characters entered by the user in the search box are considered as user input data.

[0039] The Redis (Remote Dictionary Server) database stores the user's historical input data. The user's input data is matched with the user's historical input data in the Redis database, and the first prompt data corresponding to the user's input data is retrieved from the Redis database.

[0040] The large language model is called to process the user input data and obtain the second prompt data of the user input data. The large language model is an artificial intelligence technology that includes natural language processing, deep learning and other technologies, and is used to perform semantic understanding and reasoning on the user input content.

[0041] Syntax rules are suggestion rules predefined by users or the system, such as keyword mapping and regular expression rules, which are used to help large language models generate suggestion results that are more in line with business scenarios.

[0042] Using user input as the key, the system directly retrieves cached matching results from the Redis database, generating the first suggestion data with a millisecond-level response. Then, the same string of characters is fed into a large language model, which combines contextual semantics and global knowledge to infer and output intent-aware second suggestion data in real time. Next, a pre-defined syntax performs validity checks, industry terminology mapping, and security filtering on the second suggestion data, generating a third suggestion data that conforms to specific scenario constraints. Finally, the three candidate results are merged and sorted, and the optimal personalized, context-relevant, and safe / compliant terms are returned to the front end for display. By combining the capabilities of AI semantic understanding, Redis's high-speed caching, and customizable syntax rules, the system significantly reduces suggestion latency and overcomes the bottlenecks of traditional prefix matching in semantic depth and personalization, thereby achieving improved search suggestion accuracy, response speed, and business adaptability.

[0043] There are several ways to retrieve the first prompt data corresponding to the user input data from the Redis database. In one implementation, such as... Figure 3 As shown, it includes the following steps: S301: Calculate the first similarity between each of the historical prompt data and the user input data.

[0044] S302: Obtain historical prompt data corresponding to each first similarity greater than the preset similarity, and use it as the first prompt data.

[0045] The Redis database contains historical prompt data. For example, the Redis database contains first historical prompt data, second historical prompt data, and third historical prompt data. A first similarity is calculated between the user input data and the first historical prompt data; a second similarity is calculated between the user input data and the second historical prompt data; and a third similarity is calculated between the user input data and the third historical prompt data. The first similarity is compared with a preset similarity; if the first similarity is greater than or equal to the preset similarity, the first historical prompt data is used as the first prompt data. The second similarity is compared with the preset similarity; if the second similarity is greater than or equal to the preset similarity, the second historical prompt data is used as the first prompt data. The third similarity is compared with the preset similarity; if the third similarity is greater than or equal to the preset similarity, the third historical prompt data is used as the first prompt data. Finally, the first, second, and third historical prompt data are used as the first prompt data.

[0046] In another implementation of retrieving the first prompt data corresponding to the user input data from the Redis database, the Redis database contains historical prompt data for the user, and each historical prompt data has a corresponding search frequency. The multiple historical prompt data are sorted from largest to smallest according to the search frequency to obtain the historical prompt data sorting. The user input data is matched with the historical prompt data in the historical prompt data sorting in turn, and the historical prompt data that matches the user input data is obtained as the first prompt data.

[0047] For example, the historical suggestion data sorting includes first historical suggestion data, second historical suggestion data, and third historical suggestion data. The search frequency of the first historical suggestion data is 20 times / week, the search frequency of the second historical suggestion data is 15 times / week, and the search frequency of the third historical suggestion data is 10 times / week. User input data is matched sequentially with the historical suggestion data in the historical suggestion data sorting. When the user input data matches the first historical suggestion data, the first historical suggestion data is used as the first suggestion data. When the user input data does not match the first historical suggestion data, it is matched with the second historical suggestion data. When the user input data matches the second historical suggestion data, the second historical suggestion data is used as the first suggestion data. When the user input data does not match the second historical suggestion data, it is determined that the Redis database does not contain the first suggestion data corresponding to the user input data.

[0048] There are several ways to input user input data into a large language model and obtain the second prompt data. In one implementation, such as... Figure 4 As shown, it includes the following steps: S401: Preprocess the user input data to obtain the first user input data.

[0049] S402: Determine the intent information of the first user input data based on the large language model.

[0050] S403: Obtain the historical user input data corresponding to the first user input data.

[0051] S404: Adjust the intent information based on historical user input data to obtain the adjusted intent information.

[0052] S405: Expand the adjusted intent information to obtain the second prompt data corresponding to the user input data.

[0053] The user input data is preprocessed. Preprocessing methods include word segmentation, stop word removal, part-of-speech tagging, and spell correction to obtain the first user input data.

[0054] The intent information of the first user's input data can be determined based on the large language model, such as determining the intent information of the first user's input data as "product search", "information query", "navigation and positioning", etc.

[0055] Determine the historical user input data corresponding to the first user input data, adjust the intent information based on the historical user input data, and obtain the adjusted intent information. Semantic disambiguation can be performed by combining historical user input data and the current conversation context. For example, "apple" can correspond to "fruit" or "electronic product", thus clarifying whether "apple" in the first user input data is "fruit" or "electronic product".

[0056] By expanding synonyms, related words, and hyponyms based on word vectors or knowledge graphs, the adjusted intent information is further expanded to obtain the second prompt data corresponding to the user input data. For example, "phone case" is expanded to "protective case" or "phone protective cover", which serve as the second prompt data corresponding to the user input data.

[0057] In another example, a prompt template is generated based on the adjusted intent information and the expanded intent information to obtain the second prompt data corresponding to the user input data. For example, if the user inputs "nearby restaurants", candidate prompts such as "nearby restaurant recommendations", "nearby restaurant rankings", and "nearby restaurants suitable for gatherings" are generated.

[0058] There are several ways to perform syntax rule matching on the second prompt data to obtain the third prompt data. In one implementation, such as... Figure 5As shown, it includes the following steps: S501: Keywords in the second prompt data.

[0059] S502: Convert keywords into standard terms.

[0060] S503: Replace the keywords with standard terms to obtain third-party prompt data.

[0061] For example, abbreviations or colloquial expressions are mapped to standard terms, such as "GPU card" being mapped to "graphics processor".

[0062] Another way to obtain the third prompt data by performing grammatical rule matching on the second prompt data is to identify the keywords in the second prompt data, determine whether the keywords belong to sensitive words, and if so, remove the keywords from the second prompt data to obtain the third prompt data.

[0063] For example, non-compliant or sensitive terms can be directly removed to avoid generating non-compliance alert data.

[0064] Another way to obtain the third prompt data by performing syntax rule matching on the second prompt data is to filter the second prompt data based on regular expressions.

[0065] For example, the second prompt data can be formatted or completed using syntax rules, such as automatically correcting "19216801" to "192.168.0.1".

[0066] The third set of prompts can be obtained by performing grammatical rule matching on the second prompt data. It may also include replacing or supplementing general prompts with industry-specific expressions by combining industry-specific terminology databases. For example, in the medical field, "CT" prompts may be "CT examination appointment" or "CT image interpretation".

[0067] Rules in the rule base are ordered by priority, and in case of conflict, higher-priority rules override lower-priority rules. For example, filtering the second suggestion data based on regular expressions gives it higher priority than combining industry-specific terminology databases to replace or supplement general suggestions with industry-specific expressions. If the second suggestion data also matches the above syntax rules, then only filtering the second suggestion data based on regular expressions will be executed to obtain the second suggestion data.

[0068] Based on the first, second, and third prompt data, candidate data for user input is obtained. There are multiple ways to output these candidate data as prompts. One such method is... Figure 6 As shown, it includes the following steps: S601: Determine the first weight of the first prompt data.

[0069] S602: Determine the second weight of the second prompt data.

[0070] S603: Determine the third weight of the third prompt data.

[0071] S604: Calculate the first product of the first prompt data and the first weight.

[0072] S605: Calculate the second product of the second hint data and the second weight.

[0073] S606: Calculate the third product of the third hint data and the third weight.

[0074] S607: Calculate the sum of the first product, the second product, and the third product to obtain the overall score.

[0075] S608: Obtain a target comprehensive score that is greater than the preset score from each comprehensive score.

[0076] S609: Obtain the first, second, and third hint data corresponding to the target comprehensive score as candidate data.

[0077] The first, second, and third prompt data are merged and then sorted using a weighted scoring mechanism. The overall score is calculated as follows: α × First hint data + β × Second hint data + γ × Third hint data, where α, β, and γ are the adjustable first, second, and third weights, respectively.

[0078] Each comprehensive score is compared with the preset score. A target comprehensive score that is greater than the preset score is obtained from each comprehensive score. The first, second, and third prompt data corresponding to the target comprehensive score are obtained as candidate data.

[0079] In another example, a word vector model is used to convert user input data and second prompt data into vectors, and the cosine similarity between user input data and second prompt data is calculated. The higher the value, the more relevant the prompt is to user input data.

[0080] The third tip is that if the data matches a high-priority rule, the corresponding weight will be added to the overall score. For example, industry-specific terminology replacement has a higher priority than general regular expression correction.

[0081] The comprehensive score is calculated based on the cosine similarity between the first prompt data, the user input data, and the second prompt data, as well as the third prompt data. The weights of the first prompt data, the cosine similarity between the user input data and the second prompt data, and the weights of the third prompt data are adjusted based on whether the third prompt data matches a high-priority rule.

[0082] Finally, the data is sorted by comprehensive score, and the top N prompts are returned. Prompts below the set threshold are automatically removed.

[0083] The final candidate data is returned to the front end and displayed in real time. Users can choose to directly click on the prompt to complete the search input.

[0084] Please refer to Figure 7 This application embodiment also provides an application for Figure 1 The electronic device 100 includes a search suggestion device 110, which comprises: Module 111 is used to determine user input data; The acquisition module 112 is used to acquire first prompt data corresponding to the user input data from the Redis database; input the user input data into the large language model to obtain second prompt data; perform syntax rule matching on the second prompt data to obtain third prompt data; and obtain candidate data of the user input data based on the first prompt data, the second prompt data, and the third prompt data, and output the candidate data as prompts.

[0085] This application also provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer-executable instructions, which, when executed by the processor 130, implement the search suggestion method.

[0086] This application embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor 130, implements the search suggestion method.

[0087] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0088] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0089] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0090] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A search prompting method characterized by comprising: The method comprises: determining user input data; obtaining first prompt data corresponding to the user input data from a Redis database; inputting the user input data into a large language model to obtain second prompt data; performing syntax rule matching on the second prompt data to obtain third prompt data; based on the first prompt data, the second prompt data and the third prompt data, obtaining candidate data of the user input data, and prompting output of the candidate data.

2. The method of claim 1, wherein, The Redis database contains historical prompt data, and the step of obtaining first prompt data corresponding to the user input data from the Redis database comprises: respectively calculating the first similarity of each historical prompt data and the user input data; obtain the historical prompt data corresponding to each first similarity greater than the preset similarity as the first prompt data.

3. The method of claim 1, wherein, The step of inputting the user input data into the large language model to obtain the second prompt data comprises: preprocessing the user input data to obtain first user input data; determining the intent information of the first user input data based on the large language model; obtaining historical user input data corresponding to the first user input data; adjusting the intent information based on the historical user input data to obtain adjusted intent information; extending the adjusted intent information to obtain second prompt data corresponding to the user input data.

4. The method of claim 1, wherein, The step of performing syntax rule matching on the second prompt data to obtain third prompt data comprises: filtering the second prompt data based on regular expressions to obtain second prompt data.

5. The method of claim 1, wherein, The step of performing syntax rule matching on the second prompt data to obtain third prompt data comprises: determining the keywords in the second prompt data; convert the keywords to standard terms; replace the keywords with the standard terms to obtain third prompt data.

6. The method of claim 1, wherein, The step of performing syntax rule matching on the second prompt data to obtain third prompt data comprises: determining the keywords in the second prompt data; determine whether the keyword is a sensitive term; if yes, remove the keyword from the second prompt data to obtain third prompt data.

7. The method of claim 1, wherein, The step of obtaining candidate data of the user input data based on the first prompt data, the second prompt data and the third prompt data, and prompting output of the candidate data comprises: determining the first weight of the first prompt data; determining the second weight of the second prompt data; determining the third weight of the third prompt data; calculating the first product of the first prompt data and the first weight; calculating the second product of the second prompt data and the second weight; calculating the third product of the third prompt data and the third weight; calculating the sum of the first product, the second product and the third product to obtain a comprehensive score; obtaining a target comprehensive score greater than a preset score from each comprehensive score; obtaining the first prompt data, the second prompt data and the third prompt data corresponding to the target comprehensive score as candidate data.

8. A search prompting apparatus characterized by comprising: The device comprises: A determination module is configured to determine user input data; An acquisition module is configured to acquire first prompt data corresponding to the user input data from a Redis database; input the user input data into a large language model to obtain second prompt data; perform syntax rule matching on the second prompt data to obtain third prompt data; and based on the first prompt data, the second prompt data, and the third prompt data, obtain candidate data of the user input data, and output the candidate data for prompting.

9. An electronic device, comprising: A computer program product comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1-7 when executing the computer program.

10. A storage medium having stored thereon a computer program, characterized in that The computer program product is executed by the processor to implement the steps of the method according to any one of claims 1-7.