Search matching method, device, electronic device and storage medium

By using word search trees to match search words and generate query templates in the human-computer dialogue system, the problem of low efficiency in the existing technology is solved, and quick response to query content matching input by the user is achieved.

CN112559717BActive Publication Date: 2024-08-30BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202011555351.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-24
Publication Date
2024-08-30
Estimated Expiration
2040-12-24

AI Technical Summary

Technical Problem

In the existing technology, the matching method of user query content in human-machine dialogue systems is inefficient, resulting in long parsing time and inability to effectively respond to user input.

Method used

Use word search trees to match search words and nodes, generate matching query templates, and use the public prefixes of strings to reduce query time overhead and improve efficiency.

Benefits of technology

It significantly improves the efficiency of query content matching, solves the problem of long parsing time, and enables rapid response to user input.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112559717B
    Figure CN112559717B
Patent Text Reader

Abstract

The present disclosure discloses a search matching method, device, electronic device and storage medium, and relates to the field of computer technology, in particular to the field of intelligent search and cloud computing. The specific implementation scheme is: obtaining search information, wherein the search information includes multiple search terms with a sequence; matching the search terms in the search information with nodes in a word search tree in sequence, and determining a target node in the word search tree that matches the search terms, wherein the word search tree includes one or more types of nodes; generating a query template that matches the search information according to the target node that matches the search terms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the field of intelligent search. Background Art

[0002] In human-computer dialogue systems, such as intelligent customer service systems, voice assistants, etc., for query statements entered by users, it is necessary to map the query content to a certain answer in real time.

[0003] The related art generally uses keyword retrieval, semantic similarity and regular matching to respond to user input, but the method of matching the user's query content in the related art has technical problems such as time-consuming parsing and low efficiency. Summary of the invention

[0004] The present disclosure provides a search and matching method, device, electronic device and storage medium.

[0005] According to one aspect of the present disclosure, a search matching method is provided, comprising: obtaining search information, wherein the search information includes a plurality of search terms in a sequence; matching the search terms in the search information with nodes in a word search tree in the sequence, and determining a target node in the word search tree that matches the search terms, wherein the word search tree includes one or more types of nodes; and generating a query template that matches the search information based on the target node that matches the search terms.

[0006] According to another aspect of the present disclosure, a search and matching device is provided, including: a first acquisition module, a matching module and a generation module.

[0007] The first acquisition module is used to acquire search information, wherein the search information includes a plurality of search terms in a sequential order.

[0008] The matching module is used to match the search terms in the above search information with the nodes in the word search tree in the above sequence, and determine the target nodes in the above word search tree that match the above search terms, wherein the above word search tree includes one or more types of nodes.

[0009] A generation module is used to generate a query template matching the search information according to the target node matching the search term.

[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.

[0012] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.

[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0015] Figure 1 An exemplary system architecture to which the search and matching method and device according to an embodiment of the present disclosure can be applied is schematically shown;

[0016] Figure 2 A flowchart of a search and matching method according to an embodiment of the present disclosure is schematically shown;

[0017] Figure 3 A schematic diagram of a word search tree according to an embodiment of the present disclosure is schematically shown;

[0018] Figure 4 Schematically shows a flow chart of generating a new word search tree according to an embodiment of the present disclosure;

[0019] Figure 5 A schematic diagram schematically shows a template configuration on a configuration interface according to an embodiment of the present disclosure;

[0020] Figure 6 A schematic diagram of updating a word search tree according to an embodiment of the present disclosure is schematically shown;

[0021] Figure 7 A block diagram schematically shows a search and matching device according to an embodiment of the present disclosure; and

[0022] Figure 8 A schematic block diagram of an example electronic device that can be used to implement an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0024] In the process of implementing the present disclosure, it is found that keyword retrieval, semantic similarity-based matching and regular matching can respond to user input to realize the search function. The keyword retrieval-based method mainly uses TF-IDF or other keyword extraction algorithms to extract keywords from the search terms, and uses the keyword intersection of the search terms and the candidate search terms to retrieve the corresponding answers. The semantic similarity-based matching method mainly uses a deep model such as the Bert model to measure the semantic similarity of sentences. The specific method is to input the candidate sentences and search terms into the Bert model, take out the vectors to calculate the semantic similarity, and sentences with high semantic similarity are considered to be successfully matched. Regular matching mainly involves writing regular expressions for fixed sentence patterns, parsing whether the user's search terms meet this regular expression, and if they do, the match is successful.

