A method and system for collaborative control based on on-chain and off-chain interoperation of blockchain

By analyzing and optimizing decisions on off-chain data in logistics transactions, the problems of low data storage efficiency and high cost in the blockchain system are solved, efficient utilization and legality verification are achieved, and the flexibility and flexibility of the blockchain are improved. User experience.

CN118012958BActive Publication Date: 2024-09-20STATE GRID SHANDONG ELECTRIC POWER CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410296318.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2024-09-20
Estimated Expiration
2044-03-15

AI Technical Summary

Technical Problem

The existing blockchain system lacks analysis of data on-chain storage in the logistics field, resulting in low actual utilization and high costs of the blockchain, and the inability to effectively verify the integrity and legality of transactions.

Method used

By obtaining off-chain data in logistics transactions, analyze it to generate on-chain data, determine whether it meets on-chain storage standards, and make optimization decisions based on storage costs to ensure that on-chain storage is only performed when the cost is low and beneficial to avoid unnecessary data interaction.

Benefits of technology

It improves the utilization and flexibility of the blockchain, ensures the legality and integrity of data, while reducing storage costs and improving user experience and transaction flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118012958B
    Figure CN118012958B
Patent Text Reader

Abstract

The present invention belongs to the technical field of blockchain. The present invention provides a method and system for collaborative control between on-chain and off-chain interoperation based on blockchain, including: acquiring off-chain data in logistics transactions, obtaining on-chain data based on analysis of the off-chain data, the on-chain data including a data on-chain storage determination value ZJY, comparing the on-chain storage determination value ZJY with an on-chain storage determination threshold, determining whether an on-chain information group meets an on-chain storage standard, and generating a signal. Based on an unqualified signal, the on-chain information group is not stored on the chain. The present invention determines whether the off-chain data meets the on-chain storage standard by analyzing the off-chain data, thereby preventing the off-chain data stored on the chain from being unable to guarantee the integrity and legitimacy of the transaction verification. At the same time, the off-chain data that does not meet the on-chain storage standard is not stored on the chain, and the interaction between the on-chain and off-chain is controlled to achieve efficient use of blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of blockchain technology, and specifically relates to a method and system for collaborative control based on on-chain and off-chain interoperability of blockchain. Background Art

[0002] With the rapid development of blockchain technology, it has been widely used in finance, logistics, medical and other fields. However, in the field of logistics, traditional blockchain systems mainly verify on-chain and off-chain data to protect the security and efficiency of logistics transactions and the non-tampering of data, but lack analysis of data storage on the chain.

[0003] A Chinese patent application with publication number CN111522882A discloses an internal model management system and method based on blockchain, including: an internal model data storage subsystem and an internal model settlement subsystem; wherein the internal model data storage subsystem adopts a data platform + blockchain structure, stores the internal model business data used for the internal simulation market of the enterprise in the data platform, and the lightweight metadata of the internal model business data is chained to the blockchain, and each node of the blockchain reaches a consensus and stores evidence; the internal model settlement subsystem is connected to the internal model data storage subsystem, and is used to send internal model business data access request information to the blockchain; after the blockchain passes the access request, it accesses the internal model business data in the data platform, performs internal model settlement, and stores the internal model settlement results on the blockchain. The present invention is based on the consensus mechanism of blockchain to improve the objectivity and accuracy of internal model management. The capacity of the blockchain is expanded, and the data on and off the chain are coordinated to ensure data consistency.

[0004] In the existing technology, the coordination and consistency of on-chain and off-chain data are analyzed in depth, but there is a lack of analysis of on-chain data before storage. Not all data on the blockchain is critical, which reduces the actual utilization rate of the blockchain and increases consumption costs.

[0005] To this end, the present invention provides a method and system for collaborative control based on on-chain and off-chain interoperability of blockchain. Summary of the invention

[0006] In order to make up for the deficiencies of the prior art, at least one technical problem raised in the background technology is solved.

[0007] The technical solution adopted by the present invention to solve the technical problem is: a collaborative control method based on the on-chain and off-chain interoperability of blockchain, comprising:

[0008] Step 1: Obtain off-chain data in logistics transactions;

[0009] Step 2: Based on the analysis of off-chain data, the on-chain data is obtained, and the on-chain data includes the data on-chain storage determination value ZJY;

[0010] Step 3: Compare the on-chain storage determination value ZJY with the on-chain storage determination threshold, determine whether the on-chain information group meets the on-chain storage standard according to the comparison result, and generate a signal, which includes a qualified signal and a failed signal;

[0011] If the up-chain storage determination value ZJY ≥ the up-chain storage determination threshold ZXC, it means that the up-chain information group meets the up-chain storage standard and generates a qualified signal;

[0012] If the on-chain storage determination value ZJY is less than the on-chain storage determination threshold ZXC, it means that the on-chain information group does not meet the on-chain storage standard, and an unqualified signal is generated. Based on the unqualified signal, the on-chain information group is not stored on the chain.

