Keyword-based search method and device, medium and equipment

By building a target knowledge base and combining the user's historical search information and context information to perform keyword searches, the problem of low detection accuracy in the prior art is solved, and higher search results relevance and accuracy are achieved.

CN119557421APending Publication Date: 2025-03-04CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411694749.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The existing keyword search methods have low detection accuracy and are difficult to meet the actual needs of users.

Method used

By receiving information about the user logging into the target service system, determining the user's access rights, obtaining the data source corresponding to the access rights, performing word vector conversion, and building a target knowledge base. Then, obtain the user's search keywords, perform semantic matching and word vector transformation, obtain historical correlation information and context information, merge it into a target vector, perform answer search and optimization processing, and obtain the target answer.

Benefits of technology

It improves the relevance and accuracy of search results, enhances the reliability of search results, and meets the actual needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557421A_ABST
    Figure CN119557421A_ABST
Patent Text Reader

Abstract

The invention discloses a keyword-based search method and device, a medium and equipment, and relates to the technical field of financial management, and the method comprises the steps: constructing a target knowledge base based on the access authority of a user in a target service system; obtaining a search keyword of a user, and performing semantic matching and word vector conversion on the search keyword to obtain a semantic vector; obtaining historical associated information related to the search keyword, performing word vector conversion on the historical associated information and the current context information to obtain an associated vector, and combining the semantic vector with the associated vector to obtain a target vector; and performing answer retrieval on the target vector based on the target knowledge base to obtain a candidate answer vector, and performing optimization processing on the candidate answer vector through a preset large language model to obtain a target answer corresponding to the search keyword. According to the method, the historical search information and the context information of the user are fully considered, the query of the related results is more relevant, and the reliability and the accuracy of the search results are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of keyword search, and in particular relates to a keyword-based search method, device, medium and equipment. Background Art

[0002] The search function is an important functional module in the software system. The user enters the query information, and the search function determines the keywords from the input query information, and uses the keywords to quickly lock specific information without browsing huge data sets, effectively avoiding complex and irrelevant information, and significantly improving the speed and efficiency of data query.

[0003] In the traditional search function, users input keywords, and the search engine determines the keywords through the semantics of the keywords, and searches for content matching the keywords from the massive data. However, this method has some shortcomings. For example, users use non-standard expressions, such as non-standard natural language, spelling errors or grammatical errors, etc. Sometimes the keywords determined by the search engine are not accurate enough, and the relevance of the search results is often low, which is difficult to meet the actual needs of users.

[0004] Therefore, a keyword search method with high detection accuracy is needed. Summary of the invention

[0005] In view of this, the present invention provides a keyword-based search method, device, medium and equipment, the main purpose of which is to solve the problem of low detection accuracy of existing keyword search methods.

[0006] According to one aspect of the present application, a keyword-based search method is provided, the method comprising:

[0007] After receiving information about the user logging into the target service system, determining the user's access rights in the target service system, obtaining a data source corresponding to the access rights in a database corresponding to the target service system based on the access rights, performing word vector conversion on the data in the data source, and obtaining a target knowledge base;

[0008] Obtaining the user's search keyword, performing semantic matching on the search keyword to obtain multiple target keywords, and performing word vector conversion on each of the target keywords to obtain a semantic vector;

[0009] Using the context information of the search keyword as current association information, obtaining historical association information related to the search keyword from the historical search information of the user, performing word vector conversion on the historical association information and the current association information to obtain an association vector, and merging the semantic vector with the association vector to obtain a target vector;

[0010] The target vector is retrieved for answers based on the target knowledge base to obtain candidate answer vectors, and the candidate answer vectors are optimized through a preset large language model to obtain a target answer corresponding to the search keyword.

[0011] Optionally, performing semantic matching on the search keyword to obtain multiple target keywords includes:

[0012] Perform word segmentation processing on the search keyword based on a word segmenter to obtain multiple initial keywords;

[0013] Semantic matching is performed on each of the initial keywords based on a preset knowledge base to obtain at least one target keyword corresponding to each of the initial keywords.

[0014] Optionally, the acquiring of historical association information related to the search keyword from the historical search information of the user includes:

[0015] In the user's historical search information, the search keyword and the target keyword corresponding to the search keyword are searched to obtain historical keyword information;

[0016] In the historical search information of the user, context information corresponding to the historical keyword information is obtained, and the historical keyword information and the corresponding context information are used as historical association information.

[0017] Optionally, performing answer retrieval on the target vector based on the target knowledge base to obtain a candidate answer vector includes:

