Data processing method and device and large language model fine tuning method and device

By using a large language model to generate structured query statements and relationship sets in heterogeneous storage systems, the problem of low accuracy in traditional data query methods in heterogeneous storage systems is solved, and unified access to heterogeneous storage systems and high-accurate data query are realized.

CN119576964AActive Publication Date: 2025-03-07BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202411587997.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-07
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

Traditional data query methods have low accuracy in heterogeneous storage systems and lack a unified data query method.

Method used

By obtaining the data structure information of the text to be searched and the heterogeneous storage system, using a large language model to generate structured query statements and relationship sets, and then building data access requests for the heterogeneous storage system to realize overall access to the heterogeneous storage system.

Benefits of technology

The unified access of storage media unit of multiple different storage media is improved, and the accuracy of text query to be checked is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576964A_ABST
    Figure CN119576964A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, and relates to the technical field of computers, in particular to the technical fields of large models, deep learning and the like. According to the specific implementation scheme, a to-be-searched text and data structure information of a heterogeneous storage system are obtained; based on the to-be-queried text, the data structure information and the large language model, structured query statements and a relation set are obtained, and the structured query statements and the relation set comprise at least one structured query statement and an incidence relation between any two structured query statements in the at least one structured query statement; obtaining a data access request of the heterogeneous storage system based on the structured query statement and the relationship set; and querying the heterogeneous storage system by adopting the data access request to obtain a query result of the to-be-queried text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computers, specifically to technical fields such as large models and deep learning, and in particular to a data processing method and device, a large language model fine-tuning method and device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the rapid development of big data, data query has become a daily necessity. However, traditional data query methods generally match the information to be queried with the data in the database to be queried, which has low query accuracy. Summary of the invention

[0003] The present disclosure provides a data processing method and device, a large language model fine-tuning method and device, an electronic device, a computer-readable storage medium, and a computer program product.

[0004] According to a first aspect, a data processing method is provided, the method comprising: obtaining data structure information of a text to be queried and a heterogeneous storage system; obtaining a structured query statement and a relationship set based on the text to be queried, the data structure information and a large language model, the structured query statement and the relationship set comprising at least one structured query statement and an association relationship between any two structured query statements in at least one structured query statement; obtaining a data access request for the heterogeneous storage system based on the structured query statement and the relationship set; and querying the heterogeneous storage system using the data access request to obtain a query result for the text to be queried.

[0005] According to a second aspect, a large language model fine-tuning method is provided, the method comprising: obtaining an initial large language model and a training data set, the training data set comprising at least one training data, the training data comprising: an entity segmentation sequence and a structured query statement; selecting training data from the training data set; inputting the training data into the large language model to obtain the structured query statement and relationship set output by the large language model; fine-tuning the large language model based on the training data and the structured query statement and the relationship set; in response to the large language model satisfying a training completion condition, obtaining a trained large language model.

[0006] According to a third aspect, a data processing device is provided, which includes: an information acquisition unit, configured to acquire data structure information of a text to be searched and a heterogeneous storage system; a set acquisition unit, configured to obtain structured query statements and relationship sets based on the text to be searched, the data structure information and a large language model, wherein the structured query statements and the relationship sets include at least one structured query statement and an association relationship between any two structured query statements in at least one structured query statement; a request acquisition unit, configured to obtain a data access request of the heterogeneous storage system based on the structured query statement and the relationship set; and a query unit, configured to query the heterogeneous storage system using the data access request to obtain a query result of the text to be searched.

[0007] According to a fourth aspect, a large language model fine-tuning device is provided, the device comprising: a data acquisition unit, configured to acquire an initial large language model and a training data set, the training data set comprising at least one training data, the training data comprising: an entity segmentation sequence and a structured query statement; a selection unit, configured to select training data from the training data set; an input unit, configured to input the training data into the large language model, and obtain the structured query statement and relationship set output by the large language model; a fine-tuning unit, configured to perform fine-tuning training on the large language model based on the training data, the structured query statement and the relationship set; and a model acquisition unit, configured to obtain a trained large language model in response to the large language model satisfying a training completion condition.

[0008] According to the fifth aspect, an electronic device is provided, which includes: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any implementation of the first aspect or the second aspect.

[0009] According to a sixth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method described in any implementation of the first aspect or the second aspect.

[0010] According to a seventh aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the method described in any implementation of the first aspect or the second aspect.

[0011] The data processing method and device provided by the embodiment of the present disclosure first obtain the data structure information of the text to be checked and the heterogeneous storage system; secondly, based on the text to be checked, the data structure information and the large language model, obtain the structured query statement and the relationship set, the structured query statement and the relationship set include at least one structured query statement and the association relationship between any two structured query statements in the at least one structured query statement; thirdly, based on the structured query statement and the relationship set, obtain the data access request of the heterogeneous storage system; finally, use the data access request to query the heterogeneous storage system to obtain the query result of the text to be checked. Thus, the structured query statement and the relationship set obtained by analyzing the text to be checked and the data structure information through the large language model can realize the overall access to the storage medium unit in the heterogeneous storage system, and improve the uniformity of the storage medium unit access of multiple different storage media; because the structured query statement and the relationship set include the association relationship between any two structured query statements, the query of the text to be checked can be divided into a query plan for querying in multiple storage medium units, and the accuracy of the query of the text to be checked is improved.

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

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

[0014] Figure 1 is a flow chart of an embodiment of a data processing method according to the present disclosure;

[0015] Figure 2 is a schematic diagram of a structure for accessing a heterogeneous storage system in the present disclosure;

[0016] Figure 3 is a flowchart of an embodiment of a large language model fine-tuning method according to the present disclosure;

[0017] Figure 4 is a schematic structural diagram of an embodiment of a data processing device according to the present disclosure;

[0018] Figure 5 is a structural schematic diagram of an embodiment of a large language model fine-tuning device according to the present disclosure;

[0019] Figure 6 It is a block diagram of an electronic device used to implement the data processing method or large language model fine-tuning method of the embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0021] In traditional technology, there are two ways to query data: query from the database. The business needs to use the specific method of the background database to query the data. The learning query cost of the business is relatively high. If the business wants to obtain detailed data, it must accurately understand the storage format of the backend medium and the organizational relationship of the business data, otherwise it cannot describe the data query relationship. The other way is to retrieve information from the search engine, but the way to query information from the search engine is essentially similar to full-text information retrieval. The query results are not accurate, and there is no unified data query method for heterogeneous storage systems of existing databases and search engines.