[0013] As a further technical solution of the present invention, the off-chain data is aggregated and integrated to obtain an off-chain data table, and the off-chain data table is sent to both parties of the transaction respectively, and both parties of the transaction check the information contained in the off-chain data in the off-chain data table, and the information checked by both parties of the transaction in the off-chain data table is extracted and deduplicated;

[0014] Integrate all the deduplicated information and mark them as on-chain information groups, and obtain the percentage data of the on-chain information groups, where the percentage data includes the quantity deviation percentage and the quantity average percentage of the on-chain information groups;

[0015] The obtained quantity deviation proportion and quantity average proportion are marked as ZX and ZW respectively;

[0016] By formula: The chain storage determination value ZJY is obtained, where s1 and s2 are both preset proportional coefficients, s1 is 1.02, and s2 is 1.31.

[0017] As a further technical solution of the present invention, the method for obtaining the quantity deviation ratio ZX is:

[0018] Based on the records of on-chain data of each previous smart contract verification in the blockchain, the on-chain data of each smart contract verification is obtained, and the on-chain data of each smart contract verification is extracted and deduplicated to obtain an on-chain verification reference data group;

[0019] Compare the on-chain inspection reference data group with the on-chain information group, extract the identical information, and mark it as overlapping information to obtain the number of overlapping information. Perform difference processing on the number of overlapping information and the number of information in the on-chain inspection reference data group, and take the absolute value of the difference to obtain the number of non-overlapping information. Perform ratio processing on the number of non-overlapping information and the number of information in the on-chain inspection reference data group to obtain the quantity deviation percentage ZX.

[0020] As a further technical solution of the present invention, the method for obtaining the average proportion ZW of the quantity is as follows:

[0021] The on-chain information group is compared with the on-chain data verified by the smart contract each time, the same information is extracted and marked as the second overlapping information, the number of second overlapping information and the total number of on-chain data verified by the smart contract in the blockchain are counted, the number of second overlapping information is ratioed with the total number of on-chain data verified by the smart contract in the blockchain to obtain the average number of second overlapping information, the average number of second overlapping information is ratioed with the number of information in the on-chain information group to obtain the average quantitative proportion ZW.

[0022] As a further technical solution of the present invention, it also includes the following steps:

[0023] Step 4: Based on the qualified signal, the storage cost representation value SD of the uplink information group is obtained according to the storage representation value FG and the complexity representation value FH of the uplink information group;

[0024] Step 5: Based on the comparison result of the on-chain storage cost representation value SD and the storage cost representation threshold, the storage cost of the on-chain information group is determined. If the cost is high, the determination result is sent to both parties to the transaction for on-chain storage confirmation, and a confirmation signal is generated. The confirmation signal includes a confirmation storage signal and a confirmation non-storage signal.

[0025] The preset storage cost representation threshold is SJ;

[0026] If the on-chain storage cost representation value SD ≥ the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is high;

[0027] If the on-chain storage cost representation value SD is less than the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is low;

[0028] Based on the low cost, the on-chain information group is stored on the chain;

[0029] Based on the high cost, the determination result of the high on-chain cost of the on-chain information group is sent to both parties of the transaction. If both parties of the transaction confirm the on-chain storage, a confirmation storage signal is generated. Based on the confirmation storage signal, the on-chain information group is stored on the chain;

[0030] If both parties to the transaction confirm that no on-chain storage will be performed, a confirmation signal for non-storage will be generated.

[0031] As a further technical solution of the present invention, the storage characterization value FG is obtained in the following manner:

[0032] Based on the uplink information group, the data byte length of the uplink information group is obtained, and it is marked as the original data byte length of the uplink information group, and the uplink information group is serialized according to the on-chain storage format, and the byte length of the serialized uplink information group is recorded, and the original data byte length of the uplink information group is multiplied by the byte length of the serialized uplink information group to obtain the storage representation value FG of the uplink information group;

[0033] The method for obtaining the complexity characterization value is as follows:

[0034] Based on the uplink information group, the number of fields and the number of field types of the information contained in the uplink information group are obtained, and the number of fields and the number of field types are multiplied to obtain a complexity representation value FH of the uplink information group.

[0035] As a further technical solution of the present invention, it also includes the following steps:

[0036] Step 6: Based on the confirmation of the non-storage signal, the on-chain storage cost is optimized, and the optimized on-chain storage cost representation value ai is obtained. The on-chain storage beneficial parameter Si is output according to the optimized on-chain storage cost representation value ai and the data verification efficiency value bi, and the on-chain storage beneficial parameter Si is compared with the on-chain storage beneficial parameter threshold. If the on-chain storage is more beneficial, the judgment result is sent to both parties to the transaction, and the on-chain storage is confirmed again.

[0037] As a further technical solution of the present invention, the on-chain storage cost is optimized and the optimized on-chain storage cost representation value ai is obtained. The specific process is:

[0038] The on-chain information group is compared with the overlapping information. If the information in the on-chain information group is overlapping information, it will be retained. If the information in the on-chain information group is not overlapping information, it will be screened out to obtain the optimized on-chain information group. Based on the optimized on-chain information group, the optimized on-chain storage cost representation value ai is recalculated, and its calculation method is the same as the calculation method of the on-chain storage cost representation value of the on-chain information group.

[0039] As a further technical solution of the present invention, the data verification efficiency value bi is obtained in the following manner:

[0040] Based on the blockchain, obtain the time when the smart contract previously obtained the off-chain data that is the same as the coincident information and the time when the smart contract verified the off-chain data that is the same as the coincident information, and mark them as the off-chain data acquisition time and the off-chain data verification time respectively;

[0041] Obtain the time when the smart contract previously obtained the on-chain data that is identical to the coincident information and the time when the smart contract verified the on-chain data that is identical to the coincident information, and mark them as the on-chain data acquisition time and the on-chain data verification time respectively;

[0042] Sum the off-chain data acquisition time and the off-chain data verification time to get the off-chain data processing time, sum the on-chain data acquisition time and the on-chain data verification time to get the on-chain data processing time, perform difference processing on the on-chain processing time and the off-chain processing time, and take the absolute value of the difference to get the data processing time difference, perform ratio processing on the data processing time difference and the off-chain data processing time to get the data verification efficiency value bi.

[0043] A blockchain-based on-chain and off-chain interoperable collaborative control system, including:

[0044] Data collection module: obtain off-chain data in logistics transactions;

[0045] Analysis module: Based on the analysis of off-chain data, the on-chain data is obtained, and the on-chain data includes the data on-chain storage determination value ZJY;

[0046] Comparison module: compares the on-chain storage determination value ZJY with the on-chain storage determination threshold, determines whether the on-chain information group meets the on-chain storage standard according to the comparison result, and generates a signal, which includes a qualified signal and a unqualified signal;

[0047] Based on the unqualified signal, the uplink information group is not stored on the chain;

[0048] Data acquisition module: Based on the qualified signal, the storage cost representation value SD of the on-chain information group is obtained according to the storage representation value and complexity representation value output of the on-chain information group;

[0049] Storage confirmation module: According to the comparison result of the on-chain storage cost representation value SD and the storage cost representation threshold, the storage cost of the on-chain information group is determined. If the determination result is that the cost is high, the determination result is sent to the transaction parties for on-chain storage confirmation, and a confirmation signal is generated. The confirmation signal includes a storage confirmation signal and a non-storage confirmation signal;

[0050] Storing the uplink information group on the chain based on the confirmation storage signal;

[0051] Optimization confirmation module: Based on the confirmation of non-storage signal, the on-chain storage cost is optimized and the optimized on-chain storage cost representation value is obtained. The on-chain storage beneficial parameter Si is obtained according to the optimized on-chain storage cost representation value and the data verification efficiency value output, and the on-chain storage beneficial parameter is compared with the on-chain storage beneficial parameter threshold. If the on-chain storage is more beneficial, the judgment result is sent to both parties of the transaction, and the on-chain storage is confirmed again;

[0052] If both parties to the transaction finally confirm the storage, the cost-optimized on-chain information group will be stored on the chain;

[0053] If both parties to the transaction finally confirm that they will not store the information, the cost-optimized chain information group will not be stored on the chain.

[0054] The beneficial effects of the present invention are as follows:

[0055] 1. The method and system for collaborative control between on-chain and off-chain based on blockchain described in the present invention obtains off-chain data in logistics transactions, and obtains on-chain data based on analysis of the off-chain data. The on-chain data includes a data on-chain storage determination value ZJY, and compares the on-chain storage determination value ZJY with the on-chain storage determination threshold. According to the comparison result, it is determined whether the on-chain information group meets the on-chain storage standard, and a signal is generated. The signal includes a qualified signal and an unqualified signal. Based on the unqualified signal, the on-chain information group is not stored on the chain. The present invention determines whether the off-chain data meets the on-chain storage standard by analyzing the off-chain data, thereby preventing the off-chain data stored on the chain from being unable to guarantee the integrity and legitimacy of the transaction. At the same time, the off-chain data that does not meet the on-chain storage standard is not stored on the chain, and the interaction between the on-chain and off-chain is controlled to achieve efficient use of the blockchain.

[0056] 2. The present invention discloses a method and system for collaborative control of on-chain and off-chain interoperability based on blockchain. Based on a qualified signal, an on-chain storage cost characterization value SD of the on-chain information group is obtained according to the storage characterization value and complexity characterization value output of the on-chain information group. According to the comparison result of the on-chain storage cost characterization value SD and the storage cost characterization threshold, the storage cost of the on-chain information group is determined. If the determination result is that the cost is high, the determination result is sent to the transaction parties for on-chain storage confirmation, and a confirmation signal is generated. The confirmation signal includes a confirmation storage signal and a confirmation non-storage signal. The on-chain information group is stored on the chain based on the confirmation storage signal. The present invention evaluates the cost of on-chain storage, sends the evaluation determination result to the transaction parties when the cost is too high, and confirms the on-chain storage, thereby improving the flexibility and freedom of blockchain storage and blockchain transactions.

