On-chain data analysis method, device, computer equipment, readable storage medium and program product

By combining the data encryption and hash value generation technology of blockchain SIM cards and large language models, the problem of large amount and high complexity of on-chain data is solved, efficient and accurate on-chain data analysis is achieved, and data security and privacy are ensured.

CN119853915BActive Publication Date: 2025-10-03CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411995485.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-10-03
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In existing technologies, with the exponential growth of the amount of data on the blockchain network, traditional data analysis methods are inefficient and difficult to effectively process large amounts of complex on-chain data.

Method used

By obtaining a variety of preset task types, natural language questions input by users and their semantic vectors and constraints, combining blockchain SIM cards and large language models to perform data encryption and hash value generation, and outputting analysis results, efficient analysis of on-chain data can be achieved.

Benefits of technology

It improves the efficiency and accuracy of on-chain data analysis and ensures the security and privacy of data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119853915B_ABST
    Figure CN119853915B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, computer-readable storage medium, and computer program product for on-chain data analysis. The method comprises: obtaining a target data field based on multiple preset task types and semantic vectors, and for each preset constraint, obtaining a corresponding conditional range of the semantic vector based on a constraint matrix; encrypting the combined data formed by the target data field, the conditional range, and the target on-chain data using the public key of a large language model to obtain encrypted data; generating a first hash value corresponding to the combined data based on a blockchain SIM card, and generating a digital signature corresponding to the first hash value based on the private key of the blockchain SIM card; inputting the required data, the public key of the blockchain SIM card, the encrypted data, the first hash value, and the digital signature into the large language model, and outputting analysis results for the target on-chain data. The method provided in this application can effectively improve the efficiency of on-chain data analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to an on-chain data analysis method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the continuous development and popularization of blockchain technology, the on-chain data of blockchain networks is widely used in finance, logistics, supply chain and other fields. Therefore, the analysis of on-chain data is becoming more and more important.

[0003] Existing technologies primarily rely on software computing to encrypt and verify on-chain data, enabling analysis of this data. However, as the volume of on-chain data grows exponentially, its scale and complexity far exceed those of traditional data, making this method of analyzing on-chain data increasingly inefficient. Summary of the Invention

[0004] Based on this, it is necessary to provide an on-chain data analysis method, device, computer equipment, computer-readable storage medium and computer program product that can improve analysis efficiency in response to the above technical problems.

[0005] In a first aspect, the present application provides an on-chain data analysis method, the method comprising:

[0006] Acquire multiple preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and multiple preset constraints;

[0007] Based on the multiple preset task types and the semantic vectors, a target data field is obtained from the at least one initial data field, and for each preset constraint condition, a condition range corresponding to the semantic vector is obtained based on the constraint condition matrix;

[0008] Acquire at least one target on-chain data from the blockchain network, and encrypt the combined data formed by the target data field, the condition range, and the target on-chain data based on the public key of the large language model to obtain encrypted data;

[0009] Generate a first hash value corresponding to the combined data based on the blockchain SIM card, and generate a digital signature corresponding to the first hash value based on the private key of the blockchain SIM card;

[0010] Obtain user demand data from the natural language question, input the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value and the digital signature into the large language model, and output the analysis results for the data on the target chain.

[0011] In one embodiment, obtaining a semantic vector corresponding to the natural language question includes:

[0012] The natural language question is input into the embedding function of the large language model, and a semantic vector corresponding to the natural language question is output.

[0013] In one embodiment, the acquiring of a target data field from the at least one initial data field based on the multiple preset task types and the semantic vector includes:

[0014] Inputting the semantic vector and the plurality of preset task types into a similarity function, and outputting a target task type corresponding to the natural language question;

[0015] Obtaining a mapping matrix between task types and data fields, and obtaining a weight value corresponding to the initial data field based on the target task type and the mapping matrix;

[0016] For each initial data field, if a corresponding weight value of the initial data field is greater than a weight threshold, the initial data field is determined as the target data field.

[0017] In one embodiment, obtaining at least one target on-chain data from the blockchain network includes:

[0018] Obtain at least one original on-chain data of the blockchain network;

[0019] For each type of original on-chain data, if the corresponding data field of the original on-chain data includes at least one target data field, determine the original on-chain data as intermediate on-chain data;

[0020] Cleaning the data on the intermediate chain to obtain cleaned data on the intermediate chain; wherein the data cleaning includes removing invalid data, duplicate data, and noise data;