[0018] Setting a first filter based on the access rights of the user, and querying the target knowledge base for answers to the semantic vectors in the target vector based on the first filter to obtain a plurality of first intermediate answer vectors;

[0019] Using the associated vector in the target vector as a second filter, and performing secondary filtering on the plurality of first intermediate answer vectors based on the second filter to obtain a plurality of second intermediate answer vectors;

[0020] Based on the matching degree between the current association information and the historical association information and each second intermediate answer vector, the plurality of second intermediate answer vectors are sorted to obtain a candidate answer vector.

[0021] Optionally, performing answer retrieval on the target vector based on the target knowledge base to obtain a candidate answer vector includes:

[0022] Based on the target knowledge base and the target vector, obtaining a plurality of preliminarily retrieved third intermediate answer vectors;

[0023] combining the plurality of third intermediate answer vectors to generate a preliminary reply vector;

[0024] Based on the target knowledge base and the preliminary answer vector, obtaining a plurality of fourth intermediate answer vectors retrieved again;

[0025] combining the plurality of fourth intermediate answer vectors to form a new preliminary answer vector;

[0026] Based on the target knowledge base and the new preliminary reply vector, multiple third intermediate answer vectors are retrieved again until the number of retrievals reaches a preset number, and the answer vector retrieved last time is used as a candidate answer vector.

[0027] Optionally, based on the access permission, obtaining a data source corresponding to the access permission in a database corresponding to the target service system, performing word vector conversion on the data in the data source to obtain a target knowledge base includes:

[0028] Based on the access permission, obtaining multiple data sources corresponding to the access permission in a database corresponding to the target service system, wherein the data sources include service data stored in a preset database, historical search data of the user, and search behavior track of the user;

[0029] Monitoring newly added data in the database corresponding to the target service system, and when monitoring that a new data source corresponding to the access authority is added in the database corresponding to the target service system, acquiring the new data source;

[0030] Performing format processing on each of the data sources to obtain a plurality of documents in a standard format;

[0031] Segmenting the text in each document having a standard format based on a text segmenter to obtain a plurality of text data;

[0032] Each of the text data is converted into a word vector to obtain a plurality of text vectors, and the text vectors are stored in a vector database to obtain a target knowledge base.

[0033] Optionally, merging the semantic vector with the association vector to obtain a target vector includes:

[0034] The semantic vector is concatenated with the association vector to obtain a target vector.

[0035] According to another aspect of the present application, a keyword-based search device is provided, comprising:

[0036] A target knowledge base acquisition module is used to determine the user's access rights in the target service system after receiving the user's login information to the target service system, obtain a data source corresponding to the access rights in a database corresponding to the target service system based on the access rights, and perform word vector conversion on the data in the data source to obtain a target knowledge base;

[0037] A semantic vector acquisition module, used to acquire the user's search keyword, perform semantic matching on the search keyword to obtain multiple target keywords, and perform word vector conversion on each of the target keywords to obtain a semantic vector;

[0038] a target vector acquisition module, configured to use the context information of the search keyword as current association information, acquire historical association information related to the search keyword from the user's historical search information, perform word vector conversion on the historical association information and the current association information to obtain an association vector, and merge the semantic vector with the association vector to obtain a target vector;

[0039] The target answer acquisition module is used to retrieve the answer of the target vector based on the target knowledge base to obtain a candidate answer vector, optimize the candidate answer vector through a preset large language model, and obtain the target answer corresponding to the search keyword.

[0040] Optionally, the semantic vector acquisition module is further used for:

[0041] Perform word segmentation processing on the search keyword based on a word segmenter to obtain multiple initial keywords;

[0042] Semantic matching is performed on each of the initial keywords based on a preset knowledge base to obtain at least one target keyword corresponding to each of the initial keywords.

[0043] Optionally, the target vector acquisition module is further used for:

[0044] In the user's historical search information, the search keyword and the target keyword corresponding to the search keyword are searched to obtain historical keyword information;

[0045] In the user's historical search information, context information corresponding to the historical keyword information is obtained, and the historical keyword information and its corresponding context information are used as historical association information.

[0046] Optionally, the target answer acquisition module is further used to:

[0047] Setting a first filter based on the access rights of the user, and querying the target knowledge base for answers to the semantic vectors in the target vector based on the first filter to obtain a plurality of first intermediate answer vectors;

[0048] Using the associated vector in the target vector as a second filter, and performing secondary filtering on the plurality of first intermediate answer vectors based on the second filter to obtain a plurality of second intermediate answer vectors;

[0049] Based on the matching degree between the current association information and the historical association information and each second intermediate answer vector, the plurality of second intermediate answer vectors are sorted to obtain a candidate answer vector.

