Cargo supply chain data tracing method and system based on block chain

By building contract vectors and sensitive identification codes in the goods supply chain and identifying and processing abnormal contracts, the problem of insufficient distinction between replay attacks and transaction risks in the blockchain system is solved, and the speed and accuracy of data traceability are improved.

CN120013557APending Publication Date: 2025-05-16HUNAN UNIV OF FINANCE & ECONOMICS
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510183299.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The prior art is difficult to effectively prevent replay attacks in blockchain and distributed systems, which affects transaction fairness and lacks sensitivity to changes in transaction behavior risk, resulting in loss of goods.

Method used

By obtaining the goods information between any two participants in the goods supply chain, building a contract vector and calculating transaction duplication risks, establishing a time-segment transaction form and sensitive identification code, determining anomaly contracts and signing a new contract on the blockchain.

Benefits of technology

It improves the traceability speed and accuracy of supply chain data, avoids the problem of insufficient distinction between static identifiers, enhances the sensitivity of transaction behavior risks, and reduces cargo losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013557A_ABST
    Figure CN120013557A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a cargo supply chain data tracing method and system based on a block chain, and the method specifically comprises the steps: constructing each contract vector between participants through the cargo transaction information between the participants in a cargo supply chain; taking each participant as each node, determining a first transaction repetition risk between the nodes at each transaction interval based on the similarity of vectors in the contract vectors accumulated at each transaction interval, and using the first transaction repetition risk for a time period transaction form; constructing a sensitive identification code based on the amplitude change in the frequency table corresponding to the form; determining an abnormal contract based on the difference between the sensitive identification codes of the adjacent transaction periods; and the abnormal contracts are uniformly signed as new contracts to be stored in the block chain, so that nodes which subsequently find the abnormal contracts can perform abnormal traceability. The problem that the transaction behavior risk change sensitivity between the nodes is insufficiently distinguished due to the fact that the transaction behavior risk change sensitivity between the nodes is distinguished only through a static identifier and other preset passwords on the contract is avoided; and the traceability speed and precision of the supply chain data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and specifically to a method and system for tracing data of a goods supply chain based on blockchain. Background Art

[0002] A replay attack refers to an attacker maliciously intercepting and replaying previously valid communication data in an attempt to produce unauthorized effects in the system. In blockchain and distributed systems, replay attacks may lead to duplicate transactions, damage data integrity, or interfere with consensus mechanisms.

[0003] The existing technology rotates the master nodes regularly after expanding the number of master nodes. However, for attackers, the repeated instructions formed by replaying system instructions will inevitably cause beneficiaries in the supply chain nodes. Therefore, the selected master nodes may be the beneficiary nodes, thus affecting the fairness of transactions. When screening the risk of replay attack damage in the existing technology, it only distinguishes by means of preset passwords such as static identifiers on the contract. It is not enough to distinguish the sensitivity of transaction behavior risk changes between nodes, and the problem of being attacked will not be discovered until a large loss of goods has occurred. Summary of the invention

[0004] In order to solve the above technical problems, the purpose of this application is to provide a method and system for tracing the data of a goods supply chain based on blockchain. The technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for tracing data in a goods supply chain based on blockchain, the method comprising the following steps:

[0006] Obtain cargo information every time a cargo transaction occurs between any two participants in the cargo supply chain;

[0007] Taking each participant as each node, constructing each contract vector between any two nodes based on the cargo information of each transaction between the two nodes; calculating the transaction duplication risk between the two nodes based on the similarity between different contract vectors of the two nodes;

[0008] From the initial transaction interval to any transaction interval, based on the contract vector of the transaction between nodes and in combination with the calculation method of the transaction duplication risk, the first transaction duplication risk between any two nodes in any transaction interval is obtained, and the first risk vector of each node in any transaction interval is constructed; based on the first risk vector, a period transaction form of each node in the current transaction period is constructed;

[0009] Constructing a sensitive identification code for each node in the current trading period based on the amplitude change in the frequency table corresponding to the transaction form of the period;

