Data search method and device, data search system and electronic equipment

By obtaining data requirements, calculating the similarity and constructing query instructions, the language question and answer model is used to quickly and accurately search for the required data in real-time data in the power industry and other fields, solving the search difficulty problem caused by large amounts of data.

CN118690849APending Publication Date: 2024-09-24NAT ENERGY GRP HUNAN ELECTRIC POWER NEW ENERGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410738262.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In fields such as the electric power industry, the amount of real-time data is large, making it difficult for staff to quickly and accurately search for the required data in the huge data.

Method used

By obtaining data requirements, determining relevant data, calculating the degree of similarity, constructing query instructions, and using the language question and answer model to determine the target data in the reference data, data search is realized.

Benefits of technology

It can quickly and accurately search for the required data in huge real-time data, improving data retrieval efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690849A
    Figure CN118690849A
Patent Text Reader

Abstract

The invention relates to the field of data processing, and provides a data search method and device, a data search system and electronic equipment. The method comprises the steps of obtaining a data demand; determining a plurality of related data in a database according to the data demand; determining the similarity degree between each piece of related data and the data demand, sorting the similarity degrees of the plurality of pieces of related data, and determining a plurality of pieces of reference data in the plurality of pieces of related data according to a sorting result; constructing a query instruction according to the plurality of reference data and the data demand; and inputting the query instruction into the language question and answer model, so that the language question and answer model determines target data in the multiple pieces of reference data according to the query instruction, and outputs the target data. Therefore, a worker can accurately and quickly search required data in huge real-time data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a data search method, device, data search system and electronic equipment. Background Art

[0002] At present, many industries generate a large amount of real-time data during their work, which is of great significance for workers to conduct safety monitoring and system control. For example, in the power industry, during the power production and transmission process, each device in the power system generates real-time working data every minute and every second. The amount of such real-time data is huge, and how to enable workers to quickly and accurately search for the required data in the huge amount of data is a problem worthy of attention. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a data search method, device, data search system and electronic equipment, so that staff can quickly and accurately search through huge amounts of data.

[0004] In a first aspect, an embodiment of the present application provides a method for data denoising, the method comprising:

[0005] Obtain data requirements;

[0006] Determine a plurality of related data in a database according to the data requirement;

[0007] Determining the similarity between each of the related data and the data requirement, sorting the similarities of the multiple related data, and determining multiple reference data from the multiple related data according to the sorting result;

[0008] Constructing a query instruction according to the plurality of reference data and the data requirement;

[0009] The query instruction is input into a language question answering model, so that the language question answering model determines target data from the multiple reference data according to the query instruction and outputs the target data.

[0010] In some implementations, the data in the database is in vector form, and before determining a plurality of related data in the database according to the data requirement, the method further includes:

[0011] Vectorizing and encoding the data requirements;

[0012] The determining of the similarity between each of the related data and the data requirement, sorting the similarity of the multiple related results, and determining multiple reference data from the multiple related data according to the sorting results, includes:

[0013] Determine the Euclidean distance and the cosine distance between each of the related data and the data requirement;

[0014] The similarity of the corresponding related data is determined according to each of the Euclidean distances and each of the cosine distances.

[0015] In some implementations, before constructing a query instruction according to the plurality of reference data and the data requirement, the method further includes:

[0016] Determining whether the correlation between the plurality of reference data and the data requirement meets the correlation requirement;

[0017] The constructing a query instruction according to the plurality of reference data and the data requirement includes:

[0018] In the case where the correlation between the multiple reference data and the data requirement meets the correlation requirement, a query instruction is constructed according to the multiple reference data and the data requirement.

[0019] In some embodiments, the method further comprises:

[0020] In a case where the correlation between the multiple reference data and the data requirement does not meet the correlation requirement, determining whether the number of times the multiple related data are determined in the database according to the data requirement has reached a preset threshold;

[0021] In a case where the number of times of determining the multiple related data in the database according to the data demand does not reach a preset threshold, determining the multiple related data in the database according to the data demand;

[0022] When the number of times of determining the plurality of related data in the database according to the data demand has reached a preset threshold, a data search termination prompt is output.

[0023] In some implementations, after inputting the query instruction into a language question answering model so that the language question answering model determines the target data from the plurality of reference data according to the query instruction, the method further includes:

[0024] Determining whether the correlation between the target data and the plurality of reference data meets the correlation requirement;

[0025] When the correlation between the target data and the multiple reference data does not meet the correlation requirement, the query instruction is modified, and the modified query instruction is input into the language question answering model, so that the language question answering model determines new target data from the multiple reference data according to the modified query instruction.

[0026] In some embodiments, the method further comprises:

[0027] Determining whether the correlation between the new target data and the plurality of reference data meets the correlation requirement;

[0028] In a case where the correlation between the new target data and the plurality of reference data does not satisfy the correlation requirement, determining a plurality of related data in a database according to the data requirement;

[0029] Determining the similarity between each of the related data and the data requirement, sorting the similarities of the multiple related data, and determining multiple reference data from the multiple related data according to the sorting result;

[0030] Constructing a query instruction according to the plurality of reference data and the data requirement;

[0031] The query instruction is input into a language question answering model, so that the language question answering model determines the target data from the multiple reference data according to the query instruction.

[0032] In some implementations, after inputting the query instruction into a language question answering model so that the language question answering model determines the target data from the plurality of reference data according to the query instruction, the method further includes:

[0033] Determining whether the correlation between the target data and the data requirement meets the correlation requirement;

[0034] In a case where the correlation between the target data and the data requirement does not satisfy the correlation requirement, determining a plurality of related data in a database according to the data requirement;

[0035] Determining the similarity between each of the related data and the data requirement, sorting the similarities of the multiple related data, and determining multiple reference data from the multiple related data according to the sorting result;

[0036] Constructing a query instruction according to the plurality of reference data and the data requirement;

[0037] The query instruction is input into a language question answering model, so that the language question answering model determines the target data from the multiple reference data according to the query instruction.

[0038] A second aspect of an embodiment of the present application provides a data search device, the device comprising:

[0039] A data requirement acquisition module is used to acquire data requirements;

[0040] A related data determination module, used to determine a plurality of related data in a database according to the data requirement;

[0041] A reference data determination module, used to determine the similarity between each of the related data and the data requirement, sort the similarities of the multiple related data, and determine multiple reference data from the multiple related data according to the sorting result;

[0042] A query instruction building module, used to build a query instruction according to the multiple reference data and the data requirement;

[0043] The target data determination module is used to input the query instruction into the language question answering model, so that the language question answering model determines the target data from the multiple reference data according to the query instruction and outputs the target data.

[0044] A third aspect of an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the data search method provided in the first aspect of the embodiment of the present application.

[0045] A fourth aspect of the embodiments of the present application provides a data search system, the system comprising:

[0046] The electronic device provided by the third aspect of the embodiment of the present application;

[0047] The original database is used for real-time acquisition and distributed storage of data;

[0048] A data transmission device, used for receiving data pushed by the original database;

[0049] The database is used to obtain data from the data transmission device and perform distributed storage on the obtained data.

[0050] In the embodiment of the present application, the processor first obtains the data requirements input by the staff, and performs a preliminary search in the database according to the data requirements to determine multiple related data, and according to the similarity between each related data and the data requirements, screens out multiple reference data that are most similar to the data requirements from the multiple related data, that is, multiple reference data are used as the answer domain of the language question-answering model; the processor then uses the multiple reference data and the data requirements to construct a query instruction, and uses the query instruction to ask and answer the language question-answering model, so that the language question-answering model can determine the target data from the multiple reference data and output it. In this way, the staff can accurately and quickly search for the required data in the huge real-time data. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1is a flow chart of a method for data denoising provided in an embodiment of the present application;

[0052] Figure 2 It is a process logic block diagram of the data search method provided in the embodiment of the present application;

[0053] Figure 3 is a structural schematic diagram of a data search device provided in an embodiment of the present application;

[0054] Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0055] Figure 5 It is a structural diagram of a data search system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0057] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0058] The data search method, device, data search system and electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0059] See also Figure 1 , is a flow chart of a data search method provided by an embodiment of the present application. In a first aspect, an embodiment of the present application provides a data search method, including the following steps S100 to S500:

[0060] Step S100: Obtain data requirements.

[0061] When the processor executes the data search method provided in the embodiment of the present application, it first needs to obtain the data requirements input by the staff. The specific form of the data requirements can be determined according to the specific application scenario of the data search method provided in the embodiment of the present application, and may include the time of the data, the specific device that generated the data, and the specific parameter type of the data.

