Digital object retrieval method and device based on retrieval enhancement generation under smart contract mechanism

Through the method based on search enhancement generation under the smart contract mechanism, the similarity is calculated by vectorized query information and metadata, the problem of low retrieval efficiency of digital objects is solved, and more efficient and accurate retrieval of digital objects is achieved.

CN118410241BActive Publication Date: 2024-11-01PEKING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410881297.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-11-01
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

In the existing digital object retrieval methods, due to the data dictionary limitation of metadata, it is difficult for users to retrieve the required digital objects, and the retrieval efficiency is not high.

Method used

Using the method based on search enhancement generation under the smart contract mechanism, the query information input by the user is vectorized, the similarity between the metadata of the digital object and the query feature vector is calculated, the query results are generated, and the similarity and loyalty are based on the similarity and loyalty. Scores are filtered and updated to improve retrieval accuracy and efficiency.

Benefits of technology

It reduces the probability of query results being independent of user input, improves the retrieval efficiency and accuracy of digital objects, and ensures the relevance and reliability of query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118410241B_ABST
    Figure CN118410241B_ABST
Patent Text Reader

Abstract

The present application provides a digital object retrieval method and device based on retrieval enhancement generation under a smart contract mechanism, including: in response to a first query information variable input by a target user, vectorizing the first query information variable to obtain a query feature vector, determining the first similarity between the first metadata vectors of each first digital object and the query feature vector, generating a first query result based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold, screening the first digital object according to the first similarity between the query feature vector and the first metadata vector to obtain the second digital object, and generating a first query result for the second digital object, thereby reducing the probability of the first query result being irrelevant to the query information input by the user, and improving the retrieval efficiency of digital objects to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital networking technology, and in particular to a method and device for retrieving digital objects based on retrieval enhancement generation under a smart contract mechanism. Background Art

[0002] The most representative architecture of the Internet of Things is the Digital Object Architecture (DOA) proposed by Robert Kahn, the inventor of the Internet and Turing Award winner. The Digital Object Architecture is a software architecture that is centered on digital objects and supports the interconnection, interoperability and interoperability of system data in an open environment. As the core element of this architecture, digital objects are abstract representations of data resources. Digital objects are composed of three parts: identification, metadata, and entity. The identification is the unique mark of a digital object, which is used to uniquely identify a digital object; metadata is data, which is used to describe some information related to the digital object. Its main function is to search for digital objects according to application requirements; and the data entity represents the actual content of the data resource and is the basis for the creation of digital objects. When searching for digital objects, you can search through the metadata of the digital object.

[0003] In the related art, data dictionaries are mainly used to describe metadata to restrict the metadata of digital objects. The metadata obtained by this method is mainly concentrated in the field of service text retrieval and can be used as a retrieval entry to retrieve digital objects.

[0004] However, when the metadata obtained by the above method is used to search for digital objects, due to the limitation of the data dictionary in the metadata, users often cannot search for the desired digital objects, and the search efficiency of digital objects is not high. Summary of the invention

[0005] In view of the above problems, the embodiments of the present application provide a digital object retrieval method, device, electronic device and readable storage medium based on retrieval enhancement generation under a smart contract mechanism, so as to overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect, an embodiment of the present application provides a digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism, the method comprising:

[0007] In response to a first query information variable input by a target user, vectorizing the first query information variable to obtain a query feature vector;

[0008] Determine a first similarity between the first metadata vector of each first digital object and the query feature vector;

[0009] A first query result is generated based on a second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold.

[0010] Optionally, the method further comprises:

[0011] Determine first metadata corresponding to each of the first digital objects;

[0012] The first metadata is vectorized to obtain the first metadata vector.

[0013] Optionally, the generating a first query result based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold includes:

[0014] Determine a second similarity between a second digital object corresponding to the first metadata vector having the first similarity greater than or equal to a first threshold and the first query information variable;

[0015] A first query result is generated based on a third digital object whose second similarity is greater than or equal to a second threshold.

[0016] Optionally, the method further comprises:

[0017] In the case that there is no first metadata vector whose first similarity is greater than or equal to the first threshold, updating the first query information variable to obtain an updated first query information variable;

[0018] Re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0019] Optionally, the method further comprises:

[0020] determining a fidelity score between the first query result and the first query information variable;

[0021] In a case where the fidelity score is greater than or equal to a third threshold, determining a third similarity between the first query result and the first query information variable;

[0022] When the third similarity is greater than or equal to a fourth threshold, the first query result is displayed.

[0023] Optionally, the method further comprises:

[0024] When the fidelity score is less than the third threshold, the first query result corresponding to the second digital object is regenerated.

[0025] Optionally, the method further comprises:

[0026] When the third similarity is less than the fourth threshold, updating the first query information variable to obtain an updated first query information variable;

[0027] Re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0028] Optionally, determining the first similarity between the first metadata vectors of the first digital objects and the query feature vector respectively includes:

[0029] Determining a fourth similarity between the first query information variable and each historical query result included in the historical query result database;

[0030] In the case that each of the fourth similarities is less than the fifth threshold, a first similarity between the first metadata vector of each first digital object and the query feature vector is determined.

[0031] Optionally, displaying the first query result includes:

[0032] Based on the smart contract of the target user, determining a second query result that the target user has viewing permission from the first query result;

[0033] The second query result is displayed.

[0034] In a second aspect, an embodiment of the present application provides a digital object retrieval device based on retrieval enhancement generation under a smart contract mechanism, the device comprising:

[0035] A first vectorization module, configured to vectorize a first query information variable in response to a first query information variable input by a user to obtain a query feature vector;

[0036] A first determination module, used to determine a first similarity between the first metadata vector of each first digital object and the query feature vector;

[0037] The first generating module is used to generate a first query result based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold.

[0038] Optionally, the device further comprises:

[0039] A second determining module, used to determine first metadata corresponding to each of the first digital objects;

[0040] The second vectorization module is used to vectorize the first metadata to obtain the first metadata vector.

[0041] Optionally, the first generating module includes:

[0042] A first determination submodule, configured to determine a second similarity between a second digital object corresponding to a first metadata vector whose first similarity is greater than or equal to a first threshold and the first query information variable;

[0043] The first generating submodule is used to generate a first query result based on a third digital object whose second similarity is greater than or equal to a second threshold.

[0044] Optionally, the device further comprises:

[0045] A first updating module, configured to update the first query information variable to obtain an updated first query information variable when there is no first metadata vector whose first similarity is greater than or equal to the first threshold;

[0046] The first execution module is used to re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0047] Optionally, the device further comprises:

[0048] a third determination module, configured to determine a fidelity score between the first query result and the first query information variable;

[0049] A fourth determination module, configured to determine a third similarity between the first query result and the first query information variable if the fidelity score is greater than or equal to a third threshold;

[0050] A display module is used to display the first query result when the third similarity is greater than or equal to a fourth threshold.

[0051] Optionally, the device further comprises:

[0052] The second generating module is configured to regenerate the first query result corresponding to the second digital object when the fidelity score is less than the third threshold.

[0053] Optionally, the device further comprises:

[0054] A second updating module, configured to update the first query information variable to obtain an updated first query information variable when the third similarity is less than the fourth threshold;

[0055] The second execution module is used to re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0056] Optionally, the first determining module includes:

[0057] A second determination submodule, configured to determine a fourth similarity between the first query information variable and each historical query result included in the historical query result database;

[0058] The third determination submodule is used to determine the first similarities between the first metadata vectors of the first digital objects and the query feature vector respectively when the fourth similarities are all less than the fifth threshold.

[0059] Optionally, the display module includes:

[0060] A fourth determination submodule, configured to determine, based on the smart contract of the target user, from the first query result, a second query result that the target user has the permission to view;

[0061] The display submodule is used to display the second query result.

[0062] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement a digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism as described in any one of the above.

[0063] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, a digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism as described in any one of the above is implemented.

[0064] The specific beneficial effects are:

[0065] The embodiment of the present application vectorizes the first query information variable in response to the first query information variable input by the target user to obtain a query feature vector, determines the first similarity between the first metadata vectors of each first digital object and the query feature vector, generates a first query result based on the second digital objects corresponding to the first metadata vectors whose first similarity is greater than or equal to the first threshold, can screen the first digital objects according to the first similarity between the query feature vector and the first metadata vector to obtain the second digital objects, and generates a first query result for the second digital object, thereby reducing the probability of the first query result being irrelevant to the query information input by the user, and improving the retrieval efficiency of digital objects to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0067] Figure 1 It is a flowchart of a digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism provided by an embodiment of the present application;

[0068] Figure 2 It is a flowchart of a digital object retrieval method based on retrieval enhancement generation under another smart contract mechanism provided in an embodiment of the present application;

[0069] Figure 3 A flowchart of a method for retrieving a query feature vector provided in an embodiment of the present application;

[0070] Figure 4 It is a flowchart of another method for re-acquiring a query feature vector provided in an embodiment of the present application;

