Time series data confusion processing and transaction method based on smart contract
Patent Information
- Application Number
- CN202310522679.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-10
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-05-10
AI Technical Summary
[0005]本发明提供了一种基于智能合约的时序数据混淆处理及交易方法,旨在解决区块链环境下的数据可靠存储和数据交易便利性问题
[0036]本发明提出了一种基于智能合约的时序数据混淆处理及交易方法,通过对时序数据混淆处理消除了原始数据的统计学特征,保障了数据在区块链平台中的安全性。相较于其他加密算法,混淆后的时序数据仍保留时序特征,数据存储节点可利用时序压缩算法实现数据高效存储,利用时序检索算法实现数据的快速访问。
Smart Images

Figure CN116595550B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart contract technology, and in particular to a time-series data transaction method based on smart contracts. Background Technology
[0002] In recent years, the emergence of blockchain technology has revolutionized multiple industry sectors, including fintech, supply chain management, healthcare, and education. By providing secure, transparent, and decentralized systems, it enables organizations to better meet the demands of competitive markets and end-user needs.
[0003] A smart contract is a computer program based on blockchain technology that can automatically execute contractual terms and has binding force. The emergence of smart contracts enables blockchain technology to be applied to a wider range of scenarios, such as the creation, transfer, and management of digital assets. Leveraging the decentralized nature of blockchain, smart contracts can achieve traceability and transparency in transactions, thereby providing a safer and more efficient trading environment for various industries.
[0004] The number of IoT devices is increasing dramatically, from large industrial sensors to various fitness trackers, all constantly generating time-series data. Ensuring the security of this data has become a key research area in computer science, with numerous encryption algorithms applied in blockchain and IoT environments. However, the extensive data encryption operations not only significantly increase the computational burden on systems but also create major obstacles for data sharing and transactions. Taking the commonly used AES encryption as an example, AES-encrypted time-series data does not retain its original temporal characteristics. When trading such IoT time-series data, data buyers find it difficult to select and purchase data with fine-grained precision. Based on the above background, this invention proposes a time-series data obfuscation and transaction method based on smart contracts. Obfuscation of time-series data can effectively eliminate all statistical characteristics of the data while still maintaining its original temporal characteristics, facilitating data transactions and compressed retrieval for all parties. Summary of the Invention
[0005] This invention provides a smart contract-based method for obfuscating and transacting time-series data, aiming to solve the problems of reliable data storage and convenient data transactions in a blockchain environment. This method enables trusted transactions of time-series data between different participants through smart contracts, and allows for fine-grained transactions along both the time and attribute dimensions of the data. Simultaneously, it uses smart contracts to construct complete transaction proofs, ensuring the transparency and traceability of transactions.
[0006] The technical solution adopted by this invention to achieve its technical objective is: a time-series data obfuscation processing and transaction method based on smart contracts, comprising the following three roles:
[0007] Data owner: The data owner is the original producer of the time-series data. Time-series data can be generated by IoT devices, such as ambient temperature and humidity over a period of time or bearing speed over a period of time.
[0008] Data users: Data users are the buyers of data who need to extract information from the data that is beneficial to them.
[0009] Data storage nodes: Data storage nodes are an alliance of multiple cloud service providers that participate in the blockchain as storage service providers.
[0010] Furthermore, data owners can upload time-series data to data storage nodes and use smart contracts to define data ranges and prices. Data users can purchase data through smart contracts under certain conditions and obtain complete transaction proof. Data storage nodes will charge a storage service fee and provide secure storage guarantees for the transactions.
[0011] Furthermore, such as Figure 2 As shown, after the time-series data is generated, the data owner generates a confusion sequence. This confusion sequence is then used to obfuscate the original data. Taking a simple data addition example, adding the original time-series data to the generated confusion sequence yields the obfuscated data. The obfuscated data does not possess the statistical characteristics of the original data but retains its temporal characteristics. Because the obfuscated data still retains its temporal characteristics, it can be efficiently compressed using time-series compression algorithms and quickly retrieved using time-series data retrieval algorithms.
[0012] Furthermore, the smart contracts included in the technical solution adopted by this invention include:
[0013] Obfuscated key generation contract: such as Figure 3 As shown, the obfuscation key generation contract takes the data user's public key and the obfuscation sequence provided by the data owner as input, and outputs an obfuscated key. This key can be used as input to the obfuscation sequence decomposition contract. The data key contains the data user's public key information; in the event of a key leak, the source of the leak can be traced through the blockchain.
[0014] Obfuscated sequence restoration contract: such as Figure 4 As shown, the obfuscated sequence restoration contract takes the obfuscated key as input and restores the corresponding obfuscated sequence. When a data user invokes this contract, the obfuscated sequence restoration operation is recorded on the blockchain for evidence storage to trace the source of key leakage issues.
[0015] Time-series data transaction contracts are used to exchange identity information and establish transactions between parties. Specifically, the data owner first generates a scrambled sequence corresponding to the original time-series data. Then, the original time-series data and the scrambled sequence are used to calculate the scrambled time-series data. The scrambled time-series data does not possess the statistical characteristics of the original data, but it can be used for data retrieval and compression, improving the system's data retrieval efficiency and space utilization. In addition, the scrambled sequence can be dynamically configured, generating separate scrambled sequences for time-series data with different attributes. Fine-grained data transactions can be achieved by using scrambled sequences with different attributes and time-series data from different times. Scrambling can be performed using methods such as data interpolation or data multiplication.
[0016] In a blockchain environment, the inputs and outputs of the above contracts are encrypted by default.
[0017] Furthermore, blockchain trading platforms leverage the decentralized and tamper-proof characteristics of blockchain to provide trusted data trading services to all parties. Simultaneously, data owners, data users, and data storage nodes conduct secure transactions through the blockchain platform. Using the smart contract-based time-series data trading method designed in this invention, statistical features are removed while preserving the time-series characteristics through data obfuscation. Data storage nodes are introduced, utilizing the hardware resources of cloud service providers to improve data retrieval and data storage efficiency.
[0018] Furthermore, in a blockchain environment, a three-party time-series data transaction method based on smart contracts involves the following specific implementation steps for transactions between the data owner and the data storage node:
[0019] Step 1: The data owner uses their private key, obfuscation sequence length, and obfuscation precision as input, and outputs the corresponding obfuscation sequence through a random generation function;
[0020] Step 2: The data owner calculates the obfuscated sequence with the original time series data to obtain the obfuscated time series data;
[0021] Step 3: The data owner and the data storage node sign a data storage contract to determine the fee and storage duration required for providing storage services;
[0022] Step 4: The data storage node copies the obfuscated time-series data multiple times for redundant storage.
[0023] The specific steps for transactions between data owners and data users are as follows:
[0024] Step 1: Data users initiate transactions with data owners and establish transaction contracts through the blockchain platform;
[0025] Step 2: After the transaction contract is established, the obfuscation key generation contract is invoked. The obfuscation key is generated by taking the public key of the data user and the obfuscation sequence provided by the data owner as inputs to restore the obfuscation sequence.
[0026] Step 3: The data owner withdraws funds from the contract;
[0027] Step 4: The data user extracts the obfuscation key from the contract.
[0028] The specific steps for transactions between data users and data storage nodes are as follows:
[0029] Step 1: Data users establish data transaction contracts with data storage nodes through the blockchain platform;
[0030] Step 2: Data storage nodes query and verify transactions between data owners and data users from the blockchain;
[0031] Step 3: After verification, the data storage node returns the corresponding obfuscated time-series data;
[0032] Step 4: After the data user obtains the corresponding obfuscated time series data, it calculates and restores the original data by combining it with the obfuscated sequence previously obtained from the data user.
[0033] All three transactions were conducted on a blockchain platform. The transparency and traceability of the blockchain platform effectively ensured the security of data transactions.
[0034] Furthermore, obfuscated sequences can obfuscate multi-attribute time-series data. Thanks to the ease of operation of obfuscated sequences, data users can dynamically select the required data range and data attributes to obtain the required data in a fine-grained manner.
[0035] Compared to other blockchain data encryption and transaction methods, this invention has the following advantages:
[0036] This invention proposes a smart contract-based method for obfuscating and transacting time-series data. By obfuscating the time-series data, the statistical characteristics of the original data are eliminated, ensuring data security within the blockchain platform. Compared to other encryption algorithms, the obfuscated time-series data retains its temporal characteristics. Data storage nodes can utilize time-series compression algorithms for efficient data storage and time-series retrieval algorithms for fast data access.
[0037] The time-series data trading method proposed in this invention benefits from continuity and operability, allowing data users to select time intervals and data attributes for trading in a fine-grained manner.
[0038] Because time-series data is characterized by large data volume, this invention introduces data storage nodes to provide data storage services for data owners and improves data reliability by redundant storage among alliance members, thus avoiding single points of failure. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the system architecture provided in an embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram illustrating data owner data obfuscation provided in an embodiment of the present invention;
[0041] Figure 3 A data key generation diagram provided for embodiments of the present invention;
[0042] Figure 4 The reconstruction diagram provided for the embodiments of the present invention;
[0043] Figure 5 This invention provides a fine-grained transaction graph for time-series data in an embodiment of the invention.
[0044] Figure 6 This is a transaction graph representing the time-series data attribute dimension provided in an embodiment of the present invention; Detailed Implementation
[0045] The technical solutions in the embodiments of the present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments.
[0046] This invention provides a method for obfuscating and transacting time-series data based on smart contracts, which can be applied to scenarios where time-series data is transacted securely in a blockchain environment.
[0047] This invention discloses a method for time-series data obfuscation and transaction based on smart contracts. The invention aims to solve the security and transaction convenience issues of time-series data storage in a blockchain environment. By combining blockchain technology and smart contracts, this invention enables trusted and fine-grained transactions of time-series data among different participants. The method obfuscates the time-series data, eliminating the statistical characteristics of the original data while preserving its temporal characteristics. The obfuscated data can still utilize data compression algorithms to improve data storage efficiency and time-series data retrieval algorithms to improve data access efficiency. These characteristics ensure secure storage and convenient access to data on the blockchain platform, while using the blockchain system to achieve transaction traceability, ensuring transaction transparency.
[0048] like Figure 1 The diagram shown is a preview of the system architecture provided in this embodiment. As can be seen from the diagram, this system includes data users, a blockchain platform, smart contracts, data owners, and data storage nodes.
[0049] The data owner is generally the data producer; in this invention, the data owner possesses the original time-series data. The data owner is responsible for generating a confusion sequence corresponding to the time-series data. This sequence is used to obfuscate the original time-series data, eliminating its statistical characteristics while preserving its highly compressible and fast retrieval properties.
[0050] Data users are generally consumers of data, performing statistical analysis on time-series data provided by data owners. Data users can trade specific portions of a data set provided by the data owner. For example, grape growers might be more interested in data from February and March (spring) and November (autumn), requiring fine-grained data consumption to facilitate statistical analysis of the impact of rainfall, temperature, and other factors on grape cultivation. Therefore, trading such time-series data is reasonable.
[0051] The data storage node is an alliance of multiple cloud service providers. This node provides data storage services to users on the blockchain platform through off-chain storage and on-chain verification, and receives a fee in return. Because time-series data is generally large in volume, it places high demands on computer hardware resources. Cloud service providers, on the other hand, offer flexible computing resources, making them suitable for providing storage services for data of various scales in a blockchain environment.
[0052] Blockchain platforms facilitate the establishment of contracts and consensus among parties, enabling them to publish information and initiate transactions. Thanks to the high transparency and traceability of blockchain platforms, transactions are highly secure. Furthermore, their traceability ensures the feasibility of three-party transactions; for example, data storage nodes can use the blockchain's traceability to query transaction information between data owners and users. All transactions can be traced within the blockchain, effectively preventing various types of attacks. After time-series data is generated, such as... Figure 2 As shown, the data owner generates a scrambled sequence. This scrambled sequence is then used to obfuscate the original data. Taking a simple data addition example, adding the original time-series data to the generated scrambled sequence yields the obfuscated data. The obfuscated data lacks the statistical characteristics of the original data but retains its temporal characteristics. Because the obfuscated data still retains its temporal characteristics, it can be efficiently compressed using time-series compression algorithms and quickly retrieved using time-series data retrieval algorithms.
[0053] The smart contracts involved in this invention include obfuscation key generation contracts, such as... Figure 3 As shown, this contract takes the data user's public key and a confusion sequence provided by the data owner as input, and outputs a confusion key. This key can be used as the output of the confusion sequence decomposition contract to obtain the corresponding confusion sequence. The confusion sequence decomposition contract is as follows: Figure 4As shown, the obfuscated sequence is restored using the obfuscated key as input. Time-series data transaction contracts are used to exchange identity information and construct transactions between parties. In a blockchain environment, the inputs and outputs of the above contracts are encrypted by default.
[0054] This invention is particularly applicable to time-series data trading scenarios in a blockchain environment. In today's rapidly expanding data volume, data generally suffers from inconsistent standards, low liquidity, low returns, and insufficient security. To avoid losses due to cloud data leaks, data owners typically employ inefficient and inconvenient peer-to-peer encrypted transactions, resulting in very limited data circulation. Simultaneously, many data owners lack sufficient computer hardware resources, potentially leading to significant waste of time-series data. This invention utilizes a smart contract-based time-series data trading method to ensure the security of cloud data storage through data obfuscation operations.
[0055] Furthermore, this invention also constructs a three-party data transaction method based on smart contracts. The data owner entrusts the data to the data storage node to reduce the pressure on local hardware resources. At the same time, the data storage node can obtain elastic income by utilizing the blockchain platform, and the data user can efficiently retrieve and obtain the required data.
[0056] The time-series data obfuscation method proposed in this invention is more flexible in data transactions compared to data compression. Data compression for on-chain transactions has many limitations. First, both parties must agree in detail on the data to be encrypted and traded before the transaction, and then the transaction is conducted through a contract on the blockchain, resulting in poor information flow. Using the method of this invention, the obfuscated data used by the data user still retains its basic data characteristics, allowing for fine-grained access by the data user. The data user only needs to select the desired time period and attributes for the time-series data to conduct the transaction.
[0057] The specific implementation steps of the above-mentioned three-party time-series data transaction method based on smart contracts are as follows:
[0058] I. Transactions between data owners and data storage nodes
[0059] Step 1: The data owner uses their private key, obfuscation sequence length, and obfuscation precision as input, and outputs the corresponding obfuscation sequence through a random generation function;
[0060] Step 2: The data owner calculates the obfuscated sequence with the original time series data to obtain the obfuscated time series data;
[0061] Step 3: The data owner and the data storage node sign a data storage contract to determine the fee and storage duration required for providing storage services;
[0062] Step 4: The data storage node copies the obfuscated time-series data multiple times for redundant storage.
[0063] II. Transactions between Data Owners and Data Users
[0064] Step 1: Data users initiate transactions with data owners and establish transaction contracts through the blockchain platform;
[0065] Step 2: After the transaction contract is established, the obfuscation key generation contract is invoked. The obfuscation key is generated by taking the public key of the data user and the obfuscation sequence provided by the data owner as inputs to restore the obfuscation sequence.
[0066] Step 3: The data owner withdraws funds from the contract;
[0067] Step 4: The data user extracts the obfuscation key from the contract.
[0068] III. Transactions between data users and data storage nodes
[0069] Step 1: Data users establish data transaction contracts with data storage nodes through the blockchain platform;
[0070] Step 2: Data storage nodes query and verify transactions between data owners and data users from the blockchain;
[0071] Step 3: After verification, the data storage node returns the corresponding obfuscated time-series data;
[0072] Step 4: After the data user obtains the corresponding obfuscated time series data, it calculates and restores the original data by combining it with the obfuscated sequence previously obtained from the data user.
[0073] The smart contract-based three-party time-series data transaction method unfolds through data transaction smart contracts. The time-series data is stored by data storage nodes, which also provide data retrieval services. Thanks to the mandatory and traceable characteristics of smart contracts, transaction information is stored on-chain, effectively ensuring the platform's information openness and transparency.
[0074] The length of the obfuscated sequence is equal to the length of the time-series data to be obfuscated.
[0075] The obfuscation precision is a controllable parameter used to control the range of randomly generated obfuscated sequences.
[0076] The data key generation contract, obfuscated sequence restoration contract, and data transaction contract proposed in this invention enable fine-grained transactions of time-series data on a blockchain platform. For example... Figure 5As shown, suppose a data owner has collected a batch of meteorological time-series data from March 20, 2023 to April 27, 2023 using their device. Different users have different uses for this data. A company needs the data for the first 15 days to analyze weather trends. The company obtains the sequence corresponding to the first 15 days of the obfuscated sequence through a transaction and calculates the original data with the obfuscated time-series data obtained from the data storage node, and then analyzes this type of data. Besides this company, an educational institution and a farmer also need data for different time periods. In this case, the data owner can conduct fine-grained transactions for different time period sequences. This invention improves the convenience and rationality of transactions by allowing transactions of obfuscated sequences.
[0077] In addition to enabling fine-grained transactions along the time dimension, this invention can also achieve fine-grained transactions along the data attribute dimension. By obfuscating different attributes of time-series data through sequence obfuscation, fine-grained acquisition of data attributes can also be achieved. For example... Figure 6 As shown, suppose there is a batch of time-series data with four different attributes, and an institution is more interested in attributes 2 and 3. During the transaction process, the data owner can generate a confused sequence for their data regarding attributes 2 and 3 and deliver it to the institution. The institution then uses the confused sequence of attributes 2 and 3, along with the confused time-series data extracted from the data storage node, to calculate the original data. In this context, the confused sequence transaction method employed in this invention enables fine-grained data attribute transactions.
[0078] Regarding the performance of this method, we conducted a simple experiment to verify it. We compared the obfuscated sequence transaction method with the original data transaction method. Using the RSA encryption algorithm, we compared the encryption time of obfuscated sequences of 100,000, 500,000, and 1,000,000 time-series data with the same amount of original data. The encryption times for the obfuscated sequence and original data proposed in this invention were: 0.09 seconds and 3.7 seconds for 100,000 data entries; 0.44 seconds and 18.6 seconds for 500,000 data entries; and 0.88 seconds and 37.78 seconds for 1,000,000 data entries. Therefore, we conclude that when using RSA to encrypt data for transactions, the speed of sequence data encryption is 43 times that of original data encryption. The method used in this invention significantly reduces the computational burden in blockchain data transactions and meets low storage requirements.
Claims
1. A method for time-series data obfuscation processing and transaction based on smart contracts, characterized in that... include I. Transactions between data owners and data storage nodes; II. Transactions between data owners and data users; III. Transactions between data users and data storage nodes; The transaction between the data owner and the data storage node is implemented as follows: Step 1: The data owner uses their private key, obfuscation sequence length, and obfuscation precision as input, and outputs the corresponding obfuscation sequence through a random generation function; Step 2: The data owner calculates the obfuscated sequence with the original time series data to obtain the obfuscated time series data; The original time-series data is added to the generated obfuscated sequence to obtain the obfuscated time-series data. The obfuscated time-series data does not have the statistical characteristics of the original data but retains the temporal characteristics of the data. Therefore, it can be efficiently compressed using time-series compression algorithms and can be quickly retrieved using time-series data retrieval algorithms. Step 3: The data owner and the data storage node sign a data storage contract to determine the fee and storage duration required for providing storage services; Step 4: The data storage node copies the obfuscated time-series data multiple times for redundant storage; The transaction between the data owner and the data user is implemented as follows: Step (1): The data user initiates a transaction with the data owner and establishes a transaction contract through the blockchain platform; Step (2): After the transaction contract is established, the obfuscation key generation contract is called, and the obfuscation key is generated by taking the public key of the data user and the obfuscation sequence provided by the data owner as input to restore the obfuscation sequence; Step (3): The data owner withdraws funds from the contract; Step (4): The data user extracts the obfuscation key from the contract.
2. The method for time-series data obfuscation processing and transaction based on smart contracts according to claim 1, characterized in that... The transactions between data users and data storage nodes are implemented as follows: Step 1: Data users establish data transaction contracts with data storage nodes through the blockchain platform; Step 2: The data storage node queries and verifies the transactions between the data owner and the data user from the blockchain; Step 3: After verification, the data storage node returns the corresponding obfuscated time-series data; Step 4: After obtaining the corresponding obfuscated time series data, the data user calculates and restores the original data by comparing it with the obfuscated sequence previously obtained from the data user.
3. The method for time-series data obfuscation processing and transaction based on smart contracts according to claim 1, characterized in that... The length of the obfuscated sequence is equal to the length of the time-series data to be obfuscated.
4. The method for time-series data obfuscation processing and transaction based on smart contracts according to claim 1, characterized in that... The obfuscation precision is a controllable parameter used to control the range of randomly generated obfuscated sequences.
Citation Information
Patent Citations
Ponzi scheme intelligent contract detection method based on transaction time sequence information on Ethereum
CN113191775A
Block chain-based big data privacy sharing security protection system and method
CN114584374A