[0025] However, the keyword-based search method has problems with recall because the keywords themselves cannot represent the limitations of fixed sentences. The problem with the matching method based on semantic similarity is that the calculation of similarity depends on the similarity calculation module, which has low accuracy. In addition, for some words that are not entered into the system, the word vector may be missing or inaccurate. The matching based on regular expressions has performance problems. The more regular expressions there are, the worse the performance is. It takes a long time to match hundreds of regular expressions.

[0026] Embodiments of the present disclosure provide a search matching method, apparatus, electronic device and storage medium, wherein a specific implementation scheme of the search matching method is: obtaining search information, wherein the search information includes multiple search terms in a sequence; matching the search terms in the search information with nodes in a word search tree in sequence, and determining a target node in the word search tree that matches the search terms, wherein the word search tree includes one or more types of nodes; generating a query template that matches the search information based on the target node that matches the search terms.

[0027] Figure 1 An exemplary system architecture to which the search and matching method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.

[0028] It should be noted that Figure 1The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, an exemplary system architecture to which the search and matching method and apparatus can be applied may include a terminal device, but the terminal device may implement the search and matching method and apparatus provided by the embodiments of the present disclosure without interacting with the server.

[0029] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0030] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).

[0031] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0032] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the content browsed by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0033] It should be noted that the search and matching method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the search and matching apparatus provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.

[0034] Alternatively, the search and matching method provided in the embodiment of the present disclosure may also be generally performed by the server 105. Accordingly, the search and matching device provided in the embodiment of the present disclosure may generally be arranged in the server 105. The search and matching method provided in the embodiment of the present disclosure may also be performed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the search and matching device provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.

[0035] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0036] Figure 2 The flowchart of the search and matching method according to the embodiment of the present disclosure is schematically shown.

[0037] like Figure 2 As shown, the method 200 includes operations S210 to S230.

[0038] In operation S210, search information is obtained, wherein the search information includes a plurality of search words in a sequential order.

[0039] In operation S220, the search words in the search information are matched with the nodes in the word search tree in order to determine the target node in the word search tree that matches the search words, wherein the word search tree includes one or more types of nodes.

[0040] In operation S230, a query template matching the search information is generated according to the target node matching the search term.

[0041] According to the embodiments of the present disclosure, the type of search information is not limited. For example, it can be voice information, text information, image information. Among them, the image information can include text information.

[0042] According to an embodiment of the present disclosure, the search information may be a sentence or a paragraph, and the search information includes multiple search terms in a sequence. For example, in the search information "help me check flight HU2341 in Guangzhou", "help me", "check", "Guangzhou", "of", and "flight HU2341" have a sequence. According to an embodiment of the present disclosure, the sequence may be the order in which the search information is input.

[0043] According to an embodiment of the present disclosure, after obtaining search information, the search information can be segmented to obtain one or more search terms. When there is only one search term, the search term can also be matched with the nodes in the word search tree to determine the target node in the word search tree that matches the search term.

[0044] According to an embodiment of the present disclosure, the order of the search terms can be determined according to the position of the search terms in the sentence of the search information. According to an embodiment of the present disclosure, the search terms can be sequentially matched with the nodes in the word search tree in the order of the search terms, and each search term can have a target node that matches it.

[0045] According to an embodiment of the present disclosure, the word search tree can include multiple nodes of the same or different types.

[0046] According to an embodiment of the present disclosure, after determining the target node that matches the search term, a query template that matches the search information can be generated based on all the target nodes. For example, according to the content represented by all the target nodes, a query template is automatically generated in the order of the target nodes in the word search tree.