[0021] The target chain data is obtained based on the intermediate chain data after the data cleaning.

[0022] In one embodiment, obtaining the target chain data based on the intermediate chain data after data cleaning includes:

[0023] Obtaining context information of the data on the intermediate chain;

[0024] The context information is added to the intermediate chain data after the data cleaning to obtain the target chain data.

[0025] In one embodiment, the analysis result is output by the large language model based on the size relationship between the first hash value and the second hash value, and the size relationship between the first hash value and the third hash value; the second hash value is calculated by the large language model based on the combined data, and the combined data is obtained by the large language model decrypting the encrypted data based on the private key of the large language model; the third hash value is obtained by the large language model based on the decrypted digital signature, and the decrypted digital signature is obtained by the large language model decrypting the digital signature based on the public key of the blockchain SIM card.

[0026] In a second aspect, the present application further provides an on-chain data analysis device, the device comprising:

[0027] A first acquisition module is configured to acquire a plurality of preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and a plurality of preset constraints;

[0028] a second acquisition module, configured to acquire a target data field from the at least one initial data field based on the multiple preset task types and the semantic vector, and acquire, for each preset constraint condition, a condition range corresponding to the semantic vector based on the constraint condition matrix;

[0029] A third acquisition module is configured to acquire at least one target on-chain data from the blockchain network, and encrypt the combined data formed by the target data field, the conditional range, and the target on-chain data based on the public key of the large language model to obtain encrypted data;

[0030] A generation module, configured to generate a first hash value corresponding to the combined data based on the blockchain SIM card, and generate a digital signature corresponding to the first hash value based on the private key of the blockchain SIM card;

[0031] The fourth acquisition module is used to obtain the user's demand data from the natural language question, input the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value and the digital signature into the large language model, and output the analysis results for the data on the target chain.

[0032] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any of the above embodiments when executing the computer program.

[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in any one of the above embodiments.

[0034] In a fifth aspect, the present application further provides a computer program product, which includes a computer program that implements the steps of the method in any one of the above embodiments when executed by a processor.

[0035] The above-mentioned chain data analysis method, device, computer equipment, computer-readable storage medium and computer program product obtain multiple preset task types, natural language questions input by the user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix and multiple preset constraints; based on the multiple preset task types and semantic vectors, a target data field is obtained from at least one initial data field, and for each preset constraint, a condition range corresponding to the semantic vector is obtained based on the constraint matrix; at least one target chain data is obtained from the blockchain network, and the combined data formed by the target data field, the condition range and the target chain data is encrypted based on the public key of the large language model to obtain encrypted data; a first hash value corresponding to the combined data is generated based on the blockchain SIM card, and a digital signature corresponding to the first hash value is generated based on the private key of the blockchain SIM card; the user's demand data is obtained from the natural language question, the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value and the digital signature are input into the large language model, and the analysis result for the target chain data is output. The method provided by this application can effectively improve the efficiency and accuracy of analyzing chain data. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 A flowchart of an on-chain data analysis method in one embodiment;

[0038] Figure 2A schematic diagram of a blockchain SIM card in one embodiment;

[0039] Figure 3 Schematic diagram of a flow chart of a method for obtaining a target data field in one embodiment;

[0040] Figure 4 This is a system architecture diagram of an on-chain data analysis method in another embodiment;

[0041] Figure 5 This is a timing diagram of an on-chain data analysis method in another embodiment;

[0042] Figure 6 This is a structural block diagram of an on-chain data analysis device in one embodiment;

[0043] Figure 7 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0045] In one embodiment, Figure 1 As shown, a method for analyzing on-chain data is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0046] S102: Acquire multiple preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and multiple preset constraints.

[0047] Among them, task types are used to analyze and process on-chain data of the blockchain to extract valuable information. Task types can be, but are not limited to, traceability analysis, anomaly analysis, and behavior analysis; natural language problems refer to problems expressed in natural language (i.e., the language used by humans for daily communication, such as Chinese, English, French, etc.); data fields refer to structured information extracted from natural language problems. These fields can help the system better understand and process user problems. Each field represents a specific part or attribute in the problem. For example, data fields can include shipping time, delivery time, transportation method, order amount, and customer rating; semantic vector refers to the conversion of natural language text into a numerical vector that can capture the semantic information of the text; constraints are used to constrain the analysis process of on-chain data.