[0057] 3. The present invention discloses a method and system for collaborative control based on on-chain and off-chain interoperability of blockchain. Based on the confirmation of non-storage signal, the on-chain storage cost is optimized, and the optimized on-chain storage cost characterization value is obtained. The on-chain storage beneficial parameter Si is output according to the optimized on-chain storage cost characterization value and the data verification efficiency value, and the on-chain storage beneficial parameter is compared with the on-chain storage beneficial parameter threshold. If the on-chain storage is of high benefit, the judgment result is sent to the transaction parties, and the on-chain storage is confirmed again. If the transaction parties finally confirm the storage, the on-chain information group with optimized cost is stored on the chain. If the transaction parties finally confirm not to store, the on-chain information group with optimized cost is not stored on the chain. When the cost is too high and the transaction parties do not perform on-chain storage, the present invention optimizes the cost of on-chain storage, and conducts a comprehensive and integrated analysis based on the risks of not performing on-chain storage and the beneficialness of on-chain storage, and finally requests confirmation of on-chain storage to the transaction parties. The present invention realizes a comprehensive analysis of on-chain storage, improves user experience, and further improves the flexibility of on-chain storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The present invention will be further described below in conjunction with the accompanying drawings.

[0059] Figure 1 is a flow chart of Embodiment 1 of the present invention;

[0060] Figure 2 is a flow chart of Embodiment 2 of the present invention;

[0061] Figure 3 is a flowchart of Embodiment 3 of the present invention;

[0062] Figure 4 It is a system module diagram of the present invention. DETAILED DESCRIPTION

[0063] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.

[0064] Example 1

[0065] like Figure 1 As shown, the embodiment of the present invention is a method for collaborative control based on on-chain and off-chain interoperation of blockchain, including:

[0066] Step 1: Obtain off-chain data in logistics transactions, where off-chain data includes but is not limited to identity information of both parties to the transaction, transaction logistics status information, transaction logistics quantity information, transaction history information, account logistics storage information, and transaction time;

[0067] In some embodiments, off-chain data is collected through an off-chain system or intermediary to obtain off-chain data;

[0068] Step 2: Based on the analysis of off-chain data, the on-chain data is obtained, and the on-chain data includes the data on-chain storage determination value ZJY;

[0069] In some embodiments, the off-chain data is aggregated and integrated to form an off-chain data table, and the off-chain data table is sent to the transaction parties respectively. The transaction parties check the information contained in the off-chain data in the off-chain data table, and the information checked by the transaction parties in the off-chain data table is extracted and deduplicated;

[0070] It should be noted that the off-chain data table contains all the information in the off-chain data. The transaction parties can check the information that can be stored on the chain in the off-chain data table;

[0071] Integrate all the deduplicated information and mark them as on-chain information groups, and obtain the percentage data of the on-chain information groups, where the percentage data includes the quantity deviation percentage and the quantity average percentage of the on-chain information groups;

[0072] The obtained quantity deviation proportion and quantity average proportion are marked as ZX and ZW respectively;

[0073] By formula: The chain storage determination value ZJY is obtained, where s1 and s2 are both preset proportional coefficients, s1 is 1.02, and s2 is 1.31;

[0074] Exemplarily, the quantity deviation ratio ZX is obtained as follows:

[0075] Based on the records of on-chain data of each previous smart contract verification in the blockchain, the on-chain data of each smart contract verification is obtained, and the on-chain data of each smart contract verification is extracted and deduplicated to obtain an on-chain verification reference data group;

[0076] Compare the on-chain inspection reference data group with the on-chain information group, extract the same information, and mark it as overlapping information to obtain the number of overlapping information. Perform difference processing on the number of overlapping information and the number of information in the on-chain inspection reference data group, and take the absolute value of the difference to obtain the number of non-overlapping information. Perform ratio processing on the number of non-overlapping information and the number of information in the on-chain inspection reference data group to obtain the quantity deviation ratio ZX;

[0077] It should be noted that each time a smart contract verifies on-chain data, it will be recorded and stored in the blockchain. The on-chain data verified by the smart contract each time includes but is not limited to the identity information of both parties to the transaction, transaction logistics status information, transaction logistics quantity information, transaction history information, account logistics storage information, and transaction time.

[0078] Exemplarily, the method for obtaining the average proportion ZW of quantity is as follows:

[0079] Compare the on-chain information group with the on-chain data verified by the smart contract each time, extract the same information, and mark it as the second coincident information, count the number of second coincident information and the total number of on-chain data verified by the smart contract in the blockchain, and perform a ratio process on the number of second coincident information and the total number of on-chain data verified by the smart contract in the blockchain to obtain the average number of second coincident information, and perform a ratio process on the average number of second coincident information and the number of information in the on-chain information group to obtain the average proportion ZW;

