Intelligent contract execution method and system based on big data analysis engine

By applying a big data analysis engine in the execution of intelligent contracts, real -time verification transaction data compliance and identification of abnormal circulation of funds have been solved, and the problem of uncomfortable implementation efficiency of smart contracts has been solved, and more efficient and secure transaction processing has been achieved.

CN119359442AInactive Publication Date: 2025-01-24CHENGDU YOUKA DIGITAL INFORMATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411896582.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-01-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The execution efficiency of smart contracts is not adapted, resulting in the mismatch between the processing requirements and the current processing efficiency. How to improve efficiency while ensuring transaction security has become an urgent problem.

Method used

Use the big data analysis engine to obtain transaction data from the blockchain network in real time, extract both parties and contract terms of the transaction, analyze it into a ternary expression, check the breach of contract and the transfer of funds abnormal, calculate the transaction risk index and output the response strategy.

Benefits of technology

The real -time compliance verification during the execution of the smart contract was realized, the capital abnormalities were discovered in a timely manner, and measures were taken to improve the implementation efficiency, reducing the risk of breach of contract, and enhanced transaction security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359442A_ABST
    Figure CN119359442A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent contract execution method and system based on a big data analysis engine, and relates to the technical field of intelligent contract optimization, and the method comprises the steps that the big data analysis engine obtains structured transaction data from a block chain network in real time; extracting both transaction parties in the transaction data and terms in smart contracts signed by the both transaction parties, and analyzing the terms into ternary expressions; using the analyzed ternary expression to check whether transaction data generated by the two transaction parties have default behaviors or not; identifying whether fund circulation of the two transaction parties is abnormal or not based on the historical transaction data of the two transaction parties; and calculating a risk index of the transaction based on a verification result of the default behavior and an identification result of fund circulation, and outputting a coping strategy according to the risk index and executing the coping strategy. While the execution efficiency of the intelligent contract is improved, the default risk and loss can be reduced, and the security of the transaction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart contract optimization technology, and in particular to a smart contract execution method and system based on a big data analysis engine. Background Art

[0002] Smart contracts are digital agreements signed and stored on blockchain networks that can be automatically executed when the terms and conditions of the contract are met. They use blockchain's distributed ledger technology and smart contract programming languages ​​(such as Solidity) to embed contract logic into the code, thereby achieving automation and decentralization of transactions. With the widespread application of smart contracts and the increasing number of users, the execution of smart contracts has also ushered in a bottleneck, that is, the mismatch between the increasing processing demand and the current processing efficiency. How to ensure transaction security and improve efficiency has become a problem that people in this field need to solve urgently. Big data analysis engines have significant advantages in processing large-scale and complex data sets. If big data analysis engines can be applied to the execution of smart contracts, the problem of mismatch in processing efficiency can be easily solved. Summary of the invention

[0003] The present invention provides a smart contract execution method based on a big data analysis engine, comprising: Step 1: The big data analysis engine obtains structured transaction data from the blockchain network in real time; Step 2: Extract the transaction parties from the transaction data, as well as the terms in the smart contract signed by the transaction parties, and parse them into ternary expressions; Step 3: Use the parsed ternary expression to verify whether the transaction data generated by both parties to the transaction has any breach of contract; Step 4: Identify whether there is any abnormality in the capital flow of both parties based on their historical transaction data; Step 5. Based on the verification results of the default behavior and the identification results of the capital flow, calculate the risk index of this transaction, output the response strategy according to the risk index and execute it.

[0004] As described above, a smart contract execution method based on a big data analysis engine is described, wherein the transaction parties in the transaction data and the clauses in the smart contract signed by the transaction parties are extracted and parsed into a ternary expression, which is specifically divided into the following sub-steps: Extract the restrictions and conditions of the terms in the smart contract signed by both parties to the transaction; Take the restriction item as the input parameter of the ternary expression, determine the value range of the restriction item according to its restriction condition, and define the judgment body of the ternary expression according to the value range; According to the different results pointed to by different values ​​of the restriction items, set the judgment return result for the ternary expression; Annotate the resulting ternary expression with restrictions.