[0050] Optionally, the target answer acquisition module is further used to:

[0051] Based on the target knowledge base and the target vector, obtaining a plurality of preliminarily retrieved third intermediate answer vectors;

[0052] combining the plurality of third intermediate answer vectors to generate a preliminary reply vector;

[0053] Based on the target knowledge base and the preliminary answer vector, obtaining a plurality of fourth intermediate answer vectors retrieved again;

[0054] combining the plurality of fourth intermediate answer vectors to form a new preliminary answer vector;

[0055] Based on the target knowledge base and the new preliminary reply vector, multiple third intermediate answer vectors are retrieved again until the number of retrievals reaches a preset number, and the answer vector retrieved last time is used as a candidate answer vector.

[0056] Optionally, the target knowledge base acquisition module is further used to:

[0057] Based on the access permission, obtaining multiple data sources corresponding to the access permission in a database corresponding to the target service system, wherein the data sources include service data stored in a preset database, historical search data of the user, and search behavior track of the user;

[0058] Monitoring newly added data in the database corresponding to the target service system, and when monitoring that a new data source corresponding to the access authority is added in the database corresponding to the target service system, acquiring the new data source;

[0059] Performing format processing on each of the data sources to obtain a plurality of documents in a standard format;

[0060] Segmenting the text in each document having a standard format based on a text segmenter to obtain a plurality of text data;

[0061] Each of the text data is converted into a word vector to obtain a plurality of text vectors, and the text vectors are stored in a vector database to obtain a target knowledge base.

[0062] Optionally, the target vector acquisition module is further used for:

[0063] The semantic vector is concatenated with the association vector to obtain a target vector.

[0064] According to another aspect of the present application, a storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned keyword-based search method.

[0065] According to another aspect of the present application, a computer device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0066] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the keyword-based search method as described above.

[0067] Through the above technical scheme, the present application provides a keyword-based search method, device, medium and equipment, which obtains multiple target keywords by semantically matching the search keywords entered by the user in the target service platform, and converts them into semantic vectors, obtains historical association information and context information of the search keyword, and converts them into association vectors, combines the semantic vector with the association vector to obtain a target vector, builds a real-time target knowledge base that matches the user's access rights in the target service platform, performs answer queries for the target vector in the target knowledge base, obtains candidate answer vectors, and then optimizes the candidate answer vectors through a large language model to obtain the target answer, which fully considers the user's historical search information and context information, so that the query for related results is more relevant, and at the same time combines the data source of the target service system itself, also provides the relevance of the query results, and improves the reliability and accuracy of the search results.

[0068] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0070] Figure 1 A flowchart of a keyword-based search method provided in an embodiment of the present application is shown;

[0071] Figure 2 Another flow chart of a keyword-based search method provided in an embodiment of the present application is shown;

[0072] Figure 3 Another flowchart of a keyword-based search method provided in an embodiment of the present application is shown;

[0073] Figure 4 A block diagram of a keyword-based search device provided in an embodiment of the present application is shown;

[0074] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown.

[0075] In the figure: 402 - target knowledge base acquisition module; 404 - semantic vector acquisition module; 406 - target vector acquisition module; 408 - target answer acquisition module; 502 - processor; 504 - communication interface; 506 - memory; 508 - communication bus; 510 - program. DETAILED DESCRIPTION

[0076] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0077] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention application are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.

[0078] In view of the problem that the existing keyword search method has low detection accuracy, the present application embodiment provides a keyword-based search method, such as Figure 1 As shown, the method includes:

[0079] 102: After receiving the information that the user logs in to the target service system, determine the user's access rights in the target service system, obtain a data source corresponding to the access rights in a database corresponding to the target service system based on the access rights, perform word vector conversion on the data in the data source, and obtain a target knowledge base;

[0080] 104: Obtain the user's search keyword, perform semantic matching on the search keyword, obtain multiple target keywords, perform word vector conversion on each target keyword, and obtain a semantic vector;

[0081] 106: Using the context information of the search keyword as the current association information, obtaining the historical association information related to the search keyword from the user's historical search information, performing word vector conversion on the historical association information and the current association information to obtain an association vector, and merging the semantic vector with the association vector to obtain a target vector;

[0082] 108: Perform answer retrieval on the target vector based on the target knowledge base to obtain a candidate answer vector, optimize the candidate answer vector through a preset large language model, and obtain a target answer corresponding to the search keyword.