[0010] Constructing a looseness evaluation of each node in the current trading period based on the difference between the sensitive identification code of the current trading period and the previous trading period; determining abnormal contracts in the current trading period based on the looseness evaluation;

[0011] The abnormal contracts are uniformly signed as new contracts and stored in the blockchain for subsequent abnormality tracing by nodes that discover the abnormal contracts.

[0012] In one embodiment, the process of obtaining each contract vector between any two nodes is as follows:

[0013] For each cargo transaction between any two nodes, a vector consisting of all items of cargo information of the cargo transaction is recorded as each contract vector between the any two nodes.

[0014] In one embodiment, the process of obtaining the transaction duplication risk between any two nodes is as follows:

[0015] Obtain a set of contract vectors of all transactions between any two nodes, recorded as the contract vector set; calculate the similarity between any two contract vectors in the contract vector set, recorded as the first similarity; calculate the average value of all the first similarities in the contract vector set, recorded as the similarity mean; record the transaction duplication risk between the current node a and any other node a′ as R a,a′ , R a,a′ The expression is:

[0016] In the formula, is the number of transactions between any other node a′ and the current node a; The total number of transactions performed by the current node a; S d,a′ is the mean similarity between the current node a and any other node a′; is the average of the similarity means between the current node a and all other nodes; σ S is the standard deviation of the similarity mean between node a and all other nodes.

[0017] In one embodiment, the process of obtaining the first transaction repetition risk is:

[0018] From the initial transaction interval to any transaction interval, a set of contract vectors of all transactions between any two nodes is obtained as a cumulative set of contracts between any two nodes at any transaction interval;

[0019] At any transaction interval, based on the cumulative set of contracts between any two nodes, the same calculation method as the transaction duplication risk is adopted to obtain the transaction duplication risk between any two nodes at any transaction interval, which is recorded as the first transaction duplication risk.

[0020] In one embodiment, the first risk vector of each node in any transaction interval is: the horizontal amount of the first transaction repetition risk composition between the current node and all other nodes at any transaction interval is used as the first risk vector of the current node at any transaction interval.

[0021] In one embodiment, the process of obtaining the time period transaction form is as follows:

[0022] The first risk vector of the current node in each transaction interval is used as each row of data in the time period transaction form of the current node to obtain the time period transaction form of the current node.

[0023] In one embodiment, the process of obtaining the sensitive identification code is as follows:

[0024] In the current trading period, the frequency table corresponding to the period trading form of the current node is obtained through the time-frequency conversion algorithm, and the sequence composed of the amplitudes of all frequency domain components in the frequency table is recorded as the amplitude sequence. The division position of the amplitude sequence is determined based on the amplitude difference between adjacent elements in the amplitude sequence, and two subsequences are obtained by division. The frequencies in the subsequence with large amplitude are regarded as high-heat frequencies, and the frequencies in the subsequence with small amplitude are regarded as low-heat frequencies;

[0025] Mark the position of the high heat frequency in the frequency table of the current node as 1, and mark the position of the low heat frequency as 0;

[0026] If the number of frequency data in each row in the frequency table is less than the preset value, 0 is added to the end of each row of frequency data; otherwise, each row of frequency data is truncated, and the obtained frequency table is recorded as the first frequency table;

[0027] Arrange the mark values ​​of the positions corresponding to all the frequency data in the first frequency table, and the resulting string of binary numbers is recorded as the sensitive behavior identification code of the current node in the current trading period; convert the sensitive behavior identification code into hexadecimal numbers with every 4 bits of binary numbers, and the resulting string of codes is recorded as the sensitive identification code of the current node in the current trading period.

[0028] In one embodiment, the process of obtaining the sparseness evaluation of each node in the current trading period is as follows:

[0029] For the current node a, calculate the Hamming distance between the sensitive identification code of the current trading period and its previous trading period, denoted as d a (Hr-1 ,H r );Record the loose evaluation of the current node in the current trading period as S a,r , S a,r The expression is: In the formula, l r,1 It is the longest number of consecutive 1s in the sensitive behavior identification code of the current node in the current trading period.