[0022] In view of the defects in the traditional technology, the present invention proposes a data processing method, which can realize the query of abnormal storage system and improve the accuracy of data query. Figure 1 A process 100 according to an embodiment of a data processing method of the present disclosure is shown. The data processing method comprises the following steps:

[0023] Step 101, obtaining the data structure information of the text to be searched and the heterogeneous storage system.

[0024] In this embodiment, the text to be searched is the text to be searched for data, and the text to be searched may be obtained by performing text analysis on a user request, such as Figure 2 shown.

[0025] In this embodiment, the heterogeneous storage system is a heterogeneous underlying storage engine. The heterogeneous storage system can store data updated by users and provide data query services for users.

[0026] In this embodiment, the heterogeneous storage system mainly has two types of data in terms of data content:

[0027] The first type is basic data that describes the basic data information of business data. The basic data includes relevant description information of the data table, as well as descriptions of related information such as the data fields of the data table and the storage medium. The amount of basic data is generally not very large, and vector indexes need to be established. There are no special restrictions on the storage engine, and any vector index engine can be used, or the vector database can be used directly.

[0028] The other is the real data of the business database. Generally speaking, each business is stored in a separate data table. The storage media used by different businesses are also very different. According to the storage media, they are mainly divided into the following types:

[0029] Database: For example, Mysql Sqlserver also supports general ID and aggregate indexes, and the data interface can directly support queries of structured query statements.

[0030] Table storage: such as table and Hbase, generally supports KV query, prefix scan and data filtering.

[0031] Search engines: For example, Elasticsearch supports various inverted index queries. Different search engines generally have their own query interfaces and support full-text retrieval.

[0032] File storage: For example, HDFS, AFS, etc., generally serialize all data directly into the remote file system according to a certain serialized data format.

[0033] In this embodiment, the data structure information is the basic data of the heterogeneous storage system. The data structure information can be used to represent the relevant description information of the data table of each storage medium unit in the current heterogeneous storage system, the data fields of the data table, and the description of the storage medium related information to the large language model, so that the structured query statement generated by the large language model carries the parameters of the corresponding storage medium unit, thereby generating the corresponding access sub-request through the parameters.

[0034] It should be noted that when querying a heterogeneous storage system through the text to be searched, the real data of the above-mentioned different storage media is mainly accessed. For this purpose, the real data of each storage medium is converted into a storage medium unit, and the query result of the text to be searched can be obtained by accessing the storage medium unit.

[0035] In the technical solution disclosed in this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of the text to be checked are carried out after authorization and in compliance with relevant laws and regulations. The information related to the user in the text to be checked is information obtained after the user's permission, and the data processing related to the user is carried out under confidentiality conditions.

[0036] Step 102, based on the text to be searched, data structure information and large language model, obtain a structured query statement and a relationship set.

[0037] In this embodiment, the structured query statement and the relationship set include at least one structured query statement and an association relationship between any two structured query statements in the at least one structured query statement.

[0038] In this embodiment, since there are multiple storage medium units in the heterogeneous storage system, the structured query statement and the relationship set use a query method with a unified representation form to query a collection of different storage medium units. Each structured query statement corresponds to a storage medium unit in the heterogeneous storage system. Each structured query statement has a parameter of the corresponding storage medium unit. By identifying the parameter in the structured query statement, the storage medium unit corresponding to the structured query statement can be determined.

[0039] In this embodiment, the association relationship between any two structured query statements in the structured query statement and relationship set reflects the dependency relationship of the two structured query statements in querying heterogeneous storage systems. Specifically, the association relationship includes: parallel execution and front-to-back execution, wherein parallel execution refers to executing the two structured query statements at the same time; front-to-back execution refers to the execution result of one of the two structured query statements depends on the execution result of the other structured query statement.

[0040] In this embodiment, the Large Language Model (LLM) is a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. The large language model can handle a variety of natural language tasks, such as text classification, question answering, dialogue, etc., and is an important path to artificial intelligence.

[0041] In this embodiment, the large language model can parse the text to be queried, convert natural language into structured query statements to execute topology, and make each structured query statement correspond to the storage medium unit of the heterogeneous storage system. To this end, each structured query statement can access the corresponding storage medium unit to obtain the intermediate result of each structured query statement, and the intermediate result is processed based on the structured query statement and the association relationship between any two structured query statements in the relationship set to obtain the query result of the text to be queried. The query result is the final result obtained by sequentially combining the structured query statement and the intermediate results of the structured query statement in the relationship set. For example, the text to be searched is: query the relevant information of the province with the highest GDP (Gross Domestic Product) in a certain country in the past two years. The structured query statement and relationship set obtained by the large language model first find out the years of the country in the past two years through a common table expression, then calculate the total GDP of each province in these two years, and then filter out the province with the highest GDP, and finally obtain detailed information about the province. That is, the structured query statement and relationship set include four structured query statements. The first structured query statement is used to find out the years of the country in the past two years through a common table expression, the second structured query statement is used to calculate the total GDP of each province in these two years, the third structured query statement is used to calculate the total GDP of each province in these two years, and the fourth structured query statement is used to obtain detailed information about the province. Among them, the association relationship between the four structured query statements is that the adjacent structured query statements from the first structured query statement to the fourth structured query statement are executed one after the other, and the latter structured query statement among the adjacent structured query statements is executed on the execution result of the previous structured query statement. After accessing the corresponding storage medium unit through the first structured query statement, the intermediate result of the first structured query statement is obtained; based on the intermediate result of the first structured query statement, the corresponding storage medium unit is accessed through the second structured query statement. Based on the above principle, multiple storage medium units are accessed in sequence to finally obtain the query result of the text to be searched.

[0042] Step 103: obtaining a data access request of a heterogeneous storage system based on the structured query statement and the relationship set.

[0043] In this embodiment, the data access request is a real request for accessing a heterogeneous storage system, and the data access request contains corresponding access parameters, such as data type, data source and other parameters. After obtaining the access parameters, the heterogeneous storage system reads the real data of the business database stored therein through the access parameters to obtain the query result of the text to be queried.