[0062] Please also see Figure 1 and Figure 2 , Figure 2 It is a process logic block diagram of the data search method provided by the embodiment of the present application. For example, in the application scenario of real-time data search in the power system, the data requirement input by the staff can be a combination of the time when the data was generated, the specific device that generated the data, and the specific parameter type of the data. For example, "What is the real-time power of wind turbine No. 21 at station A at 12:43:43 today?" A question of this type input by the staff is a data requirement, recorded as query. In the subsequent method flow, the language question-answering model is used to answer this question, that is, to determine the target data in the database that corresponds to the data requirement.

[0063] Step S200: determining a plurality of related data in a database according to data requirements.

[0064] After obtaining the data requirements, the processor directly searches the database based on the data requirements. This search is relatively rough and searches out multiple related data for subsequent screening and model question and answer.

[0065] Step S300: determining the similarity between each relevant data and the data requirement, sorting the similarities of the plurality of relevant data, and determining a plurality of reference data from the plurality of relevant data according to the sorting result.

[0066] Since the search in the database based on data requirements is only rough, in order to ensure that the answer range of the answer domain answered by the subsequent language question and answer model is smaller and the answers in the answer domain are more accurate, after multiple related data are determined, the processor further calculates the similarity between each related data and the data requirement, and sorts the multiple related data based on the similarity, and screens out multiple reference data with the highest similarity to the data requirement as the answer domain for the language question and answer model to answer the data requirement. Exemplarily, the processor filters out three reference data from multiple related data. For example, if the query input by the staff is: "What is the real-time power of wind turbine No. 21 at station A at 12:43:43 today?", the three reference data filtered out by the processor may be: "The real-time power of wind turbine No. 21 at station A at 2024-5-19 12:43:43 is 23; the real-time power of wind turbine No. 21 at station B at 2024-5-19 12:43:43 is 23; the real-time power of wind turbine No. 22 at station A at 2024-5-19 12:43:43 is 23", and these three reference data are recorded as context as the answer domain when the subsequent language question and answer model answers the query.

[0067] Step S400: construct a query instruction according to multiple reference data and data requirements.

[0068] The data search method provided in the embodiment of the present application performs data search in the mode of question and answer with the language question and answer model, so the processor needs to use multiple reference data core data requirements to construct a query instruction to ask questions to the language question and answer model. Exemplarily, if the query instruction is constructed using the query and context in the above example, the specific form of the query instruction can be: "You are now an electric power real-time data processing engineer, please answer questions based on the real-time data content I provide. Content: {context}. Question: {query}." This query instruction is the trigger stimulus for the language question and answer model to answer, which can be recorded as prompt.

[0069] Step S500: Input a query instruction into the language question answering model, so that the language question answering model determines target data from multiple reference data according to the query instruction and outputs the target data.

[0070] The language question answering model can generate an answer based on the questions it receives. However, if the language question answering model has never encountered this question and answer before and there is no reference answer data, the language question answering model will also output an irrelevant answer. Therefore, using only the language question answering model for simple questions and answers will not allow for accurate data search.

[0071] Therefore, the data search method provided in the embodiment of the present application first performs a rough search in the database, then screens out multiple reference data that constitute the answer domain from the search results, and constructs a query instruction using the data requirements and the multiple reference data, so that after the processor inputs the query instruction into the language question and answer model, when the language question and answer model answers the data requirements, it can directly confirm the optimal answer as the target data in the answer domain composed of multiple reference data to complete the data search.

[0072] Exemplarily, the language question-answering model can be Llama_Chinese, which is a large language model provided by Open AI. Similar to GPT-4, it is specifically used to generate text and perform various language understanding tasks. Llama_Chinese is a model based on Llama that has been trained on a large amount of data and adapted to the Chinese language. It can simulate human language ability through a variety of tasks such as answering questions in the form of dialogue, writing articles, summarizing information, and translating languages. It has the characteristics of versatility, high performance, scalability, and rich functions. After receiving the prompt, Llama_Chinese determines the target data according to the context included in the prompt, and the target data can be recorded as answer.