[0030] In one embodiment, the process of obtaining abnormal contracts in the current trading period is as follows:

[0031] S a,r The percentage form is recorded as S′ a,r %, sort the transaction repetition risks of all transaction intervals in the current trading period from large to small, and put the first S′ in the sorting result a,r % of the transaction intervals are marked; within the marked transaction intervals, the generated transaction contracts are reviewed to identify abnormal contracts.

[0032] On the second aspect, an embodiment of the present application also provides a blockchain-based cargo supply chain data traceability system, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the above methods are implemented.

[0033] The embodiments of the present application have at least the following beneficial effects:

[0034] This application establishes a transaction form for a node through its transaction behavior, and screens sensitive transaction behaviors in the form. It combines changes in the stable relationship between supply and demand in the supply chain to screen abnormal contracts in the current node and reduce the amount of data reviewed by the node.

[0035] By obtaining the cargo information of each transaction between any two participants in the cargo supply chain, each contract vector between any two participants is constructed; each participant is taken as each node, and the transaction repetition risk is analyzed based on the similarity of the contract vector between any two nodes, and then the first transaction repetition risk between nodes at each transaction interval is determined based on the accumulated contract vector at each transaction interval, and the period transaction form of each node in each transaction period is constructed; the sensitive identification code is constructed based on the amplitude change in the frequency table corresponding to the period transaction form; the loose evaluation of each node in the current transaction period is constructed based on the difference between the sensitive identification code of the current transaction period and the previous transaction period; the abnormal contract in the current transaction period is determined based on the loose evaluation; the abnormal contract is uniformly signed as a new contract and stored in the blockchain for subsequent abnormal traceability of the node that discovers the abnormal contract. It avoids the problem of insufficient distinction of the sensitivity of the risk change of transaction behavior between nodes by distinguishing only by preset passwords such as static identifiers on the contract; and improves the traceability speed and accuracy of supply chain data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0037] Figure 1 A flowchart of the steps of a blockchain-based cargo supply chain data traceability method provided for one embodiment of the present application.

[0038] Figure 2 Schematic diagram of the process of obtaining repeated risk for the first transaction. DETAILED DESCRIPTION

[0039] In order to further explain the technical means and effects adopted by this application to achieve the predetermined invention purpose, the following is a detailed description of the blockchain-based cargo supply chain data traceability method and system proposed in this application, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0040] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0041] The specific scheme of the blockchain-based cargo supply chain data traceability method and system provided by this application is described in detail below with reference to the accompanying drawings.

[0042] See also Figure 1 , which shows a flowchart of a method for tracing the source of goods supply chain data based on blockchain provided by an embodiment of the present application, the method comprising the following steps:

[0043] Step S1, obtaining cargo information each time a cargo transaction is conducted between any two participants in the cargo supply chain.

[0044] Participants in the goods supply chain of this application include suppliers, manufacturers, distributors, retailers, logistics companies and final consumers. In the supply chain management platform, obtain the goods information of each goods transaction between any two participants. The goods information in the embodiment of this application includes logistics data, goods identification number, goods name, goods size, goods quantity, storage time and outbound time. The goods information form is shown in Table 1, where logistics data refers to the type of logistics data.

[0045] Table 1

[0046]

[0047]

[0048] Step S2, taking each participant as each node, constructing each contract vector between any two nodes based on the cargo information of each transaction between the two nodes; and calculating the transaction duplication risk between the two nodes based on the similarity between different contract vectors of the two nodes.

[0049] A supply chain topology graph is constructed based on the goods supply relationship between participants in the supply chain. Specifically, each participant is regarded as a node. For any two nodes, if there is a direct goods transaction relationship between the two nodes, contracts will be sent and signed between the nodes during the transaction. Therefore, the initiator of the contract is taken as the starting node, and the receiver of the contract is taken as the ending node. A directed edge is established to connect the two nodes. If there is no direct goods transaction relationship between the two nodes, the two nodes are not connected, thereby obtaining a topology graph, which is recorded as the supply chain topology graph.