[0044] In this embodiment, the structured query statement and relationship set include at least one structured query statement and the association relationship between any two structured query statements. When the storage medium units in the heterogeneous storage system queried through the structured query statement and the relationship set are all Mysql databases, the data access request of the heterogeneous storage system can be determined directly through the structured query statement and the relationship set.

[0045] Specifically, the above step 103 includes: determining the type of each storage medium unit corresponding to each structured query statement based on the parameters of each structured query statement in the structured query statement and the relationship set; in response to the type of each storage medium unit being a Mysql type database, converting each structured query statement into a corresponding access sub-request for accessing the Mysql type database; determining the execution order of each structured query statement based on the association relationship in the structured query statement and the relationship set, determining the sending order of the access sub-request according to the execution order, and combining each access sub-request according to the sending order to obtain a data access request for the heterogeneous storage system.

[0046] like Figure 2 As shown, the structured query statement execution engine performs semantic grammar analysis on the received structured query statement and relationship set, determines the storage medium unit corresponding to each structured query statement, generates access sub-requests for accessing each storage medium unit, combines the access sub-requests according to the association relationship, and obtains the data access request of the heterogeneous storage system. It should be noted that the storage medium of each storage medium unit is different, and the access sub-request has a different expression form.

[0047] Step 104: Use a data access request to query the heterogeneous storage system to obtain a query result of the text to be searched.

[0048] In this embodiment, the data access request includes: at least one access sub-request combined in a sending order, and the above step 104 includes: sending each access sub-request in the sending order, and calling the access interface of the corresponding storage medium unit in the heterogeneous storage system through each access sub-request to obtain the query result of the text to be searched. Among them, the query result is the result obtained after executing the last access sub-request in the data access request, and the access interface is an interface for writing data to and reading data from the storage medium unit set in advance for each storage medium unit. Through the access sub-request of each storage medium unit, data related to the access sub-request can be read in each storage medium unit, and the execution subject on which the data processing method runs can send the access sub-requests in sequence according to the order of each access sub-request in the data access request to obtain the query result of the text to be searched.

[0049] The data processing method provided by the embodiment of the present disclosure first obtains the data structure information of the text to be checked and the heterogeneous storage system; secondly, based on the text to be checked, the data structure information and the large language model, a structured query statement and a relationship set are obtained, the structured query statement and the relationship set include at least one structured query statement and the association relationship between any two structured query statements in the at least one structured query statement, and each structured query statement corresponds to a storage medium unit in the heterogeneous storage system; thirdly, based on the structured query statement and the relationship set, a data access request of the heterogeneous storage system is obtained, and finally, the heterogeneous storage system is queried using the data access request to obtain the query result of the text to be checked. Thus, the structured query statement and the relationship set obtained by analyzing the text to be checked and the data structure information by the large language model can realize the overall access to the storage medium unit in the heterogeneous storage system, and improve the uniformity of the storage medium unit access of multiple different storage media; because the structured query statement and the relationship set include the association relationship between any two structured query statements, the query of the text to be checked can be divided into a query plan for querying in multiple storage medium units, and the accuracy of the query of the text to be checked is improved.

[0050] In some embodiments of the present disclosure, the above method further includes: receiving data change information of a heterogeneous storage system; generating new data structure information based on the data change information; and replacing the data structure information with the new data structure information.

[0051] In this embodiment, the data change information refers to the change of basic data in the heterogeneous storage system. When the storage data in the storage medium unit increases or decreases, the increased or decreased data is reflected in the basic data.

[0052] In this embodiment, the heterogeneous storage system generally classifies and stores incoming data (data entering the heterogeneous storage system) according to user needs, provides data basic description information, data query characteristics, data schema, data magnitude and other related information for the incoming data, and selects the most suitable storage medium unit for storage based on the actual characteristics of the business. After determining this part of information, two parts of information classification processing will be performed:

[0053] Meta information processing: Expand and recall the original Meta data basic information before the data is entered, supplement the relevant searchable full information, and then store this part in a vector search engine in a structured manner; or directly store the expanded data.

[0054] Data information processing: Two rounds of data standardization processing are performed on the incoming data information: basic processing and personalized advanced information processing. After the processing is completed, it is stored in the corresponding storage medium unit.

[0055] In this embodiment, new data structure information is used to replace data structure information, so that the large language model can determine the changes in basic data in the current heterogeneous storage system, thereby more accurately generating structured query statements and relationship sets, thereby improving the accuracy of the generated structured query statements and relationship sets.

[0056] The data processing method provided by this optional implementation receives data change information from a heterogeneous storage system; generates new data structure information based on the data change information; and uses the new data structure information to replace the data structure information, thereby providing a reliable implementation method for effectively updating the data structure information.

[0057] In some embodiments of the present disclosure, the above method further includes: storing the to-be-queried text, data structure information, and query results in a heterogeneous storage system.

[0058] In this embodiment, the text to be searched, the data structure information and the query results may be stored in a heterogeneous storage system according to their respective types and regions.

[0059] The data processing method provided in this embodiment stores the text to be searched, data structure information and query results in a heterogeneous storage system. Various storage information is stored in the heterogeneous storage system, thereby improving the diversity of data storage in the heterogeneous storage system.

[0060] In some optional implementations of the present disclosure, the above-mentioned obtaining of the text to be checked and the data structure information of the heterogeneous storage system includes: obtaining the text to be checked; obtaining the original data stored by category in the heterogeneous storage system; and obtaining the data structure information of the heterogeneous storage system based on the text to be checked and the original data.

[0061] In this optional implementation, the original data is all the basic data in the heterogeneous storage system; the text to be searched is directly matched with the original data, and the data in the original data that matches the text to be searched is the data structure information of the heterogeneous storage system.

[0062] This optional implementation provides a method for obtaining the data structure information of the text to be searched and the heterogeneous storage system, which obtains the text to be searched; obtains the original data stored by category in the heterogeneous storage system; and obtains the data structure information of the heterogeneous storage system based on the text to be searched and the original data, thereby improving the accuracy of obtaining the data structure information.