[0047] Through the embodiment of the present disclosure, the search terms are matched with the nodes in the word search tree in the order of the search terms, and a query template that matches the search information is generated based on the target nodes that match the search terms. The embodiment of the present disclosure performs search matching based on the word search tree, and can use the common prefix of the strings to reduce the overhead of query time to achieve the purpose of improving efficiency. It solves the technical problems of time-consuming parsing and low efficiency in the method of matching the user's query content in the related art.

[0048] According to an embodiment of the present disclosure, the word search tree can include one or more types of nodes. According to an embodiment of the present disclosure, the types of nodes in the word search tree include at least one of the following: fuzzy character nodes for storing fuzzy matching characters; entity nodes for storing entity names; wildcard nodes for storing wildcard types; extraction start nodes and extraction end nodes for identifying the start position and end position of the extraction content.

[0049] According to an embodiment of the present disclosure, in addition to the above types of nodes, the word search tree can also include some ordinary nodes, such as ordinary words like "of". According to an embodiment of the present disclosure, the word search tree may not include fuzzy character nodes. In order to achieve fuzzy matching, it can be added as a fuzzy attribute to other nodes.

[0050] According to an embodiment of the present disclosure, by using the character nodes, entity nodes, wildcard nodes, extraction start nodes and extraction end nodes in the word search tree, the query template can be designed more conveniently and flexibly.

[0051] For example, through the above-mentioned types of nodes, the word search tree has the following rich functions: 1) Support for reference entities and vocabularies: for example, "[@sys_number][$my_vocab]", where @sys_number is a numeric entity and $my_vocab is a user-defined word). 2) Support for wildcards: for example, [W:0-20^{abc,edf}] does not include any 0-20 characters of abc and edf. 3) Support for extraction: for example, "[W:0-10]{[@sys_number]name=′number′}", input "I want to buy 123", and return the result {′number′: 123}. 4) Support for fuzzy matching: for example, "~aabb", input any aabb string to match.

[0052] According to an embodiment of the present disclosure, the word search tree can also be called a key tree. The idea is to trade space for time and use the common prefixes of strings to reduce the query time overhead to achieve the purpose of improving efficiency. It is mainly used to count and sort a large number of strings.

[0053] According to an embodiment of the present disclosure, a root node may be included in a word search tree, the root node does not contain any characters, and each node except the root node may contain characters, and optionally, each node may contain only one character.

[0054] According to an embodiment of the present disclosure, from a root node to a certain node, the characters passed on the path are linked to form a character string corresponding to the node, and the character string can be combined to form a query template; the characters contained in all child nodes of each node may be different, and of course, the characters contained in the child nodes may also be the same.

[0055] Figure 3 A schematic diagram of a word search tree according to an embodiment of the present disclosure is schematically shown.

[0056] like Figure 3 As shown, the word search tree includes a root node, wherein w:0-10 represents a wildcard, supporting 0-10 arbitrary characters. w:0-5 represents a wildcard, supporting 0-5 arbitrary characters. ~ represents a fuzzy matching character. C represents a feature character, start represents the extraction start node, end represents the extraction end node, E represents an entity, and num represents a number.

[0057] According to the embodiment of the present disclosure, from the root node to a certain node, the characters on the path are linked together to obtain multiple templates, for example, Figure 3 As shown, from the root node to the last node, query templates 1 to 4 can be obtained.

[0058] According to the embodiments of the present disclosure, different query templates may be designed according to the different meanings of the characters represented by each node. For example, the query statements represented by query templates 1 to 4 may be as follows.

[0059] Query template 1, [W: 0-10] check the [@sys_filgth_num] flight of [@sys_location].

[0060] Query template 2, [W: 0-10] check [@sys_airport] of [@sys_location].

[0061] Query template three, [W:0-5][@sys_location] of [@sys_refer].

[0062] Query template four, ~[@sys_location]'s [@weather].