[0073] Through the above steps S100-S500, the processor first obtains the data requirements input by the staff, and performs a preliminary search in the database according to the data requirements to determine multiple related data, and according to the similarity between each related data and the data requirements, screens out multiple reference data that are most similar to the data requirements from the multiple related data, that is, multiple reference data are used as the answer domain of the language question-answering model; the processor then uses the multiple reference data and the data requirements to construct a query instruction, and uses the query instruction to ask and answer the language question-answering model, so that the language question-answering model can determine the target data from the multiple reference data and output it. In this way, the staff can accurately and quickly search for the required data in the huge real-time data.

[0074] In some implementations, the data in the database is in vector form, and before determining a plurality of related data in the database according to the data requirement, the method further includes:

[0075] Vectorize the data requirements;

[0076] Determine the similarity between each relevant data and the data requirement, sort the similarity of multiple relevant results, and determine multiple reference data from the multiple relevant data according to the sorting results, including:

[0077] Determine the Euclidean distance and cosine distance between each relevant data and the data requirement;

[0078] The similarity of the corresponding related data is determined according to each Euclidean distance and each cosine distance.

[0079] In the embodiment of the present application, the data is stored in the database in vector form. In order to better determine the correlation between the data demand and the related data, the data demand is vectorized and encoded before searching in the database according to the data demand. Exemplarily, the database is a distributed FAISS that can perform distributed data storage.

[0080] In this way, the data and data requirements in the database are in the form of vectors. When the processor determines the similarity between each relevant data and the data requirement, it can be determined by fusing the Euclidean distance and the cosine distance. The processor first calculates the Euclidean distance and the cosine distance between each relevant data and the data requirement, and then fuses the obtained Euclidean distance and cosine distance. The fusion method can be to multiply the Euclidean distance and the cosine distance by their respective weights and then add them.

[0081] The Euclidean distance measures the absolute distance between the points represented by the vector of the data demand and the points represented by the vector of the related data, which is directly related to the location of each point, while the cosine distance measures the angle between the vector of the data demand and the vector of the related data, which better reflects the difference in direction between the two, rather than the position. Therefore, fusing the Euclidean distance and the cosine distance to characterize the similarity between the data demand and the related data can make the determination of the similarity more accurate. It can be understood by those skilled in the art that after the two distances are fused, the larger the value of the fusion result, the lower the similarity between the related data and the data demand.

[0082] Exemplarily, when the processor fuses the Euclidean distance and cosine distance between each relevant data and the data requirement, the fusion method is to multiply the Euclidean distance and the cosine distance by their respective weights and then add them together. The corresponding weight of the Euclidean distance is 0.6, and the corresponding weight of the cosine distance is 0.4. After the two distances are fused, the larger the value of the fusion result, the lower the similarity between the relevant data and the data requirement.

[0083] In some implementations, before constructing a query instruction according to the plurality of reference data and the data requirements, the method further includes:

[0084] Determine whether the correlation between multiple reference data and data requirements meets the correlation requirements;

[0085] Based on multiple reference data and data requirements, query instructions are constructed including:

[0086] When the correlation between the multiple reference data and the data requirement meets the correlation requirement, a query instruction is constructed according to the multiple reference data and the data requirement.

[0087] In an embodiment of the present application, in order to ensure the accuracy of the match between the multiple reference data contained in the query instructions input into the language question and answer model and the data requirements, before constructing the query instructions using the multiple reference data, it is first determined whether the relevance of the multiple reference data meets the relevance requirements. Only when the relevance between the multiple reference data and the data requirements meets the preset relevance requirements, the query instructions are constructed based on the multiple reference data and the data requirements.

[0088] Exemplarily, judging whether the correlation between multiple reference data and data requirements meets the correlation requirement, that is, judging whether the correlation between context and query meets the correlation requirement, the correlation between context and query can be evaluated using True Lens, an open source tool for correlation evaluation. The correlation requirement can be adaptively preset according to the requirements of data search accuracy. For example, the correlation requirement can be set to that the correlation between each reference data in the context and the query meets the preset standard, or that the correlation between more than half of the reference data in the context and the query meets the preset standard.

[0089] In some embodiments, the method further comprises:

[0090] In the case where the correlation between the multiple reference data and the data requirement does not meet the correlation requirement, determining whether the number of times the multiple related data are determined in the database according to the data requirement has reached a preset threshold;