[0048] S104 , based on multiple preset task types and semantic vectors, obtaining a target data field from at least one initial data field, and for each preset constraint condition, obtaining a corresponding condition range of the semantic vector based on a constraint condition matrix.

[0049] Optionally, the condition range may include, but is not limited to, a time range, a spatial range, a data filtering condition, and an attribute range.

[0050] The process of obtaining the conditional range is shown in the following formula:

[0051]

[0052] In the formula, r is the condition range vector, and a vector element in r is the condition range corresponding to a constraint condition. , is the constraint matrix, .

[0053] Alternatively, the target data fields and condition ranges may be represented by the following task description matrix T:

[0054]

[0055] Where, is the target data field, The conditional range.

[0056] The task description matrix T can be expressed as follows:

[0057]

[0058] S106. Obtain at least one target on-chain data from the blockchain network, and encrypt the combined data formed by the target data field, the condition range, and the target on-chain data based on the public key of the large language model to obtain encrypted data.

[0059] Among them, on-chain data of the blockchain refers to the data stored in the blockchain network. This data is tamper-proof, transparent, and can be verified through the blockchain's distributed ledger technology.

[0060] Optionally, the encrypted data is as follows:

[0061]

[0062] Where, To encrypt data, The target chain data.

[0063] S108. Generate a first hash value corresponding to the combined data based on the blockchain SIM card, and generate a digital signature corresponding to the first hash value based on the private key of the blockchain SIM card.

[0064] Among them, the hash value is the unique identifier of the data and can verify whether the data has changed during the transmission process.

[0065] Optionally, the digital signature is as follows:

[0066]

[0067] Where, For digital signature, is the first hash value.

[0068] Optionally, based on the blockchain SIM card, the public key, encrypted data, first hash value and digital signature of the blockchain SIM card are encapsulated to obtain encapsulation information. The encapsulation information is shown in the following formula:

[0069]

[0070] Where, To encapsulate information, It is the public key of the blockchain SIM card.

[0071] Alternatively, as Figure 2 As shown, Figure 2This is a schematic diagram of a blockchain SIM (BSIM) card. The blockchain BSIM card primarily provides end users with functions such as public and private key generation, encrypted storage, signature verification, and address generation. The BSIM card primarily consists of a traditional SIM card module, a Bluetooth module, an MCU chip module, and an SE chip module. The traditional SIM card module, representing existing SIM card functions, includes basic features such as calls, 5G mobile internet access, and text messaging. The MCU is responsible for overall scheduling and communication with the phone, Bluetooth module, and SE, and is powered by the terminal's SIM card interface. The SE chip is responsible for blockchain-related algorithm operations and provides financial security-grade Bluetooth communication with the terminal. The Bluetooth module, utilizing Bluetooth 4.0 technology, connects the terminal to the card, facilitating access to card functions via terminal apps through middleware.

[0072] S110. Obtain user demand data from natural language questions, input the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value and the digital signature into the large language model, and output the analysis results for the data on the target chain.

[0073] Optionally, after obtaining the analysis results, to protect the privacy and security of user data, the analysis results are encrypted using the blockchain SIM card's public key and the encrypted ciphertext is sent to the user terminal. The user terminal decrypts the analysis results using the blockchain SIM card's built-in private key and then views the analysis report, thereby ensuring the security and privacy of the result transmission.

[0074] In the above-mentioned on-chain data analysis method, multiple preset task types, natural language questions input by the user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and multiple preset constraints are obtained; based on the multiple preset task types and semantic vectors, a target data field is obtained from at least one initial data field, and for each preset constraint, a condition range corresponding to the semantic vector is obtained based on the constraint matrix; at least one target on-chain data is obtained from the blockchain network, and the combined data formed by the target data field, the condition range, and the target on-chain data is encrypted based on the public key of the large language model to obtain encrypted data; a first hash value corresponding to the combined data is generated based on the blockchain SIM card, and a digital signature corresponding to the first hash value is generated based on the private key of the blockchain SIM card; the user's demand data is obtained from the natural language question, and the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value, and the digital signature are input into the large language model, and the analysis results for the target on-chain data are output. The method provided in this application can effectively improve the efficiency and accuracy of analyzing on-chain data.

[0075] In some embodiments, obtaining a semantic vector corresponding to a natural language question includes: inputting the natural language question into an embedding function of a large language model, and outputting a semantic vector corresponding to the natural language question.