[0005] As described above, a smart contract execution method based on a big data analysis engine is used to verify whether the transaction data generated by the two parties to the transaction has a breach of contract, which is specifically divided into the following sub-steps: Locate the corresponding field in the transaction data according to the annotated value of the ternary expression, and pass the field value into the ternary expression to obtain the return result; The transaction data fields whose returned results are in default status are stored in the default behavior verification result set.

[0006] As described above, a smart contract execution method based on a big data analysis engine is used to identify whether there is an abnormality in the capital flow of both parties based on the historical transaction data of both parties. The method is specifically divided into the following sub-steps: Calculate the capital flow index of the capital party to be identified within the long identification period; Calculate the capital flow index of the capital party to be identified in the recent identification period; If the absolute difference between the two calculation results of the capital flow index is greater than the abnormal identification threshold, the absolute difference is returned, otherwise zero is returned; The identification results when both parties of the transaction are the parties to be identified are stored in the fund flow identification result set.

[0007] As described above, a smart contract execution method based on a big data analysis engine is described, wherein the risk index of the transaction is calculated based on the verification results of the default behavior and the identification results of the capital flow, and the response strategy is output and executed according to the risk index, which is specifically divided into the following sub-steps: Preset a mapping table between risk index and response strategy; Substitute the data in the default behavior verification result set and the capital flow identification result set into the risk index calculation formula to obtain the risk index of this transaction; Query the corresponding response strategy for the risk index of this transaction from the mapping table and execute it.

[0008] The present invention also provides a smart contract execution system based on a big data analysis engine, comprising: Transaction data acquisition module, used to obtain structured transaction data from the blockchain network in real time; Smart contract parsing module, used to extract the transaction parties from the transaction data, as well as the terms and conditions of the smart contract signed by the transaction parties, and parse them into ternary expressions; The breach of contract behavior verification module is used to use the parsed ternary expression to verify whether the transaction data generated by the transaction parties contain breach of contract behavior; The abnormal fund flow identification module is used to identify whether there is an abnormality in the fund flow of the two parties to the transaction based on the historical transaction data of the two parties; The transaction risk control module is used to calculate the risk index of this transaction based on the verification results of default behavior and the identification results of capital flow, and output and execute the response strategy according to the risk index.

[0009] The beneficial effects achieved by the present invention are as follows: During the execution of smart contracts, the big data analysis engine can verify the compliance of transaction data in real time, promptly discover abnormal capital flows and take corresponding measures, thereby improving the efficiency of smart contract execution while reducing the risk of default and losses and improving the security of transactions. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0011] Figure 1 This is a flow chart of a smart contract execution method based on a big data analysis engine provided in Example 1 of the present application; Figure 2 This is a schematic diagram of a smart contract execution system based on a big data analysis engine provided in Example 2 of the present application. DETAILED DESCRIPTION

[0012] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0013] Embodiment 1 like Figure 1 As shown, the first embodiment of the present application provides a smart contract execution method based on a big data analysis engine, including: Step S10: The big data analysis engine obtains structured transaction data from the blockchain network in real time; By connecting to the transaction data acquisition API in the blockchain network, you can obtain historical transaction data and real-time transaction data in the network, including fields such as transaction time, transaction amount, transaction parties, and transaction type. The historical transaction data is stored in the persistence layer and read when needed. The data in the persistence layer is updated once a day, and the real-time transaction data is directly processed in the next step in a stream processing manner.

[0014] Step S20: extracting the transaction parties from the transaction data and the terms in the smart contract signed by the transaction parties, and parsing them into a ternary expression; Ternary expressions can well describe the restrictions in the contract and have fast execution speed. They can be used to quickly verify the compliance of transaction data, thereby improving the real-time performance of compliance verification. The specific parsing process is divided into the following sub-steps: Step S21: extracting the restrictions and conditions of various clauses in the smart contract signed by both parties to the transaction; If the smart contract is structured data, the restrictions and conditions of each clause can be directly extracted based on the field value; if the smart contract is unstructured data, regular expressions are used to extract the restrictions and conditions in each clause.