[0063] According to an embodiment of the present disclosure, query sentences supported by query templates 1 to 4 include but are not limited to the following.

[0064] Please help me check flight HU2341 from Guangzhou. Hello, I want to check flight FH403 from Beijing. Hello, I am in a hurry. Please check flight HY3242 from Nanjing. I want to take off today. Please help me check the airport in Chengdu. Hello, what is the weather in Chengdu? Is it cold? What is the weather in Shijiazhuang? Please tell me the earliest flight from Beijing. I want to take the latest flight from Wuhan.

[0065] According to an embodiment of the present disclosure, generating a query template matching the search information based on the target nodes matching the search terms includes: combining character contents corresponding to the target nodes matching the search terms into a query template according to the order of the target nodes in the word search tree.

[0066] According to an embodiment of the present disclosure, taking the search information of “I want a car that costs less than 123” as an example, the design template is: “[W: 0-10] Cars that cost less than {[@sys_number] name='number'}”.

[0067] According to the embodiment of the present disclosure, the matching starts from the root node of the word search tree. If the first node is a wildcard, the "I" node will be skipped to continue matching the remaining part of the query information. Similarly, the "want" node will be skipped. At this time, the following nodes "money", "low", and "between" will be matched. The matching continues along the current branch and then enters the extraction start node. At this time, the remaining part of the query information will enter the entity recognition module. The entity recognition module will return 123 as a digital entity, which will match the entity node in the word search tree. The next step is to enter the extraction end node, and the subsequent character nodes will be matched one by one until the end. The search information and the template match successfully, and the result {'number': 123} is returned at the same time.

[0068] According to the embodiments of the present disclosure, the task of template matching is to match a series of user query words to a template, that is, to establish a many-to-one mapping relationship, so that different user query words can be covered using limited templates.

[0069] According to an embodiment of the present disclosure, an example of establishing a many-to-one mapping relationship is as follows: check the power outage information in Guangzhou; help me check whether there is a power outage in Lishui; help me check whether there is a power outage in Dongguan; check whether there is a water outage in Shantou recently.

[0070] The above four sentences actually correspond precisely to a template. Just check |<city>|service (power outage / water outage).

[0071] It should be noted that the word search tree is only an exemplary embodiment, but is not limited thereto, and may also include other forms of word search trees known in the art, as long as they can support and implement the above functions.

[0072] According to an embodiment of the present disclosure, after obtaining a query template matching the search information, a target answering strategy corresponding to the query template matching the search information is determined; and the target answering strategy is executed according to the search information.

[0073] According to an embodiment of the present disclosure, the target answering strategy may be pre-designed by associating a query template with a query interface and responding to the search information based on the query interface.

[0074] According to an embodiment of the present disclosure, executing a target reply strategy according to search information includes: determining key search terms in the search information using a query template; and executing the target reply strategy based on the key search terms.

[0075] According to an embodiment of the present disclosure, after obtaining a query template matching the search information, key search terms in the search information may also be returned. The key search terms include but are not limited to numbers, entity names, location information, and the like.

[0076] Reference below Figures 4 to 6 , combined with specific embodiments Figure 2 The method shown is further explained.

[0077] Figure 4 The flowchart of generating a new word search tree according to an embodiment of the present disclosure is schematically shown.

[0078] like Figure 4 As shown, the method 400 includes operations S410 to S430.

[0079] In operation S410, a template configuration operation is obtained, wherein the template configuration operation includes template content.

[0080] In operation S420, in response to the template configuration operation, a new word search tree is generated according to the template content.

[0081] In operation S430, the new word search tree is associated with the user identifier and stored in the cache server.

[0082] According to the embodiments of the present disclosure, the template configuration operation input by the user can be obtained, and the user can configure the template content according to the actual business scenario.

[0083] According to an embodiment of the present disclosure, the template content may be segmented into multiple words, each word may be defined to correspond to a type of node, the words may be associated with the corresponding type of nodes, and a new word search tree may be generated based on each word.