[0071] Figure 5 It is a flowchart of a specific implementation method of a digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism provided by an embodiment of the present application;

[0072] Figure 6 It is a schematic diagram of a digital object retrieval system based on retrieval enhancement generation under a smart contract mechanism provided by an embodiment of the present application;

[0073] Figure 7 It is a logic block diagram of a digital object retrieval device based on retrieval enhancement generation under a smart contract mechanism provided by an embodiment of the present application;

[0074] Figure 8 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to enable the scope of the present application to be fully communicated to those skilled in the art.

[0076] Reference Figure 1 , Figure 1A flowchart of a digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism provided in an embodiment of the present application is provided, and the method includes:

[0077] Step 101: in response to a first query information variable input by a target user, vectorize the first query information variable to obtain a query feature vector.

[0078] In an embodiment of the present application, when the target user performs digital object retrieval, the first query information variable inputted by the target user often has a high-dimensional amount of information, which is difficult to process. Therefore, the first query information variable inputted by the target user can be vectorized to obtain a query feature vector, thereby reducing the dimension represented by the first query information variable.

[0079] In an embodiment of the present application, a method called embedding can be used to process the first query information variable to vectorize the first query information variable to obtain a query feature vector. Among them, embedding can be integrated in a module (program), and when vectorizing, the first query information variable can be input into the embedding module, so that the query feature vector output by the embedding module can be obtained. In addition, some commonly used deep learning models can also be used to vectorize the first query information variable, such as Word2vec, Doc2vec, N-gram model, etc., which is not limited in the embodiment of the present application.

[0080] Step 102: Determine the first similarity between the first metadata vector of each first digital object and the query feature vector.

[0081] In an embodiment of the present application, Retrieval-augmented Generation (RAG) is one of the current popular large model cutting-edge technologies, which combines language models and information retrieval technology. When only a large language model (LLM) is used to retrieve digital objects, the large language model may not meet the user's retrieval needs because the trained large language model may not contain the latest digital objects or digital objects in a specific field. In this case, the missing data can be introduced into the large language model through an external vector database so that the large language model can retrieve the latest or specific digital objects, that is, retrieval-augmented generation.

[0082] In an embodiment of the present application, the embedding module can generally be carried in a framework called LangChain, in which a large language model can also be carried, and the output of the embedding module can be connected to the input of the large language model. LangChain combines the large language model LLM, vector database, interactive layer prompt, external knowledge and tools, allowing developers to build AI applications by themselves. LangChain can make the large language model no longer limited to static text data, but can introduce external data sources. At the same time, developers can use LangChain to introduce the large language model into their own programs to create more intelligent applications with certain capabilities. The process of using LangChain simplifies the intermediate steps for users to call the large language model. LangChain has six core modules: (1) Agents: Decide whether to call any tool based on user input; (2) Prompt: The input prompt of the large language model is one of the optimization focuses; (3) Models: The large language model that is actually connected; (4) Memory: The context storage of the large language model conversation, which allows the large language model to remember the previous conversation and improve each prompt through context recording; (5) Chain: Represents the process of connecting multiple steps in series to complete complex tasks, such as: receiving user prompt input, formatting, passing it to the large language model to obtain a response, and retrieving and correcting the model output; (6) Index: Including vector storage, providing efficient vector retrieval capabilities. Based on the large language model and vector storage capabilities introduced by LangChain, applications can complete efficient vector matching and call the semantic processing capabilities of the large language model, which makes up for the shortcomings of digital object retrieval in the data space being limited to text and not introducing the processing capabilities of the large language model. In the large language model carried by LangChain, there can be at least one database for storing digital objects for the large language model to call. On this basis, the first digital object that can be called by the large language model connected to Langchain can be used to determine. In addition, a vector database can be integrated in Langchain to store the first metadata vectors corresponding to each first digital object. In this way, the first digital object and the first metadata vectors corresponding to the first digital object can be obtained in the Langchain framework, and then the first similarity between the first metadata vectors of each first digital object and the query feature vector can be determined. Among them, the vector elements in the query feature vector can be compared one by one with the vector elements in each first metadata vector, and the ratio between the number of identical vector elements in the first metadata vector and the query feature vector and the total number of vector elements in the query feature vector is used as the first similarity.

[0083] Step 103: Generate a first query result based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold.

[0084] In an embodiment of the present application, the first digital object can be screened according to the size between the first similarity and the first threshold. First, the first metadata vector whose first similarity is greater than or equal to the first threshold can be determined, and then the second digital object corresponding to this part of the first metadata vector can be determined from the first digital object. After the second digital object is determined, the large language model can be called to generate a first query result corresponding to the second digital object. The second digital object is used to provide data to the large language model, and the large language model can generate a natural language description with contextual understanding based on the data as the first query result.