[0050] Furthermore, if any node is used as the current node, if the content of the contract signed by the current node is similar each time, and if similar contracts are signed frequently with other nodes, it means that the transactions between the current node and other nodes are frequent and stable, which provides more opportunities for attackers to use replay attacks. Therefore, based on the supply chain topology diagram, the importance of each node in the supply chain is analyzed, and the risk of repeated transactions between nodes is evaluated, specifically:

[0051] (1) Since the essence of a contract is multi-attribute structured data, a contract vector is established for the contract to establish associations between structured data attributes so as to better judge the node transaction attributes. Taking the current node a and any other node a′ as an example, for a single cargo transaction between these two nodes, all cargo information is arranged in the order in the cargo information form to form a vector, which is recorded as the contract vector. Among them, the contract vector of the dth transaction between the current node a and any other node a′ is recorded as

[0052] (2) Analyze the similarity of the contract vectors of transactions between the current node and other nodes: obtain a set of contract vectors of all transactions between the current node and any other node a′, recorded as the contract vector set; calculate the cosine similarity between any two contract vectors in the contract vector set, recorded as the first similarity; further, calculate the average value of all the first similarities in the contract vector set, recorded as the similarity mean. Among them, cosine similarity is a well-known technology, and the specific process is not repeated here.

[0053] (3) Analyze the repetitiveness of contract transactions to determine the risk of transaction duplication between nodes. The expression is:

[0054]

[0055] In the formula, R a,a′ The transaction duplication risk between the current node a and any other node a′; is the number of transactions between any other node a′ and the current node a; The total number of transactions performed by the current node a; S d,a′ is the mean similarity between the current node a and any other node a′; is the average of the similarity means between the current node a and all other nodes; σ S is the standard deviation of the similarity mean between node a and all other nodes.

[0056] The larger it is, the more contracts have been signed between the current node a and any other node a′, that is, the current node is more likely to be replayed by the nodes that have signed contracts. is the mean similarity S between all contracts signed by the current node a and node a′ d,a′ The concentration of the contracts signed with the current node a. The closer it is, the more repeated transactions the current node has, and the more easily it is affected by repeated transaction information. SIndicates the degree of difference in contract similarity between the overall nodes, The larger the value, the more obvious the similarity difference between node a and node a′.

[0057] Step S3, from the initial transaction interval to any transaction interval, based on the contract vector of transactions between nodes and combined with the calculation method of the transaction repetition risk, obtain the first transaction repetition risk between any two nodes in any transaction interval, and construct the first risk vector of each node in any transaction interval; based on the first risk vector, construct the period transaction form of each node in the current transaction period.

[0058] By analyzing the position of the current node in the supply chain and the rapid and slow changes in repeated risks in the process of signing contracts with other nodes, we analyze abnormal situations in transactions between the current node and other nodes, and analyze abnormal trading behaviors through changes in trading styles.

[0059] The transaction style of the current node is judged by judging the changes in the number of transaction targets and the concentration of transaction contracts signed by the current node: in the supply chain, the density of contracts signed between the current node and other nodes in a short period of time reflects the preference habits of the node when trading with other nodes, and after the attacker replays its transaction information, it will change the transaction style of the current node.

[0060] When goods are traded between nodes, a trading period is set, and all transactions completed during the trading period can be uniformly reviewed after the trading period ends; further, a trading interval is set, and the role of the trading interval is to prevent repeated submissions in a short period of time, that is, at most one transaction can be performed in each trading interval. Preferably, in an embodiment of the present application, the duration of the trading period is set to 30 minutes, and the trading interval is set to 5 seconds. As other embodiments of the present application, the implementer can set the duration of the trading period and the trading interval according to the actual situation.