[0083] Specifically, the search function is an indispensable part of the software system. Through the search function, users can quickly obtain data from the system without browsing the full amount of data, which improves the user's data query speed. However, the existing keyword search method has a low detection accuracy. In this regard, the present application proposes a keyword search method.

[0084] After the user logs in to the target service system, the user's access rights in the target service system are obtained. According to the access rights, the data source allowed by the access rights is obtained in the database corresponding to the target service system, and a target knowledge base updated in near real time is built based on the obtained data source. Since there are many users logging in to the target service system, and many users search and query data in the target service system, the query and search function of the target service system needs to query data from the entire system database. The entire system database stores a considerable amount of data, the search range is relatively large, and there are also many requests to access the entire system database. Therefore, it takes a little longer to search the entire system database to obtain answers. Therefore, the target knowledge base corresponding to each user is built according to the rights of each user in the target service system, which reduces the search range and improves the search accuracy and speed.

[0085] Obtain the search keyword input by the user, perform deep and natural language processing on the search keyword input by the user, divide it into blocks based on the intent, perform semantic matching on the block keywords, obtain multiple target keywords, and use a word vector converter to convert these target keywords into word vectors to obtain semantic vectors. For example, use a large language model to perform intent analysis and block, as well as semantic matching on the search keyword to obtain multiple target keywords. Query the search keyword in the user's search history record, use the search keyword and its upper and lower historical information as historical association information, use the current context information of the search keyword as current association information, use the word vector converter to convert the historical association information and the current association information into word vectors to obtain an association vector, and combine the semantic vector and the association vector to obtain a target vector. For example, use the LangChain framework to process the user's historical association information and current context information to construct a context information vector. Perform answer retrieval on the target vector in the target knowledge base to obtain a candidate answer vector, for example, use the Conversational RetrieverChain context-aware search algorithm to search for answers in the target knowledge base. The searched candidate answer vectors are reordered to get a ranking that is more in line with the business scenario, and the Qwen-14B large language model is used to optimize the reordered candidate answer vectors. The large language model will comprehensively consider factors such as the relevance, accuracy, and credibility of the answers, and score and sort the answers through the algorithm model to ensure that the best answers can be displayed to users first. The large language model will also evaluate the answers, and this evaluation process may introduce external evaluation indicators to ensure the quality and credibility of the answers, making the output target answers more accurate.

[0086] The target service platforms of this application include but are not limited to financial management platforms, public service platforms, digital medical service platforms, etc., and the database status monitoring methods include but are not limited to financial management, public services, digital medical, and insurance business application scenarios.

[0087] Taking the data asset management platform in the financial management platform as an example, each user has different permissions on this platform. After different users log in, different target knowledge bases are built, which narrows the search scope of keywords and improves search efficiency and accuracy.

[0088] The data source is the data stored in the database corresponding to the target service platform, such as a PostgreSQL database, an ElasticSearch database, or an online document web page as a data source.

[0089] Compared with the prior art, the keyword-based search method provided by the present application performs semantic matching on the search keywords input by the user in the target service platform to obtain multiple target keywords, and converts them into semantic vectors, obtains historical association information and context information of the search keywords, and converts them into association vectors, combines the semantic vector with the association vector to obtain a target vector, builds a real-time target knowledge base that matches the user's access rights in the target service platform, performs answer queries for the target vector in the target knowledge base to obtain candidate answer vectors, and then optimizes the candidate answer vectors through a large language model to obtain the target answer. The user's historical search information and context information are fully considered, so the query for related results is more relevant. At the same time, the data source of the target service system itself is combined to provide the relevance of the query results, thereby improving the reliability and accuracy of the search results.

[0090] In another embodiment of the present invention, Figure 2 As shown, the keyword-based search method also includes:

[0091] 202: Obtain the user's search keyword, perform word segmentation processing on the search keyword based on a word segmenter to obtain multiple initial keywords, perform semantic matching on each initial keyword based on a preset knowledge base, and obtain at least one target keyword corresponding to each initial keyword:

[0092] 204: In the user's historical search information, a search keyword and a target keyword corresponding to the search keyword are searched to obtain historical keyword information, and context information corresponding to the historical keyword information is obtained from the user's historical search information, and the historical keyword information and the context information corresponding to the historical keyword information are used as historical association information;

[0093] 206: Using the context information of the search keyword as the current association information, performing word vector conversion on the historical association information and the current association information to obtain an association vector, and concatenating the semantic vector with the association vector to obtain a target vector;

[0094] 208: Perform answer retrieval on the target vector based on the target knowledge base to obtain a candidate answer vector, optimize the candidate answer vector through a preset large language model, and obtain a target answer corresponding to the search keyword.

