A supervision method and supervision digital twin model for alliance chain
By using digital twin technology in the alliance chain to establish a state transfer model diagram and abstract transactions, accounts and node behaviors, the existing alliance chain supervision solution solves the problems of low efficiency and interference with the operating system when processing incremental data, and achieves efficient and secure alliance chain supervision.
Patent Information
- Application Number
- CN202111324023.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2041-11-09
AI Technical Summary
The existing alliance chain supervision scheme is inefficient when processing incremental data and has the risk of interfering with the operating alliance chain system, making it difficult to effectively supervise the nodes and transaction behavior of the alliance chain.
Using a blockchain supervision mapping model based on digital twins, a state transfer model graph is established, transactions, account transaction behaviors and node behaviors are abstracted into nodes and edges on the graph, and dynamic supervision of transactions, accounts and nodes is realized.
It improves the efficiency and accuracy of alliance chain supervision, reduces the risk of interference to the operational alliance chain system, and achieves safe and efficient supervision of alliance chains.
Smart Images

Figure CN114036577B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a blockchain supervision mapping model based on digital twins, and more specifically to a digital twin mapping model for alliance chain supervision and a method for implementing supervision. Background Art
[0002] Since the advent of Bitcoin, blockchain technology has been developing continuously and has been more and more widely used in real life. The "13th Five-Year National Informatization Plan" issued by the State Council also emphasized the need to strengthen the innovation, testing and application of blockchain and other technologies in order to seize the leading position in the new generation of information technology. In the application scenario of enterprise collaboration, alliance chain technology has also developed in full swing.
[0003] In traditional blockchain systems, nodes refer to servers that have computing resources, storage capabilities, and can connect to the network. Any node can be connected to the blockchain system network to submit transactions, compete for bookkeeping rights, package blocks, and synchronize blocks. Generally speaking, there are a large number of nodes, including some malicious nodes, but the proportion of malicious nodes to the total number of nodes in the blockchain system is usually less than a fixed value (1 / 2 or 1 / 3). The security of the blockchain system is guaranteed through such basic assumptions and a series of mechanism designs. The most important thing for a blockchain system is to reach a consensus and ensure that the content of the blockchain stored locally by the node is consistent as much as possible. However, due to the large number of nodes and the existence of malicious nodes, it is often costly to reach a consensus in a traditional blockchain system, and consortium chain technology came into being.
[0004] Consortium chain technology focuses on application scenarios where several companies or units cooperate to share some data and business. Participating companies usually maintain some nodes that undertake different tasks in the consortium chain system, and achieve specific business data sharing by reaching consensus in the consortium chain system. Compared with traditional blockchain systems, the number of nodes in the consortium chain system is much smaller. Generally, the number of nodes in the consortium chain system is usually in the single digits, or more than a dozen nodes. Nodes joining the consortium chain also have certain identity verification mechanisms.
[0005] However, the inventors of this application have found that at the same time, there are also a series of problems caused by the irregular management and use of the alliance chain. At present, the consensus nodes in the common alliance chain system are all verifiable, and the initiation of transactions also requires the member service provider to provide permissions. The strong identity permission of the alliance chain brings the advantage of interface standardization, but at the same time it often conflicts with the purpose of privacy protection; and due to the incremental characteristics of blockchain data itself, how to efficiently handle incremental data for the supervision model of the alliance chain is also a problem that needs to be considered. In the existing alliance chain supervision scheme, most of them adopt the method of first collecting and preprocessing data, and then analyzing the relevant data. However, the large data volume of the blockchain will result in a high time and space complexity required for preprocessing, and the overall operating efficiency is low; at the same time, this supervision method also has the risk of interfering with the running alliance chain system and causing security problems caused by the regulator.
[0006] Therefore, establishing a secure and efficient data mapping model for alliance chains to achieve effective supervision is critical to establishing a security protection system. Summary of the invention
[0007] The technical problem to be solved by the present invention is to address the shortcomings of the existing technology and provide a consortium chain data mapping model based on digital twins. Different supervision algorithms are run on the established data model according to different needs to achieve more targeted and efficient supervision goals.
[0008] The present application provides a supervision method for a consortium chain, which is characterized by: a supervision server applied to a consortium chain supervision system, comprising:
[0009] Transaction supervision, by establishing a state transition model diagram for certain accounts in a certain period of time, creating a mapping from transactions that need to be supervised to circular nodes in the model, and transforming the supervision of transactions into the supervision of transaction nodes in the model;
[0010] Supervision of account transaction behavior: The transaction behavior of an account is abstracted into a transaction node on the state transfer map. The account atomic state node points to the transaction node, indicating that the account has participated in the transaction. The transaction node points to the account atomic state node with a later timestamp, indicating the state of the account after the transaction is executed. All specific transaction information is recorded on the corresponding transaction node in the state transfer model diagram.
[0011] The node behavior supervision module compares the transactions submitted by the node with the originally expected transaction execution order to determine whether the node behavior meets the supervision requirements.
[0012] The technical solution further defined in the above-mentioned supervision method of the present invention is as follows: the transaction supervision comprises the following steps:
[0013] Step 101: input a state transition model graph G;
[0014] Step 102: Read an unread transaction Tx from G;
[0015] Step 103: read the multi-account node pointing to Tx into list S1, and record the multi-account node pointed to by Tx into S2;
[0016] Step 104: Determine whether the relevant signature information in Tx complies with the consensus protocol of the blockchain;
[0017] Step 105: Check whether the relevant transfer and contract information in S1 and S2 match according to the transaction content in Tx;
[0018] Step 106: Call the algorithm for determining whether there is a contract vulnerability, and determine whether there is a contract vulnerability;
[0019] Step 107: The output transaction is illegal;
[0020] Step 108: Output that the transaction is legal, and output relevant information of the found vulnerability;
[0021] Step 109: The output transaction is legal and the contract has no loopholes;
[0022] Step 110: Determine whether there are any unread transaction nodes in the graph;
[0023] Step 111: The process ends.
[0024] The technical solution further defined in the above-mentioned supervision method of the present invention is: the account transaction behavior supervision includes the following steps:
[0025] Step 201: Establish a state transfer map based on the transaction information in the blockchain and maintain a priority queue l Used to save all suspected accounts that have not been checked, each of which has an attribute H , record their degree of suspicion;
[0026] Step 202: l Select a level of suspicion H The highest account S Check, if the suspicion level is the same, randomly select an account for check; initially, the suspicion level of all accounts is H Consistency;
[0027] Step 203: Account S The transactions involved are added to the representatives in chronological order. S Two linked lists for the payee or payer l 1 andl 2, that is, if (S, v)∈E, l1=l1({(S,v)}, (v,S)∈E,l2=l2∪{(v,S)};
[0028] Step 204: intercept transaction information about the account within a certain time period, run an algorithm on the subgraph composed of edges representing these transactions, and determine whether there is any violation; if there is any violation, proceed to step 205, otherwise proceed to step 207;
[0029] Step 205: Output that the account has illegal behavior, and conduct fine-grained screening through transaction supervision for transactions associated with the account in the transactions with illegal behavior, and proceed to step 206;
[0030] Step 206: Update the suspicion level of the account associated with the transaction. If the account has not been checked in this round of supervision, add it to the priority queue. l , proceed to step 208;
[0031] Step 207: Outputting that the account has no illegal or irregular behavior;
[0032] Step 208: If l If it is not empty, go to step 202, otherwise go to step 209;
[0033] Step 209: The supervision process ends.
[0034] The technical solution further defined in the above-mentioned supervision method of the present invention is: the node behavior supervision comprises the following steps:
[0035] Step 301: Establish a state transfer map based on the transaction information in the blockchain and the accounts that may collude with the node;
[0036] Step 302: intercept the time period corresponding to the block packaged by the supervised node, and obtain related transactions through dynamic programming algorithm traversal;
[0037] Step 303: Reorder the transactions according to the rules agreed upon by the blockchain system;
[0038] Step 304: Compare the order of transactions on the chain with the reordered transactions. If the order is basically the same, jump to step 306; if the order is very different, jump to step 305;
[0039] Step 305: Analyze the transactions that are advanced in the specific transaction sequence and the corresponding profit accounts, and investigate whether there is any benefit transfer between the account and the accounts related to the running node;
[0040] Step 306: The supervision process ends.
[0041] The present invention also discloses a digital twin model for alliance chain supervision used in the above-mentioned supervision method, including an alliance chain supervision system, characterized in that: the alliance chain supervision system includes a state transition model diagram established on the underlying alliance chain system model and an upper-layer module established on the state transition model diagram, and the upper-layer module includes a transaction supervision module, an account transaction behavior supervision module and a node behavior supervision module;
[0042] The transaction supervision module, by establishing a state transition model diagram for certain accounts in a certain period of time, creates a mapping from a transaction to be supervised to a transaction node in the model, and transforms the supervision of the transaction into the supervision of the transaction node in the model; according to the signature policy specified in the blockchain consensus protocol, it determines whether the transaction has a legal signature that complies with the provisions of the protocol. After the signature policy is passed, it verifies whether the relevant information in the transaction complies with the requirements of the consensus protocol according to the needs of supervision, and compares and verifies the corresponding attributes of the account nodes pointing to it and pointed to by it in the state transition model diagram;
[0043] In the account transaction behavior supervision module, the transaction behavior of the account is abstracted as a transaction node on the state transition map. The account atomic state node points to the transaction node, indicating that the account participates in the transaction. The transaction node points to the account atomic state node with a later timestamp, indicating the state of the account after the transaction is executed. All specific transaction information is recorded on the corresponding account node in the state transition model diagram;
[0044] The node behavior supervision module compares the transactions submitted by the node with the originally expected transaction execution order to determine whether the node behavior meets the supervision requirements.
[0045] The technical solution further defined by the above-mentioned supervised mapping model of the present invention is as follows:
[0046] The state transition model diagram is a directed graph, denoted by G = (V, E); where G is the symbol of the graph, V represents the set of vertices of the graph, and E represents the set of edges of the graph; V is the union of the two vertex sets S and W, where S and W refer to the account atomic state node and transaction node respectively; E is E R and E W The union of two edge sets, E R and E W Refers to the reading edge and writing edge respectively.
[0047] The technical solution further defined by the above-mentioned supervised mapping model of the present invention is:
[0048] The S is a collection of account atomic state nodes, which includes a preset genesis state and only appears when the state transition model diagram is initialized. The other elements of the S are common account state nodes, including the timestamp of the account, the address of the account, and the asset information of the account. S can be uniquely determined by the account address and timestamp;
[0049] W is a set of transaction nodes. The elements of W correspond to the transactions of the alliance chain one by one. Each element represents a transaction and stores the relevant information of the transaction.
[0050] The E R It is a collection of read edges, which are used to indicate that the account node participated in a transaction. Each read edge represents that the transaction read the state of a certain account at a certain timestamp. Each account atomic state node can only send one read edge at most.
[0051] The E W It is a collection of write edges, which are used to indicate that the state of the account has changed after the transaction is executed. Each write edge represents a new state generated by the transaction. Each account atomic state node can only accept one write edge at most.
[0052] Beneficial effects: The present invention provides a blockchain supervision mapping model based on digital twins, which can convert the account book information recorded in the blockchain into a state transition diagram, and based on this, implement different supervision modules according to different supervision objectives, such as transaction supervision module, account transaction behavior supervision module and node behavior supervision module. The present invention can be applied to the dynamic supervision of the alliance chain system and has a wide range of application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is a state mapping model diagram of account A to account B in the embodiment of the present application;
[0054] Figure 2 This is a multi-account transfer state transition mapping diagram of an embodiment of the present application;
[0055] Figure 3 This is a state transition mapping diagram of the transaction supervision module in Example 1 of the present application;
[0056] Figure 4 This is a state transition diagram of the account transaction supervision module in Example 1 of the present application;
[0057] Figure 5 This is a schematic diagram of the supervision process of the transaction supervision module in the first embodiment of the present application;
[0058] Figure 6 This is a flowchart of the account transaction behavior supervision module in Example 1 of this application;
[0059] Figure 7 This is a flowchart of the node behavior supervision module in Example 1 of the present application. DETAILED DESCRIPTION
[0060] The basic mapping model adopted in the embodiment of the present application is based on the underlying alliance chain system model. The alliance chain system is a distributed system built around the three concepts of nodes, ledgers and consensus mechanisms. The alliance chain system is composed of nodes, which are the main body of the distributed system. Generally, each organization runs one or more nodes, and different nodes will undertake different tasks in different consensus protocols. The blockchain maintained by the alliance chain system is also figuratively called an account book. The account book is a structure that stores and maintains the main information of the alliance chain, generally including transaction information, contract information, and global status, etc., and has the excellent characteristic of being tamper-proof. The account book has a maintained local clone at each node, and consistency is guaranteed by a consensus mechanism. In the alliance chain system, the consensus mechanism is a mechanism and method that can still ensure that the account book previously stored by the node is consistent in the presence of malicious nodes performing malicious operations or equipment failures.
[0061] Based on the understanding of the alliance chain system model, the present invention summarizes and proposes the elements and features that the alliance chain mapping model based on digital twins should have, and proposes a mapping rule and model for dynamic supervision, which maps the account status and transactions on a specific blockchain into an abstract graph model, which is called a state transition model graph.
[0062] The state transition model graph is a directed graph, denoted as G = (V, E). G is the symbol of the graph, V represents the set of vertices of the graph, and E represents the set of edges of the graph. V is the union of the two vertex sets S and W, where S and W refer to the account atomic state node and transaction node respectively. E is E R and E W The union of two edge sets, E R and E W Refers to the read edge and write edge respectively. The formal interpretation of the elements in G is:
[0063] S: S is a collection of account atomic state nodes, and its elements are drawn with squares in the diagram. S contains a preset genesis state, which only appears when the state transition model diagram is initialized, and stipulates some properties of the alliance chain such as consensus mechanism, total assets, etc. The other elements of S are ordinary account state nodes, including the timestamp of the account, the address of the account, the assets of the account, etc. S can be uniquely determined by the account address and timestamp.
[0064] W: W is a collection of transaction nodes, and its elements are drawn with circles in the figure. The elements of W correspond one-to-one to the transactions of the alliance chain. Each element represents a transaction and stores relevant information about the transaction, for example:
[0065] E R :E R It is a set of read edges, which are represented by arrows from the account atomic state node in S to the transaction node in W in the figure, indicating that the account node participates in a transaction. Each read edge represents that the transaction reads the state of an account at a certain timestamp. Usually, the state of the account will change after the transaction is executed, so each account atomic state node can only issue at most one read edge.
[0066] E W :E W It is a set of write edges, which are represented by arrows from transaction nodes in W to account atomic state nodes in S in the figure, indicating that the state of the account has changed after the transaction is executed. Each write edge represents a new state generated by the transaction, so each account atomic state node can only accept one write edge at most.
[0067] like Figure 1 As shown in the figure, it is a state mapping model diagram for account A to transfer to account B at timestamp 2. The transaction nodes in the figure are circles and the account atomic state nodes are squares. A legal state transition graph is directed acyclic, because the edges always point to nodes with larger timestamps; and the in-and-out degrees of the account state atomic nodes in the middle of the graph should be 1, because the account atomic state will change to a new atomic state after participating in a transaction; each transaction should have correct inputs and outputs, that is, it will not spend non-existent assets, nor will it double spend. Note that the transaction itself may involve more than 2 accounts. Therefore, a graph G has the following properties when it is a state transition model graph:
[0068] 1. G contains only one genesis state node, which has no write edges pointing to it, that is, the in-degree is 0.
[0069] 2. Each account atomic state node except the genesis state node has a write edge pointing to it.
[0070] 3. Each account atomic state node has at most one read edge.
[0071] 4. The graph is weakly connected.
[0072] 5. The graph has no cycles.
[0073] 6. The account atomic state nodes connected by the transaction input and output edges satisfy the same identity of the sum of the balances.
[0074] There are often a large number of account addresses and transaction affairs in the blockchain, but in the specific supervision process, not all accounts and affairs are widely supervised, but relatively important accounts and affairs are extracted for supervision. Therefore, the present invention adopts a divide-and-conquer strategy. A single account status node in the graph can be the union of multiple accounts, and supervision is carried out when necessary. At the same time, the graph can be reduced at a certain point in time, compressing the original graph data into a pseudo-genesis state and constructing a new model graph. This can effectively reduce the scale of the graph and provide assistance for efficient supervision algorithms.
[0075] Multi-account status node: The addresses of multiple accounts are combined and the assets are added to form a new node. This node replaces the status node of the account, and all transactions related to the account are directly connected to the node. Therefore, it is best for the node to satisfy certain associations to ensure the significance of the node. When necessary, this part of the graph can be expanded by backtracking the blockchain.
[0076] Construct a new model: Use a transaction to integrate the state nodes with an out-degree of 0 in the original graph as a pseudo-genesis state, and then expand the state through a transaction. After that, only the model graph in the pseudo-genesis state can be maintained, reducing the scale of the graph.
[0077] Using the above compression method, compression can be performed in the two dimensions of account quantity and time. At the same time, some characteristics of the state transition diagram itself and the dynamic programming algorithm can be used to implement different supervision modules in a targeted manner.
[0078] Let's use a set of specific transactions to illustrate. Assume that the balance of account A is 20 at timestamp 0, the balance of account B is 0 at timestamp 0, the balance of account C is 100 at timestamp 0, and the balance of account D is 10 at timestamp 0. At timestamp 2, account A transfers 5 to account B, at timestamp 3, account B transfers 1 to account C, and at timestamp 4, account C transfers 10 to account D. Here, it is agreed that account A and account B are the accounts subject to key supervision, and other account addresses are not subject to key supervision. The specific state transition mapping diagram is as follows: Figure 2 shown.
[0079] From blockchain data to the state transfer mapping diagram, the basic mapping process of the digital twin is realized, and at the same time, the basic data structure is provided for the specific supervision process. On the basis of the state transfer mapping diagram, supervision modules with different granularities and focuses can be realized, specifically the transaction supervision module, account transaction behavior supervision module and node behavior supervision module.
[0080] In order to better understand the above technical solution, Figures 3 to 7 And specific implementation methods are used to describe the above technical solutions in detail.
[0081] Embodiment 1
[0082] This embodiment provides a blockchain supervision mapping model based on digital twins, especially a digital twin mapping model for alliance chain supervision and an implementation method of an upper-level supervision module, and specifically introduces a transaction supervision module, an account transaction behavior supervision module and a node behavior supervision module.
[0083] 1) Transaction supervision module
[0084] In the blockchain system, transactions are the core model construction. The nodes that obtain the right to record will sort and package the monitored transactions according to the rules agreed in the blockchain protocol, and distribute them to most nodes in the network with the blocks through the consensus mechanism to achieve chain, thus becoming the consensus between the nodes and serving as the basis for the nodes to update the blockchain ledger world state. The supervision and verification of general transactions is to read the data of the blockchain, and use common cryptographic tools such as asymmetric encryption systems to check and verify according to the specific transaction protocol. However, as we mentioned when introducing the alliance chain mapping model based on digital twins, this reading method has certain optimization space in efficiency, and for long-running blockchain systems, processing increasing data also poses challenges to traditional processing methods. As for the transaction supervision upper-level module based on the digital twin mapping model we currently propose, it can create a mapping from transactions that need to be supervised to circular nodes in the model by establishing a state transition model diagram for certain accounts in a certain period of time, transforming the supervision of transactions into the supervision of transaction nodes in the model, thereby improving the efficiency of supervision. At the same time, by using the idea of dynamic programming, transactions can be retrieved and focused according to certain conditions, thereby further improving the flexibility of transaction verification and inspection. On the other hand, according to the nature of the state transition model graph, after focusing on a transaction, it is easy to find the transaction nodes related to the atomic state nodes of the accounts involved in the transaction, thereby supporting the supervision and verification of the account status related to the transaction.
[0085] exist Figure 3In the state transfer model diagram shown, this module focuses on the dark circular nodes marked with circles in the diagram. For a transaction node, we can run various transaction-based blockchain supervision and verification algorithms on it. The most basic supervision and verification method is to determine whether the transaction has a legal signature that complies with the provisions of the protocol according to the signature policy specified in the blockchain consensus protocol. After the signature policy is passed, the relevant information in the transaction, such as transfer information or contract information, is verified according to our supervision needs to see whether these basic information complies with the requirements of the consensus protocol. In combination with the corresponding attributes of the atomic state nodes of the accounts pointed to and pointed to by it in the state transfer model diagram, the states of the accounts participating in the transaction before and after the transaction is put on the chain are compared and verified. Of course, it is emphasized that in addition to the most basic verification of the legitimacy of blockchain digital signatures and basic information, most of the current supervision and verification methods for alliance chain transactions can also be applied to the state transfer model diagram through this module. For example, a state transfer model diagram can be established by focusing on transactions for the creation and update of smart contracts, and the supervision algorithm can be run on the contracts on the transaction nodes to detect possible contract vulnerabilities. Figure 5 The specific algorithm flow chart of the transaction supervision module using the above supervision algorithm as an example is shown:
[0086] Step 101: input a state transition model graph G;
[0087] Step 102: Read an unread transaction Tx from G;
[0088] Step 103: read the multi-account node pointing to Tx into list S1, and record the multi-account node pointed to by Tx into S2;
[0089] Step 104: Determine whether the relevant signature information in Tx complies with the consensus protocol of the blockchain;
[0090] Step 105: Check whether the relevant transfer and contract information in S1 and S2 match according to the transaction content in Tx;
[0091] Step 106: Call the algorithm for determining whether there is a contract vulnerability, and determine whether there is a contract vulnerability;
[0092] Step 107: The output transaction is illegal;
[0093] Step 108: Output that the transaction is legal, and output relevant information of the found vulnerability;
[0094] Step 109: The output transaction is legal and the contract has no loopholes;
[0095] Step 110: Determine whether there are any unread transaction nodes in the graph;
[0096] Step 111: The process ends.
[0097] On the other hand, during the above verification process, if a problem is found in the verification of a transaction, it can be reasonably inferred that the accounts related to the transaction or the nodes that sort and package the transaction are more likely to be non-compliant. Based on this, the greedy strategy can be used to increase the verification priority of these accounts or nodes, and in subsequent supervision, mapping models are created for accounts and nodes with high verification priority, thereby improving the efficiency and accuracy of subsequent inspections and verifications.
[0098] 2) Account transaction behavior supervision module
[0099] In the blockchain system, users can create accounts through certain mechanisms for transactions in the blockchain system. The account creation process usually uses an asymmetric encryption system to generate a set of public and private keys, where the private key is kept by the user and the public key can be published. This public key uniquely identifies the account, so it is usually also called the account address, and the specific transaction behavior of the account will be identified by the account address.
[0100] In the mapping model of digital twins, the transaction behavior of an account is abstracted as a directed edge on the state transition mapping graph. The two vertices of the directed edge are the things associated with the transaction and the accounts involved in the transaction. The direction of the directed edge indicates the income and expenditure status of the account in the transaction, as well as the time sequence between the various account states and transaction states. The mapping graph is recorded as a directed graph G, and the set of nodes consisting of transactions is recorded as GV. T , the set of account yard states is recorded as GV A , then in a mapping graph, there is u∈GV T ∧v∈GV A or v∈GV T ∧u∈GV A , and there is u t ≤v t .
[0101] In the mapping diagram, the main way to supervise account transaction behavior is to analyze and judge the account transaction behavior based on the out-degree and in-degree of the account address in the state transfer mapping diagram. Figure 4As shown in the figure, according to the state transition mapping diagram, it is easy to obtain the transaction information that an account has participated in, query other participants in the transaction, and trace the source of the balance in the account. In addition to monitoring the more basic problems in the blockchain such as "double spending" by tracing the source of the balance in the account, this modeling method can also use the characteristics of more clearly displaying the transaction connection between two accounts directly linked through the transaction node than the blockchain data structure, and more targeted supervision and analysis of possible illegal and irregular issues in the alliance chain. For example, considering that the transaction behavior of a normal user in a fixed time period has relatively fixed characteristics and patterns, after establishing reasonable screening indicators, it is possible to quickly locate accounts with greater suspicion, so as to conduct fine-grained screening. At the same time, the distribution characteristics of the transactions of specific transactions also characterize the closeness between accounts. Clustering algorithms can be used to analyze the transaction behavior and possible transaction relationships between accounts to achieve better supervision. As Figure 6 As shown in the figure, the process of supervising account transaction behavior on the alliance chain includes the following steps:
[0102] Step 201: Establish a state transfer map based on the transaction information in the blockchain and maintain a priority queue l Used to save all suspected accounts that have not been checked, each of which has an attribute H , record their degree of suspicion;
[0103] Step 202: l Select a level of suspicion H The highest account S If the suspicion level is the same, a random account will be selected for inspection. H Consistency;
[0104] Step 203: Account S The transactions involved are added to the representatives in chronological order. S Two linked lists for the payee or payer l 1 and l 2 in. That is, if (S, v)∈E, l1=l1∪{(S, v)}, (v, S)∈E, l2=l2∪{(v, S)};
[0105] Step 204: intercept the transaction information about the account within a certain time period, run the algorithm on the subgraph composed of the edges representing these transactions, and determine whether there is any violation. If there is any violation, proceed to step 205, otherwise proceed to step 207;
[0106] Step 205: Output that the account has illegal behavior, and conduct fine-grained screening through transaction supervision for transactions associated with the account in the transactions with illegal behavior, and proceed to step 206;
[0107] Step 206: Update the suspicion level of the account associated with the transaction. If the account has not been checked in this round of supervision, add it to the priority queue. l , proceed to step 208;
[0108] Step 207: Outputting that the account has no illegal or irregular behavior;
[0109] Step 208: If l If it is not empty, go to step 202, otherwise go to step 209;
[0110] Step 209: The supervision process ends.
[0111] It can be seen that supervision based on the state transition map does not rely on single transaction supervision and account transaction behavior supervision. Both can provide information to each other to facilitate the sorting of inspection priorities of transactions or accounts, thereby achieving better supervision effects.
[0112] 3) Node behavior supervision module
[0113] In the blockchain system, nodes have computing resources, storage space and access to the network. They are generally responsible for distributing blockchains, maintaining blockchains locally, competing for accounting rights and packaging transactions (or some nodes are responsible for certain specific tasks). When a node obtains accounting rights, it obtains the authority to determine the execution order of transactions in the block. The execution order of transactions is very important when users execute certain transactions. For example, in the application scenario of an auction, if a user colludes with an accounting node, it is possible to execute a certain transaction in advance, thereby obtaining benefits that should not belong to the user. The core of the supervision of node behavior is to compare the transactions submitted by the node with the originally expected transaction execution order, so as to determine whether the node behavior meets the regulatory requirements. In the digital twin mapping model, the transactions in a block are continuous in time. If we need to supervise a certain node, we can capture the discrete time period when the node packages the transactions, and use the state mapping diagram to obtain the specific information of the transaction in the time period. Then, we can sort a group of transactions according to a predetermined transaction order and compare it with the actual transaction order on the blockchain. If there is a large difference, it can be basically determined that the node has not performed its function well and impose corresponding penalties.
[0114] like Figure 7 The figure shows a flow chart of the node behavior supervision module.
[0115] Step 301: Establish a state transfer map based on the transaction information in the blockchain and the accounts that may collude with the node.
[0116] Step 302: intercept the time period corresponding to the block packaged by the supervised node, and obtain related transactions through traversal by dynamic programming algorithm.
[0117] Step 303: Reorder the transactions according to the rules agreed upon by the blockchain system.
[0118] Step 304: Compare the order of transactions on the chain with the reordered transactions. If the comparison order is basically the same, jump to step 306; if the comparison order is very different, jump to step 305.
[0119] Step 305: Analyze the transactions that are advanced in the specific transaction sequence and the corresponding income accounts, and investigate whether there is any interest transfer between the account and the related accounts of the running node.
[0120] Step 306: The supervision process ends.
[0121] Through the above steps, it is possible to investigate whether the node executes certain transactions in advance. Combined with the supervision of the transfer relationship between the account running the node and the beneficiary account of the advance transaction, it is possible to determine whether a certain account has a benefit transfer relationship with the account running the node, and thus conduct corresponding investigations and punishments.
[0122] The present invention provides a blockchain regulatory mapping model based on digital twins and an implementation method of the upper-layer module. There are many specific methods and ways to implement this technology. The above is only a preferred implementation scheme of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the scope of protection of the present invention. All components not specified in this embodiment can be implemented using existing technologies.
Claims
1. A supervision method for alliance chain, applied to the supervision server of the alliance chain supervision system, characterized by: include: Transaction supervision, by establishing a state transfer mapping model diagram of certain accounts in a certain period of time, creating a mapping from transactions that need to be supervised to corresponding nodes in the model, and transforming the supervision of transactions into the supervision of nodes in the model; Supervision of account transaction behavior: the transaction behavior of an account is abstracted as a transaction node on the state transition mapping model diagram. The account atomic state node points to the transaction node, indicating that the account has participated in the transaction. The transaction node points to the account atomic state node with a later timestamp, indicating the state of the account after the transaction is executed. All specific transaction information is recorded on the corresponding transaction node in the state transition model diagram. The state transition model graph is a directed graph, denoted by G = (V, E), where G is the symbol of the graph, V represents the set of vertices of the graph, E represents the set of edges of the graph, V is the union of the two vertex sets S and W, S and W refer to the account atomic state node and transaction node respectively, and E is E R and E W The union of two edge sets, E R and E W They refer to the read edge and the write edge respectively. The formal interpretation of the elements in G is: S is a collection of account atomic state nodes, whose elements are drawn with squares in the figure. S contains a preset genesis state, which only appears when the state transition model diagram is initialized, and stipulates the nature of the alliance chain. The other elements of S are ordinary account state nodes, including the timestamp of the account, the address of the account, and the asset information of the account. S is uniquely determined by the account address and timestamp; W is a set of transaction nodes, and its elements are drawn with circles in the figure. The elements of W correspond one-to-one to the transactions of the alliance chain. Each element represents a transaction and stores the relevant information of the transaction. E R It is a set of read edges, which are represented by arrows from the account atomic state node in S to the transaction node in W in the figure. They are used to indicate that the account node participates in a transaction. Each read edge represents that the transaction reads the state of the account at the timestamp. After the transaction is executed, the state of the account will change. Each account atomic state node can only issue one read edge at most. E W It is the set of write edges, which are represented by arrows from the transaction node in W to the account atomic state node in S in the figure. They are used to indicate that the state of the account has changed after the transaction is completed. Each write edge represents a new state generated by the transaction. Therefore, each account atomic state node can only accept at most one write edge; Node behavior supervision compares the transactions submitted by the node with the originally expected transaction execution order to determine whether the node behavior meets the supervision requirements.
2. A supervision method for alliance chain according to claim 1, characterized in that: The transaction supervision includes the following steps: Step 101: input a state transition model graph G; Step 102: Read an unread transaction Tx from G; Step 103: read the multi-account node pointing to Tx into list S1, and record the multi-account node pointed to by Tx into S2; Step 104: Determine whether the relevant signature information in Tx complies with the consensus protocol of the blockchain. Step 105: Check whether the relevant transfer and contract information in S1 and S2 match according to the transaction content in Tx; Step 106: Call the algorithm for determining whether there is a contract vulnerability, and determine whether there is a contract vulnerability; Step 107: The output transaction is illegal; Step 108: Output that the transaction is legal, and output relevant information of the found vulnerability; Step 109: The output transaction is legal and the contract has no loopholes; Step 110: Determine whether there are any unread transaction nodes in the graph; Step 111: The process ends.
3. A supervision method for alliance chain according to claim 1, characterized in that: The account transaction behavior supervision includes the following steps: Step 201: Establish a state transition map based on the transaction information in the blockchain, and maintain a priority queue l to store all suspected accounts that have not been checked, where each account has an attribute H to record their degree of suspicion; Step 202: Select an account S with the highest suspicion level H from l for inspection. If the suspicion levels are consistent, randomly select an account for inspection. Initially, the suspicion levels H of all accounts are consistent. Step 203: Add the transactions participated by account S to two linked lists l1 and l2 representing S as the payee or payee in chronological order, i.e., if (S, v) ∈ E, l1 = l1 ∪ {(S, v)}, (v, S) ∈ E, l2 = l2 ∪ {(v, S)}; Step 204: intercept transaction information about the account within a certain time period, run an algorithm on the subgraph consisting of the edges representing these transactions, and determine whether there is any violation; if there is any violation, proceed to step 205, otherwise proceed to step 207; Step 205: Output that the account has illegal behavior, and conduct fine-grained screening through transaction supervision for transactions associated with the account in the transactions with illegal behavior, and proceed to step 206; Step 206: Update the suspicion level of the account associated with the transaction. If the account has not been checked in this round of supervision, add it to the priority queue. l , proceed to step 208; Step 207: Outputting that the account has no illegal or irregular behavior; Step 208: If l If it is not empty, go to step 202, otherwise go to step 209; Step 209: The supervision process ends.
4. A supervision method for alliance chain according to claim 1, characterized in that: The node behavior supervision includes the following steps: Step 301: Establish a state transfer map based on the transaction information in the blockchain and the accounts that may collude with the node; Step 302: intercept the time period corresponding to the block packaged by the supervised node, and obtain related transactions through dynamic programming algorithm traversal; Step 303: Reorder the transactions according to the rules agreed upon by the blockchain system; Step 304: Compare the order of transactions on the chain with the reordered transactions. If the order is basically the same, jump to step 306; if the order is very different, jump to step 305; Step 305: Analyze the transactions that are advanced in the specific transaction sequence and the corresponding profit accounts, and investigate whether there is any benefit transfer between the account and the accounts related to the running node; Step 306: The supervision process ends.
5. A digital twin model for alliance chain supervision, including an alliance chain supervision system, characterized by: The alliance chain supervision system includes a state transfer model diagram established on the underlying alliance chain system model and an upper-layer module established on the state transfer model diagram, wherein the upper-layer module includes a transaction supervision module, an account transaction behavior supervision module and a node behavior supervision module; The transaction supervision module, by establishing a state transition model diagram for certain accounts in a time period, creates a mapping from transactions that need to be supervised to transaction nodes in the model, and transforms the supervision of transactions into the supervision of transaction nodes in the model; According to the signature policy specified in the blockchain consensus protocol, determine whether the transaction has a legal signature that complies with the protocol. After the signature policy is passed, verify whether the relevant information in the transaction complies with the requirements of the consensus protocol according to the needs of supervision, and compare and verify the corresponding attributes of the account nodes pointing to it and pointed to by it in the state transfer model diagram; In the account transaction behavior supervision module, the transaction behavior of the account is abstracted as a transaction node on the state transition map. The account atomic state node points to the transaction node, indicating that the account participates in the transaction. The transaction node points to the account atomic state node with a later timestamp, indicating the state of the account after the transaction is executed. All specific transaction information is recorded on the corresponding transaction node in the state transition model diagram; The node behavior supervision module compares the transactions submitted by the node with the originally expected transaction execution order to determine whether the node behavior meets the supervision requirements; The state transition model graph is a directed graph, denoted by G = (V, E), where G is the symbol of the graph, V represents the set of vertices of the graph, E represents the set of edges of the graph, V is the union of the two vertex sets S and W, S and W refer to the account atomic state node and transaction node respectively, and E is E R and E W The union of two edge sets, E R and E W They refer to the read edge and the write edge respectively. The formal interpretation of the elements in G is: S is a collection of account atomic state nodes, whose elements are drawn with squares in the figure. S contains a preset genesis state, which only appears when the state transition model diagram is initialized, and stipulates the nature of the alliance chain. The other elements of S are ordinary account state nodes, including the timestamp of the account, the address of the account, and the asset information of the account. S is uniquely determined by the account address and timestamp; W is a set of transaction nodes, and its elements are drawn with circles in the figure. The elements of W correspond one-to-one to the transactions of the alliance chain. Each element represents a transaction and stores the relevant information of the transaction. E R It is a set of read edges, which are represented by arrows from the account atomic state node in S to the transaction node in W in the figure. They are used to indicate that the account node participates in a transaction. Each read edge represents that the transaction reads the state of the account at the timestamp. After the transaction is executed, the state of the account will change. Each account atomic state node can only issue one read edge at most. E W It is a collection of write edges, represented in the figure by an arrow pointing from the transaction node in W to the account atomic state node in S, which is used to indicate that the state of the account has changed after the transaction is executed. Each write edge represents a new state generated by the transaction, so each account atomic state node can only accept at most one write edge.
Citation Information
Patent Citations
Data processing method and device
CN104717098A
Intellectual property protection block chain construction method based on alliance chain
CN113377873A