[0063] In some embodiments of the present disclosure, the data structure information of the heterogeneous storage system obtained based on the text to be queried and the original data includes: vectorizing the text to be queried to obtain a text vector; vectorizing the original data to obtain an original vector; matching the text vector with the original vector to obtain a matching vector in the original vector, and using the original data corresponding to the matching vector as the data structure information.

[0064] In this optional implementation, the text to be searched and the original data are vectorized and matched, so that the obtained data structure information is semantically closer to the text to be searched, thereby improving the accuracy of the data structure information.

[0065] The method for obtaining data structure information of a heterogeneous storage system provided by this optional implementation method vectorizes the text to be queried to obtain a text vector; vectorizes the original data to obtain an original vector; matches the text vector with the original vector to obtain a matching vector in the original vector, and uses the original data corresponding to the matching vector as data structure information, thereby improving the accuracy of obtaining the data structure information through vector retrieval.

[0066] In some optional implementations of the present disclosure, the above-mentioned obtaining of structured query statements and relationship sets based on the text to be queried, data structure information and a large language model includes: sending the text to be queried, the data structure information and the query task splitting prompt words to the large language model, obtaining the structured query statements and relationship sets output by the large language model, and the query task splitting prompt words are used to prompt the large language model to split the query tasks of the text to be queried based on the text to be queried and the data structure information, and generate structured query statements and relationship sets for querying heterogeneous storage systems.

[0067] In this optional implementation, the structured query statement and the structured query statement in the relationship set correspond to a storage medium unit. The large language model performs query step analysis on the text to be queried, determines the storage medium unit of the heterogeneous storage system that needs to be queried at each step, obtains the structured query statement of each step based on the data structure information corresponding to the storage medium unit, and generates an association relationship between any two structured query statements to obtain the structured query statement and the relationship set.

[0068] The method for generating recommended videos provided by this optional implementation sends the text to be searched, data structure information, and query task splitting prompt words to a large language model, obtains structured query statements and relationship sets output by the large language model, and improves the accuracy of the structured query statements and relationship sets.

[0069] Optionally, the above-mentioned obtaining of structured query statements and relationship sets based on the text to be queried, data structure information and large language model includes: dividing the text to be queried into subject clauses to obtain multiple subject clauses; inputting the multiple subject clauses and data structure information into the large language model to obtain structured query statements and relationship sets output by the large language model, and the query task splitting prompt words are used to prompt the large language model to split the query tasks of the text to be queried based on the text to be queried and the data structure information, so as to generate structured query statements and relationship sets for querying heterogeneous storage systems.

[0070] In some optional implementations of the present disclosure, the above-mentioned obtaining a data access request for a heterogeneous storage system based on a structured query statement and a relationship set includes: performing grammatical and semantic parsing on the structured query statement and the relationship set to obtain a syntax tree for each structured query statement and an association relationship between any two syntax trees; determining an execution subgraph of the heterogeneous storage system based on the association relationship and each syntax tree; and obtaining a data access request for the heterogeneous storage system based on the execution subgraph.

[0071] In this optional implementation, each structured query statement in the structured query statement and the relationship set is used to query a storage medium unit to obtain an intermediate result; a corresponding syntax tree can be generated for each structured query statement.

[0072] In this optional implementation, the execution subgraph of the heterogeneous storage system is a topological graph for accessing each storage medium unit in the heterogeneous storage system. The access subrequests for accessing each storage medium unit can be determined through the execution subgraph, and all access subrequests are combined to obtain a data access request.

[0073] The method for obtaining a data access request provided by this optional implementation performs grammatical and semantic analysis on structured query statements and relationship sets to obtain a syntax tree for each structured query statement and an association relationship between any two syntax trees; based on the association relationship and each syntax tree, an execution subgraph of a heterogeneous storage system is determined; based on the execution subgraph, a data access request for the heterogeneous storage system is obtained, thereby mapping the syntax tree to an execution subgraph of the heterogeneous storage system; based on the execution subgraph, a data access request for the heterogeneous storage system is determined, thereby providing a reliable implementation method for data access requests.

[0074] In some optional implementations of the present disclosure, the above-mentioned determination of the execution subgraph of the heterogeneous storage system based on the association relationship and each syntax tree includes: based on the structured query statement and the relationship set, mapping each node of each syntax tree to the first graph node of the corresponding storage medium unit in the heterogeneous storage system, the first graph node is a node pre-set for the storage medium unit; based on the node relationship between the nodes in each syntax tree, connecting the first graph nodes of each storage medium unit to obtain the subgraph unit of each storage medium unit; based on the association relationship, connecting the subgraph units of each storage medium unit to obtain the execution subgraph.

[0075] In this optional implementation, the first graph node is a node generated by basic syntax elements in the storage medium unit, wherein the basic syntax elements of the storage medium unit are basic units for generating access to the storage medium unit, such as in the conversion of the syntax tree to the first graph node of ElasticSearch, the SELECT: in the syntax tree is converted into a _search request of ElasticSearch, where _search is a basic syntax element of ElasticSearch.

[0076] In this optional implementation, the execution subgraph is a structural diagram for executing access to a heterogeneous storage system, and the execution subgraph includes: multiple subgraph units, each subgraph unit corresponds to a storage medium unit, and the connecting edges between the subgraph units in the execution subgraph are used to reflect the association relationship.

[0077] The method for obtaining an execution subgraph provided by this optional implementation method maps each node of each syntax tree to the first graph node of the corresponding storage medium unit in the heterogeneous storage system based on a structured query statement and a relationship set, and the first graph node is a node pre-set for the storage medium unit; based on the node relationship between the nodes in each syntax tree, the first graph nodes of each storage medium unit are connected to obtain the subgraph unit of each storage medium unit; based on the association relationship, the subgraph units of each storage medium unit are connected to obtain the execution subgraph, which provides a reliable implementation method for obtaining the execution subgraph and improves the accuracy of the execution subgraph.

[0078] Optionally, the above-mentioned determination of the execution subgraph of the heterogeneous storage system based on the association relationship and each syntax tree also includes: receiving the user's insertion information; determining the connection relationship between the insertion information and each syntax tree; mapping the insertion information to the user's second graph node, the second graph node is a node pre-set for user input; based on the connection relationship, connecting the second graph node and the first graph node.