[0085] In an embodiment of the present application, by responding to a first query information variable input by a target user, the first query information variable is vectorized to obtain a query feature vector, the first similarity between the first metadata vectors of each first digital object and the query feature vector is determined, and a first query result is generated based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold. The first digital object can be screened according to the first similarity between the query feature vector and the first metadata vector to obtain a second digital object, and a first query result for the second digital object is generated, which reduces the probability of the first query result being irrelevant to the query information input by the user, thereby improving the retrieval efficiency of digital objects to a certain extent.

[0086] Reference Figure 2 , Figure 2 A flowchart of a digital object retrieval method based on retrieval enhancement generation under another smart contract mechanism provided in an embodiment of the present application is provided. The method may include:

[0087] Step 201: determine first metadata corresponding to each of the first digital objects.

[0088] In the embodiment of the present application, the first digital object may include a data entity, a digital object identifier and metadata. Therefore, the first metadata corresponding to each first digital object may be determined in each first digital object.

[0089] Step 202: vectorize the first metadata to obtain the first metadata vector.

[0090] In an embodiment of the present application, the large language model supports processing of multimodal (e.g., image, chart, text, etc.) data entities. The first metadata of the first digital object may have a higher dimension than the first digital object, and therefore, the first metadata may be vectorized by the embedding module in Langchain, thereby obtaining a first metadata vector to reduce the dimension of the first metadata.

[0091] In an embodiment of the present application, by determining the first metadata corresponding to each first digital object, the first metadata is vectorized to obtain a first metadata vector, and the first digital object can be split according to the digital object identifier of the first digital object to obtain the first metadata corresponding to the first digital object, and then obtain the first metadata vector. For different types of first digital objects, corresponding first metadata vectors can be obtained, which increases the data richness of the first metadata vector to a certain extent and improves the reliability of the first metadata vector.

[0092] Step 203: In response to the first query information variable input by the target user, vectorize the first query information variable to obtain a query feature vector.

[0093] In the embodiments of the present application, the implementation content of this step can refer to the embodiment content of step 101, which will not be repeated here.

[0094] Step 204: determine the first similarity between the first metadata vector of each first digital object and the query feature vector.

[0095] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 102, which will not be repeated here.

[0096] Optionally, step 204 may include the following sub-steps:

[0097] Sub-step 2041: determining a fourth similarity between the first query information variable and each historical query result included in the historical query result database.

[0098] In an embodiment of the present application, the historical query results corresponding to the target user's past query behavior can be stored in the historical query result database in the Langchain framework. After obtaining the first query information variable input by the target user, the fourth similarity between the first query information variable and each historical query result stored in the historical query result database can be calculated. The number of the fourth similarities can be the same as the number of historical query results. The above process can be performed by a large language model.

[0099] Sub-step 2042: when each of the fourth similarities is less than a fifth threshold, determining a first similarity between the first metadata vector of each first digital object and the query feature vector.

[0100] In an embodiment of the present application, a fifth threshold value may be pre-set. If each fourth similarity is less than the fifth threshold value, it may be considered that the historical query result does not contain a query result that matches the first query information variable. In this case, the first similarity between the query feature vector and the first metadata vector of each first digital object may be determined. The number of first similarities may be the same as the number of first metadata vectors. The calculation method of the first similarity may refer to the embodiment of step 102, which will not be described in detail here. The above process may be performed by a large language model.

[0101] In a possible embodiment, if there is a fifth similarity greater than or equal to the fifth threshold value in the fourth similarity, the historical query result corresponding to the fifth similarity can be directly displayed as the query result corresponding to the first query information variable for the target user to read and view. In this way, when the first query information variable input by the target user is repeated information or has a high similarity with the historical query information, the efficiency of digital object retrieval can be greatly improved.

[0102] In an embodiment of the present application, by determining the fourth similarity between the first query information variable and each historical query result contained in the historical query result database, and when each fourth similarity is less than the fifth threshold, determining the first similarity between the first metadata vector of each first digital object and the query feature vector, the first similarity between the first metadata vector of the first digital object and the query feature vector can be determined when the correlation between the first query information variable and the historical query result is low, and used to generate the first query result, thereby avoiding directly calling the historical query results, and improving the correlation between the first query result and the first query information variable while maintaining the necessity of generating the first query result, thereby improving the accuracy of digital object retrieval.