[0061] The period before the transaction period is used as the trial operation phase. Preferably, the embodiment of the present application sets the duration of the trial operation phase to 24 hours. As other embodiments of the present application, the implementer can set the duration of the trial operation phase according to the actual situation. Further, in order to analyze the changes in the transaction duplication risk after each transaction between nodes, the transaction duplication risk between nodes in each transaction interval in the transaction period is obtained, and the time period transaction form of the current node is constructed, specifically:

[0062] (1) Taking the i-th trading interval in the trading period as an example, the first trading interval in the trial operation phase is taken as the initial trading interval; during the period between the initial trading interval and the i-th trading interval, taking the current node a and any other node a′ as examples, obtain a set of contract vectors of all transactions between the current node a and any other node a′ as the cumulative set of contracts between the current node a and any other node a′ at the i-th trading interval. Then, obtain the cumulative set of contracts between the current node a and other nodes at the i-th trading interval;

[0063] (2) Further, at the i-th transaction interval, based on the cumulative set of contracts between the current node a and all other nodes, the transaction duplication risk between the current node a and any other node a′ in the i-th transaction interval is obtained by using the above transaction duplication risk acquisition process, which is recorded as the first transaction duplication risk. Then, the first transaction repetition risk between the current node a and other nodes in the i-th transaction interval is obtained;

[0064] (3) Further, all the first transaction repetition risks of the current node in the i-th transaction interval are arranged from large to small according to the transaction volume between the current node and the corresponding other nodes, and the composed horizontal quantity is recorded as the first risk vector; wherein, if there is no transaction between the current node and a certain node, the first transaction repetition risk calculation is not performed for it.

[0065] The first risk vector of the current node in the i-th transaction interval is used as the i-th row of data in the time period transaction form of the current node, and then the first risk vector of the current node in each transaction interval is used as each row of data in the time period transaction form of the current node, thereby obtaining the time period transaction form of the current node.

[0066] Step S4, constructing a sensitive identification code of each node in the current transaction period based on the amplitude change in the frequency table corresponding to the transaction form of the period.

[0067] Replay attacks destroy the distribution of risks and cause changes in the risks of transactions between nodes. Therefore, the sensitive blocks of the current node are screened by comparing the changes in transaction behaviors in the form. The sensitive blocks of transaction risk changes at the moment established in the form are screened, and the replay threat of the attack is judged based on the changes in sensitivity.

[0068] There are many nodes in the huge supply chain, and the interval length can be preset differently, so the size of the form is different. After DCT transformation (discrete cosine transform), the form is split, and then according to the different contract participants in the split form, it is determined whether there is a contract that has been replayed in the contract of the current node. Specifically:

[0069] (1) Perform DCT transformation (discrete cosine transform) on the time period transaction form of the current node to obtain a frequency table corresponding to the time period transaction form of the current node;

[0070] (2) There are some temporary transactions in the supply chain, that is, there are some nodes with extremely low frequency transactions among the transaction objects of the current node. Due to the small number of transactions, the supply chain nodes will strictly verify the authenticity of the contracts when trading with uncommon nodes. Therefore, the transaction popularity between the current node and its transaction objects is analyzed, and nodes with insufficient transaction popularity are deleted. Then, the sensitive identification code of the current node in the transaction period is constructed through the remaining nodes, which is specifically:

[0071] First, in the frequency table corresponding to the time period transaction form of the current node mentioned above, the amplitude of each frequency component reflects the risk of improper trading behavior in the transaction process between the current node and other nodes. Therefore, the sequence composed of the amplitudes of all frequency domain components in the frequency table arranged in descending order is recorded as an amplitude sequence, and the absolute value of the difference between the amplitudes of each two adjacent elements in the amplitude sequence is calculated, which is recorded as the amplitude difference between the two adjacent elements. The maximum value of all the amplitude differences in the amplitude sequence is obtained, and the amplitude sequence is divided between the two adjacent elements corresponding to the maximum value, and the amplitude sequence is divided into two sub-sequences. The frequencies in the sub-sequence with large amplitude are regarded as high-heat frequencies, and the frequencies in the sub-sequence with small amplitude are regarded as low-heat frequencies.