[0015] Step S22: taking the restriction item as an input parameter of the ternary expression, determining the value range of the restriction item according to its restriction condition, and defining the judgment body of the ternary expression according to the value range; For example, if there is a restriction item called "delivery date" and the restriction condition is "before December 30, 2024", then the delivery date is used as the input parameter of the ternary expression, denoted as a, and its value range is less than or equal to December 1, 2024. Then the judgment body of the ternary expression is defined as "a<=date(2024.12.30)".

[0016] Step S23: setting a judgment return result for the ternary expression according to different results pointed to by different values ​​of the restriction item; Taking "delivery date" as an example, if the delivery time is before December 30, 2024, it is recorded in the contract, that is, the compliance status, recorded as 1. Then the delivery date after December 30, 2024 should be regarded as a breach of contract status, recorded as 0. Then the complete ternary expression should be expressed as "a<=date(2024.12.30)?1:0".

[0017] Step S24: annotating the generated ternary expression with restriction items; The generated ternary expression is annotated with restriction items because the restriction items are actually fields of transaction data. In subsequent verification, the corresponding ternary expression can be quickly located according to the fields of transaction data.

[0018] Step S30: Use the parsed ternary expression to verify whether the transaction data generated by the transaction parties contain any breach of contract; The parsing of expressions and the verification of transaction data also adopt the stream processing method, that is, parsing and verification at the same time. The specific verification process is divided into the following sub-steps: Step S31: locate the corresponding field in the transaction data according to the annotated value of the ternary expression, and pass the field value into the ternary expression to obtain the return result; This process can realize the synchronous verification of multiple transaction data fields by opening multiple threads to maximize the verification rate.

[0019] Step S32: storing the transaction data fields whose returned results are in default status into the default behavior verification result set.

[0020] Step S40: Identify whether there is any abnormality in the capital flow between the two parties based on the historical transaction data of the two parties; In the actual smart contract execution environment, it is necessary not only to verify whether the transaction violates the terms clearly given in the contract, but also to combine big data analysis technology to identify hidden transaction anomalies. Specifically: Step S41: Calculate the capital flow index of the funding party to be identified within the long identification period; The far identification cycle refers to a preset identification cycle far away from the current transaction. In this embodiment, one identification cycle is three months. The far identification cycle must be at least one identification cycle away from the current transaction. The historical transaction data within the far identification cycle is brought into the calculation formula of the capital flow index: The capital flow index of the capital party to be identified in the long identification period is obtained, where S is the calculated capital flow index, is the total amount of fund transactions of the fund party to be identified on the i-th day in the far identification cycle, i ranges from 1 to N, N is the total number of days in the far identification cycle, , They represent the total amount of capital transactions of the capital party to be identified on the rth rising day and the r+1th rising day in the far identification period. , They respectively represent the total amount of capital transactions on the fth falling day and the f+1th falling day of the capital party to be identified in the far identification period, r takes values ​​from 1 to R-1, R is the total number of rising days of the capital party to be identified in the far identification period, and f takes values ​​from 1 to F-1, F is the total number of falling days of the capital party to be identified in the far identification period.

[0021] Step S42: Calculate the capital flow index of the funding party to be identified in the recent identification period; The recent identification cycle refers to an identification cycle that includes this transaction. By substituting the historical transaction data within the recent identification cycle into the calculation formula of the capital circulation index, the capital circulation index of the capital party to be identified within the recent identification cycle can be obtained.