[0079] In some optional implementations of the present disclosure, the above-mentioned data access request for the heterogeneous storage system based on the execution subgraph includes: determining the unit execution order of each subgraph unit based on the connection relationship of the subgraph units in the execution subgraph; determining the parameters in the data access request based on the graph nodes in each subgraph unit; determining the parameter execution order of the parameters based on the node relationship of the graph nodes in each subgraph unit; and obtaining the data access request for the heterogeneous storage system based on the unit execution order, the parameters and the parameter execution order.

[0080] In this optional implementation, the unit execution order is the access order for accessing heterogeneous storage systems; the parameters in the data access request include: parameters of each access sub-request, the parameters of each access sub-request are necessary parameters for accessing each storage medium unit, and the parameters of the access sub-request are different for different types of storage media; in order to implement the data access request, the sending order of each access sub-request can be determined by the unit execution order; based on the parameters and the parameter order, the access sub-request for accessing each media storage unit can be effectively filled.

[0081] The method for obtaining a data access request provided by this optional implementation method determines the unit execution order of each subgraph unit based on the connection relationship between the subgraph units in the execution subgraph; determines the parameters in the data access request based on the graph nodes in each subgraph unit; and determines the parameter execution order of the parameters based on the node relationship of the graph nodes in each subgraph unit, thereby improving the accuracy of obtaining data access requests.

[0082] In some optional implementations of the present disclosure, the above-mentioned obtaining data access requests for heterogeneous storage systems based on structured query statements and relationship sets includes: parsing structured query statements and relationship sets to obtain relational algebraic expressions of each structured query statement; based on the relational algebraic expressions, determining an execution subgraph of the heterogeneous storage system; based on the execution subgraph, obtaining data access requests for the heterogeneous storage system.

[0083] In this optional implementation, the relational algebra expression represents the parameters and parameter relationships in each structured query statement in the form of a functional relationship, wherein one relational algebra expression represents a structured query statement, and another relational algebra expression can represent the association relationship between multiple structured query statements.

[0084] The method for obtaining a data access request provided by this optional implementation parses structured query statements and relationship sets to obtain relational algebraic expressions of each structured query statement; based on the relational algebraic expression, an execution subgraph of a heterogeneous storage system is determined; based on the execution subgraph, a data access request of the heterogeneous storage system is obtained, thereby mapping the relational algebraic expression to an execution subgraph of the heterogeneous storage system; based on the execution subgraph, the data access request of the heterogeneous storage system is determined, providing another reliable implementation method for data access requests.

[0085] Based on this, this paper proposes a large language model fine-tuning method. Figure 3 A process 300 of an embodiment of a large language model fine-tuning method according to the present disclosure is shown. The large language model fine-tuning method includes the following steps:

[0086] Step 301, obtaining an initial large language model and training data set.

[0087] In this embodiment, the execution subject on which the large language model fine-tuning method runs can obtain the training data set and the initial large language model in a variety of ways. For example, the execution subject can obtain the training data set and the initial large language model stored in the database server through a wired connection or a wireless connection. For another example, the user can obtain the training data set and the initial large language model collected by the terminal by communicating with the terminal.

[0088] Here, the training data set may include at least one training data, and the training data includes: entity segmentation sequence and structured query statements, wherein the sample graph structure is used to reflect the structured query statement and the association relationship between multiple structured query statements.

[0089] It should be noted that the training data set is obtained based on a preset database. The database contains multiple table structures, such as table name: employees columns: id (integer), name (string), age (integer), department (string), etc. The process of obtaining the training data set is as follows:

[0090] Obtain an initial data set including at least one initial data, wherein the initial data includes: a natural language query paired with an SQL statement. For example: natural language: "Get the names of all employees working in the marketing department." SQL: SELECT nameFROM employees WHERE department = 'marketing department'; segment the natural language query and remove stop words (which may not always be required in Chinese processing) to obtain an entity segmentation sequence. Perform format detection on the SQL statement to obtain a structured query statement, wherein the format detection includes: performing space and case detection in the statement to ensure that the statement format is consistent.

[0091] In the technical solution disclosed in the present invention, the collection, storage, use, processing, transmission, provision and disclosure of the training data set and the initial large language model involved are carried out after authorization and comply with relevant laws and regulations.

[0092] In this embodiment, the initial large language model can be a general large language model obtained through pre-training. For example, when a question is input into the initial large language model, the initial large language model only outputs a structured query statement for querying the database, and only one database can be queried through the structured query statement.

[0093] In this embodiment, the initial large language model can use a Seq2Seq model architecture, where the encoder part of the architecture processes natural language input and the decoder part of the architecture generates SQL statements.

[0094] Optionally, an attention mechanism can also be added to the decoder so that the model can refer to specific parts of the natural language input when generating SQL.

[0095] Step 302: Select training data from the training data set.

[0096] The method and quantity of selecting training data from the image sample set are not limited in this application, and the number of fine-tuning training of the large language model is not limited. For example, in one fine-tuning training, multiple continuous training data sets can be randomly selected, and the initial network loss value of the large language model is calculated by the selected training data sets to adjust the parameters of the large language model.

[0097] Step 303: input the training data into the large language model to obtain the structured query statement and relationship set output by the large language model.

[0098] In this embodiment, while inputting the training data into the large language model, it is necessary to input the differential task splitting prompt words into the large language model to prompt the large language model to perform query task splitting on the entity word segmentation sequence in the training data according to the data structure information of the preset database, and obtain structured query statements and relationship sets.

[0099] Step 304: fine-tune the large language model based on the training data, structured query statements, and relationship sets.

[0100] In this embodiment, the execution subject can select entity segmentation sequences from the training data obtained in step 302, and execute the training steps from step 303 to step 304 to complete a fine-tuning training of the large language model.

[0101] In this embodiment, during each fine-tuning training of the large language model, an entity segmentation sequence is selected from the training data, and the selected entity segmentation sequence is input into the large language model. Based on the structured query statements and relationship sets output by the large language model and the structured query statements in the training data, the network loss value of the large language model is calculated.

[0102] In this embodiment, the loss function for calculating the network loss value of the large language model can adopt the cross entropy loss function, which can measure the difference between two different probability distributions in the same random variable, and is represented as the difference between the true probability distribution and the predicted probability distribution in machine learning. The smaller the value of the cross entropy loss function, the better the prediction effect of the large language model.