[0091] If the number of times of determining the multiple related data in the database according to the data demand does not reach a preset threshold, determining the multiple related data in the database according to the data demand;

[0092] When it is determined in the database according to the data demand that the number of times a plurality of related data are searched has reached a preset threshold, a data search termination prompt is output.

[0093] If the correlation between multiple reference data and data requirements does not meet the correlation requirement, the processor needs to re-search in the database, determine multiple relevant data, and then screen the reference data. When the number of re-searches in the database due to the correlation between multiple reference data and data requirements not meeting the correlation requirement reaches a certain number (the total number of searches in the database is the number of re-searches plus 1), that is, the total number of searches in the database reaches the preset threshold, the processor determines that it is impossible to obtain multiple reference data that can meet the correlation requirement, the data search process ends, and the processor outputs a data search termination prompt. Conversely, if the total number of searches in the database does not reach the preset threshold, the processor re-searches in the database to obtain multiple new reference data. The specific size of the preset threshold can be adaptively set according to the requirements of data search accuracy and the computing power of the processor.

[0094] Exemplarily, the preset threshold is 2. Then, when the re-search in the database has been performed once because the correlation between the context and the query does not meet the correlation requirement, no new re-search is performed and the data search process ends.

[0095] In some implementations, after inputting a query instruction into the language question answering model so that the language question answering model determines target data from a plurality of reference data according to the query instruction, the method further includes:

[0096] Determine whether the correlation between the target data and multiple reference data meets the correlation requirements;

[0097] When the correlation between the target data and multiple reference data does not meet the correlation requirement, the query instruction is modified, and the modified query instruction is input into the language question answering model, so that the language question answering model determines new target data from multiple reference data according to the modified query instruction.

[0098] In the embodiment of the present application, in order to ensure the accuracy of the match between the target data output by the language question answering model and the multiple reference data, and to prevent the language question answering model from giving irrelevant and distorted answers without answering based on the multiple reference data, after obtaining the target data determined by the language question answering model, it is determined whether the correlation between the target data and the multiple reference data meets the correlation requirement. If the correlation requirement is met, the target data is output, or if Figure 2 As shown, the target data is subjected to the next step of determining the relevance between the target data and the data requirements.

[0099] If the correlation between the target data and multiple reference data does not meet the correlation requirements, then the constructed query instruction may not enable the language question and answer model to give a corresponding answer based entirely on the multiple reference data. Therefore, the processor modifies the query instruction and then re-inputs the modified query instruction into the language question and answer model, allowing the language question and answer model to re-determine a new target data.

[0100] Exemplarily, after obtaining the answer output by the language question-answering model according to the prompt, the processor determines whether the correlation between the answer and the context meets the correlation requirement. If the correlation between the answer and the context meets the correlation requirement, the next step of correlation judgment based on the answer and the query is performed. If the correlation between the answer and the context does not meet the correlation requirement, the prompt is modified and re-entered into Llama_Chinese to obtain a new answer. The prompt can be modified for parts other than the context and the query. For example, the original prompt is: "You are now an electric power real-time data processing engineer. Please answer the questions based on the real-time data content I provide. Content: {context}. Question: {query}.", then the modified prompt can be: "Please answer carefully based on the content of the provided context. Content: {context}. Question: {query}.".

[0101] Similarly, the correlation between answer and context can also be evaluated using True Lens, an open source tool for correlation evaluation. The correlation requirement can be adaptively preset according to the requirements of data search accuracy. For example, the correlation requirement can be set to that the correlation between each reference data in the context and the answer meets the preset standard, or that the correlation between more than half of the reference data in the context and the answer meets the preset standard.

[0102] In some embodiments, the method further comprises:

[0103] Determine whether the correlation between the new target data and multiple reference data meets the correlation requirements;

[0104] In the case where the correlation between the new target data and the plurality of reference data does not satisfy the correlation requirement, determining a plurality of related data in the database according to the data requirement;

[0105] Determine the similarity between each relevant data and the data requirement, sort the similarities of multiple relevant data, and determine multiple reference data from the multiple relevant data according to the sorting result;

[0106] Construct query instructions based on multiple reference data and data requirements;

[0107] The query instruction is input into the language question answering model, so that the language question answering model determines the target data from multiple reference data according to the query instruction.