[0072] Then, the position of the high heat frequency in the frequency table of the current node is marked as 1, and the position of the low heat frequency is marked as 0.

[0073] Afterwards, the maximum chain length is preset. Preferably, in the embodiment of the present application, the maximum chain length is set to 256. As other embodiments of the present application, the implementer can set the maximum chain length according to the actual situation. For each row of frequency data in the frequency table, if the number of elements in each row of frequency data is less than the preset maximum chain length, 0 is added to the end of each row of frequency data. If the number of elements in each row of frequency data is greater than the preset maximum chain length, each row of frequency data is truncated. Thereby, the number of elements in each row of the frequency table is the same, and the frequency table at this time is recorded as the first frequency table.

[0074] Finally, for the frequency data in the first frequency table, the mark values ​​of the positions corresponding to all the frequency data are extracted and arranged from left to right and then from top to bottom according to their positions in the first frequency table, and the string of binary numbers obtained by the arrangement is recorded as the sensitive behavior identification code of the current node during the transaction period; the identification code is converted into a hexadecimal number with every 4 bits of binary number, and the obtained string of codes is recorded as the sensitive identification code of the current node during the transaction period.

[0075] Step S5, constructing a looseness evaluation of each node in the current trading period based on the difference between the sensitive identification code of the current trading period and the previous trading period; and determining abnormal contracts in the current trading period based on the looseness evaluation.

[0076] The sensitive identification code is used to analyze whether the transaction environment of the node is stable, and further judge the effect of the disruption of the supply and demand situation between nodes, specifically:

[0077] (1) Obtain the sensitive identification codes of the current node a in the current trading period and the previous trading period respectively through the above method. The current trading period is recorded as r, and the Hamming distance between the sensitive identification codes of the current trading period and the previous trading period is recorded as d a (H r-1 ,H r ), and the difference bits of the sensitive identification code;

[0078] (2) Analyze the node supply and demand information represented by the sensitive authentication code difference bits. Based on the supply and demand matching tacit understanding obtained by the supply and demand information exchange mechanism between nodes, and the number of authentication code difference bits after being interrupted by replay, the risk of being attacked is defined and the attack location is further locked.

[0079] Due to the change in transaction behavior corresponding to high heat frequency, and the different distribution of the mark position in the authentication code, the transaction environment is first judged, and the loose evaluation of the current node that may be invaded by replay attack in the current period is calculated. The expression is:

[0080]

[0081] In the formula, S a,r is the loose evaluation of the current node a in the current trading period; l r,1 is the longest number of consecutive 1s in the binary sensitive behavior identification code of the current node a during the current trading period; d(H r-1 ,H r ) is the Hamming distance between the sensitive identification code of the current node a in the current trading period and its previous trading period.

[0082] The larger it is, the more concentrated the frequency band of transaction risks generated by the current node is, which means that the current node can specifically screen out targets that may be at risk, that is, for the transaction chain, the current node can specifically prevent the threat of possible replay attacks.

[0083] (3) S a,r The percentage form is recorded as S′ a,r %, arrange the transaction repetition risks of all transaction intervals in the current trading period in descending order, and obtain the first S′ in the arrangement resulta,r % of the transaction interval is used as the transaction interval that may be used to replay the current node, and is marked;

[0084] (4) During the marked transaction interval, the transaction contracts generated by the current node are reviewed and the contracting parties of the abnormal contracts are notified to correct the impact of the abnormal transactions.

[0085] Step S6: The abnormal contracts are uniformly signed as new contracts and stored in the blockchain for subsequent abnormality tracing by nodes that discover the abnormal contracts.