[0022] Step S43: if the absolute difference between the two calculation results of the capital flow index is greater than the abnormality identification threshold, the absolute difference is returned, otherwise zero is returned; In the anomaly identification of capital flow, the accuracy of the threshold is directly related to the accuracy of the identification result. In order to obtain an accurate anomaly identification threshold, it is necessary to bring the historical transaction data in the last three identification cycles into the formula: To calculate the identification threshold T that meets the current funding party, It indicates the total amount of fund transactions of the fund party to be identified on the jth day in the last three identification cycles. j ranges from 1 to M, where M is the total number of days in the last three identification cycles. The maximum value of the total amount of fund transactions on the day within the last three identification cycles. The minimum value of the total amount of fund transactions on the day within the last three identification cycles. is the frequency of change in fund transaction volume in the last three identification periods, , , They are the resolution coefficients of average transaction volume, transaction fluctuation frequency and transaction fluctuation amplitude in identifying abnormal fund flow.

[0023] Step S44: storing the identification results when both transaction parties are respectively used as the funding parties to be identified in the fund flow identification result set.

[0024] Step S50: Based on the verification result of the default behavior and the identification result of the capital flow, the risk index of the current transaction is calculated, and the response strategy is output and executed according to the risk index; The risk index is used to measure the compliance of the current transaction. The big data analysis engine will execute corresponding response strategies for this transaction according to the level of the risk index to achieve real-time processing of illegal transactions. Specifically: Step S51: presetting a mapping table of risk index and response strategy; The mapping table between risk index and response strategy is a system preset table. Users can make corresponding modifications according to actual conditions. It includes at least two parts: the risk index value range and the specific response strategy. The specific response strategy is a series of packaged callable APIs, including: API to notify both parties of the successful transaction, API to suspend the transaction, API to prompt both parties to correct the transaction data, API to freeze the transaction function of the trading account, etc.

[0025] Step S52: Substitute the data in the default behavior verification result set and the capital flow identification result set into the risk index calculation formula to obtain the risk index of this transaction; The calculation formula of risk index H is expressed as: ,in The kth transaction data field in the default behavior verification result set, For Field The risk impact coefficient of default, The first Item data, For data The abnormal identification threshold, v is the risk impact coefficient of fund abnormality, k ranges from 1 to W, W is the length of the default behavior verification result set, The value ranges from 1 to L, where L is the length of the fund flow identification result set.

[0026] Step S53: Query the corresponding response strategy of the transaction risk index from the mapping table and execute it; The API defined in the response strategy can be called directly on the big data analysis engine, but the specific program is still executed on the application (that is, the application subject of the smart contract).

[0027] Embodiment 2 like Figure 2 As shown, the second embodiment of the present application provides a smart contract execution system based on a big data analysis engine, including: a transaction data acquisition module 21, a smart contract parsing module 22, a default behavior verification module 23, a fund flow abnormality identification module 24, and a transaction risk control module 25; The transaction data acquisition module 21 is used to acquire structured transaction data from the blockchain network in real time; By connecting to the transaction data acquisition API in the blockchain network, you can obtain historical transaction data and real-time transaction data in the network, including fields such as transaction time, transaction amount, transaction parties, and transaction type. The historical transaction data is stored in the persistence layer and read when needed. The data in the persistence layer is updated once a day, and the real-time transaction data is directly processed in the next step in a stream processing manner.

[0028] The smart contract parsing module 22 is used to extract the transaction parties in the transaction data, as well as the terms and conditions in the smart contract signed by the transaction parties, and parse them into a ternary expression; including: a restriction item and restriction condition extraction submodule, a ternary expression judgment body definition submodule, and a ternary expression return result setting submodule; 1. The restriction and restriction condition extraction submodule is used to extract the restriction and restriction conditions of various clauses in the smart contract signed by both parties to the transaction; If the smart contract is structured data, the restrictions and conditions of each clause can be directly extracted based on the field value; if the smart contract is unstructured data, regular expressions are used to extract the restrictions and conditions in each clause.

[0029] 2. The ternary expression judgment body definition submodule is used to take the restriction item as the input parameter of the ternary expression, determine the value range of the restriction item according to its restriction condition, and define the judgment body of the ternary expression according to the value range; For example, if there is a restriction item called "delivery date" and the restriction condition is "before December 30, 2024", then the delivery date is used as the input parameter of the ternary expression, denoted as a, and its value range is less than or equal to December 1, 2024. Then the judgment body of the ternary expression is defined as "a<=date(2024.12.30)".