[0103] Step 205 : generating a first query result based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold.

[0104] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 103, which will not be repeated here.

[0105] Optionally, step 205 may include the following sub-steps:

[0106] Sub-step 2051: determining a second similarity between the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold and the first query information variable.

[0107] In an embodiment of the present application, in order to improve the accuracy of the query result finally generated, a second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to the first threshold value can be obtained from the first digital object through a large language model connected to Langchain, and the second similarity between the second digital object and the first query information variable can be determined. Among them, the text information of the second digital object can be first obtained and compared with the first query information variable, and the ratio between the same amount of information and the total amount of information of the first query information variable is used as the second similarity between the second digital object and the first query information variable. Among them, the minimum unit of information amount can be a word.

[0108] Sub-step 2052: generating a first query result based on the third digital objects whose second similarity is greater than or equal to a second threshold.

[0109] In an embodiment of the present application, a second threshold may be preset, and a third digital object having a second similarity greater than or equal to the second threshold may be obtained from the second digital object, and after the third digital object is obtained, a first query result corresponding to the third digital object may be generated. The above content may be executed by a large language model.

[0110] In an embodiment of the present application, by determining the second similarity between the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to the first threshold and the first query information variable, a first query result is generated based on the third digital object whose second similarity is greater than or equal to the second threshold. A first query result for a third digital object with a higher correlation with the first query information variable can be generated through the second similarity, thereby improving the accuracy and reliability of the first query result.

[0111] Step 206: Determine a fidelity score between the first query result and the first query information variable.

[0112] In an embodiment of the present application, a fidelity score between the first query result and the first query information variable can also be calculated. Among them, the fidelity score can be used to determine whether there is an illusion in the first query result. Hallucinations belong to the problems of the large language model LLM during use: that is, seemingly reasonable content is generated, but in fact these contents are incorrect or irrelevant to the input query information, or even conflicting. The large language model will produce three kinds of illusions: input conflict illusion, context conflict illusion and fact conflict illusion. The input conflict illusion refers to the generated content that does not match the input provided by the user, the context conflict illusion refers to the generated content that contradicts the previously generated information, and the fact conflict illusion refers to the generated content that does not match the known world knowledge. Hallucinations can be evaluated based on two different capabilities of the large language model: the ability to generate factual statements, or the ability to distinguish factual statements from non-factual statements. The fidelity score can be calculated as follows: first, multiple sentences are split from the first query result, and then for each sentence, it is determined whether the sentence can be inferred from the context information. If it can be inferred, the sentence is a supported sentence, otherwise it is an unsupported sentence, and the ratio between the number of supported sentences and the total number of sentences is used as the fidelity score between the first query result and the first query information variable. The above process can be performed by a large language model.

[0113] Step 207: When the fidelity score is greater than or equal to a third threshold, determine a third similarity between the first query result and the first query information variable.

[0114] In an embodiment of the present application, a third threshold value may be preset. If the fidelity score is greater than or equal to the third threshold value, it may be considered that there is no hallucination in the current first query result. In this case, a third similarity between the first query result and the first query information variable may be further determined. The calculation method of the third similarity is similar to that of the first similarity. Please refer to the embodiment of step 102, which will not be described here. The above process may be performed by a large language model.

[0115] Step 208: When the third similarity is greater than or equal to a fourth threshold, display the first query result.

[0116] In an embodiment of the present application, a fourth threshold value may be preset. If the third similarity is greater than or equal to the fourth threshold value, it may be considered that the first query result is highly consistent with the first query information variable. In this case, the first query result may be displayed, for example, the first query result may be displayed in the query window in the form of a text summary. In addition, the text summary may also be provided with a hyperlink function, and the user may view detailed digital object information after clicking on the text summary.

[0117] Optionally, step 208 may include the following sub-steps:

[0118] Sub-step 2081, based on the smart contract of the target user, determining from the first query results a second query result that the target user has viewing permission.

[0119] In an embodiment of the present application, a smart contract can be added between the target user and the LangChain framework (generated when the target user registers and can be modified by the administrator). The target user's viewing rights for digital objects can be specified in the smart contract. On this basis, the second query result for which the target user has viewing rights can be determined from the first query result based on the target user's smart contract, so as to shield the digital objects for which the target user does not have viewing rights.

[0120] Sub-step 2082, displaying the second query result.

[0121] In the embodiment of the present application, the second query result may be displayed. The method for displaying the second query result is similar to the method for displaying the first query result in step 208, and the embodiment of step 208 may be referred to, and will not be described in detail here.