[0084] According to an embodiment of the present disclosure, obtaining a template configuration operation includes: obtaining template content customized by a user according to business data; and generating a template configuration operation according to the template content customized by the user according to the business data.

[0085] According to an embodiment of the present disclosure, the business data may be, for example, bank-related business, which may include, for example, card application business. The template content customized according to the business data may include, for example, debit card application, credit card application, card opening, card opening fee, etc.

[0086] According to an embodiment of the present disclosure, the business data may also be, for example, car rental related business, and the template content customized according to the business data may include, for example, the cost of renting a car to Beijing, the cost of renting a car to a target city, and so on.

[0087] Figure 5 A schematic diagram of performing template configuration on a configuration interface according to an embodiment of the present disclosure is schematically shown.

[0088] like Figure 5As shown, when you need to configure a template, you can first display the configuration interface, which can include rule entities, composite entities, and intent / question-and-answer templates. The user can enter content in the configuration interface. For example, the user expresses: I want to rent a car to go to Beijing, la la la......

[0089] According to an embodiment of the present disclosure, the electronic device may generate template content based on user input content, for example, template content: rent a car to [@sys_location].

[0090] According to an embodiment of the present disclosure, the electronic device can perform verification based on rule entities, composite entities, intent / question-and-answer templates, etc., and obtain a verification result: it complies with the rules and can be hit.

[0091] According to the embodiments of the present disclosure, a word search tree is used as a basic data structure, and the idea of ​​exchanging space for time is utilized to make the search and matching analysis speed fast, and the request response rate is tens to hundreds of times that of the model-based matching method.

[0092] According to the embodiments of the present disclosure, users can intervene in template design in real time with low labor costs. Users do not need to mark, but only need to add new templates. When the system monitors the template changes, it will automatically update the template tree (i.e., the word search tree) and the template entity will take effect.

[0093] According to the embodiment of the present disclosure, a customized template is provided, and the user can define the template according to his own needs to complete the matching of entities and synonyms, as well as fuzzy matching, and can extract the corresponding entities. The matching based on the template can also generate search terms as needed.

[0094] According to an embodiment of the present disclosure, the user identifier may be the user identifier corresponding to the user who generates the template configuration operation. For each user, since the templates configured by the user themselves are different, each user will have a user identifier. This ensures that when the user calls the template matching service, the response template will not conflict.

[0095] According to an embodiment of the present disclosure, a new word search tree may be associated with a user identifier, and then the associated new word search tree and user identifier may be stored in a cache server.

[0096] According to an embodiment of the present disclosure, the update time of the word search tree associated with the user identifier in the cache server can be monitored; when the update time of the word search tree associated with the user identifier in the cache server is different from the last update time, the updated word search tree associated with the user identifier will be stored in the search engine database.

[0097] Figure 6 A schematic diagram of updating a word search tree according to an embodiment of the present disclosure is schematically shown.

[0098] like Figure 6 As shown, the user can modify the template by using a triggered Redis (cache server 601) update, and the user ID can be associated with the current update time. The user can add, delete or modify the template through the management page, and use the timer 602 to monitor the changes of Reids. The timer 602 can adopt the producer and consumer mode.

[0099] According to an embodiment of the present disclosure, a copy of Redis data can be maintained locally in database 603 to monitor the update time of the word search tree in Redis. When the update time of Redis is newer than the local database, it means that the local template data of database 603 is outdated, and the modified user ID can be added to the blocking queue; further, all user IDs are obtained from the blocking queue at one time, and the templates corresponding to these user IDs are fully updated, that is, all templates under the corresponding user ID are read from the database, a word search tree is created in the memory, and the newly created word search tree is provided to the user.

[0100] According to an embodiment of the present disclosure, the entity recognition module 604 may be used to recognize entities in the search information, and the template recognition module 605 may be used to recognize a template corresponding to the search information.

[0101] According to an embodiment of the present disclosure, when a user conducts a search, he or she may input search information based on a query page, and the search system may respond to the user input information based on a word search tree in a database 603 using an entity recognition module 604 and a template recognition module 605 .