[0080] Step 3: Compare the on-chain storage determination value ZJY with the on-chain storage determination threshold, determine whether the on-chain information group meets the on-chain storage standard according to the comparison result, and generate a signal, which includes a qualified signal and a failed signal;

[0081] The specific comparison process is as follows:

[0082] The preset threshold for on-chain storage determination is ZXC;

[0083] If the up-chain storage determination value ZJY ≥ the up-chain storage determination threshold ZXC, it means that the up-chain information group meets the up-chain storage standard and generates a qualified signal;

[0084] If the on-chain storage determination value ZJY is less than the on-chain storage determination threshold ZXC, it means that the on-chain information group does not meet the on-chain storage standard, and an unqualified signal is generated. Based on the unqualified signal, the on-chain information group is not stored on the chain.

[0085] Example 2

[0086] Based on Example 1, Figure 2 As shown, the embodiment of the present invention is based on a blockchain on-chain and off-chain interoperation collaborative control method, and further includes:

[0087] Step 4: Based on the qualified signal, the storage cost representation value SD of the uplink information group is obtained according to the storage representation value FG and the complexity representation value FH of the uplink information group;

[0088] Among them, based on the analysis of the uplink information group, the storage representation value and the complexity representation value of the uplink information group are obtained, and they are marked as FG and FH respectively;

[0089] By formula: The on-chain storage cost representation value SD is obtained, where a1 and a2 are both preset proportional coefficients, a1 is 1.326, and a2 is 1.034;

[0090] Exemplarily, the storage characterization value FG is obtained in the following manner:

[0091] Based on the uplink information group, the data byte length of the uplink information group is obtained, and it is marked as the original data byte length of the uplink information group, and the uplink information group is serialized according to the on-chain storage format, and the byte length of the serialized uplink information group is recorded, and the original data byte length of the uplink information group is multiplied by the byte length of the serialized uplink information group to obtain the storage representation value FG of the uplink information group;

[0092] Exemplarily, the complexity representation value is obtained in the following manner:

[0093] Based on the uplink information group, the number of fields and the number of field types of the information contained in the uplink information group are obtained, and the number of fields and the number of field types are multiplied to obtain a complexity representation value FH of the uplink information group;

[0094] Step 5: According to the comparison result between the on-chain storage cost representation value SD and the storage cost representation threshold, the storage cost of the on-chain information group is determined. If the determination result is that the cost is high, the determination result is sent to both parties of the transaction for on-chain storage confirmation, and a confirmation signal is generated. The confirmation signal includes a storage confirmation signal and a non-storage confirmation signal;

[0095] Specifically, the storage cost characterization threshold is preset as SJ;

[0096] If the on-chain storage cost representation value SD ≥ the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is high;

[0097] If the on-chain storage cost representation value SD is less than the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is low;

[0098] Based on the low cost, the on-chain information group is stored on the chain;

[0099] Based on the high cost, the determination result of the high on-chain cost of the on-chain information group is sent to both parties of the transaction. If both parties of the transaction confirm the on-chain storage, a confirmation storage signal is generated. Based on the confirmation storage signal, the on-chain information group is stored on the chain;

[0100] If both parties to the transaction confirm that no on-chain storage will be performed, a confirmation signal for non-storage will be generated.

[0101] Example 3

[0102] Based on Example 1 and Example 2, Figure 3 As shown, the embodiment of the present invention is based on a blockchain on-chain and off-chain interoperation collaborative control method, and further includes:

[0103] Step 6: Based on the confirmation of the non-storage signal, the on-chain storage cost is optimized, and the optimized on-chain storage cost representation value ai is obtained. The on-chain storage benefit parameter Si is obtained according to the optimized on-chain storage cost representation value ai and the data verification efficiency value bi, and the on-chain storage benefit parameter is compared with the on-chain storage benefit parameter threshold. If the on-chain storage is more beneficial, the judgment result is sent to both parties of the transaction, and the on-chain storage is confirmed again;

[0104] Specifically, the optimized on-chain storage cost representation value and data verification efficiency value are marked as ai and bi respectively;

[0105] By formula: Get the on-chain storage beneficial parameter Si, where , is the preset proportional coefficient;

[0106] Compare the on-chain storage benefit parameter Si with the on-chain storage benefit parameter threshold:

[0107] The preset threshold of beneficial parameters for on-chain storage is SE;

[0108] If the on-chain storage benefit parameter Si ≥ SE, it means that the on-chain storage is more beneficial, and the judgment result is sent to both parties of the transaction;

[0109] If the on-chain storage benefit parameter Si < SE, it means that the on-chain storage is less beneficial, and the judgment result will not be sent to the transaction parties, and the on-chain information group after the optimized cost will not be stored on the chain;

[0110] If both parties to the transaction finally confirm the storage, the cost-optimized on-chain information group will be stored on the chain;