[0103] Step 305 , in response to the large language model satisfying the training completion condition, a trained large language model is obtained.

[0104] In this embodiment, the network loss value of the large language model can be used to detect whether the large language model meets the training completion condition. After the large language model meets the training completion condition, a trained large language model is obtained.

[0105] In this embodiment, the training completion condition includes: the network loss value of the large language model is less than a first loss value threshold. The first loss threshold can be determined based on specific training requirements, for example, the first loss threshold is 0.01.

[0106] Optionally, in this embodiment, in response to the large language model not meeting the training completion condition, relevant parameters in the large language model are adjusted so that the network loss value of the large language model converges, and the above training steps 302-304 are continued to be executed based on the adjusted large language model.

[0107] In this embodiment, during the fine-tuning training process of the large language model, the execution entity on which the large language model fine-tuning method runs records the loss and accuracy on the validation set in each iterative fine-tuning training stage, determines signs of overfitting, and increases the learning rate if the large language model converges slowly; if the overfitting phenomenon of the large language model is serious, reduces the learning rate.

[0108] In this embodiment, the performance indicators of the trained large language model can be evaluated through the validation set and the test set. Specifically, the performance indicators can mainly use two types: accuracy and grammatical correctness of structured query statements.

[0109] In this embodiment, after the trained large language model is obtained, the large language model can be deployed to the production environment and provided for user query through the API (Application Programming Interface). The structured query statements and relationship sets input by the user and generated by the model are continuously collected to monitor the accuracy of the model output.

[0110] Optionally, the training data set may be updated regularly to retrain or fine-tune the trained large language model to improve the performance of the large language model.

[0111] The embodiment of the present disclosure provides a large language model fine-tuning method, first, obtaining an initial large language model and a training data set, the training data set includes at least one training data, the training data includes: entity segmentation sequence and structured query statement; secondly, selecting training data from the training data set; thirdly, inputting the training data into the large language model to obtain the structured query statement and relationship set output by the large language model; then, based on the training data and the structured query statement and relationship set, fine-tuning the large language model; finally, in response to the large language model meeting the training completion condition, obtaining the trained large language model. Thus, by converting the structured query statement and the relationship into a prediction graph structure, the graph relationship between multiple structured query statements can be effectively represented, providing a reliable basis for fine-tuning the large language model, and improving the accuracy and reliability of the large language model training.

[0112] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a data processing device, which is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically implemented in various electronic devices.

[0113] like Figure 4 As shown, the data processing device 400 provided in this embodiment includes: an information acquisition unit 401, a set acquisition unit 402, a request acquisition unit 403, and a query unit 404. Among them, the above-mentioned information acquisition unit 401 can be configured to obtain the data structure information of the text to be searched and the heterogeneous storage system. The above-mentioned set acquisition unit 402 can be configured to obtain a structured query statement and a relationship set based on the text to be searched, the data structure information and the large language model. The structured query statement and the relationship set include at least one structured query statement and the association relationship between any two structured query statements in at least one structured query statement, and each structured query statement corresponds to a storage medium unit in the heterogeneous storage system. The above-mentioned request acquisition unit 403 can be configured to obtain a data access request of the heterogeneous storage system based on the structured query statement and the relationship set. The above-mentioned query unit 404 can be configured to query the heterogeneous storage system using the data access request to obtain the query result of the text to be searched.

[0114] In this embodiment, the specific processing and technical effects of the information acquisition unit 401, the collection acquisition unit 402, the request acquisition unit 403, and the query unit 404 in the data processing device 400 can be referred to in Figure 1 The relevant descriptions of step 101, step 102, step 103, and step 104 in the corresponding embodiment are not repeated here.

[0115] In some optional implementations of this embodiment, the above-mentioned device 400 also includes: an update unit (not shown in the figure), which is configured to receive data change information of a heterogeneous storage system; generate new data structure information based on the data change information; and replace the data structure information with the new data structure information.

[0116] In some optional implementations of this embodiment, the above-mentioned device also includes: a storage unit (not shown in the figure), and the above-mentioned storage unit is configured to: store the text to be searched, data structure information and query results in a heterogeneous storage system.

[0117] In some optional implementations of this embodiment, the above-mentioned information acquisition unit 401 is further configured to: obtain the text to be searched; obtain the original data stored by category in the heterogeneous storage system; and obtain data structure information of the heterogeneous storage system based on the text to be searched and the original data.

[0118] In some optional implementations of this embodiment, the above-mentioned information acquisition unit 401 is further configured to: vectorize the text to be checked to obtain a text vector; vectorize the original data to obtain an original vector; match the text vector with the original vector to obtain a matching vector in the original vector, and use the original data corresponding to the matching vector as data structure information.

[0119] In some optional implementations of the present embodiment, the above-mentioned set obtaining unit 402 is configured to: send the text to be queried, the data structure information and the query task splitting prompt words to the large language model, obtain the structured query statement and the relationship set output by the large language model, and the query task splitting prompt words are used to prompt the large language model to split the query task of the text to be queried based on the text to be queried and the data structure information, and generate the structured query statement and the relationship set for querying the heterogeneous storage system.

[0120] In some optional implementations of the present embodiment, the request obtaining unit 403 is configured to: perform grammatical and semantic analysis on the structured query statements and relationship sets to obtain the syntax trees of each structured query statement and the association relationship between any two syntax trees; determine the execution subgraph of the heterogeneous storage system based on the association relationship and each syntax tree; and obtain a data access request for the heterogeneous storage system based on the execution subgraph.

[0121] In some optional implementations of the present embodiment, the request obtaining unit 403 is further configured to: based on the structured query statement and the relationship set, map each node of each syntax tree to the first graph node of the corresponding storage medium unit in the heterogeneous storage system, where the first graph node is a node pre-set for the storage medium unit; based on the node relationship between the nodes in each syntax tree, connect the first graph nodes of each storage medium unit to obtain the subgraph unit of each storage medium unit; based on the association relationship, connect the subgraph units of each storage medium unit to obtain the execution subgraph.