[0095] Specifically, word segmentation is the process of dividing a text into independent words or phrases. The word segmenter will segment the words in the text according to certain rules and algorithms to form a word list, and then count the frequency of each word in the text. The word frequency statistics can be used as an important reference for keyword extraction. After obtaining the initial keywords, semantic matching is performed on each initial keyword based on the preset knowledge base to obtain words with the same or similar meaning as the initial keywords, or to find the correct expression of the initial keyword in the preset knowledge base. Specifically, this method will first extract multiple candidate words, then score each candidate word, and finally output the candidate word with a relatively high score as the target keyword, and use the word vector converter to convert the target keyword into a semantic vector.

[0096] In the user's historical search information, search keywords and target keywords corresponding to the search keywords are queried, and then the context information corresponding to the queried information is obtained. The queried historical information is used as historical associated information, and the current context information of the search keyword is used as current associated information. A word vector converter is used to convert the historical associated information and the current associated information into word vectors to obtain an associated vector. The semantic vector and the associated vector are concatenated and fused to obtain a target vector, and an answer query is performed on the target vector in the target knowledge base.

[0097] In one embodiment, after the target answer is sent to the client, the number of clicks, click order, and evaluation of the target answer by the user are obtained, the user's feedback information on the search results is collected, and the feedback information is updated in real time to the user's search history for subsequent improvement.

[0098] In one embodiment, Figure 3 As shown, the keyword-based search method also includes:

[0099] 302: Setting a first filter based on the user's access rights, and querying the target knowledge base for answers to the semantic vector in the target vector based on the first filter to obtain a plurality of first intermediate answer vectors;

[0100] 304: using the associated vector in the target vector as a second filter, and performing secondary filtering on the plurality of first intermediate answer vectors based on the second filter to obtain a plurality of second intermediate answer vectors;

[0101] 306: Sort the multiple second intermediate answer vectors based on the matching degree between the current association information and the historical association information and each second intermediate answer vector to obtain a candidate answer vector.

[0102] Specifically, first, according to the semantic vector in the target vector, the first query is performed in the target knowledge base, and a customized first filter is set through the user's permission data. The first query is performed in combination with the first filter to ensure secure access to the data. Then, the association vector in the target vector is used as the second filter, especially the current context information, and the intermediate answer vector of the first query is filtered twice to filter out the answer information most relevant to the user's search keyword, and obtain multiple second intermediate answer vectors; finally, according to the user's historical search records, context information, and behavior trajectory data, a customized sorting rule is determined, and multiple second intermediate vectors are sorted according to the sorting rule to obtain candidate answer vectors, which are multiple answers that are relatively matched with the search keyword.

[0103] In one embodiment, when a search is not completed, the context of the search keyword is continuously updated, and the search in the target knowledge base is also continuously updated until the search is completed.

[0104] In one embodiment, answer retrieval is performed on the target vector based on the target knowledge base to obtain a candidate answer vector, including:

[0105] Based on the target knowledge base and the target vector, a plurality of third intermediate answer vectors of preliminary retrieval are obtained;

[0106] combining the plurality of third intermediate answer vectors to generate a preliminary reply vector;

[0107] Based on the target knowledge base and the preliminary answer vector, a plurality of fourth intermediate answer vectors retrieved again are obtained;

[0108] combining the plurality of fourth intermediate answer vectors to form a new preliminary answer vector;

[0109] Based on the target knowledge base and the new preliminary reply vector, multiple third intermediate answer vectors are retrieved again until the number of retrievals reaches a preset number, and the answer vector retrieved last time is used as a candidate answer vector.

[0110] Specifically, the answer to the target vector is preliminarily queried in the target knowledge base to obtain multiple third intermediate answer vectors, the multiple third intermediate answer vectors are combined as a preliminary answer vector, the preliminary answer vector is queried or matched in the target knowledge base to obtain multiple fourth intermediate vectors, the multiple fourth intermediate vectors are combined to obtain a new preliminary answer vector, the new preliminary answer vector is queried or matched in the target knowledge base to obtain multiple intermediate vectors that are retrieved again, the multiple intermediate vectors that are retrieved again are combined again, and the target knowledge base is queried or matched again until the number of iterations is reached, the multiple intermediate vectors of the last query or match are used as candidate answer vectors, and the query accuracy is improved through repeated queries.

[0111] In one embodiment, based on the access rights, a data source corresponding to the access rights is obtained in a database corresponding to the target service system, and word vector conversion is performed on the data in the data source to obtain a target knowledge base, including:

[0112] Based on the access rights, multiple data sources corresponding to the access rights are obtained in a database corresponding to the target service system, wherein the data sources include service data stored in a preset database, historical search data of the user, and search behavior track of the user;

[0113] Monitor the newly added data in the database corresponding to the target service system, and when it is detected that a new data source corresponding to the access permission is added in the database corresponding to the target service system, obtain the newly added data source;

[0114] Perform format processing on each data source to obtain multiple documents with standard formats;

[0115] Segmenting the text in each document having a standard format based on a text segmenter to obtain a plurality of text data;

[0116] Each text data is converted into a word vector to obtain multiple text vectors, and the text vectors are stored in a vector database to obtain a target knowledge base.

[0117] Specifically, the data of the target service platform is stored in a preset database, for example, the user's access data, the service data generated according to the access data, etc., and the stored service data, the user's historical search data, and the user's search behavior trajectory are read from the preset database. At the same time, the newly added data in the database is monitored, and when new data related to the user's access rights is detected, a new data source is obtained. Taking the data asset management platform as an example, according to the characteristics of the data asset management platform, the PostgreSQL database, the ElasticSearch database, and the online document webpage are used as data sources, and the data in the existing or newly added data sources are captured and loaded through the data loader. Then, the captured data is formatted, the unrecognizable content is removed, and metadata information such as file name, time, user name, database name, data table name, indicator name, label name, etc. is extracted. Then, the document is segmented using a text segmenter to improve processing efficiency and search performance. Then, the segmented text data is converted into word vectors using a word vector converter to obtain multiple text vectors, which can be used to represent the semantic information of the text. In natural language processing (NLP), word vector conversion is a very important concept because it can map text data to a high-dimensional vector space, making it easier to process using machine learning and deep learning models. Finally, a vector database is used to store these text vector data as a target knowledge base for search algorithms to search for data.

[0118] During the keyword search process, if a new data source is generated, the above method is used to process the new data source to obtain a new text vector, which is stored in the target knowledge base so that the target knowledge base can be updated according to real-time data.

[0119] Furthermore, as a response to the above Figure 1 The implementation of the method shown is as follows Figure 4 As shown, an embodiment of the present invention provides a keyword-based search device, comprising:

[0120] The target knowledge base acquisition module 402 is used to determine the user's access rights in the target service system after receiving the information of the user logging into the target service system, and based on the access rights, obtain the data source corresponding to the access rights in the database corresponding to the target service system, perform word vector conversion on the data in the data source, and obtain the target knowledge base;

[0121] The semantic vector acquisition module 404 is used to acquire the user's search keyword, perform semantic matching on the search keyword to obtain multiple target keywords, and perform word vector conversion on each target keyword to obtain a semantic vector;

[0122] The target vector acquisition module 406 is used to use the context information of the search keyword as the current association information, obtain the historical association information related to the search keyword in the user's historical search information, perform word vector conversion on the historical association information and the current association information to obtain the association vector, and merge the semantic vector with the association vector to obtain the target vector;

[0123] The target answer acquisition module 408 is used to retrieve the answer of the target vector based on the target knowledge base to obtain the candidate answer vector, optimize the candidate answer vector through the preset large language model, and obtain the target answer corresponding to the search keyword.

[0124] Compared with the prior art, the keyword-based search device provided by the present application obtains multiple target keywords by semantically matching the search keywords input by the user in the target service platform, and converts them into semantic vectors, obtains historical association information and context information of the search keywords, and converts them into association vectors, combines the semantic vector with the association vector to obtain a target vector, builds a real-time target knowledge base that matches the user's access rights in the target service platform, performs answer queries for the target vector in the target knowledge base, obtains candidate answer vectors, and then optimizes the candidate answer vectors through a large language model to obtain the target answer, which fully considers the user's historical search information and context information, so that the query for related results is more relevant, and at the same time combines the data source of the target service system itself, also provides the relevance of the query results, and improves the reliability and accuracy of the search results.

[0125] In one embodiment, the semantic vector acquisition module is further used to:

[0126] Perform word segmentation on the search keyword based on the word segmenter to obtain multiple initial keywords;

[0127] Semantic matching is performed on each initial keyword based on a preset knowledge base to obtain at least one target keyword corresponding to each initial keyword.

[0128] In one embodiment, the target vector acquisition module is further used for:

[0129] In the user's historical search information, search for a search keyword and a target keyword corresponding to the search keyword to obtain historical keyword information;

[0130] In the user's historical search information, context information corresponding to the historical keyword information is obtained, and the historical keyword information and its corresponding context information are used as historical association information.

[0131] In one embodiment, the target answer acquisition module is further used to:

[0132] A first filter is set based on the user's access rights, and based on the first filter, a target knowledge base is queried for an answer to a semantic vector in a target vector to obtain a plurality of first intermediate answer vectors;

[0133] Using the associated vector in the target vector as a second filter, and performing secondary filtering on the plurality of first intermediate answer vectors based on the second filter to obtain a plurality of second intermediate answer vectors;

[0134] Based on the matching degree between the current association information and the historical association information and each second intermediate answer vector, the multiple second intermediate answer vectors are sorted to obtain a candidate answer vector.

[0135] In one embodiment, the target answer acquisition module is further used to:

[0136] Based on the target knowledge base and the target vector, a plurality of third intermediate answer vectors of preliminary retrieval are obtained;

[0137] combining the plurality of third intermediate answer vectors to generate a preliminary reply vector;

[0138] Based on the target knowledge base and the preliminary answer vector, a plurality of fourth intermediate answer vectors retrieved again are obtained;

[0139] combining the plurality of fourth intermediate answer vectors to form a new preliminary answer vector;

[0140] Based on the target knowledge base and the new preliminary reply vector, multiple third intermediate answer vectors are retrieved again until the number of retrievals reaches a preset number, and the answer vector retrieved last time is used as a candidate answer vector.

[0141] In one embodiment, the target knowledge base acquisition module is further used to:

[0142] Based on the access rights, multiple data sources corresponding to the access rights are obtained in a database corresponding to the target service system, wherein the data sources include service data stored in a preset database, historical search data of the user, and search behavior track of the user;

[0143] Monitor the newly added data in the database corresponding to the target service system, and when it is detected that a new data source corresponding to the access permission is added in the database corresponding to the target service system, obtain the newly added data source;

[0144] Perform format processing on each data source to obtain multiple documents with standard formats;

[0145] Segmenting the text in each document having a standard format based on a text segmenter to obtain a plurality of text data;

[0146] Each text data is converted into a word vector to obtain multiple text vectors, and the text vectors are stored in a vector database to obtain a target knowledge base.

[0147] In one embodiment, the target vector acquisition module is further used for:

[0148] The semantic vector is concatenated with the association vector to obtain the target vector.

[0149] According to another aspect of the present application, a storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned keyword-based search method.

[0150] According to an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the keyword-based search method in any of the above method embodiments.

[0151] Figure 5 A schematic diagram of the structure of a computer device provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computer device.

[0152] like Figure 5 As shown, the computer device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .

[0153] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .

[0154] The communication interface 504 is used to communicate with other devices such as clients or other servers.

[0155] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned keyword-based search method embodiment.

[0156] Specifically, the program 510 may include program codes, which include computer operation instructions.

[0157] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0158] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0159] The program 510 may be specifically configured to enable the processor 502 to perform the following operations:

[0160] After receiving the information that the user logs in to the target service system, determine the user's access rights in the target service system, obtain the data source corresponding to the access rights in the database corresponding to the target service system based on the access rights, perform word vector conversion on the data in the data source, and obtain the target knowledge base;

[0161] Obtain the user's search keywords, perform semantic matching on the search keywords, obtain multiple target keywords, perform word vector conversion on each target keyword, and obtain a semantic vector;

[0162] The context information of the search keyword is used as the current association information, and the historical association information related to the search keyword is obtained from the user's historical search information. The historical association information and the current association information are converted into word vectors to obtain an association vector, and the semantic vector is merged with the association vector to obtain a target vector.

[0163] The answer of the target vector is retrieved based on the target knowledge base to obtain the candidate answer vector, which is then optimized through the preset large language model to obtain the target answer corresponding to the search keyword.

[0164] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. A keyword-based search method, characterized in that: include: After receiving information about the user logging into the target service system, determining the user's access rights in the target service system, obtaining a data source corresponding to the access rights in a database corresponding to the target service system based on the access rights, performing word vector conversion on the data in the data source, and obtaining a target knowledge base; Obtaining the user's search keyword, performing semantic matching on the search keyword to obtain multiple target keywords, and performing word vector conversion on each of the target keywords to obtain a semantic vector; Using the context information of the search keyword as current association information, obtaining historical association information related to the search keyword from the historical search information of the user, performing word vector conversion on the historical association information and the current association information to obtain an association vector, and merging the semantic vector with the association vector to obtain a target vector; The target vector is retrieved for answers based on the target knowledge base to obtain candidate answer vectors, and the candidate answer vectors are optimized through a preset large language model to obtain a target answer corresponding to the search keyword.