[0111] If both parties to the transaction finally confirm that they will not store the information, the information group on the chain after cost optimization will not be stored on the chain;

[0112] Exemplarily, the optimized on-chain storage cost representation value ai is obtained as follows:

[0113] Compare the on-chain information group with the overlapping information. If the information in the on-chain information group is overlapping information, retain it. If the information in the on-chain information group is not overlapping information, filter it out to obtain the optimized on-chain information group. Based on the optimized on-chain information group, recalculate the optimized on-chain storage cost representation value ai. The calculation method is the same as the calculation method of the on-chain storage cost representation value of the on-chain information group.

[0114] Exemplarily, the data verification efficiency value bi is obtained as follows:

[0115] Based on the blockchain, obtain the time when the smart contract previously obtained the off-chain data that is the same as the coincident information and the time when the smart contract verified the off-chain data that is the same as the coincident information, and mark them as the off-chain data acquisition time and the off-chain data verification time respectively;

[0116] Obtain the time when the smart contract previously obtained the on-chain data that is identical to the coincident information and the time when the smart contract verified the on-chain data that is identical to the coincident information, and mark them as the on-chain data acquisition time and the on-chain data verification time respectively;

[0117] Sum the off-chain data acquisition time and the off-chain data verification time to get the off-chain data processing time, sum the on-chain data acquisition time and the on-chain data verification time to get the on-chain data processing time, perform difference processing on the on-chain processing time and the off-chain processing time, and take the absolute value of the difference to get the data processing time difference, perform ratio processing on the data processing time difference and the off-chain data processing time to get the data verification efficiency value bi.

[0118] Example 4

[0119] like Figure 4 As shown, the embodiment of the present invention is based on a blockchain-based on-chain and off-chain interoperable collaborative control system, including:

[0120] Data collection module: obtain off-chain data in logistics transactions;

[0121] Analysis module: Based on the analysis of off-chain data, the on-chain data is obtained, and the on-chain data includes the data on-chain storage determination value ZJY;

[0122] Comparison module: compares the on-chain storage determination value ZJY with the on-chain storage determination threshold, determines whether the on-chain information group meets the on-chain storage standard according to the comparison result, and generates a signal, which includes a qualified signal and a unqualified signal;

[0123] Based on the unqualified signal, the uplink information group is not stored on the chain;

[0124] Data acquisition module: Based on the qualified signal, the storage cost representation value SD of the on-chain information group is obtained according to the storage representation value and complexity representation value output of the on-chain information group;

[0125] Storage confirmation module: According to the comparison result of the on-chain storage cost representation value SD and the storage cost representation threshold, the storage cost of the on-chain information group is determined. If the determination result is that the cost is high, the determination result is sent to the transaction parties for on-chain storage confirmation, and a confirmation signal is generated. The confirmation signal includes a storage confirmation signal and a non-storage confirmation signal;

[0126] Storing the uplink information group on the chain based on the confirmation storage signal;

[0127] Optimization confirmation module: Based on the confirmation of non-storage signal, the on-chain storage cost is optimized and the optimized on-chain storage cost representation value is obtained. The on-chain storage beneficial parameter Si is obtained according to the optimized on-chain storage cost representation value and the data verification efficiency value output, and the on-chain storage beneficial parameter is compared with the on-chain storage beneficial parameter threshold. If the on-chain storage is more beneficial, the judgment result is sent to both parties of the transaction, and the on-chain storage is confirmed again;

[0128] If both parties to the transaction finally confirm the storage, the cost-optimized on-chain information group will be stored on the chain;

[0129] If both parties to the transaction finally confirm that they will not store the information, the cost-optimized chain information group will not be stored on the chain.

[0130] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0131] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A collaborative control method based on on-chain and off-chain interoperability of blockchain, characterized by: include: Step 1: Obtain off-chain data of logistics transactions; Step 2: Based on the analysis of off-chain data, the on-chain data is obtained, and the on-chain data includes the data on-chain storage determination value ZJY; The method of obtaining the on-chain storage judgment value ZJY is as follows: Based on the off-chain data, the off-chain data table is obtained by aggregating and integrating, and the off-chain data table is sent to the transaction parties respectively. The transaction parties check the information contained in the off-chain data in the off-chain data table, and the information checked by the transaction parties in the off-chain data table is extracted and deduplicated; Integrate all the deduplicated information and mark them as on-chain information groups, and obtain the percentage data of the on-chain information groups, where the percentage data includes the quantity deviation percentage and the quantity average percentage of the on-chain information groups; The obtained quantity deviation proportion and quantity average proportion are marked as ZX and ZW respectively; By formula: The chain storage determination value ZJY is obtained, where s1 and s2 are both preset proportional coefficients, s1 is 1.02, and s2 is 1.3; Step 3: Compare the on-chain storage determination value ZJY with the on-chain storage determination threshold, determine whether the on-chain information group meets the on-chain storage standard according to the comparison result, and generate a signal, which includes a qualified signal and a failed signal; If the up-chain storage determination value ZJY ≥ the up-chain storage determination threshold ZXC, it means that the up-chain information group meets the up-chain storage standard and generates a qualified signal; If the on-chain storage determination value ZJY is less than the on-chain storage determination threshold ZXC, it means that the on-chain information group does not meet the on-chain storage standard, and an unqualified signal is generated. Based on the unqualified signal, the on-chain information group is not stored on the chain.