[0076] Optionally, the process of obtaining the semantic vector is as follows:

[0077]

[0078] Where q is the semantic vector, , is the embedding function of the large language model, and Q is the natural language question.

[0079] In this embodiment, a natural language question is input into the embedding function of the large language model, and a semantic vector corresponding to the natural language question is output. The semantic vector obtained in this way is more accurate.

[0080] In some embodiments, as Figure 3 As shown, based on multiple preset task types and semantic vectors, a target data field is obtained from at least one initial data field, including:

[0081] S302: Input the semantic vector and multiple preset task types into the similarity function, and output the target task type corresponding to the natural language question.

[0082] S304: Obtain a mapping matrix between task types and data fields, and obtain corresponding weight values ​​of the initial data fields based on the target task type and the mapping matrix.

[0083] S306 : For each initial data field, if the corresponding weight value of the initial data field is greater than a weight threshold, determine the initial data field as a target data field.

[0084] Optionally, by inputting the semantic vector and multiple preset task types into the similarity function, a preset task type that best matches the natural language question can be selected from the multiple preset task types as the target task type. The process of obtaining the target task type is shown in the following formula:

[0085]

[0086] Where, is the target task type, is the similarity function, t i The default task type.

[0087] Optionally, the process of obtaining the weight value corresponding to the initial data field is as follows:

[0088]

[0089] Where d is the weight vector corresponding to the initial data field, and a vector element in d is the weight value corresponding to an initial data field. , is the mapping matrix, .

[0090] In this embodiment, the target task type corresponding to the natural language question is first obtained based on the similarity function, then the weight value corresponding to the initial data field is obtained based on the target task type, and finally the target data field is obtained based on the weight value. In this way, the target data field obtained is more accurate.

[0091] In some embodiments, obtaining at least one target on-chain data from a blockchain network includes: obtaining at least one original on-chain data of the blockchain network; for each type of original on-chain data, when the corresponding data field of the original on-chain data includes at least one target data field, determining the original on-chain data as intermediate on-chain data; performing data cleaning on the intermediate on-chain data to obtain cleansed intermediate on-chain data; wherein the data cleaning includes removing invalid data, duplicate data, and noise data; and obtaining target on-chain data based on the cleansed intermediate on-chain data.

[0092] Alternatively, the original on-chain data set can be represented as , the data set on the intermediate chain can be expressed as , you can use the query function Filter out from S , where x is the data on the intermediate chain and r is the condition range.

[0093] Optionally, the data set on the intermediate chain after data cleaning can be expressed as ,in, is a Boolean function used to determine whether the data is invalid data. Used to determine whether the data is duplicate data. For the intermediate chain data, It is the intermediate chain data after data cleaning.

[0094] In this embodiment, the original on-chain data is screened and cleaned to obtain the cleaned intermediate on-chain data, which makes the subsequently obtained target on-chain data more accurate.

[0095] In some embodiments, obtaining target chain data based on the intermediate chain data after data cleaning includes: obtaining context information of the intermediate chain data; supplementing the context information to the intermediate chain data after data cleaning to obtain the target chain data.

[0096] Among them, contextual information refers to the background information and metadata related to the on-chain data.

[0097] Optionally, first clean the data on the intermediate chain Converted into standardized structure data , and supplement the context information c of the on-chain data to obtain the target on-chain data, where the data structure of the standardized structure data can be but is not limited to JSON or CSV. The target on-chain data can be shown as follows:

[0098]

[0099] In this embodiment, the context information of the intermediate chain data is obtained, and the context information is added to the intermediate chain data after data cleaning to obtain the target chain data, which makes the subsequent analysis process of the chain data more accurate.

[0100] In some embodiments, the analysis result is output by the large language model based on the size relationship between the first hash value and the second hash value, and the size relationship between the first hash value and the third hash value; the second hash value is calculated by the large language model based on the combined data, and the combined data is obtained by the large language model based on the private key of the large language model to decrypt the encrypted data; the third hash value is obtained by the large language model based on the decrypted digital signature, and the decrypted digital signature is obtained by the large language model based on the public key of the blockchain SIM card to decrypt the digital signature.

[0101] Optionally, when the first hash value is equal to the second hash value, and the first hash value is equal to the third hash value, the large language model outputs an analysis result.

[0102] In this embodiment, the large language model outputs an analysis result based on the size relationship between the first hash value and the second hash value, and the size relationship between the first hash value and the third hash value, so that the output analysis result is more accurate.

