A method, device, equipment and readable storage medium for storing transaction data
Through transaction data consensus and off-chain storage in the blockchain network, the problems of insufficient collaboration, traceability and scalability of transaction data storage are solved, and unified storage and security improvement of data from multiple IoT devices are achieved.
Patent Information
- Application Number
- CN202111106337.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-22
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-09-22
AI Technical Summary
Existing transaction data storage methods have deficiencies in collaboration, traceability and scalability, especially when data interaction between IoT devices in different industries requires reliance on a third-party centralized system, resulting in system collaboration and traceability and weak scalability.
By receiving the original transaction data and signature results uploaded by IoT devices, consensus operations are performed in the preset blockchain network, summary results are generated and stored, and the transaction time, block height and original data are packaged and stored in the database to realize the chain Unified storage on and off the chain ensures data security and traceability.
It improves the collaboration and traceability of the transaction data storage system, enhances the scalability, ensures the unified storage and security of transaction data of multiple IoT devices, and realizes reliable transmission and query of cross-domain data.
Smart Images

Figure CN113781229B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a method, device, equipment and computer-readable storage medium for storing transaction data. Background Art
[0002] With the development of the Internet, when transaction data is generated between the nodes of the two parties to a transaction, the transaction data needs to be stored so as to record the relevant transactions and facilitate subsequent query and statistics of the relevant transactions.
[0003] At present, the common transaction data storage method is that each industry and each business independently stores the transaction data generated by it in a decentralized manner. When transaction data needs to be interacted between IoT devices in different industries, they need to rely on a third-party centralized system to complete the interaction, resulting in weak coordination, traceability, and scalability of the transaction data storage system.
[0004] In summary, how to effectively solve the problems of existing transaction data storage methods, such as weak coordination, traceability, and scalability of transaction data storage, is an issue that technical personnel in this field urgently need to solve. Summary of the invention
[0005] An object of the present invention is to provide a method for storing transaction data, which improves the coordination of the transaction data storage system, improves the traceability of transaction data, and enhances the scalability of the transaction data storage system; another object of the present invention is to provide a storage device, equipment and computer-readable storage medium for transaction data.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] A method for storing transaction data, comprising:
[0008] Receive the original transaction data and signature result uploaded by the target IoT device; wherein the signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result;
[0009] Performing a consensus operation on the original transaction data and the signature result in a preset blockchain network;
[0010] Determine whether consensus on the original transaction data and the signature result is successful;
[0011] If yes, the first summary result corresponding to the signature result is stored in the preset blockchain network, and the corresponding transaction time and block height stored on the current chain are generated;
[0012] The transaction time, the block height, the original transaction data and the signature result are packaged, and the packaged target data packet is stored in a preset database.
[0013] In a specific embodiment of the present invention, after storing the packaged target data packet in a preset database, the method further includes:
[0014] When receiving a verification request for the target data packet, searching the first summary result from the preset blockchain network according to the transaction time, the block height and the signature result in the target data packet;
[0015] Performing a digest calculation on the original transaction data in the target data packet to obtain a second digest result;
[0016] Determining whether the second summary result is consistent with the first summary result;
[0017] If yes, it is determined that the original transaction data is not distorted;
[0018] If not, it is determined that the original transaction data has been distorted.
[0019] In a specific implementation manner of the present invention, after determining that the second summary result is consistent with the first summary result, the method further includes:
[0020] Obtaining a device distributed identity corresponding to the first summary result from the preset blockchain network;
[0021] Searching for the target IoT device according to the device distributed identity;
[0022] Sending the signature result in the target data packet to the target IoT device, so that the target IoT device uses a built-in security chip to verify the signature result;
[0023] Determining that the original transaction data is not distorted includes:
[0024] When the signature verification returned by the target IoT device is successful, it is determined that the original transaction data is not distorted.
[0025] In a specific implementation of the present invention, after determining that the original transaction data is not distorted, the method further includes:
[0026] The target data packet is uploaded to a data center constructed by nodes of each industry.
[0027] In a specific implementation of the present invention, uploading the target data packet to a data center constructed by various industry nodes includes:
[0028] Uploading the target data packet to the preset blockchain network so that each of the industry nodes performs a consensus operation on the target data packet;
[0029] When each of the industry nodes successfully reaches a consensus on the target data packet, a pre-stored anonymous identity credential and an industry distributed identity identifier are obtained;
[0030] Finding a target industry node corresponding to the industry distributed identity identifier, so as to use the target industry node to perform a verification operation on the anonymous identity credential;
[0031] When the identity credential verification passed prompt information returned by the target industry node is received, the target data packet is uploaded to the data center.
[0032] In a specific embodiment of the present invention, it also includes:
[0033] Parse the received data query request to obtain the identity information of the query requester;
[0034] Determining whether the identity information of the query requester is legal;
[0035] If so, a corresponding transaction data query is performed from the preset database or the data center.
[0036] In a specific implementation of the present invention, after querying the corresponding transaction data from the preset database or the data center, the method further includes:
[0037] Perform verification operations on the queried target transaction data.
[0038] A storage device for transaction data, comprising:
[0039] A data and signature receiving module, used to receive the original transaction data and signature result uploaded by the target IoT device; wherein the signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result;
[0040] A data and signature consensus module, used to perform a consensus operation on the original transaction data and the signature result in a preset blockchain network;
[0041] A first judgment module is used to judge whether the consensus on the original transaction data and the signature result is successful;
[0042] The on-chain storage module is used to store the first summary result corresponding to the signature result to the preset blockchain network when it is determined that the consensus on the original transaction data and the signature result is successful, and generate the transaction time and block height corresponding to the on-chain storage at that time;
[0043] The off-chain storage module is used to package the transaction time, the block height, the original transaction data and the signature result, and store the packaged target data packet in a preset database.
[0044] A storage device for transaction data, comprising:
[0045] Memory for storing computer programs;
[0046] A processor is used to implement the steps of the transaction data storage method as described above when executing the computer program.
[0047] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the transaction data storage method as described above.
[0048] The transaction data storage method provided by the present invention receives the original transaction data and signature results uploaded by the target Internet of Things device; wherein the signature result is obtained by performing a summary calculation on the original transaction data, and signing the calculated first summary result; performing a consensus operation on the original transaction data and the signature result in a preset blockchain network; judging whether the consensus on the original transaction data and the signature result is successful; if so, storing the first summary result corresponding to the signature result in the preset blockchain network, and generating the corresponding transaction time and block height stored on the current chain; performing a packaging operation on the transaction time, block height, original transaction data and signature result, and storing the packaged target data packet in a preset database.
[0049] It can be seen from the above technical solution that by reaching consensus on the original transaction data and the corresponding signature result in the preset blockchain network, after the consensus is successful, the first summary result corresponding to the original transaction data is stored on the preset blockchain network, and the transaction time, block height, original transaction data and signature result corresponding to the current on-chain storage are packaged and stored in the preset database to complete the off-chain storage. By combining on-chain summary storage with off-chain full data storage, unified storage of transaction data of multiple IoT devices is achieved, and the synergy of the transaction data storage system is improved. On-chain storage improves the security of transaction data storage, improves the traceability of transaction data, and enhances the scalability of the transaction data storage system.
[0050] Correspondingly, the present invention also provides a storage device, equipment and computer-readable storage medium for transaction data corresponding to the above-mentioned transaction data storage method, which has the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 A flowchart of a method for storing transaction data in an embodiment of the present invention;
[0053] Figure 2 Another implementation flow chart of the method for storing transaction data in an embodiment of the present invention;
[0054] Figure 3 This is an overall structural block diagram of a storage system for transaction data in an embodiment of the present invention;
[0055] Figure 4 This is a structural block diagram of an off-chain storage system for transaction data in an embodiment of the present invention;
[0056] Figure 5 A structural block diagram of a storage device for transaction data in an embodiment of the present invention;
[0057] Figure 6 This is a structural block diagram of a storage device for transaction data in an embodiment of the present invention;
[0058] Figure 7 A schematic diagram of the specific structure of a transaction data storage device provided in this embodiment. DETAILED DESCRIPTION
[0059] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0060] See also Figure 1 , Figure 1 This is a flow chart of an implementation of a method for storing transaction data in an embodiment of the present invention. The method may include the following steps:
[0061] S101: Receive the original transaction data and signature result uploaded by the target IoT device.
[0062] The signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result.
[0063] A security chip responsible for key generation, calculation, and sensitive data storage is pre-deployed inside the target IoT device. When the target IoT device needs to store the generated transaction data, the target IoT device performs a summary calculation on the original transaction data to obtain a first summary result, uses the security chip to sign the first summary result to obtain a signature result, and uploads the original transaction data and the signature result to the corresponding application node. The application node receives the original transaction data and signature result uploaded by the target IoT device.
[0064] S102: Perform consensus operation on the original transaction data and signature results in the preset blockchain network.
[0065] A blockchain network is pre-set, and the target public key in the public-private key pair generated by the security chip in the target IoT device is stored in the preset blockchain network. After receiving the original transaction data and signature results uploaded by the target IoT device, the application node performs a consensus operation on the original transaction data and signature results in the preset blockchain network, that is, each node in the preset blockchain network is used to verify the transaction data according to the original transaction data and signature results.
[0066] S103: Determine whether the consensus on the original transaction data and the signature result is successful. If not, execute step S104; if so, execute step S105.
[0067] After consensus operation is performed on the original transaction data and the signature result in the preset blockchain network, it is determined whether the consensus on the original transaction data and the signature result is successful. If not, it indicates that the original transaction data is distorted, and step S104 is executed. If so, it indicates that the original transaction data is transmitted normally without distortion, and step S105 is executed.
[0068] S104: Outputting a prompt message indicating that the transaction data is incorrect.
[0069] When it is determined that the consensus on the original transaction data and the signature result has failed, it means that the original transaction data is distorted, and a prompt message is output that the transaction data is incorrect, so as to prompt the user that the current transaction data storage application has failed.
[0070] S105: The first summary result corresponding to the signature result is stored in the preset blockchain network, and the corresponding transaction time and block height stored on the current chain are generated.
[0071] When the consensus on the original transaction data and the signature result is confirmed to be successful, it means that the original transaction data is transmitted normally without distortion. The signature result is decrypted using the pre-stored target public key to obtain the first summary result corresponding to the signature result, and the first summary result is stored in the preset blockchain network, and the corresponding transaction time and block height of the current on-chain storage are generated, thereby realizing the on-chain storage of transaction data. In addition, the application node can also generate storage status data.
[0072] S106: Packing the transaction time, block height, original transaction data and signature result, and storing the packaged target data packet in a preset database.
[0073] Pre-set the database corresponding to the application node. After generating the corresponding transaction time and block height for storage on the current chain, the transaction time, block height, original transaction data and signature result are packaged, and the packaged target data packet is stored in the preset database, thereby realizing the off-chain storage of transaction data. Following the description in step S105, if storage status data is generated, the storage status data can also be uploaded to the preset database.
[0074] By storing the first summary result in the preset blockchain network and storing the target data packet packaged by transaction time, block height, original transaction data and signature result in the preset database, while fully utilizing the security of blockchain technology, it avoids excessive occupation of blockchain storage space and fully utilizes the big data storage capacity of the database. By combining on-chain summary storage with off-chain full data storage, unified storage of transaction data of multiple IoT devices is achieved, and the synergy of the transaction data storage system is improved. On-chain storage improves the security of transaction data storage, improves the traceability of transaction data, and enhances the scalability of the transaction data storage system.
[0075] It can be seen from the above technical solution that by reaching consensus on the original transaction data and the corresponding signature result in the preset blockchain network, after the consensus is successful, the first summary result corresponding to the original transaction data is stored on the preset blockchain network, and the transaction time, block height, original transaction data and signature result corresponding to the current on-chain storage are packaged and stored in the preset database to complete the off-chain storage. By combining on-chain summary storage with off-chain full data storage, unified storage of transaction data of multiple IoT devices is achieved, and the synergy of the transaction data storage system is improved. On-chain storage improves the security of transaction data storage, improves the traceability of transaction data, and enhances the scalability of the transaction data storage system.
[0076] It should be noted that, based on the above embodiment, the embodiment of the present invention also provides corresponding improved solutions. In the subsequent embodiments, the same steps or corresponding steps as those in the above embodiment can be referenced to each other, and the corresponding beneficial effects can also be referenced to each other, which will not be repeated one by one in the following improved embodiments.
[0077] See also Figure 2 , Figure 2 Another implementation flow chart of the method for storing transaction data in an embodiment of the present invention is shown below. The method may include the following steps:
[0078] S201: Receive the original transaction data and signature result uploaded by the target IoT device.
[0079] The signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result.
[0080] S202: Perform consensus operation on the original transaction data and signature results in the preset blockchain network.
[0081] S203: Determine whether the consensus on the original transaction data and the signature result is successful. If not, execute step S204; if so, execute step S205.
[0082] S204: Outputting a prompt message indicating that the transaction data is incorrect.
[0083] S205: The first summary result corresponding to the signature result is stored in the preset blockchain network, and the corresponding transaction time and block height stored on the current chain are generated.
[0084] S206: Packing the transaction time, block height, original transaction data and signature result, and storing the packaged target data packet in a preset database.
[0085] See also Figure 4 , Figure 4 The following is a structural block diagram of an off-chain storage system for transaction data in an embodiment of the present invention. After the application node packages the transaction time, block height, original transaction data and signature result, it packages the transaction time, block height, original transaction data and signature result, and stores the packaged target data packet in a preset database.
[0086] Combined with actual applications, the Javacard-based IoT devices have added a Smart Contract module. The SmartContract module supports multiple blockchain protocols for applications, and the security of keys and data. The secure chip IoT application in IoT devices involves multiple related instructions. As shown in Table 1, Table 1 is a table of some related instructions involved in the secure chip IoT application.
[0087] Table 1
[0088] instruction describe READ RECORD Read the record file in the security chip UPDATE RECORD Update the record file in the security chip WRITE KEY Security chip generates key pair GENERATE PROOF Secure chip generates identity proof GET DATA Get security chip data GENERATE SIGNATURE Security chip generates data signature VERIFY SIGNATURE Security chip verifies data signature
[0089] S207: When a verification request for a target data packet is received, a first summary result is searched from a preset blockchain network according to the transaction time, block height and signature result in the target data packet.
[0090] After the packaged target data packet is stored in the preset database, when the application node receives a verification request for the target data packet, it searches for the first summary result from the preset blockchain network according to the transaction time, block height and signature result in the target data packet.
[0091] S208: Performing digest calculation on the original transaction data in the target data packet to obtain a second digest result.
[0092] The original transaction data in the target data packet is obtained, and a summary calculation is performed on the original transaction data, such as by hash value (HASH) calculation, MD5 value calculation, etc., to obtain a second summary result.
[0093] It should be noted that the first and second in the first summary result and the second summary result are only used to distinguish between the summary result found from the preset blockchain network and the summary result obtained by summarizing the original transaction data, and there is no distinction between size and order.
[0094] S209: Determine whether the second summary result is consistent with the first summary result. If not, execute step S210. If yes, execute step S211.
[0095] After finding the first summary result from the preset blockchain network and calculating the second summary result, it is determined whether the second summary result is consistent with the first summary result. If not, it means that the original transaction data in the target data packet has not been verified on the chain, and step S210 is executed. If yes, it means that the original transaction data in the target data packet has been verified on the chain, and step S211 is executed.
[0096] S210: Determine that the original transaction data is distorted.
[0097] When it is determined that the second summary result is inconsistent with the first summary result, it means that the original transaction data in the target data packet has failed the on-chain verification, and it is determined that the original transaction data has been distorted.
[0098] S211: Obtain a device distributed identity corresponding to the first summary result from a preset blockchain network.
[0099] When it is determined that the second summary result is consistent with the first summary result, it means that the original transaction data in the target data packet has passed the on-chain verification, and the device distributed identity (Decentralized Identifiers, DID) corresponding to the first summary result is stored in the preset blockchain network, and the device distributed identity corresponding to the first summary result is obtained from the preset blockchain network.
[0100] S212: Search for a target IoT device based on the device's distributed identity.
[0101] After obtaining the device distributed identity corresponding to the first summary result, the target Internet of Things device is searched according to the device distributed identity.
[0102] S213: Send the signature result in the target data packet to the target IoT device, so that the target IoT device uses a built-in security chip to verify the signature result.
[0103] After finding the target IoT device, the signature result in the target data packet is sent to the target IoT device. The target IoT device uses the target public key in the built-in security chip to decrypt and verify the signature result. If the decryption is successful, it means that the signature result verification is successful.
[0104] S214: When the signature verification is successful and is received from the target IoT device, it is determined that the original transaction data is not distorted.
[0105] When the target IoT device successfully verifies the signature result, it returns feedback information of successful signature verification to the application node. When the application node receives the signature verification success returned by the target IoT device, it means that the IoT device has passed the verification and the original transaction data is not distorted.
[0106] S215: Upload the target data packet to the data center constructed by the nodes of each industry.
[0107] After confirming that the original transaction data is not distorted, the target data packet is uploaded to the data center built by nodes in various industries, thereby ensuring the reliability of the transaction data uploaded to the data center and realizing cross-domain storage of transaction data.
[0108] In a specific implementation of the present invention, step S215 may include the following steps:
[0109] Step 1: Upload the target data packet to the preset blockchain network so that each industry node can perform consensus operations on the target data packet;
[0110] Step 2: When each industry node successfully reaches consensus on the target data packet, it obtains the pre-stored anonymous identity credentials and industry distributed identity identifiers;
[0111] Step 3: Find the target industry node corresponding to the industry distributed identity identifier, and use the target industry node to verify the anonymous identity credential;
[0112] Step 4: When receiving the identity credential verification passed prompt information returned by the target industry node, upload the target data packet to the data center.
[0113] For the convenience of description, the above four steps can be combined for explanation.
[0114] See also Figure 3 , Figure 3 The figure is an overall structural block diagram of a storage system for transaction data in an embodiment of the present invention. The entire system mainly includes regulatory nodes, industry nodes, application nodes, and Internet of Things devices. Among them, the regulatory node is mainly responsible for the access, authentication and management of industry nodes, generally using consortium chain technology, and is also responsible for the formulation of DID rules, providing industry node DID generation, and verification services. The DID identification coding rules for Internet of Things devices are set as: industry code: application code: device code. Among them, the industry code is generated by the corresponding industry node, the application code is generated by the corresponding application node, the device code is generated by the Internet of Things device, and the device code is generally calculated through the public key, thereby ensuring the uniqueness of the device code.
[0115] Industry nodes are mainly responsible for the access, authentication and management of application nodes, and participate in the DID generation and management of application nodes.
[0116] Application nodes, each node can be connected to multiple IoT devices and participate in the DID generation and management of application nodes. At the same time, it connects with terminal manufacturers to provide IoT device initialization services.
[0117] IoT devices are connected to corresponding application nodes. IoT devices have built-in security chips that are responsible for key generation, calculation, and sensitive data storage.
[0118] After confirming that the original transaction data is not distorted, the target data packet is uploaded to the preset blockchain network, and each industry node performs a consensus operation on the target data packet. When each industry node successfully reaches a consensus on the target data packet, the pre-stored anonymous identity credentials and industry distributed identity identifiers are obtained, and the target industry node corresponding to the industry distributed identity identifier is found. Since industry nodes participate in the generation and management of anonymous identity credentials of corresponding application nodes, after finding the target industry node corresponding to the distributed identity identifier, the anonymous identity credentials are verified using the target industry node. When the identity credential verification prompt information returned by the target industry node is received, the target data packet is uploaded to the data center.
[0119] S216: Parse the received data query request to obtain the identity information of the query requester.
[0120] After the target data packet containing transaction time, block height, original transaction data and signature results is stored, subsequent transaction data query services are provided. For special industry organizations, such as regulators and industry parties, data can be retrieved directly through the data center (mapped to the database service corresponding to the application node) through a dedicated query platform. For third-party applications, data queries can be performed by accessing industry nodes. According to the DID encoding rules, the data associated with industry nodes and application nodes can be determined. In specific operations, identity authentication is required between different industry nodes (queries between different industry nodes), and the query strategy is used to determine whether the industry node query service is supported. When the query requester needs to query transaction data, a data query request is sent to the application node. The data query request contains the identity information of the query requester. The application node parses the received data query request to obtain the identity information of the query requester.
[0121] S217: Determine whether the identity information of the query requester is legal, if not, execute step S218, if yes, execute step S219.
[0122] After parsing the query requester's identity information, determine whether the query requester's identity information is legal. If not, it means that the query requester's identity authentication has failed, and execute step S218. If so, it means that the query requester's identity authentication has passed, and execute step S219.
[0123] S218: Outputting a prompt message indicating that the identity information is illegal.
[0124] When it is determined that the identity information of the query requester is illegal, it means that the identity authentication of the query requester fails, and a prompt message indicating that the identity information is illegal is output.
[0125] S219: Query corresponding transaction data from a preset database or data center.
[0126] When it is determined that the identity information of the query requester is legal, it means that the identity authentication of the query requester is passed, and the corresponding transaction data query is performed from the preset database or data center.
[0127] S220: Perform verification operations on the queried target transaction data.
[0128] After the corresponding target transaction data is queried, the queried target transaction data is verified. The verification process of the target transaction data can refer to the on-chain verification process from step S207 to step S210, or the IoT device verification process from step S211 to step S213, which will not be described in detail in the embodiment of the present invention.
[0129] The present invention unifies the generation, storage, verification and query of transaction data, which helps to fully explore the value of data.
[0130] Corresponding to the above method embodiment, the present invention further provides a storage device for transaction data. The storage device for transaction data described below and the storage method for transaction data described above can refer to each other.
[0131] See also Figure 5 , Figure 5 This is a structural block diagram of a storage device for transaction data in an embodiment of the present invention. The device may include:
[0132] The data and signature receiving module 51 is used to receive the original transaction data and the signature result uploaded by the target IoT device; wherein the signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result;
[0133] The data and signature consensus module 52 is used to perform consensus operations on the original transaction data and signature results in a preset blockchain network;
[0134] The first judgment module 53 is used to judge whether the consensus on the original transaction data and the signature result is successful;
[0135] The on-chain storage module 54 is used to store the first summary result corresponding to the signature result to the preset blockchain network when it is determined that the consensus on the original transaction data and the signature result is successful, and generate the transaction time and block height corresponding to the on-chain storage at that time;
[0136] The off-chain storage module 55 is used to package the transaction time, block height, original transaction data and signature result, and store the packaged target data packet in a preset database.
[0137] It can be seen from the above technical solution that by reaching consensus on the original transaction data and the corresponding signature result in the preset blockchain network, after the consensus is successful, the first summary result corresponding to the original transaction data is stored on the preset blockchain network, and the transaction time, block height, original transaction data and signature result corresponding to the current on-chain storage are packaged and stored in the preset database to complete the off-chain storage. By combining on-chain summary storage with off-chain full data storage, unified storage of transaction data of multiple IoT devices is achieved, and the synergy of the transaction data storage system is improved. On-chain storage improves the security of transaction data storage, improves the traceability of transaction data, and enhances the scalability of the transaction data storage system.
[0138] In a specific embodiment of the present invention, the device may further include:
[0139] A summary result search module, configured to search for a first summary result from a preset blockchain network according to the transaction time, block height and signature result in the target data packet when receiving a verification request for the target data packet;
[0140] A summary result calculation module, used for performing summary calculation on the original transaction data in the target data packet to obtain a second summary result;
[0141] A second judgment module, used to judge whether the second summary result is consistent with the first summary result;
[0142] a non-distortion determination module, configured to determine that the original transaction data is not distorted when it is determined that the second summary result is consistent with the first summary result;
[0143] The distortion determination module is used to determine that the original transaction data is distorted when it is determined that the second summary result is inconsistent with the first summary result.
[0144] In a specific embodiment of the present invention, the device may further include:
[0145] A device identity acquisition module, configured to acquire a device distributed identity corresponding to the first summary result from a preset blockchain network after determining that the second summary result is consistent with the first summary result;
[0146] The device search module is used to search for target IoT devices based on the device’s distributed identity;
[0147] A signature result verification module is used to send the signature result in the target data packet to the target IoT device, so that the target IoT device can verify the signature result using the built-in security chip;
[0148] The non-distortion determination module is specifically a module that determines that the original transaction data is not distorted when the signature verification returned by the target IoT device is successful.
[0149] In a specific embodiment of the present invention, the device may further include:
[0150] The data packet upload module is used to upload the target data packet to the data center constructed by various industry nodes after confirming that the original transaction data is not distorted.
[0151] In a specific embodiment of the present invention, the data packet uploading module includes:
[0152] The data packet consensus submodule is used to upload the target data packet to the preset blockchain network so that each industry node can perform consensus operations on the target data packet;
[0153] The credential and industry identification acquisition submodule is used to obtain the pre-stored anonymous identity credentials and industry distributed identity identification when each industry node successfully reaches a consensus on the target data packet;
[0154] The identity credential verification submodule is used to find the target industry node corresponding to the industry distributed identity identifier, so as to use the target industry node to verify the anonymous identity credential;
[0155] The data packet upload submodule is used to upload the target data packet to the data center when receiving the identity credential verification passed prompt information returned by the target industry node.
[0156] In a specific embodiment of the present invention, the device may further include:
[0157] A query request parsing module is used to parse the received data query request to obtain the identity information of the query requester;
[0158] The third judgment module is used to judge whether the identity information of the query requester is legal;
[0159] The transaction data query module is used to perform corresponding transaction data query from a preset database or data center when it is determined that the identity information of the query requester is legal.
[0160] In a specific embodiment of the present invention, the device may further include:
[0161] The transaction data verification module is used to verify the queried target transaction data after the corresponding transaction data is queried from the preset database or data center.
[0162] Corresponding to the above method embodiment, see Figure 6 , Figure 6 A schematic diagram of a storage device for transaction data provided by the present invention, the device may include:
[0163] A memory 332, for storing computer programs;
[0164] The processor 322 is configured to implement the steps of the transaction data storage method of the above method embodiment when executing a computer program.
[0165] For details, please refer to Figure 7 , Figure 7A specific structural diagram of a storage device for transaction data provided in this embodiment, which may have relatively large differences due to different configurations or performances, may include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer applications 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the storage device 301 for transaction data.
[0166] The storage device 301 for transaction data may also include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .
[0167] The steps in the transaction data storage method described above can be implemented by the structure of the transaction data storage device.
[0168] Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:
[0169] Receive the original transaction data and signature result uploaded by the target IoT device; wherein the signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result; perform a consensus operation on the original transaction data and the signature result in a preset blockchain network; determine whether the consensus on the original transaction data and the signature result is successful; if so, store the first summary result corresponding to the signature result in the preset blockchain network, and generate the corresponding transaction time and block height stored on the current chain; package the transaction time, block height, original transaction data and signature result, and store the packaged target data packet in a preset database.
[0170] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0171] For an introduction to the computer-readable storage medium provided by the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.
[0172] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the devices, equipment and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0173] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the technical solution and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, the present invention can also be improved and modified without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for storing transaction data, It is characterized in that include: Receive the original transaction data and signature result uploaded by the target IoT device; wherein the signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result; Performing a consensus operation on the original transaction data and the signature result in a preset blockchain network; Determine whether consensus on the original transaction data and the signature result is successful; If yes, the first summary result corresponding to the signature result is stored in the preset blockchain network, and the corresponding transaction time and block height stored on the current chain are generated; Packing the transaction time, the block height, the original transaction data and the signature result, and storing the packaged target data packet in a preset database; When receiving a verification request for the target data packet, searching the first summary result from the preset blockchain network according to the transaction time, the block height and the signature result in the target data packet; Performing a digest calculation on the original transaction data in the target data packet to obtain a second digest result; Determining whether the second summary result is consistent with the first summary result; If yes, obtaining a device distributed identity corresponding to the first summary result from the preset blockchain network; Searching for the target IoT device according to the device distributed identity; Sending the signature result in the target data packet to the target IoT device, so that the target IoT device uses a built-in security chip to verify the signature result; When receiving a signature verification signal returned by the target IoT device that is successful, determining that the original transaction data is not distorted; Uploading the target data packet to the preset blockchain network so that each industry node performs a consensus operation on the target data packet; When each of the industry nodes successfully reaches a consensus on the target data packet, a pre-stored anonymous identity credential and an industry distributed identity identifier are obtained; Finding a target industry node corresponding to the industry distributed identity identifier, so as to use the target industry node to perform a verification operation on the anonymous identity credential; When receiving the identity credential verification passed prompt information returned by the target industry node, uploading the target data packet to the data center constructed by each industry node; If not, it is determined that the original transaction data has been distorted.
2. The method for storing transaction data according to claim 1, It is characterized in that Also includes: Parse the received data query request to obtain the identity information of the query requester; Determining whether the identity information of the query requester is legal; If so, a corresponding transaction data query is performed from the preset database or the data center.
3. The method for storing transaction data according to claim 2, It is characterized in that After querying the corresponding transaction data from the preset database or the data center, the method further includes: Perform verification operations on the queried target transaction data.
4. A storage device for transaction data, It is characterized in that include: A data and signature receiving module, used to receive the original transaction data and signature result uploaded by the target IoT device; wherein the signature result is obtained by performing a summary calculation on the original transaction data and signing the calculated first summary result; A data and signature consensus module, used to perform a consensus operation on the original transaction data and the signature result in a preset blockchain network; A first judgment module is used to judge whether the consensus on the original transaction data and the signature result is successful; The on-chain storage module is used to store the first summary result corresponding to the signature result to the preset blockchain network when it is determined that the consensus on the original transaction data and the signature result is successful, and generate the transaction time and block height corresponding to the on-chain storage at that time; The off-chain storage module is used to package the transaction time, the block height, the original transaction data and the signature result, and store the packaged target data packet in a preset database; A summary result search module, configured to search for a first summary result from a preset blockchain network according to the transaction time, block height and signature result in the target data packet when receiving a verification request for the target data packet; A summary result calculation module, used for performing summary calculation on the original transaction data in the target data packet to obtain a second summary result; A second judgment module, used to judge whether the second summary result is consistent with the first summary result; A device identity acquisition module, configured to acquire a device distributed identity corresponding to the first summary result from a preset blockchain network after determining that the second summary result is consistent with the first summary result; The device search module is used to search for target IoT devices based on the device’s distributed identity; A signature result verification module is used to send the signature result in the target data packet to the target IoT device, so that the target IoT device can verify the signature result using the built-in security chip; The non-distortion determination module is used to determine that the original transaction data is not distorted when the signature verification returned by the target IoT device is successful; Data packet upload module, the data packet upload module includes: The data packet consensus submodule is used to upload the target data packet to the preset blockchain network so that each industry node can perform consensus operations on the target data packet; The credential and industry identification acquisition submodule is used to obtain the pre-stored anonymous identity credentials and industry distributed identity identification when each industry node successfully reaches a consensus on the target data packet; The identity credential verification submodule is used to find the target industry node corresponding to the industry distributed identity identifier, so as to use the target industry node to verify the anonymous identity credential; The data packet upload submodule is used to upload the target data packet to the data center constructed by each industry node when receiving the identity credential verification passed prompt information returned by the target industry node; The distortion determination module is used to determine that the original transaction data is distorted when it is determined that the second summary result is inconsistent with the first summary result.
5. A storage device for transaction data, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the transaction data storage method as claimed in any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the transaction data storage method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Multi-party sharing transaction metadata method, device and system based on block chain
CN107180350A
Method for registration and verification of Internet of Things identity based on blockchain
CN109639714A
An Internet of Things equipment digital identity management system and method based on a block chain
CN109714174A
Blockchain system and method based on streaming data
CN111382463A
Data processing method and device, computer equipment and medium
CN111461799A