[0102] Figure 7 The block diagram of the search and matching device according to an embodiment of the present disclosure is schematically shown.

[0103] like Figure 7 As shown, the search and matching device 700 includes: a first acquisition module 710 , a matching module 720 and a generation module 730 .

[0104] The first acquisition module 710 is used to acquire search information, wherein the search information includes a plurality of search terms in a sequential order.

[0105] The matching module 720 is used to match the search words in the search information with the nodes in the word search tree in order, and determine the target node in the word search tree that matches the search words, wherein the word search tree includes one or more types of nodes.

[0106] The generating module 730 is used to generate a query template matching the search information according to the target node matching the search term.

[0107] Through the embodiments of the present disclosure, the search terms are matched with the nodes in the word search tree according to the order of the search terms, and a query template matching the search information is generated according to the target node matching the search terms. The embodiments of the present disclosure perform search matching based on the word search tree, and can use the common prefix of the string to reduce the query time overhead to achieve the purpose of improving efficiency. The technical problem that the method for matching the user's query content in the related art is time-consuming to parse and inefficient is solved.

[0108] According to an embodiment of the present disclosure, the search and matching device 700 further includes: a determination module and an execution module.

[0109] The determination module is used to determine the target answering strategy corresponding to the query template matching the search information.

[0110] The execution module is used to execute the target reply strategy according to the search information.

[0111] According to an embodiment of the present disclosure, the execution module includes: a determination unit and an execution unit.

[0112] A determination unit, used to determine key search terms in the search information using the query template;

[0113] An execution unit is used to execute a target reply strategy based on a key search term.

[0114] According to an embodiment of the present disclosure, the search and matching device 700 further includes: a second acquisition module, a response module and a first storage module.

[0115] The second acquisition module is used to acquire the template configuration operation, wherein the template configuration operation includes the template content.

[0116] The response module is used to generate a new word search tree according to the template content in response to the template configuration operation.

[0117] The first storage module is used to store the new word search tree in association with the user identifier in the cache server.

[0118] According to an embodiment of the present disclosure, the search and matching device 700 further includes: a monitoring module and a second storage module.

[0119] The monitoring module is used to monitor the update time of the word search tree associated with the user identifier in the cache server.

[0120] The second storage module is used to store the updated word search tree associated with the user identifier in the search engine database when the update time of the word search tree associated with the user identifier in the cache server is different from the last update time.

[0121] According to an embodiment of the present disclosure, the second acquisition module includes: an acquisition unit and a generation unit.

[0122] An acquisition unit, used to acquire the template content customized by the user according to the business data;

[0123] The generating unit is used to generate a template configuration operation according to the template content customized by the user according to the business data.

[0124] According to an embodiment of the present disclosure, the generation module is used to combine character contents corresponding to target nodes matching the search term into a query template according to the order of the target nodes in the word search tree.

[0125] According to an embodiment of the present disclosure, the types of nodes in the word search tree include at least one of the following: a fuzzy character node for storing fuzzy matching characters; an entity node for storing entity names; a wildcard node for storing wildcard types; an extraction start node and an extraction end node for identifying the starting position and the ending position of the extracted content.

[0126] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0127] According to an embodiment of the present disclosure, an electronic device is also provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0128] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to enable a computer to execute the method as described above.

[0129] According to an embodiment of the present disclosure, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method as described above is implemented.

[0130] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0131] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0132] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0133] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as search matching methods. For example, in some embodiments, the above method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).

[0134] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0135] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0136] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0137] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0138] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0139] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0140] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0141] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A search and matching method, comprising: Acquire search information, wherein the search information includes a plurality of search terms in a sequence, and the sequence of the plurality of search terms is determined according to positions of the search terms in the search information; Matching the search words in the search information with the nodes in the word search tree in the order, and determining a target node in the word search tree that matches the search words, wherein the word search tree includes one or more types of nodes; The character contents corresponding to the target nodes matching the search terms are linked together according to the order of the target nodes in the word search tree to form a query template matching the search information, wherein the order of the target nodes matching the search terms in the word search tree is the same as the order of the multiple search terms.