[0103] In one embodiment, another on-chain data analysis method is provided. The system architecture diagram and timing diagram of the method are respectively as follows: Figure 4 and Figure 5 The method includes the following:

[0104] Data collection and preprocessing: Utilize the capabilities of the big model to obtain on-chain data from the blockchain network, and preprocess, denoise, and extract features from the collected on-chain data. Use the intelligent algorithm of the big model to extract key features and patterns in the data, and conduct preliminary data analysis and pattern recognition.

[0105] Data encryption: Data is encrypted and verified through BSIM's hardware security, and blockchain's secure encryption algorithm is used for acceleration at the hardware level to solve traditional security issues such as data leakage.

[0106] BSIM hardware acceleration: Utilize the BSIM hardware accelerator to optimize the encryption calculations of on-chain data and increase data processing speed. BSIM supports the efficient execution of asymmetric encryption and other complex algorithms, and can maintain high computing performance even when the amount of data increases.

[0107] Intelligent Analysis and Modeling: Use Large Language Models (LLMs) to conduct in-depth analysis of on-chain data, explore potential patterns and trends in the data, output the analysis results (including but not limited to data prediction, risk assessment, behavioral analysis, etc.) in a visual manner, and generate predictive models and intelligent analysis reports to support intelligent decision-making.

[0108] Data feedback and optimization: Based on the analysis results, the BSIM device provides a feedback mechanism and stores the data on-chain to improve the accuracy and efficiency of the analysis.

[0109] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0110] Based on the same inventive concept, the embodiments of the present application also provide an on-chain data analysis device for implementing the on-chain data analysis method involved above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations in the embodiments of one or more on-chain data analysis devices provided below can be found in the above-mentioned limitations on the on-chain data analysis method, and will not be repeated here.

[0111] In an exemplary embodiment, Figure 6 As shown, a chain data analysis device 600 is provided, including: a first acquisition module 601, a second acquisition module 602, a third acquisition module 603, a generation module 604 and a fourth acquisition module 605, wherein:

[0112] The first acquisition module 601 is used to obtain multiple preset task types, natural language questions input by the user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix and multiple preset constraints.

[0113] The second acquisition module 602 is used to obtain the target data field from the at least one initial data field based on the multiple preset task types and the semantic vector, and for each preset constraint condition, obtain the corresponding condition range of the semantic vector based on the constraint condition matrix.

[0114] The third acquisition module 603 is used to obtain at least one target chain data from the blockchain network, and encrypt the combined data formed by the target data field, the condition range and the target chain data based on the public key of the large language model to obtain encrypted data.

[0115] The generation module 604 is configured to generate a first hash value corresponding to the combined data based on the blockchain SIM card, and generate a digital signature corresponding to the first hash value based on the private key of the blockchain SIM card.

[0116] The fourth acquisition module 605 is used to obtain the user's demand data from the natural language question, input the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value and the digital signature into the large language model, and output the analysis results for the data on the target chain.

[0117] In some embodiments, the first acquisition module 601 is further configured to input the natural language question into the embedding function of the large language model, and output a semantic vector corresponding to the natural language question.

[0118] In some embodiments, the second acquisition module 602 is further used to input the semantic vector and the multiple preset task types into a similarity function, and output the target task type corresponding to the natural language question; obtain a mapping matrix between task types and data fields, and obtain the corresponding weight value of the initial data field based on the target task type and the mapping matrix; for each initial data field, when the corresponding weight value of the initial data field is greater than a weight threshold, determine the initial data field as the target data field.

[0119] In some embodiments, the third acquisition module 603 includes:

[0120] The first acquisition unit is used to obtain at least one original on-chain data of the blockchain network.

[0121] A determination unit is used to determine, for each type of original on-chain data, the original on-chain data as intermediate on-chain data when the corresponding data field of the original on-chain data includes at least one target data field.

[0122] A data cleaning unit is used to clean the data on the intermediate chain to obtain the cleaned data on the intermediate chain; wherein the data cleaning includes removing invalid data, duplicate data and noise data.

[0123] The second acquisition unit is used to acquire the target chain data based on the intermediate chain data after the data cleaning.

[0124] In some embodiments, the second acquisition unit is further used to obtain context information of the data on the intermediate chain; and add the context information to the data on the intermediate chain after data cleaning to obtain the target chain data.