[0122] In an embodiment of the present application, by determining a second query result that the target user has viewing permissions for from the first query result based on a smart contract of the target user, and displaying the second query result, the second query result that complies with the viewing permissions of the target user can be displayed to the target user, thereby improving the data security of the digital object.

[0123] In an embodiment of the present application, by determining a fidelity score between a first query result and a first query information variable, and when the fidelity score is greater than or equal to a third threshold, determining a third similarity between the first query result and the first query information variable, and when the third similarity is greater than or equal to a fourth threshold, displaying the first query result, the first query result can be displayed when the fidelity score of the first query result and the third similarity with the first query information variable meet conditions, and a more accurate first query result can be provided to the target user, thereby improving the accuracy and reliability of digital object retrieval to a certain extent.

[0124] Step 209: When the fidelity score is less than the third threshold, regenerate the first query result corresponding to the second digital object.

[0125] In an embodiment of the present application, if the fidelity score is less than the third threshold, it can be considered that there is an illusion in the currently generated first query result, and the reference value of the first query result is low. In this case, the first query result corresponding to the second digital object can be regenerated through the large language model in the Langchain framework. After the first query result is regenerated, the fidelity score of the first query result can be determined again and it can be determined whether the fidelity score is greater than or equal to the third threshold.

[0126] In an embodiment of the present application, by regenerating the first query result corresponding to the second digital object when the fidelity score is less than the third threshold, the first query result can be regenerated when the fidelity score is less than the third threshold, thereby improving the reliability of the first query result.

[0127] Based on the above implementation, Figure 3 , Figure 3 A flowchart of a method for retrieving a query feature vector provided in an embodiment of the present application is provided. The digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism may further include, after step 208:

[0128] Step 210: When there is no first metadata vector whose first similarity is greater than or equal to the first threshold, update the first query information variable to obtain an updated first query information variable.

[0129] In an embodiment of the present application, if there is no first metadata with a first similarity greater than or equal to the first threshold, the first query information variable can be updated to obtain an updated first query information variable. Among them, the situation where there is no first metadata with a first similarity greater than or equal to the first threshold may be due to the presence of incorrect words in the first query information variable, or incorrect letters in the words, or redundant expressions, etc., which causes the large language model to be unable to recognize the semantics of the first query information variable well. In this case, the large language model can recognize the first query information variable, and correct the first query information variable according to common words and vocabulary dictionaries, or remove redundant expressions, etc., to complete the update of the first query information variable and obtain an updated first query information variable.

[0130] Step 211, re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0131] In an embodiment of the present application, after the first query information variable is updated to obtain the updated first query information variable, the step of vectorizing the first query information variable to obtain a query feature vector can be re-executed to obtain the first query result again.

[0132] In an embodiment of the present application, by updating the first query information variable in the absence of a first metadata vector whose first similarity is greater than or equal to a first threshold, an updated first query information variable is obtained, and the step of vectorizing the first query information variable to obtain a query feature vector is re-executed. In the absence of a first metadata vector whose first similarity is greater than or equal to the first threshold, the first query information variable can be updated and the query feature vector can be obtained again, thereby improving the convenience and usability of the digital object retrieval method.

[0133] Based on the above implementation, Figure 4 , Figure 4 A flowchart of another method for retrieving a query feature vector provided in an embodiment of the present application is provided. The digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism may further include, after step 208:

[0134] Step 212: When the third similarity is less than the fourth threshold, the first query information variable is updated to obtain an updated first query information variable.

[0135] In an embodiment of the present application, if the third similarity is less than the fourth threshold, it can be considered that the correlation between the generated first query result and the first query information variable is low, and the first query information variable can be updated to obtain an updated first query information variable. The implementation content of updating the first query information variable can refer to the embodiment content of step 210, which will not be repeated here.

[0136] Step 213, re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0137] In an embodiment of the present application, after the first query information variable is updated to obtain the updated first query information variable, the step of vectorizing the first query information variable to obtain a query feature vector can be re-executed to obtain the first query result again.

[0138] In an embodiment of the present application, by updating the first query information variable when the third similarity is less than a fourth threshold value to obtain an updated first query information variable, and re-executing the step of vectorizing the first query information variable to obtain a query feature vector, the first query information variable can be updated when the third similarity is less than a fourth threshold value, and the query feature vector can be obtained again, thereby improving the convenience and usability of the digital object retrieval method.