[0122] In some optional implementations of the present embodiment, the request obtaining unit 403 is further configured to: determine the unit execution order of each subgraph unit based on the connection relationship between the subgraph units in the execution subgraph; determine the parameters in the data access request based on the graph nodes in each subgraph unit; determine the parameter execution order of the parameters based on the node relationship of the graph nodes in each subgraph unit; obtain the data access request of the heterogeneous storage system based on the unit execution order, parameters and parameter execution order.

[0123] In some optional implementations of the present disclosure, the request obtaining unit 403 is configured to: parse structured query statements and relationship sets to obtain relational algebraic expressions of each structured query statement; determine an execution subgraph of a heterogeneous storage system based on the relational algebraic expression; and obtain a data access request of the heterogeneous storage system based on the execution subgraph.

[0124] The data processing device provided by the embodiment of the present disclosure, first, the information acquisition unit 401 acquires the data structure information of the text to be searched and the heterogeneous storage system; secondly, the set acquisition unit 402 obtains the structured query statement and the relationship set based on the text to be searched, the data structure information and the large language model, the structured query statement and the relationship set include at least one structured query statement and the association relationship between any two structured query statements in at least one structured query statement, and each structured query statement corresponds to a storage medium unit in the heterogeneous storage system; thirdly, the request acquisition unit 403 obtains the data access request of the heterogeneous storage system based on the structured query statement and the relationship set, and finally, the query unit 404 uses the data access request to query the heterogeneous storage system to obtain the query result of the text to be searched. Therefore, the structured query statements and relationship sets obtained by analyzing the text to be queried and data structure information through a large language model can realize the overall access to the storage medium units in the heterogeneous storage system, thereby improving the uniformity of the access to the storage medium units of multiple different storage media; since the structured query statements and relationship sets include the association relationship between any two structured query statements, the query for the text to be queried can be divided into query plans for querying in multiple storage medium units, thereby improving the accuracy of the query for the text to be queried.

[0125] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0126] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a large language model fine-tuning device, which is similar to Figure 3 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0127] like Figure 5 As shown, the large language model fine-tuning device 500 provided in this embodiment includes: a data acquisition unit 501, a selection unit 502, an input unit 503, a fine-tuning unit 504, and a model acquisition unit 505. Among them, the above-mentioned data acquisition unit 501 can be configured to obtain an initial large language model and a training data set, and the training data set includes at least one training data, and the training data includes: an entity segmentation sequence and a structured query statement. The above-mentioned selection unit 502 can be configured to select training data from the training data set. The above-mentioned input unit 503 can be configured to input the training data into the large language model to obtain a structured query statement and a relationship set output by the large language model. The above-mentioned fine-tuning unit 504 can be configured to fine-tune the large language model based on the training data and the prediction graph structure. The above-mentioned model acquisition unit 505 can be configured to obtain a large language model that has been trained in response to the large language model satisfying the training completion condition.

[0128] In this embodiment, the specific processing and technical effects of the large language model fine-tuning device 500: the data acquisition unit 501, the selection unit 502, the input unit 503, the fine-tuning unit 504, and the model acquisition unit 505 can be referred to respectively. Figure 3 The relevant descriptions of step 301, step 302, step 303, step 304, and step 305 in the corresponding embodiment are not repeated here.

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

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

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

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

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

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

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

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

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

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

[0139] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

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

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

Claims

1. A data processing method, the method comprising: Obtain the data structure information of the text to be queried and the heterogeneous storage system; Based on the text to be searched, the data structure information and the large language model, a structured query statement and a relationship set are obtained, wherein the structured query statement and the relationship set include at least one structured query statement and an association relationship between any two structured query statements in the at least one structured query statement; Based on the structured query statement and the relationship set, obtaining a data access request of the heterogeneous storage system; The heterogeneous storage system is queried using the data access request to obtain a query result of the text to be queried.

2. The method according to claim 1, further comprising: Receiving data change information of the heterogeneous storage system; Based on the data change information, generate new data structure information; The new data structure information is used to replace the data structure information.

3. The method according to claim 1, further comprising: The to-be-queried text, the data structure information and the query result are stored in the heterogeneous storage system.

4. The method according to any one of claims 1 to 3, wherein: The obtaining of the data structure information of the to-be-queried text and the heterogeneous storage system includes: Get the text to be searched; Obtain the original data stored by category in heterogeneous storage systems; Based on the text to be searched and the original data, data structure information of the heterogeneous storage system is obtained.

5. The method according to claim 4, wherein: The obtaining of data structure information of the heterogeneous storage system based on the to-be-queried text and the original data includes: Performing vectorization processing on the text to be searched to obtain a text vector; Performing vectorization processing on the original data to obtain an original vector; The text vector is matched with the original vector to obtain a matching vector in the original vector, and the original data corresponding to the matching vector is used as data structure information.

6. The method according to any one of claims 1 to 3, wherein: The step of obtaining a structured query statement and a relationship set based on the text to be searched, the data structure information and the large language model includes: The text to be searched, the data structure information and the query task splitting prompt words are sent to the large language model to obtain the structured query statement and relationship set output by the large language model. The query task splitting prompt words are used to prompt the large language model to split the query task of the text to be searched based on the text to be searched and the data structure information, and generate the structured query statement and relationship set for querying the heterogeneous storage system.

7. The method according to any one of claims 1 to 3, wherein: The obtaining of the data access request of the heterogeneous storage system based on the structured query statement and the relationship set includes: Performing grammatical and semantic analysis on the structured query statements and the relationship set to obtain a syntax tree of each structured query statement and an association relationship between any two syntax trees; Determine an execution subgraph of the heterogeneous storage system based on the association relationship and each syntax tree; Based on the execution subgraph, a data access request of the heterogeneous storage system is obtained.

8. The method according to claim 7, wherein: The determining, based on the association relationship and each syntax tree, the execution subgraph of the heterogeneous storage system comprises: Based on the structured query statement and the relationship set, each node of each syntax tree is mapped to a first graph node of a corresponding storage medium unit in the heterogeneous storage system, wherein the first graph node is a node pre-set for the storage medium unit; Based on the node relationship between the nodes in each syntax tree, the first graph nodes of each storage medium unit are connected to obtain the subgraph units of each storage medium unit; Based on the association relationship, the subgraph units of each storage medium unit are connected to obtain an execution subgraph.