[0125] In some embodiments, the fourth acquisition module 605 is also used for the analysis result to be output by the large language model based on the size relationship between the first hash value and the second hash value, and the size relationship between the first hash value and the third hash value; the second hash value is calculated by the large language model based on the combined data, and the combined data is obtained by the large language model decrypting the encrypted data based on the private key of the large language model; the third hash value is obtained by the large language model based on the decrypted digital signature, and the decrypted digital signature is obtained by the large language model decrypting the digital signature based on the public key of the blockchain SIM card.

[0126] Each module in the above-mentioned on-chain data analysis device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.

[0127] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, while the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means. The wireless means can be implemented via Wi-Fi, mobile cellular networks, near-field communication (NFC), or other technologies. When executed by the processor, the computer program implements an on-chain data analysis method.

[0128] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0129] In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: obtaining multiple preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and multiple preset constraints; based on the multiple preset task types and the semantic vector, obtaining a target data field from the at least one initial data field, and for each preset constraint, obtaining a condition range corresponding to the semantic vector based on the constraint matrix; obtaining at least one target on-chain data from a blockchain network, encrypting combined data formed by the target data field, the condition range, and the target on-chain data based on a public key of a large language model to obtain encrypted data; generating a first hash value corresponding to the combined data based on a blockchain SIM card, and generating a digital signature corresponding to the first hash value based on a private key of the blockchain SIM card; obtaining user demand data from the natural language question, inputting the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value, and the digital signature into the large language model, and outputting an analysis result for the target on-chain data.

[0130] In one embodiment, obtaining the semantic vector corresponding to the natural language question implemented when the processor executes the computer program includes: inputting the natural language question into the embedding function of the large language model, and outputting the semantic vector corresponding to the natural language question.

[0131] In one embodiment, the processor executes a computer program to obtain a target data field from at least one initial data field based on the multiple preset task types and the semantic vector, including: inputting the semantic vector and the multiple preset task types into a similarity function, and outputting the target task type corresponding to the natural language question; obtaining a mapping matrix between task types and data fields, and obtaining a weight value corresponding to the initial data field based on the target task type and the mapping matrix; for each initial data field, when the weight value corresponding to the initial data field is greater than a weight threshold, determining the initial data field as the target data field.

[0132] In one embodiment, the processor executes a computer program to obtain at least one target on-chain data from a blockchain network, including: obtaining at least one original on-chain data of the blockchain network; for each type of original on-chain data, when the corresponding data field of the original on-chain data includes at least one target data field, determining the original on-chain data as intermediate on-chain data; performing data cleaning on the intermediate on-chain data to obtain cleansed intermediate on-chain data; wherein the data cleaning includes removing invalid data, duplicate data, and noise data; and obtaining the target on-chain data based on the cleansed intermediate on-chain data.

[0133] In one embodiment, the processor executes a computer program to obtain the target chain data based on the intermediate chain data after data cleaning, including: obtaining context information of the intermediate chain data; supplementing the context information to the intermediate chain data after data cleaning to obtain the target chain data.

[0134] In one embodiment, the analysis result achieved when the processor executes the computer program is output by the large language model based on the size relationship between the first hash value and the second hash value, and the size relationship between the first hash value and the third hash value; the second hash value is calculated by the large language model based on the combined data, and the combined data is obtained by the large language model decrypting the encrypted data based on the private key of the large language model; the third hash value is obtained by the large language model based on the decrypted digital signature, and the decrypted digital signature is obtained by the large language model decrypting the digital signature based on the public key of the blockchain SIM card.

[0135] In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon. When executed by a processor, the computer program implements the following steps: obtaining multiple preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and multiple preset constraints; based on the multiple preset task types and the semantic vector, obtaining a target data field from the at least one initial data field, and for each preset constraint, obtaining a condition range corresponding to the semantic vector based on the constraint matrix; obtaining at least one target on-chain data from a blockchain network, encrypting combined data formed by the target data field, the condition range, and the target on-chain data based on a public key of a large language model to obtain encrypted data; generating a first hash value corresponding to the combined data based on a blockchain SIM card, and generating a digital signature corresponding to the first hash value based on a private key of the blockchain SIM card; obtaining user demand data from the natural language question, inputting the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value, and the digital signature into the large language model, and outputting an analysis result for the target on-chain data.

[0136] In one embodiment, obtaining the semantic vector corresponding to the natural language question implemented by the computer program when executed by the processor includes: inputting the natural language question into the embedding function of the large language model, and outputting the semantic vector corresponding to the natural language question.