[0108] After the processor inputs the modified query instruction into the language question answering model to obtain new target data, it can also evaluate the correlation between the new target data and multiple reference data. It determines whether the correlation between the new target data and multiple reference data meets the correlation requirement. If the correlation between the new target data and multiple reference data meets the correlation requirement, the target data is output, or if Figure 2 As shown, the target data is subjected to the next step of determining the relevance between the target data and the data requirements.

[0109] If the correlation between the new target data and multiple reference data does not meet the correlation requirements, it means that modifying the query instruction cannot make the correlation between the target data and multiple reference data meet the correlation requirements. The processor will start by searching for multiple related data in the database using the data requirements and re-perform the above steps S100-S500.

[0110] Exemplarily, after obtaining a new answer, the processor determines whether the correlation between the new answer and the context meets the correlation requirement. If the correlation between the new answer and the context meets the correlation requirement, the processor performs the next step of correlation judgment based on the answer and the query. If the correlation between the new answer and the context does not meet the correlation requirement, the processor starts again by searching for multiple related data in the database according to the query and performs another data search process.

[0111] It is worth noting that before the processor restarts to search for multiple relevant data in the database according to the query, the processor can also first determine whether the number of re-searches in the database due to the correlation between the answer and the context not meeting the correlation requirement has reached a certain number. When the number of re-searches in the database due to the correlation between the answer and the context not meeting the correlation requirement has reached a certain number, the processor determines that it is impossible to obtain an answer that meets the correlation requirement, the data search process ends, and the processor outputs a data search termination prompt. Conversely, if the number of re-searches in the database due to the correlation between the answer and the context not meeting the correlation requirement has not reached a certain number, the processor restarts the search in the database and performs another data search process.

[0112] Exemplarily, when the re-search in the database has been completed once because the correlation between the answer and the context does not meet the correlation requirement, no new re-search is performed and the data search process ends.

[0113] In some implementations, after inputting a query instruction into the language question answering model so that the language question answering model determines target data from a plurality of reference data according to the query instruction, the method further includes:

[0114] Determine whether the correlation between the target data and the data requirements meets the correlation requirements;

[0115] In the case where the correlation between the target data and the data requirement does not satisfy the correlation requirement, determining a plurality of related data in the database according to the data requirement;

[0116] Determine the similarity between each relevant data and the data requirement, sort the similarities of multiple relevant data, and determine multiple reference data from the multiple relevant data according to the sorting result;

[0117] Construct query instructions based on multiple reference data and data requirements;

[0118] The query instruction is input into the language question answering model, so that the language question answering model determines the target data from multiple reference data according to the query instruction.

[0119] In an embodiment of the present application, in order to ensure the accuracy of the match between the target data output by the language question and answer model and the data requirements, the processor can also judge the correlation between the target data and the data requirements after obtaining the target data output by the language question and answer model. If the correlation between the target data and the data requirements meets the correlation requirements, the target data is output; if the correlation between the target data and the data requirements does not meet the correlation requirements, the above steps S100-S500 are repeated.

[0120] Those skilled in the art will appreciate that the above-mentioned determination of the correlation between the target data and the data requirement can be performed as follows: Figure 2 As shown, it is performed after the correlation between the target data and the multiple reference data is determined.

[0121] Exemplarily, after completing the correlation based on the answer and context, the processor determines whether the correlation between the answer and the query meets the correlation requirement. If the correlation between the answer and the query meets the correlation requirement, the answer is output and the data search process ends. If the correlation between the answer and the query does not meet the correlation requirement, the processor starts again by searching for multiple related data in the database based on the query and performs another data search process.

[0122] It is worth noting that before the processor restarts to search for multiple relevant data in the database based on the query, the processor can also first determine whether the number of re-searches in the database due to the correlation between the answer and the query not meeting the correlation requirement has reached a certain number. When the number of re-searches in the database due to the correlation between the answer and the query not meeting the correlation requirement has reached a certain number, the processor determines that it is impossible to obtain an answer that meets the correlation requirement, the data search process ends, and the processor outputs a data search termination prompt. Conversely, if the number of re-searches in the database due to the correlation between the answer and the query not meeting the correlation requirement has not reached a certain number, the processor restarts the search in the database and performs another data search process.

[0123] Exemplarily, when the re-search in the database has been performed once because the correlation between the answer and the query does not meet the correlation requirement, no new re-search is performed and the data search process ends.