[0139] Reference Figure 5 , Figure 5The flowchart is a specific implementation method of a digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism provided by an embodiment of the present application. In the figure, the process can be started first, and then the query content input by the user is obtained. After that, it is determined whether it is necessary to perform digital object retrieval based on the similarity between the query content and the historical query results. If not, the large language model directly outputs and displays the historical query results whose similarity with the query content meets the requirements. If necessary, the retrieval is performed, and the retrieval results are sorted so that the retrieved digital objects are arranged in order from large to small according to the similarity. After that, it can be determined whether the retrieval results are related to the query content. If not, the large language model rewrites the query content and re-executes the retrieval. If relevant, the large language model generates the query results. After that, it can be determined whether the query results have hallucinations. If there are hallucinations, the large language model regenerates the query results. If there are no hallucinations, it is determined whether the query results meet the query content. If not, the large language model rewrites the query content and re-executes the retrieval. If it meets, the query results can be displayed. After displaying the query results, the current process can be ended.

[0140] Reference Figure 6 , Figure 6 It is a schematic diagram of a digital object retrieval system based on retrieval enhancement generation under a smart contract mechanism provided by an embodiment of the present application. In the figure, the digital object retrieval system based on retrieval enhancement generation under a smart contract can include two modules, namely, a vector retrieval module based on retrieval enhancement, and an access control module based on a smart contract. The interaction process between the digital object retrieval system based on retrieval enhancement generation under a smart contract and the user is as follows: First, the user can input query information to the vector retrieval module based on retrieval enhancement generation in the digital object retrieval system based on retrieval enhancement generation under a smart contract, and when the metadata vector database of the digital object contained in the module is called, the large language model in the module performs retrieval to obtain the digital object, and then the retrieved digital object can be sent to the access control module based on the smart contract, and the user authority binding function and the smart contract authority verification function contained in the module determine the digital object that the user can view. Then, the access control module based on the smart contract can send the digital object that the user has the right to view to the vector retrieval module based on retrieval enhancement, and the vector retrieval module based on retrieval enhancement generates the query result and returns it to the user in a displayed manner. In this way, an interaction is completed.

[0141] Reference Figure 7 , Figure 7 A logic block diagram of a digital object retrieval device based on retrieval enhancement generation under a smart contract mechanism provided in an embodiment of the present application, wherein the digital object retrieval device 700 based on retrieval enhancement generation under the smart contract mechanism may include:

[0142] A first vectorization module 701, configured to vectorize a first query information variable in response to a first query information variable input by a user to obtain a query feature vector;

[0143] A first determination module 702, configured to determine a first similarity between the first metadata vector of each first digital object and the query feature vector;

[0144] The first generating module 703 is configured to generate a first query result based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold.

[0145] Optionally, the device 700 further includes:

[0146] A second determining module, used to determine first metadata corresponding to each of the first digital objects;

[0147] The second vectorization module is used to vectorize the first metadata to obtain the first metadata vector.

[0148] Optionally, the first generating module 703 includes:

[0149] A first determination submodule, configured to determine a second similarity between a second digital object corresponding to a first metadata vector whose first similarity is greater than or equal to a first threshold and the first query information variable;

[0150] The first generating submodule is used to generate a first query result based on a third digital object whose second similarity is greater than or equal to a second threshold.

[0151] Optionally, the device 700 further includes:

[0152] A first updating module, configured to update the first query information variable to obtain an updated first query information variable when there is no first metadata vector whose first similarity is greater than or equal to the first threshold;

[0153] The first execution module is used to re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0154] Optionally, the device 700 further includes:

[0155] a third determination module, configured to determine a fidelity score between the first query result and the first query information variable;

[0156] A fourth determination module, configured to determine a third similarity between the first query result and the first query information variable if the fidelity score is greater than or equal to a third threshold;

[0157] A display module is used to display the first query result when the third similarity is greater than or equal to a fourth threshold.

[0158] Optionally, the device 700 further includes:

[0159] The second generating module is configured to regenerate the first query result corresponding to the second digital object when the fidelity score is less than the third threshold.

[0160] Optionally, the device 700 further includes:

[0161] A second updating module, configured to update the first query information variable to obtain an updated first query information variable when the third similarity is less than the fourth threshold;

[0162] The second execution module is used to re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

[0163] Optionally, the first determining module 702 includes:

[0164] A second determination submodule, configured to determine a fourth similarity between the first query information variable and each historical query result included in the historical query result database;

[0165] The third determination submodule is used to determine the first similarities between the first metadata vectors of the first digital objects and the query feature vector respectively when the fourth similarities are all less than the fifth threshold.

[0166] Optionally, the display module includes:

[0167] A fourth determination submodule, configured to determine, based on the smart contract of the target user, from the first query result, a second query result that the target user has the permission to view;