2. The method according to claim 1, further comprising: Determining a target answering strategy corresponding to a query template matching the search information; The target answering strategy is executed according to the search information.

3. The method according to claim 2, wherein: The executing the target answering strategy according to the search information comprises: Determining key search terms in the search information using the query template; The targeted reply strategy is executed based on the key search terms.

4. The method according to claim 1, further comprising: Obtaining a template configuration operation, wherein the template configuration operation includes template content; In response to the template configuration operation, generating a new word search tree according to the template content; and The new word search tree is associated with the user identifier and stored in the cache server.

5. The method according to claim 4, further comprising: Monitoring the update time of the word search tree associated with the user identifier in the cache server; When the update time of the word search tree associated with the user identifier in the cache server is different from the last update time, the updated word search tree associated with the user identifier is stored in the search engine database.

6. The method according to claim 4, wherein: The operation of obtaining the template configuration includes: Get the template content customized by the user based on business data; The template configuration operation is generated according to the template content customized by the user according to the business data.

7. The method according to claim 1, wherein: The types of nodes in the word search tree include at least one of the following: Fuzzy character node, used to store fuzzy matching characters; Entity node, used to store entity name; Wildcard node, used to store wildcard types; The extraction start node and the extraction end node are used to identify the starting position and the ending position of the extracted content.

8. A search and matching device, comprising: A first acquisition module is used to acquire search information, wherein the search information includes a plurality of search terms in a sequence, and the sequence of the plurality of search terms is determined according to the positions of the search terms in the search information; A matching module, used for matching the search words in the search information with the nodes in the word search tree in the order, and determining the target node in the word search tree that matches the search words, wherein the word search tree includes one or more types of nodes; A generation module is used to link the character contents corresponding to the target nodes matching the search terms according to the order of the target nodes in the word search tree to form a query template matching the search information, wherein the order of the target nodes matching the search terms in the word search tree is the same as the order of the multiple search terms.

9. The apparatus according to claim 8, further comprising: A determination module, used to determine a target answering strategy corresponding to a query template matching the search information; An execution module is used to execute the target reply strategy according to the search information.

10. The device according to claim 9, wherein: The execution module includes: A determination unit, configured to determine a key search term in the search information using the query template; An execution unit is used to execute the target reply strategy based on the key search term.

11. The apparatus according to claim 8, further comprising: A second acquisition module is used to acquire a template configuration operation, wherein the template configuration operation includes template content; A response module, used for generating a new word search tree according to the template content in response to the template configuration operation; and The first storage module is used to store the new word search tree in association with the user identifier in a cache server.

12. The apparatus according to claim 11, further comprising: A monitoring module, used for monitoring the update time of the word search tree associated with the user identifier in the cache server; The second storage module is used to store the updated word search tree associated with the user identifier in the search engine database when the update time of the word search tree associated with the user identifier in the cache server is different from the last update time.

13. The device according to claim 11, wherein: The second acquisition module includes: An acquisition unit, used to acquire the template content customized by the user according to the business data; A generating unit is used to generate the template configuration operation according to the template content customized by the user according to the business data.

14. The device according to claim 8, wherein: The types of nodes in the word search tree include at least one of the following: Fuzzy character node, used to store fuzzy matching characters; Entity node, used to store entity name; Wildcard node, used to store wildcard types; The extraction start node and the extraction end node are used to identify the starting position and the ending position of the extracted content.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • File directory storage method, retrieval method and device

    CN103299297A

  • Chinese AC (Aho-Corasick) automaton working method based on keyword dictionary tree structure

    CN105260354A

  • Data query method, device and system

    CN105378724A

  • Verbal skill generation method and device based on artificial intelligence, device and memory medium

    CN107423363A

  • A keyword inquiry method for linked data based on tree template

    CN109271560A