[0030] 3. The ternary expression return result setting submodule is used to set the judgment return result for the ternary expression according to the different results pointed to by different values ​​of the restriction items; Taking "delivery date" as an example, if the delivery time is before December 30, 2024, it is recorded in the contract, that is, the compliance status, recorded as 1. Then the delivery date after December 30, 2024 should be regarded as a breach of contract status, recorded as 0. Then the complete ternary expression should be expressed as "a<=date(2024.12.30)?1:0".

[0031] The generated ternary expression is annotated with restriction items. Because the restriction items are actually fields of transaction data, the corresponding ternary expression can be quickly located according to the fields of transaction data in subsequent verification.

[0032] The breach of contract behavior verification module 23 is used to use the parsed ternary expression to verify whether the transaction data generated by the transaction parties have breach of contract behavior; including: a verification field positioning submodule and a verification result storage submodule; 1. The verification field positioning submodule is used to locate the corresponding field in the transaction data according to the annotation value of the ternary expression, and pass the field value into the ternary expression to obtain the return result; This process can realize the synchronous verification of multiple transaction data fields by opening multiple threads to maximize the verification rate.

[0033] 2. The verification result storage submodule is used to store the transaction data fields whose returned results are in default status into the default behavior verification result set.

[0034] The abnormal fund flow identification module 24 is used to identify whether there is abnormal fund flow between the two parties based on the historical transaction data of the two parties; it includes: a fund flow index calculation submodule and a fund flow index comparison submodule; 1. The capital flow index calculation submodule is used to calculate the capital flow index of the capital party to be identified in the long identification cycle and the short identification cycle respectively; The far identification cycle refers to a preset identification cycle far away from the current transaction. In this embodiment, one identification cycle is three months. The far identification cycle must be at least one identification cycle away from the current transaction. The historical transaction data within the far identification cycle is brought into the calculation formula of the capital flow index: The capital flow index of the capital party to be identified in the long identification period is obtained, where S is the calculated capital flow index, is the total amount of fund transactions of the fund party to be identified on the i-th day in the far identification cycle, i ranges from 1 to N, N is the total number of days in the far identification cycle, , They represent the total amount of capital transactions of the capital party to be identified on the rth rising day and the r+1th rising day in the far identification period. , They respectively represent the total amount of capital transactions on the fth falling day and the f+1th falling day of the capital party to be identified in the far identification period, r takes values ​​from 1 to R-1, R is the total number of rising days of the capital party to be identified in the far identification period, and f takes values ​​from 1 to F-1, F is the total number of falling days of the capital party to be identified in the far identification period.

[0035] The recent identification cycle refers to an identification cycle that includes this transaction. By substituting the historical transaction data within the recent identification cycle into the calculation formula of the capital circulation index, the capital circulation index of the capital party to be identified within the recent identification cycle can be obtained.

[0036] 2. The capital flow index comparison submodule is used to compare whether the absolute difference between the two capital flow index calculation results is greater than the abnormal identification threshold. If so, the absolute difference is returned, otherwise zero is returned; In the anomaly identification of capital flow, the accuracy of the threshold is directly related to the accuracy of the identification result. In order to obtain an accurate anomaly identification threshold, it is necessary to bring the historical transaction data in the last three identification cycles into the formula: To calculate the identification threshold T that meets the current funding party, It indicates the total amount of fund transactions of the fund party to be identified on the jth day in the last three identification cycles. j ranges from 1 to M, where M is the total number of days in the last three identification cycles. The maximum value of the total amount of fund transactions on the day within the last three identification cycles. The minimum value of the total amount of fund transactions on the day within the last three identification cycles. is the frequency of change in fund transaction volume in the last three identification periods, , , They are the resolution coefficients of average transaction volume, transaction fluctuation frequency and transaction fluctuation amplitude in identifying abnormal fund flow.