[0086] The above method completes the screening of abnormal contracts in the current trading period by the current node. Furthermore, the same method as the current node screening abnormal contracts in the current trading period is used to screen abnormal contracts in other nodes in the supply chain. The screened abnormal contract data of all nodes in the supply chain are uniformly signed as new contracts and stored in the blockchain for subsequent abnormal tracing by nodes that discover abnormal contracts.

[0087] The schematic diagram of the process of obtaining the first transaction repetition risk is as follows Figure 2 shown.

[0088] Based on the same inventive concept as the above method, an embodiment of the present application also provides a blockchain-based cargo supply chain data traceability system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of any one of the above-mentioned blockchain-based cargo supply chain data traceability methods are implemented.

[0089] In summary, the embodiment of the present application provides a data traceability method for a goods supply chain based on blockchain, which establishes a transaction form of a node through the transaction behavior of the node, and screens sensitive transaction behaviors in the form, and combines the changes in the stable relationship between supply and demand in the supply chain to screen abnormal contracts in the current node, thereby reducing the amount of review data for the node;

[0090] By obtaining the cargo information of each transaction between any two participants in the cargo supply chain, each contract vector between any two participants is constructed; each participant is taken as each node, and the transaction repetition risk is analyzed based on the similarity of the contract vector between any two nodes, and then the first transaction repetition risk between nodes at each transaction interval is determined based on the accumulated contract vector at each transaction interval, and the period transaction form of each node in each transaction period is constructed; the sensitive identification code is constructed based on the amplitude change in the frequency table corresponding to the period transaction form; the loose evaluation of each node in the current transaction period is constructed based on the difference between the sensitive identification code of the current transaction period and the previous transaction period; the abnormal contract in the current transaction period is determined based on the loose evaluation; the abnormal contract is uniformly signed as a new contract and stored in the blockchain for subsequent abnormal traceability of the node that discovers the abnormal contract. It avoids the problem of insufficient distinction of the sensitivity of the risk change of transaction behavior between nodes by distinguishing only by preset passwords such as static identifiers on the contract; and improves the traceability speed and accuracy of supply chain data.

[0091] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

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

[0093] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims

1. A cargo supply chain data traceability method based on blockchain, characterized in that: The method comprises the following steps: Obtain cargo information every time a cargo transaction occurs between any two participants in the cargo supply chain; Taking each participant as each node, constructing each contract vector between any two nodes based on the cargo information of each transaction between the two nodes; calculating the transaction duplication risk between the two nodes based on the similarity between different contract vectors of the two nodes; From the initial transaction interval to any transaction interval, based on the contract vector of the transaction between nodes and in combination with the calculation method of the transaction duplication risk, the first transaction duplication risk between any two nodes in any transaction interval is obtained, and the first risk vector of each node in any transaction interval is constructed; based on the first risk vector, a period transaction form of each node in the current transaction period is constructed; Constructing a sensitive identification code for each node in the current trading period based on the amplitude change in the frequency table corresponding to the transaction form of the period; Constructing a looseness evaluation of each node in the current trading period based on the difference between the sensitive identification code of the current trading period and the previous trading period; determining abnormal contracts in the current trading period based on the looseness evaluation; The abnormal contracts are uniformly signed as new contracts and stored in the blockchain for subsequent abnormality tracing by nodes that discover the abnormal contracts.

2. The method for tracing the source of goods supply chain data based on blockchain as claimed in claim 1, characterized in that: The process of obtaining each contract vector between any two nodes is as follows: For each cargo transaction between any two nodes, a vector consisting of all items of cargo information of the cargo transaction is recorded as each contract vector between the any two nodes.

3. The method for tracing the source of goods supply chain data based on blockchain as claimed in claim 1, characterized in that: The process of obtaining the transaction duplication risk between any two nodes is as follows: Obtain a set of contract vectors of all transactions between any two nodes, recorded as the contract vector set; calculate the similarity between any two contract vectors in the contract vector set, recorded as the first similarity; calculate the average value of all the first similarities in the contract vector set, recorded as the similarity mean; record the transaction duplication risk between the current node a and any other node a′ as R a,a′ , R a,a′ The expression is: In the formula, is the number of transactions between any other node a′ and the current node a; The total number of transactions performed by the current node a; S d,a′ is the mean similarity between the current node a and any other node a′; is the average of the similarity means between the current node a and all other nodes; σ s is the standard deviation of the similarity mean between node a and all other nodes.