[0124] See also Figure 3 , is a schematic diagram of the structure of a data search device provided in an embodiment of the present application. A second aspect of an embodiment of the present application provides a data search device 1000, including:

[0125] The data requirement acquisition module 1100 is used to acquire data requirements;

[0126] A related data determination module 1200 is used to determine a plurality of related data in a database according to data requirements;

[0127] The reference data determination module 1300 is used to determine the similarity between each relevant data and the data requirement, sort the similarity of multiple relevant data, and determine multiple reference data from the multiple relevant data according to the sorting result;

[0128] A query instruction building module 1400 is used to build a query instruction according to a plurality of reference data and data requirements;

[0129] The target data determination module 1500 is used to input a query instruction into the language question answering model, so that the language question answering model determines the target data from multiple reference data according to the query instruction and outputs the target data.

[0130] The data search device 1000 provided in the second aspect of the embodiment of the present application can implement each process implemented by the above-mentioned method embodiment and achieve the same beneficial effects. To avoid repetition, it will not be described here.

[0131] See also Figure 4 , is a structural diagram of an electronic device provided in an embodiment of the present application. The third aspect of the embodiment of the present application provides an electronic device 2000, including a processor 2001 and a memory 2002, the memory 2002 stores machine executable instructions that can be executed by the processor 2001, and the processor 2001 can execute the machine executable instructions to implement the above-mentioned data search method.

[0132] See also Figure 5 , is a structural diagram of a data search system provided in an embodiment of the present application. In a fourth aspect of the present application, a data search system 3000 is provided, the system comprising:

[0133] The electronic device 2000 provided by the third aspect of the embodiment of the present application;

[0134] The original database 3100 is used for real-time acquisition and distributed storage of data;

[0135] The data transmission device 3200 is used to receive the data pushed by the original database 3100;

[0136] The database 3300 is used to obtain data from the data transmission device 3200 and perform distributed storage on the obtained data.

[0137] The data search system provided in the embodiment of the present application includes an original database 3100 for real-time acquisition and distributed storage of data, an electronic device 2000, the original database 3100, a data transmission device 3200 and a database 3300. The data in the original database 3100 is transmitted to the database 3300 via the data transmission device 3200. The electronic device database 3300 serves as the data source for the electronic device 2000 to perform the above-mentioned data search method of steps S100 to S500.

[0138] Exemplarily, the data transmission device 3200 is Kafka, which is a high-throughput, stable distributed publish-subscribe messaging system that can process real-time data generated in industrial systems. The embodiment of the present application uses Kafka as the data transmission device 3200 to forward the data pushed from the original database 3100. At the same time, Kafka can be equipped with a listening program to perform self-diagnosis of abnormal faults by listening to the process of data reception.

[0139] The database 3300 obtains data from the data transmission device 3200 and performs distributed storage on the obtained data, so that the electronic device 2000 can perform data search in the database 3300 as in the above steps S100 to S500.

[0140] Exemplarily, database 3300 is FAISS (Facebook AI Similarity Search), which is a database that can perform efficient similarity search and is specifically used to store data in the form of vectors in high-dimensional space that needs to be quickly retrieved. The staff can divide the data to be stored into multiple subsets and distribute these subsets to different servers or computing nodes of FAISS. At the same time, the staff can also independently build a distributed index of FAISS on each node of FAISS.

[0141] A fifth aspect of an embodiment of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor implements the above-mentioned data search method.

[0142] In one embodiment of the present application, a computer program product is further provided, including a computer program, and when the computer program is executed by a processor, the data search method according to the above embodiment is implemented.

[0143] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0144] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0145] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0146] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0147] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0148] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0149] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

[0150] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.

Claims

1. A data search method, characterized in that: The method comprises: Obtain data requirements; Determine a plurality of related data in a database according to the data requirement; Determining the similarity between each of the related data and the data requirement, sorting the similarities of the multiple related data, and determining multiple reference data from the multiple related data according to the sorting result; Constructing a query instruction according to the plurality of reference data and the data requirement; The query instruction is input into a language question answering model, so that the language question answering model determines target data from the multiple reference data according to the query instruction and outputs the target data.