[0137] In one embodiment, the computer program implemented when executed by the processor obtains a target data field from the at least one initial data field based on the multiple preset task types and the semantic vector, including: inputting the semantic vector and the multiple preset task types into a similarity function, and outputting the target task type corresponding to the natural language question; obtaining a mapping matrix between task types and data fields, and obtaining a weight value corresponding to the initial data field based on the target task type and the mapping matrix; for each initial data field, when the weight value corresponding to the initial data field is greater than a weight threshold, determining the initial data field as the target data field.

[0138] In one embodiment, the computer program, when executed by a processor, implements obtaining at least one target on-chain data from a blockchain network, including: obtaining at least one original on-chain data of the blockchain network; for each type of original on-chain data, when the corresponding data field of the original on-chain data includes at least one target data field, determining the original on-chain data as intermediate on-chain data; performing data cleaning on the intermediate on-chain data to obtain cleansed intermediate on-chain data; wherein the data cleaning includes removing invalid data, duplicate data, and noise data; and obtaining the target on-chain data based on the cleansed intermediate on-chain data.

[0139] In one embodiment, the computer program implemented by the processor when executed by the processor obtains the target chain data based on the intermediate chain data after the data cleaning, including: obtaining the context information of the intermediate chain data; supplementing the context information to the intermediate chain data after the data cleaning to obtain the target chain data.

[0140] In one embodiment, the analysis result achieved when the computer program is executed by the processor is output by the large language model based on the size relationship between the first hash value and the second hash value, and the size relationship between the first hash value and the third hash value; the second hash value is calculated by the large language model based on the combined data, and the combined data is obtained by the large language model decrypting the encrypted data based on the private key of the large language model; the third hash value is obtained by the large language model based on the decrypted digital signature, and the decrypted digital signature is obtained by the large language model decrypting the digital signature based on the public key of the blockchain SIM card.

[0141] In one embodiment, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the following steps: obtaining multiple preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and multiple preset constraints; obtaining a target data field from the at least one initial data field based on the multiple preset task types and the semantic vector, and obtaining, for each preset constraint, a condition range corresponding to the semantic vector based on the constraint matrix; obtaining at least one target on-chain data from a blockchain network, encrypting combined data formed by the target data field, the condition range, and the target on-chain data based on a public key of a large language model to obtain encrypted data; generating a first hash value corresponding to the combined data based on a blockchain SIM card, and generating a digital signature corresponding to the first hash value based on a private key of the blockchain SIM card; obtaining user demand data from the natural language question, inputting the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value, and the digital signature into the large language model, and outputting an analysis result for the target on-chain data.

[0142] In one embodiment, obtaining the semantic vector corresponding to the natural language question implemented by the computer program when executed by the processor includes: inputting the natural language question into the embedding function of the large language model, and outputting the semantic vector corresponding to the natural language question.

[0143] In one embodiment, the computer program implemented when executed by the processor obtains a target data field from the at least one initial data field based on the multiple preset task types and the semantic vector, including: inputting the semantic vector and the multiple preset task types into a similarity function, and outputting the target task type corresponding to the natural language question; obtaining a mapping matrix between task types and data fields, and obtaining a weight value corresponding to the initial data field based on the target task type and the mapping matrix; for each initial data field, when the weight value corresponding to the initial data field is greater than a weight threshold, determining the initial data field as the target data field.

[0144] In one embodiment, the computer program, when executed by a processor, implements obtaining at least one target on-chain data from a blockchain network, including: obtaining at least one original on-chain data of the blockchain network; for each type of original on-chain data, when the corresponding data field of the original on-chain data includes at least one target data field, determining the original on-chain data as intermediate on-chain data; performing data cleaning on the intermediate on-chain data to obtain cleansed intermediate on-chain data; wherein the data cleaning includes removing invalid data, duplicate data, and noise data; and obtaining the target on-chain data based on the cleansed intermediate on-chain data.

[0145] In one embodiment, the computer program implemented by the processor when executed by the processor obtains the target chain data based on the intermediate chain data after the data cleaning, including: obtaining the context information of the intermediate chain data; supplementing the context information to the intermediate chain data after the data cleaning to obtain the target chain data.