2. According to claim 1, a collaborative control method based on on-chain and off-chain interoperability of blockchain is characterized by: The method for obtaining the quantity deviation ratio ZX is as follows: Based on the records of on-chain data of each previous smart contract verification in the blockchain, the on-chain data of each smart contract verification is obtained, and the on-chain data of each smart contract verification is extracted and deduplicated to obtain an on-chain verification reference data group; Compare the on-chain inspection reference data group with the on-chain information group, extract the identical information, and mark it as overlapping information to obtain the number of overlapping information. Perform difference processing on the number of overlapping information and the number of information in the on-chain inspection reference data group, and take the absolute value of the difference to obtain the number of non-overlapping information. Perform ratio processing on the number of non-overlapping information and the number of information in the on-chain inspection reference data group to obtain the quantity deviation percentage ZX.

3. According to claim 1, a collaborative control method based on on-chain and off-chain interoperation of blockchain is characterized by: The method for obtaining the average proportion ZW of the quantity is as follows: The on-chain information group is compared with the on-chain data verified by the smart contract each time, the same information is extracted and marked as the second overlapping information, the number of second overlapping information and the total number of on-chain data verified by the smart contract in the blockchain are counted, the number of second overlapping information is ratioed with the total number of on-chain data verified by the smart contract in the blockchain to obtain the average number of second overlapping information, the average number of second overlapping information is ratioed with the number of information in the on-chain information group to obtain the average quantitative proportion ZW.

4. According to claim 1, a collaborative control method based on on-chain and off-chain interoperability of blockchain is characterized by: The following steps are also included: Step 4: Based on the qualified signal, the storage cost representation value SD of the uplink information group is obtained according to the storage representation value FG and the complexity representation value FH of the uplink information group; Step 5: According to the comparison result between the on-chain storage cost representation value SD and the storage cost representation threshold, the storage cost of the on-chain information group is determined. If the determination result is that the cost is high, the determination result is sent to both parties of the transaction for on-chain storage confirmation, and a confirmation signal is generated. The confirmation signal includes a storage confirmation signal and a non-storage confirmation signal; The preset storage cost representation threshold is SJ; If the on-chain storage cost representation value SD ≥ the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is high; If the on-chain storage cost representation value SD is less than the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is low; Based on the low cost, the on-chain information group is stored on the chain; Based on the high cost, the determination result of the high on-chain cost of the on-chain information group is sent to both parties of the transaction. If both parties of the transaction confirm the on-chain storage, a confirmation storage signal is generated. Based on the confirmation storage signal, the on-chain information group is stored on the chain; If both parties to the transaction confirm that no on-chain storage will be performed, a confirmation signal for non-storage will be generated.

5. According to claim 4, a collaborative control method based on on-chain and off-chain interoperation of blockchain is characterized in that: The storage characterization value FG is obtained in the following manner: Based on the uplink information group, the data byte length of the uplink information group is obtained, and it is marked as the original data byte length of the uplink information group, and the uplink information group is serialized according to the on-chain storage format, and the byte length of the serialized uplink information group is recorded, and the original data byte length of the uplink information group is multiplied by the byte length of the serialized uplink information group to obtain the storage representation value FG of the uplink information group; The method for obtaining the complexity characterization value is as follows: Based on the uplink information group, the number of fields and the number of field types of the information contained in the uplink information group are obtained, and the number of fields and the number of field types are multiplied to obtain a complexity representation value FH of the uplink information group.

6. According to claim 1, a collaborative control method based on on-chain and off-chain interoperability of blockchain is characterized by: The following steps are also included: Step 6: Based on the confirmation of the non-storage signal, the on-chain storage cost is optimized, and the optimized on-chain storage cost representation value ai is obtained. The on-chain storage benefit parameter Si is obtained according to the optimized on-chain storage cost representation value ai and the data verification efficiency value bi, and the on-chain storage benefit parameter Si is compared with the on-chain storage benefit parameter threshold. If the on-chain storage is more beneficial, the judgment result is sent to both parties of the transaction, and the on-chain storage is confirmed again; If the on-chain storage benefit parameter Si ≥ SE, it means that the on-chain storage is more beneficial, and the judgment result is sent to both parties of the transaction; If the on-chain storage benefit parameter Si<SE, it means that the benefit of on-chain storage is low, and the judgment result will not be sent to the transaction parties, and the on-chain information group after optimization will not be stored on the chain.