2. The keyword-based search method according to claim 1, characterized in that: The semantic matching of the search keyword to obtain multiple target keywords includes: Perform word segmentation processing on the search keyword based on a word segmenter to obtain multiple initial keywords; Semantic matching is performed on each of the initial keywords based on a preset knowledge base to obtain at least one target keyword corresponding to each of the initial keywords.

3. The keyword-based search method according to claim 2, characterized in that: The acquiring of historical association information related to the search keyword from the historical search information of the user includes: In the user's historical search information, the search keyword and the target keyword corresponding to the search keyword are searched to obtain historical keyword information; In the user's historical search information, context information corresponding to the historical keyword information is obtained, and the historical keyword information and its corresponding context information are used as historical association information.

4. The keyword-based search method according to claim 3, characterized in that: The step of performing answer retrieval on the target vector based on the target knowledge base to obtain a candidate answer vector includes: Setting a first filter based on the access rights of the user, and querying the target knowledge base for answers to the semantic vectors in the target vector based on the first filter to obtain a plurality of first intermediate answer vectors; Using the associated vector in the target vector as a second filter, and performing secondary filtering on the plurality of first intermediate answer vectors based on the second filter to obtain a plurality of second intermediate answer vectors; Based on the matching degree between the current association information and the historical association information and each second intermediate answer vector, the plurality of second intermediate answer vectors are sorted to obtain a candidate answer vector.

5. The keyword-based search method according to claim 3, characterized in that: The step of performing answer retrieval on the target vector based on the target knowledge base to obtain a candidate answer vector includes: Based on the target knowledge base and the target vector, obtaining a plurality of preliminarily retrieved third intermediate answer vectors; combining the plurality of third intermediate answer vectors to generate a preliminary reply vector; Based on the target knowledge base and the preliminary answer vector, obtaining a plurality of fourth intermediate answer vectors retrieved again; combining the plurality of fourth intermediate answer vectors to form a new preliminary answer vector; Based on the target knowledge base and the new preliminary reply vector, multiple third intermediate answer vectors are retrieved again until the number of retrievals reaches a preset number, and the answer vector retrieved last time is used as a candidate answer vector.

6. The keyword-based search method according to any one of claims 1 to 5, characterized in that: The method of acquiring a data source corresponding to the access permission in a database corresponding to the target service system based on the access permission, performing word vector conversion on the data in the data source to obtain a target knowledge base includes: Based on the access permission, obtaining multiple data sources corresponding to the access permission in a database corresponding to the target service system, wherein the data sources include service data stored in a preset database, historical search data of the user, and search behavior track of the user; Monitoring newly added data in the database corresponding to the target service system, and when monitoring that a new data source corresponding to the access authority is added in the database corresponding to the target service system, acquiring the new data source; Performing format processing on each of the data sources to obtain a plurality of documents in a standard format; Segmenting the text in each document having a standard format based on a text segmenter to obtain a plurality of text data; Each of the text data is converted into a word vector to obtain a plurality of text vectors, and the text vectors are stored in a vector database to obtain a target knowledge base.

7. The keyword-based search method according to any one of claims 1 to 5, characterized in that: The step of merging the semantic vector with the association vector to obtain a target vector includes: The semantic vector is concatenated with the association vector to obtain a target vector.

8. A keyword-based search device, characterized in that: include: A target knowledge base acquisition module is used to determine the user's access rights in the target service system after receiving the user's login information to the target service system, obtain a data source corresponding to the access rights in a database corresponding to the target service system based on the access rights, and perform word vector conversion on the data in the data source to obtain a target knowledge base; A semantic vector acquisition module, used to acquire the user's search keyword, perform semantic matching on the search keyword to obtain multiple target keywords, and perform word vector conversion on each of the target keywords to obtain a semantic vector; a target vector acquisition module, configured to use the context information of the search keyword as current association information, acquire historical association information related to the search keyword from the user's historical search information, perform word vector conversion on the historical association information and the current association information to obtain an association vector, and merge the semantic vector with the association vector to obtain a target vector; The target answer acquisition module is used to retrieve the answer of the target vector based on the target knowledge base to obtain a candidate answer vector, optimize the candidate answer vector through a preset large language model, and obtain the target answer corresponding to the search keyword.

9. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the keyword-based search method according to any one of claims 1 to 7.

10. A computer device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the keyword-based search method as described in any one of claims 1-7.

Citation Information

Cited By

  • Intelligent data processing method based on artificial intelligence search engine technology

    CN120234403A

  • Data Intelligent Processing Method Based on Artificial Intelligence Search Engine Technology

    CN120234403B