[0146] In one embodiment, the analysis result achieved when the computer program is executed by the processor is output by the large language model based on the size relationship between the first hash value and the second hash value, and the size relationship between the first hash value and the third hash value; the second hash value is calculated by the large language model based on the combined data, and the combined data is obtained by the large language model decrypting the encrypted data based on the private key of the large language model; the third hash value is obtained by the large language model based on the decrypted digital signature, and the decrypted digital signature is obtained by the large language model decrypting the digital signature based on the public key of the blockchain SIM card.

[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0148] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0149] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0150] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for analyzing on-chain data, characterized in that: The method comprises: Acquire multiple preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and multiple preset constraints; Based on the multiple preset task types and the semantic vectors, a target data field is obtained from the at least one initial data field, and for each preset constraint condition, a condition range corresponding to the semantic vector is obtained based on the constraint condition matrix; Acquire at least one target on-chain data from the blockchain network, and encrypt the combined data formed by the target data field, the condition range, and the target on-chain data based on the public key of the large language model to obtain encrypted data; Generate a first hash value corresponding to the combined data based on the blockchain SIM card, and generate a digital signature corresponding to the first hash value based on the private key of the blockchain SIM card; Obtain user demand data from the natural language question, input the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value and the digital signature into the large language model, and output the analysis results for the data on the target chain.

2. The method according to claim 1, characterized in that The obtaining of a semantic vector corresponding to the natural language question includes: The natural language question is input into the embedding function of the large language model, and a semantic vector corresponding to the natural language question is output.

3. The method according to claim 1, characterized in that The acquiring a target data field from the at least one initial data field based on the multiple preset task types and the semantic vector includes: Inputting the semantic vector and the plurality of preset task types into a similarity function, and outputting a target task type corresponding to the natural language question; Obtaining a mapping matrix between task types and data fields, and obtaining a weight value corresponding to the initial data field based on the target task type and the mapping matrix; For each initial data field, if a corresponding weight value of the initial data field is greater than a weight threshold, the initial data field is determined as the target data field.

4. The method according to claim 1, wherein The step of obtaining at least one target on-chain data from the blockchain network includes: Obtain at least one original on-chain data of the blockchain network; For each type of original on-chain data, if the corresponding data field of the original on-chain data includes at least one target data field, determine the original on-chain data as intermediate on-chain data; Cleaning the data on the intermediate chain to obtain cleaned data on the intermediate chain; wherein the data cleaning includes removing invalid data, duplicate data, and noise data; The target chain data is obtained based on the intermediate chain data after the data cleaning.

5. The method according to claim 4, characterized in that The obtaining of the target chain data based on the intermediate chain data after data cleaning includes: Obtaining context information of the data on the intermediate chain; The context information is added to the intermediate chain data after the data cleaning to obtain the target chain data.

6. The method according to claim 1, wherein The analysis result is output by the large language model based on the magnitude relationship between the first hash value and the second hash value, and the magnitude relationship between the first hash value and the third hash value; the second hash value is calculated by the large language model based on the combined data, and the combined data is obtained by the large language model decrypting the encrypted data using the private key of the large language model; The third hash value is obtained by the large language model based on the decrypted digital signature, and the decrypted digital signature is obtained by the large language model after decrypting the digital signature based on the public key of the blockchain SIM card.

7. An on-chain data analysis device, characterized in that: The device comprises: A first acquisition module is configured to acquire a plurality of preset task types, a natural language question input by a user, at least one initial data field corresponding to the natural language question, a semantic vector corresponding to the natural language question, a constraint matrix, and a plurality of preset constraints; a second acquisition module, configured to acquire a target data field from the at least one initial data field based on the multiple preset task types and the semantic vector, and acquire, for each preset constraint condition, a condition range corresponding to the semantic vector based on the constraint condition matrix; A third acquisition module is configured to acquire at least one target on-chain data from the blockchain network, and encrypt the combined data formed by the target data field, the conditional range, and the target on-chain data based on the public key of the large language model to obtain encrypted data; A generation module, configured to generate a first hash value corresponding to the combined data based on the blockchain SIM card, and generate a digital signature corresponding to the first hash value based on the private key of the blockchain SIM card; The fourth acquisition module is used to obtain the user's demand data from the natural language question, input the demand data, the public key of the blockchain SIM card, the encrypted data, the first hash value and the digital signature into the large language model, and output the analysis results for the data on the target chain.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Contract management method based on block chain and combined key and related equipment

    CN115085934A

  • User psychological portraying system and method based on knowledge graph and large language model

    CN116821287A