[0168] The display submodule is used to display the second query result.

[0169] The digital object retrieval device generated based on retrieval enhancement under the smart contract in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a GPUBOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0170] The digital object retrieval device based on retrieval enhancement generation under the smart contract in the embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, a Linux, a Windows operating system, etc., and can also be other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0171] The digital object retrieval device based on retrieval enhancement generation under the smart contract provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0172] The present application embodiment provides an electronic device, see Figure 8 The electronic device 80 includes: a processor 801, a memory 802, and a computer program 8021 stored in the memory 802 and executable on the processor 801. When the processor 801 executes the program, the digital object retrieval method based on retrieval enhancement generation under the smart contract of the aforementioned embodiment is implemented.

[0173] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the digital object retrieval method based on retrieval enhancement generation under the smart contract disclosed in the embodiment of the present application are implemented.

[0174] The embodiment of the present application also provides a computer program product, which, when running on an electronic device, enables a processor to implement the steps in the digital object retrieval method based on retrieval enhancement generation under a smart contract as disclosed in the embodiment of the present application.

[0175] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0176] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices, electronic devices, 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 terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal 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 A device that provides the functions specified in a block or multiple blocks.

[0177] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0178] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement 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.

[0179] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

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

[0181] The above is a detailed introduction to the digital object retrieval method and device based on retrieval enhancement generation under the smart contract mechanism provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A digital object retrieval method based on retrieval enhancement generation under a smart contract mechanism, characterized in that: The method comprises: In response to a first query information variable input by a target user, vectorizing the first query information variable to obtain a query feature vector; Determine a first similarity between the first metadata vector of each first digital object and the query feature vector; Generate a first query result based on a second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to a first threshold; determining a fidelity score between the first query result and the first query information variable; In a case where the fidelity score is greater than or equal to a third threshold, determining a third similarity between the first query result and the first query information variable; When the third similarity is greater than or equal to a fourth threshold, displaying the first query result; The displaying of the first query result includes: Based on the smart contract of the target user, determining a second query result that the target user has viewing permission from the first query result; The second query result is displayed.

2. The method according to claim 1, characterized in that The method further comprises: Determine first metadata corresponding to each of the first digital objects; The first metadata is vectorized to obtain the first metadata vector.

3. The method according to claim 1, characterized in that The generating a first query result based on the second digital object corresponding to the first metadata vector whose first similarity is greater than or equal to the first threshold comprises: Determine a second similarity between a second digital object corresponding to the first metadata vector having the first similarity greater than or equal to a first threshold and the first query information variable; A first query result is generated based on a third digital object whose second similarity is greater than or equal to a second threshold.

4. The method according to claim 3, characterized in that The method further comprises: In the absence of a first metadata vector whose first similarity is greater than or equal to the first threshold, updating the first query information variable to obtain an updated first query information variable; Re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

5. The method according to claim 1, characterized in that The method further comprises: When the fidelity score is less than the third threshold, the first query result corresponding to the second digital object is regenerated.

6. The method according to claim 1, characterized in that The method further comprises: When the third similarity is less than the fourth threshold, updating the first query information variable to obtain an updated first query information variable; Re-execute the step of vectorizing the first query information variable to obtain a query feature vector.

7. The method according to claim 1, characterized in that The determining of the first similarity between the first metadata vectors of the first digital objects and the query feature vectors respectively includes: Determining a fourth similarity between the first query information variable and each historical query result included in the historical query result database; In the case that each of the fourth similarities is less than the fifth threshold, a first similarity between the first metadata vector of each first digital object and the query feature vector is determined.

8. A digital object retrieval device based on retrieval enhancement generation under a smart contract mechanism, characterized in that: The device comprises: A first vectorization module, configured to vectorize a first query information variable in response to a first query information variable input by a user to obtain a query feature vector; A first determination module, used to determine a first similarity between the first metadata vector of each first digital object and the query feature vector; A first generating module, configured to generate a first query result based on a second digital object corresponding to a first metadata vector whose first similarity is greater than or equal to a first threshold; a third determination module, configured to determine a fidelity score between the first query result and the first query information variable; A fourth determination module, configured to determine a third similarity between the first query result and the first query information variable if the fidelity score is greater than or equal to a third threshold; a display module, configured to display the first query result when the third similarity is greater than or equal to a fourth threshold; Wherein, the display module includes: A fourth determination submodule, configured to determine, based on the smart contract of the target user, from the first query results, a second query result that the target user has the permission to view; The display submodule is used to display the second query result.