[0037] The comparison result is the result of the abnormal fund flow identification, and the identification results when the two parties of the transaction are respectively used as the fund parties to be identified are stored in the fund flow identification result set.

[0038] The transaction risk control module 25 is used to calculate the risk index of the transaction based on the verification results of the default behavior and the identification results of the capital flow, and output and execute the response strategy according to the risk index; it includes: a risk strategy mapping table preset submodule, a risk index calculation submodule, and a response strategy execution submodule; 1. The risk strategy mapping table preset submodule is used to preset a mapping table of risk index and response strategy; The mapping table between risk index and response strategy is a system preset table. Users can make corresponding modifications according to actual conditions. It includes at least two parts: the risk index value range and the specific response strategy. The specific response strategy is a series of packaged callable APIs, including: API to notify both parties of the successful transaction, API to suspend the transaction, API to prompt both parties to correct the transaction data, API to freeze the transaction function of the trading account, etc.

[0039] 2. The risk index calculation submodule is used to bring the data in the default behavior verification result set and the capital flow identification result set into the risk index calculation formula to obtain the risk index of this transaction; The calculation formula of risk index H is expressed as: ,in The kth transaction data field in the default behavior verification result set, For Field The risk impact coefficient of default, The first Item data, For data The abnormal identification threshold, v is the risk impact coefficient of fund abnormality, k ranges from 1 to W, W is the length of the default behavior verification result set, The value ranges from 1 to L, where L is the length of the fund flow identification result set.

[0040] 3. The response strategy execution submodule is used to query the response strategy corresponding to the risk index of this transaction from the mapping table and execute it; The API defined in the response strategy can be called directly on the big data analysis engine, but the specific program is still executed on the application (that is, the application subject of the smart contract).

[0041] Corresponding to the above embodiment, an embodiment of the present invention provides a computer storage medium, including: at least one memory and at least one processor; The memory is used to store one or more program instructions; A processor is used to run one or more program instructions to execute a smart contract execution method based on a big data analysis engine.

[0042] Corresponding to the above embodiments, an embodiment of the present invention provides a computer-readable storage medium, which contains one or more program instructions, and the one or more program instructions are used by a processor to execute a smart contract execution method based on a big data analysis engine.

[0043] The embodiments disclosed in the present invention provide a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed on a computer, the computer executes the above-mentioned smart contract execution method based on a big data analysis engine.

[0044] In the embodiment of the present invention, the processor may be an integrated circuit chip having the ability to process signals. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0045] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.

[0046] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0047] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.

[0048] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus DRAM (DRRAM).

[0049] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0050] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0051] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A smart contract execution method based on a big data analysis engine, characterized in that: include: Step 1: The big data analysis engine obtains structured transaction data from the blockchain network in real time; Step 2: Extract the two parties in the transaction data and the terms in the smart contract signed by the two parties, and parse them into a ternary expression; Step 3: Use the parsed ternary expression to verify whether the transaction data generated by both parties to the transaction has any breach of contract; Step 4: Identify whether there is any abnormality in the capital flow of both parties based on their historical transaction data; Step 5. Based on the verification results of the default behavior and the identification results of the capital flow, calculate the risk index of this transaction, output the response strategy according to the risk index and execute it.

2. According to claim 1, a smart contract execution method based on a big data analysis engine is characterized in that: Extract the two parties in the transaction data and the terms in the smart contract signed by the two parties, and parse them into a ternary expression, which is divided into the following sub-steps: Extract the restrictions and conditions of the terms in the smart contract signed by both parties to the transaction; Take the restriction item as the input parameter of the ternary expression, determine the value range of the restriction item according to its restriction condition, and define the judgment body of the ternary expression according to the value range; According to the different results pointed to by different values ​​of the restriction items, set the judgment return result for the ternary expression; Annotate the resulting ternary expression with restrictions.

3. According to claim 1, a smart contract execution method based on a big data analysis engine is characterized in that: Use the parsed ternary expression to verify whether the transaction data generated by both parties has any breach of contract, which is divided into the following sub-steps: Locate the corresponding field in the transaction data according to the annotated value of the ternary expression, and pass the field value into the ternary expression to obtain the return result; The transaction data fields whose returned results are in default status are stored in the default behavior verification result set.