4. The method for tracing the source of goods supply chain data based on blockchain as claimed in claim 1, characterized in that: The process of obtaining the first transaction repetition risk is as follows: From the initial transaction interval to any transaction interval, a set of contract vectors of all transactions between any two nodes is obtained as a cumulative set of contracts between any two nodes at any transaction interval; At any transaction interval, based on the cumulative set of contracts between any two nodes, the same calculation method as the transaction duplication risk is adopted to obtain the transaction duplication risk between any two nodes at any transaction interval, which is recorded as the first transaction duplication risk.

5. The method for tracing the source of goods supply chain data based on blockchain according to claim 1, characterized in that: The first risk vector of each node in any transaction interval is: the horizontal amount of the first transaction repetition risk composition between the current node and all other nodes in any transaction interval is taken as the first risk vector of the current node in any transaction interval.

6. The method for tracing the source of goods supply chain data based on blockchain as claimed in claim 1, characterized in that: The process of obtaining the period transaction form is as follows: The first risk vector of the current node in each transaction interval is used as each row of data in the time period transaction form of the current node to obtain the time period transaction form of the current node.

7. The method for tracing the source of goods supply chain data based on blockchain as claimed in claim 1, characterized in that: The process of obtaining the sensitive identification code is as follows: In the current trading period, the frequency table corresponding to the period trading form of the current node is obtained through the time-frequency conversion algorithm, and the sequence composed of the amplitudes of all frequency domain components in the frequency table is recorded as the amplitude sequence. The division position of the amplitude sequence is determined based on the amplitude difference between adjacent elements in the amplitude sequence, and two subsequences are obtained by division. The frequencies in the subsequence with large amplitude are regarded as high-heat frequencies, and the frequencies in the subsequence with small amplitude are regarded as low-heat frequencies; Mark the position of the high heat frequency in the frequency table of the current node as 1, and mark the position of the low heat frequency as 0; If the number of frequency data in each row of the frequency table is less than the preset value, add 0 at the end of each row of frequency data; Otherwise, each row of frequency data is truncated, and the obtained frequency table is recorded as the first frequency table; Arrange the mark values ​​of the positions corresponding to all the frequency data in the first frequency table, and the resulting string of binary numbers is recorded as the sensitive behavior identification code of the current node in the current trading period; convert the sensitive behavior identification code into hexadecimal numbers with every 4 bits of binary numbers, and the resulting string of codes is recorded as the sensitive identification code of the current node in the current trading period.

8. The method for tracing the source of goods supply chain data based on blockchain as claimed in claim 7, characterized in that: The process of obtaining the loose evaluation of each node in the current trading period is as follows: For the current node a, calculate the Hamming distance between the sensitive identification code of the current trading period and its previous trading period, denoted as d a (H r-1 ,H r );Record the loose evaluation of the current node in the current trading period as S a,r , S a,r The expression is: In the formula, l r,1 It is the longest number of consecutive 1s in the sensitive behavior identification code of the current node in the current trading period.

9. The method for tracing the source of goods supply chain data based on blockchain as claimed in claim 8, characterized in that: The process of obtaining abnormal contracts in the current trading period is as follows: S a,r The percentage form is recorded as S ′ a,r %, sort the transaction repetition risks of all transaction intervals in the current trading period from large to small, and sort the first S ′ a,r % of the transaction intervals are marked; within the marked transaction intervals, the generated transaction contracts are reviewed to identify abnormal contracts.

10. A goods supply chain data traceability system based on blockchain, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Method for extracting and parsing bitcoin transaction autonomy information

    US12626253B2

  • Method for extracting and parsing bitcoin transaction autonomy information

    US20250037124A1