9. The method according to claim 8, wherein: The obtaining, based on the execution subgraph, a data access request of the heterogeneous storage system comprises: Determining a unit execution order of each subgraph unit based on a connection relationship between subgraph units in the execution subgraph; Determine parameters in the data access request based on the graph nodes in each subgraph unit; Determining a parameter execution order of the parameters based on a node relationship of the graph nodes in each subgraph unit; A data access request for the heterogeneous storage system is obtained based on the unit execution order, the parameters and the parameter execution order.

10. The method according to any one of claims 1 to 3, wherein: The obtaining of the data access request of the heterogeneous storage system based on the structured query statement and the relationship set includes: Parsing the structured query statements and relation sets to obtain relational algebraic expressions of each structured query statement; Based on the relational algebraic expression, determining an execution subgraph of the heterogeneous storage system; Based on the execution subgraph, a data access request of the heterogeneous storage system is obtained.

11. A method for fine-tuning a large language model, the method comprising: Acquire an initial large language model and a training data set, wherein the training data set includes at least one training data, and the training data includes: an entity segmentation sequence and a structured query statement; Selecting training data from the training data set; Inputting the training data into the large language model to obtain a structured query statement and a relationship set output by the large language model; Based on the training data and the structured query statement and the relationship set, fine-tuning the large language model; In response to the large language model satisfying a training completion condition, a trained large language model is obtained.

12. A data processing device, comprising: An information acquisition unit, configured to acquire the text to be searched and data structure information of the heterogeneous storage system; A set obtaining unit is configured to obtain a structured query statement and a relationship set based on the to-be-queried text, the data structure information and the large language model, wherein the structured query statement and the relationship set include at least one structured query statement and an association relationship between any two structured query statements in the at least one structured query statement; A request obtaining unit, configured to obtain a data access request of the heterogeneous storage system based on the structured query statement and the relationship set; The query unit is configured to query the heterogeneous storage system using the data access request to obtain a query result of the text to be queried.

13. The device according to claim 12, further comprising: An updating unit is configured to: receive data change information of the heterogeneous storage system; Based on the data change information, generate new data structure information; The new data structure information is used to replace the data structure information.

14. The apparatus according to claim 12, further comprising: The storage unit is configured to store the to-be-queried text, the data structure information and the query result in the heterogeneous storage system.

15. The device according to any one of claims 12 to 14, wherein: The information acquisition unit is further configured to: acquire the text to be checked; acquire the original data stored by category in the heterogeneous storage system; and obtain data structure information of the heterogeneous storage system based on the text to be checked and the original data.

16. The device according to claim 15, wherein: The information acquisition unit is further configured to: perform vectorization processing on the text to be checked to obtain a text vector; perform vectorization processing on the original data to obtain an original vector; match the text vector with the original vector to obtain a matching vector in the original vector, and use the original data corresponding to the matching vector as data structure information.

17. The device according to any one of claims 12 to 14, wherein: The set obtaining unit is configured to: send the text to be checked, the data structure information and the query task splitting prompt words to the large language model, and obtain the structured query statement and relationship set output by the large language model, wherein the query task splitting prompt words are used to prompt the large language model to split the query task of the text to be checked based on the text to be checked and the data structure information, and generate the structured query statement and relationship set for querying the heterogeneous storage system.

18. The device according to any one of claims 12 to 14, wherein: The request obtaining unit is configured to: perform grammatical semantic analysis on the structured query statement and the relationship set to obtain a syntax tree of each structured query statement and an association relationship between any two syntax trees; determine an execution subgraph of the heterogeneous storage system based on the association relationship and each syntax tree; Based on the execution subgraph, a data access request of the heterogeneous storage system is obtained.

19. The device according to claim 18, wherein The request obtaining unit is further configured to: based on the structured query statement and the relationship set, map each node of each syntax tree to a first graph node of a corresponding storage medium unit in the heterogeneous storage system, wherein the first graph node is a node pre-set for the storage medium unit; Based on the node relationship between the nodes in each syntax tree, the first graph nodes of each storage medium unit are connected to obtain the subgraph units of each storage medium unit; Based on the association relationship, the subgraph units of each storage medium unit are connected to obtain an execution subgraph.

20. The device according to claim 19, wherein The request obtaining unit is further configured to: determine the unit execution order of each subgraph unit based on the connection relationship of the subgraph units in the execution subgraph; determine the parameters in the data access request based on the graph nodes in each subgraph unit; determine the parameter execution order of the parameters based on the node relationship of the graph nodes in each subgraph unit; A data access request for the heterogeneous storage system is obtained based on the unit execution order, the parameters and the parameter execution order.

21. The device according to any one of claims 12 to 14, wherein: The request obtaining unit is configured to: parse the structured query statements and the relation set to obtain relational algebraic expressions of each structured query statement; Based on the relational algebraic expression, determining an execution subgraph of the heterogeneous storage system; Based on the execution subgraph, a data access request of the heterogeneous storage system is obtained.

22. A large language model fine-tuning device, the device comprising: A data acquisition unit is configured to acquire an initial large language model and a training data set, wherein the training data set includes at least one training data, and the training data includes: an entity segmentation sequence and a structured query statement; A selection unit, configured to select training data from the training data set; An input unit, configured to input the training data into the large language model to obtain a structured query statement and a relationship set output by the large language model; A fine-tuning unit, configured to perform fine-tuning training on the large language model based on the training data and the structured query statement and the relationship set; The model obtaining unit is configured to obtain a trained large language model in response to the large language model satisfying a training completion condition.

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

24. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 11.

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

Citation Information

Patent Citations

  • Unified query system of mixed heterogeneous data sources and a distributed query method

    CN107491510A

  • Semantic search systems and methods for distributed data system

    CN109863484A

  • Heterogeneous data management method, device and equipment and computer readable storage medium

    CN112364052A

  • Structured query statement generation method and device and equipment

    CN112835927A

  • Database access method and device and storage medium

    CN115438064A

Cited By

  • Endogenous security database query method and device based on large model and MCP protocol

    CN120631919A

  • A method and apparatus for querying intrinsically secure databases based on large models and the MCP protocol.

    CN120631919B