4. According to claim 1, a smart contract execution method based on a big data analysis engine is characterized in that: Based on the historical transaction data of both parties, it is determined whether there is any abnormality in the capital flow of both parties. The specific steps are as follows: Calculate the capital flow index of the capital party to be identified within the long identification period; Calculate the capital flow index of the capital party to be identified in the recent identification period; If the absolute difference between the two calculation results of the capital flow index is greater than the abnormal identification threshold, the absolute difference is returned, otherwise zero is returned; The identification results when both parties of the transaction are the parties to be identified are stored in the fund flow identification result set.

5. According to claim 1, a smart contract execution method based on a big data analysis engine is characterized in that: Based on the verification results of the default behavior and the identification results of the capital flow, the risk index of this transaction is calculated, and the response strategy is output and executed according to the risk index. It is divided into the following sub-steps: Preset a mapping table between risk index and response strategy; Substitute the data in the default behavior verification result set and the capital flow identification result set into the risk index calculation formula to obtain the risk index of this transaction; Query the corresponding response strategy for the risk index of this transaction from the mapping table and execute it.

6. A smart contract execution system based on a big data analysis engine, characterized in that: include: Transaction data acquisition module, used to obtain structured transaction data from the blockchain network in real time; Smart contract parsing module, used to extract the transaction parties from the transaction data, as well as the terms and conditions of the smart contract signed by the transaction parties, and parse them into ternary expressions; The breach of contract behavior verification module is used to use the parsed ternary expression to verify whether the transaction data generated by the transaction parties contain breach of contract behavior; The abnormal fund flow identification module is used to identify whether there is an abnormality in the fund flow of the two parties to the transaction based on the historical transaction data of the two parties; The transaction risk control module is used to calculate the risk index of this transaction based on the verification results of default behavior and the identification results of capital flow, and output and execute the response strategy according to the risk index.

7. The smart contract execution system based on big data analysis engine according to claim 6 is characterized in that: The smart contract parsing module specifically includes: The restriction and restriction condition extraction submodule is used to extract the restriction and restriction conditions of various clauses in the smart contract signed by the two parties to the transaction; The ternary expression judgment body definition submodule is used to take the restriction item as the input parameter of the ternary expression, determine the value range of the restriction item according to its restriction condition, and define the judgment body of the ternary expression according to the value range; The ternary expression return result setting submodule is used to set the judgment return result for the ternary expression according to the different results pointed to by different values ​​of the restriction item.

8. According to claim 6, a smart contract execution system based on a big data analysis engine is characterized in that: The breach behavior verification module specifically includes: The verification field positioning submodule is used to locate the corresponding field in the transaction data according to the annotation value of the ternary expression, and pass the field value into the ternary expression to obtain the return result; The verification result storage submodule is used to store the transaction data fields whose returned results are in default status into the default behavior verification result set.

9. The smart contract execution system based on big data analysis engine according to claim 6 is characterized in that: The abnormal funds flow identification module specifically includes: The capital flow index calculation submodule is used to calculate the capital flow index of the capital party to be identified in the long identification period and the short identification period respectively; The capital flow index comparison submodule is used to compare whether the absolute difference between two capital flow index calculation results is greater than the abnormal identification threshold. If so, the absolute difference is returned, otherwise zero is returned.

10. A computer storage medium, characterized in that: include: at least one memory and at least one processor; A memory for storing one or more program instructions; A processor, used to run one or more program instructions to execute a smart contract execution method based on a big data analysis engine as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Contract execution method and device based on block chain, equipment and storage medium

    CN112070503A

  • Secure transaction execution method based on smart contract

    CN113222606A

  • On-chain traceability method for data and data operation algorithm

    CN113641992A

  • Smart contract execution security control method and device based on block chain

    CN116257890A

  • Intelligent contract fuzzy testing method and device based on symbolic execution

    CN117472740A