7. According to claim 6, a collaborative control method based on the interoperability of blockchain on and off the blockchain is characterized in that: The on-chain storage cost is optimized and the optimized on-chain storage cost representation value ai is obtained. The specific process is as follows: The on-chain information group is compared with the overlapping information. If the information in the on-chain information group is overlapping information, it will be retained. If the information in the on-chain information group is not overlapping information, it will be screened out to obtain the optimized on-chain information group. Based on the optimized on-chain information group, the optimized on-chain storage cost representation value ai is recalculated, and its calculation method is the same as the calculation method of the on-chain storage cost representation value of the on-chain information group.

8. According to claim 6, a collaborative control method based on on-chain and off-chain interoperation of blockchain is characterized in that: The data verification efficiency value bi is obtained as follows: Based on the blockchain, obtain the time when the smart contract previously obtained the off-chain data that is the same as the coincident information and the time when the smart contract verified the off-chain data that is the same as the coincident information, and mark them as the off-chain data acquisition time and the off-chain data verification time respectively; Obtain the time when the smart contract previously obtained the on-chain data that is identical to the coincident information and the time when the smart contract verified the on-chain data that is identical to the coincident information, and mark them as the on-chain data acquisition time and the on-chain data verification time respectively; Sum the off-chain data acquisition time and the off-chain data verification time to get the off-chain data processing time, sum the on-chain data acquisition time and the on-chain data verification time to get the on-chain data processing time, perform difference processing on the on-chain processing time and the off-chain processing time, and take the absolute value of the difference to get the data processing time difference, perform ratio processing on the data processing time difference and the off-chain data processing time to get the data verification efficiency value bi.

9. A blockchain-based on-chain and off-chain interoperation collaborative control system, the system implements a blockchain-based on-chain and off-chain interoperation collaborative control method as described in any one of claims 1 to 8, characterized in that: include: Data collection module: obtain off-chain data in logistics transactions; Analysis module: Based on the analysis of off-chain data, the on-chain data is obtained, and the on-chain data includes the data on-chain storage determination value ZJY; The method of obtaining the on-chain storage judgment value ZJY is as follows: Based on the off-chain data, the off-chain data table is obtained by aggregating and integrating, and the off-chain data table is sent to the transaction parties respectively. The transaction parties check the information contained in the off-chain data in the off-chain data table, and the information checked by the transaction parties in the off-chain data table is extracted and deduplicated; Integrate all the deduplicated information and mark them as on-chain information groups, and obtain the percentage data of the on-chain information groups, where the percentage data includes the quantity deviation percentage and the quantity average percentage of the on-chain information groups; The obtained quantity deviation proportion and quantity average proportion are marked as ZX and ZW respectively; By formula: The chain storage determination value ZJY is obtained, where s1 and s2 are both preset proportional coefficients, s1 is 1.02, and s2 is 1.3; Comparison module: compares the on-chain storage determination value ZJY with the on-chain storage determination threshold, determines whether the on-chain information group meets the on-chain storage standard according to the comparison result, and generates a signal, which includes a qualified signal and a unqualified signal; Based on the unqualified signal, the uplink information group is not stored on the chain; Data acquisition module: Based on the qualified signal, the storage cost representation value SD of the on-chain information group is obtained according to the storage representation value and complexity representation value output of the on-chain information group; Storage confirmation module: According to the comparison result of the on-chain storage cost representation value SD and the storage cost representation threshold, the storage cost of the on-chain information group is determined. If the determination result is that the cost is high, the determination result is sent to the transaction parties for on-chain storage confirmation, and a confirmation signal is generated. The confirmation signal includes a storage confirmation signal and a non-storage confirmation signal; Among them, the preset storage cost representation threshold is SJ; If the on-chain storage cost representation value SD ≥ the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is high; If the on-chain storage cost representation value SD is less than the storage cost representation threshold SJ, it means that the on-chain storage cost of the on-chain information group is low; Storing the uplink information group on the chain based on the confirmation storage signal; Optimization confirmation module: Based on the confirmation of non-storage signal, the on-chain storage cost is optimized, and the optimized on-chain storage cost representation value is obtained. The on-chain storage beneficial parameter Si is obtained according to the optimized on-chain storage cost representation value and the data verification efficiency value output, and the on-chain storage beneficial parameter is compared with the on-chain storage beneficial parameter threshold. If the on-chain storage is more beneficial, the judgment result is sent to both parties of the transaction, and the on-chain storage is confirmed again; If the on-chain storage benefit parameter Si ≥ SE, it means that the on-chain storage is more beneficial, and the judgment result is sent to both parties of the transaction; If the on-chain storage benefit parameter Si < SE, it means that the on-chain storage is less beneficial, and the judgment result will not be sent to the transaction parties, and the on-chain information group after the optimized cost will not be stored on the chain; If both parties to the transaction finally confirm the storage, the cost-optimized on-chain information group will be stored on the chain; If both parties to the transaction finally confirm that they will not store the information, the cost-optimized chain information group will not be stored on the chain.