2. The method according to claim 1, characterized in that The data in the database is in vector form. Before determining a plurality of related data in the database according to the data requirement, the method further includes: Vectorizing and encoding the data requirements; The determining of the similarity between each of the related data and the data requirement, sorting the similarity of the multiple related results, and determining multiple reference data from the multiple related data according to the sorting results, includes: Determine the Euclidean distance and the cosine distance between each of the related data and the data requirement; The similarity of the corresponding related data is determined according to each of the Euclidean distances and each of the cosine distances.

3. The method according to claim 1, characterized in that Before constructing the query instruction according to the plurality of reference data and the data requirement, the method further includes: Determining whether the correlation between the plurality of reference data and the data requirement meets the correlation requirement; The constructing a query instruction according to the plurality of reference data and the data requirement includes: In the case where the correlation between the multiple reference data and the data requirement meets the correlation requirement, a query instruction is constructed according to the multiple reference data and the data requirement.

4. The method according to claim 3, characterized in that The method further comprises: In a case where the correlation between the multiple reference data and the data requirement does not meet the correlation requirement, determining whether the number of times the multiple related data are determined in the database according to the data requirement has reached a preset threshold; In a case where the number of times of determining the multiple related data in the database according to the data demand does not reach a preset threshold, determining the multiple related data in the database according to the data demand; When the number of times of determining the plurality of related data in the database according to the data demand has reached a preset threshold, a data search termination prompt is output.

5. The method according to claim 1, characterized in that After the query instruction is input into the language question answering model so that the language question answering model determines the target data from the plurality of reference data according to the query instruction, the method further includes: Determining whether the correlation between the target data and the plurality of reference data meets the correlation requirement; When the correlation between the target data and the multiple reference data does not meet the correlation requirement, the query instruction is modified, and the modified query instruction is input into the language question answering model, so that the language question answering model determines new target data from the multiple reference data according to the modified query instruction.

6. The method according to claim 5, characterized in that The method further comprises: Determining whether the correlation between the new target data and the plurality of reference data meets the correlation requirement; In a case where the correlation between the new target data and the plurality of reference data does not satisfy the correlation requirement, determining a plurality of related data in a database according to the data requirement; Determining the similarity between each of the related data and the data requirement, sorting the similarities of the multiple related data, and determining multiple reference data from the multiple related data according to the sorting result; Constructing a query instruction according to the plurality of reference data and the data requirement; The query instruction is input into a language question answering model, so that the language question answering model determines the target data from the multiple reference data according to the query instruction.

7. The method according to claim 1, after inputting the query instruction into the language question answering model so that the language question answering model determines the target data from the plurality of reference data according to the query instruction, the method further comprises: Determining whether the correlation between the target data and the data requirement meets the correlation requirement; In a case where the correlation between the target data and the data requirement does not satisfy the correlation requirement, determining a plurality of related data in a database according to the data requirement; Determining the similarity between each of the related data and the data requirement, sorting the similarities of the multiple related data, and determining multiple reference data from the multiple related data according to the sorting result; Constructing a query instruction according to the plurality of reference data and the data requirement; The query instruction is input into a language question answering model, so that the language question answering model determines the target data from the multiple reference data according to the query instruction.

8. A data search device, characterized in that: The device comprises: A data requirement acquisition module is used to acquire data requirements; A related data determination module, used to determine a plurality of related data in a database according to the data requirement; A reference data determination module, used to determine the similarity between each of the related data and the data requirement, sort the similarities of the multiple related data, and determine multiple reference data from the multiple related data according to the sorting result; A query instruction building module, used to build a query instruction according to the multiple reference data and the data requirement; The target data determination module is used to input the query instruction into the language question answering model, so that the language question answering model determines the target data from the multiple reference data according to the query instruction and outputs the target data.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the data search method described in any one of claims 1 to 7.

10. A data search system, characterized in that: The system comprises: The electronic device as claimed in claim 9; The original database is used for real-time acquisition and distributed storage of data; A data transmission device, used for receiving data pushed by the original database; The database is used to obtain data from the data transmission device and perform distributed storage on the obtained data.

Citation Information

Patent Citations

  • Inquire response method, inquire response device and computer readable storage medium

    CN107330120A

  • Prompt word optimization method and device of language model and electronic equipment

    CN117909361A

  • Industrial knowledge question and answer method and device and storage medium

    CN118132718A

  • KR20240018197A