Transaction data storage method, device, equipment and readable storage medium

文档序号:1954504 发布日期:2021-12-10 浏览:17次 中文

阅读说明:本技术 一种交易数据的存储方法、装置、设备及可读存储介质 (Transaction data storage method, device, equipment and readable storage medium ) 是由 张波波 平庆瑞 张一锋 于 2021-09-22 设计创作,主要内容包括:本发明公开了一种交易数据的存储方法,包括:接收目标物联网设备上传的原始交易数据和签名结果;对原始交易数据和签名结果在预设区块链网络中进行共识操作;判断是否对原始交易数据和签名结果共识成功;若是,则将签名结果对应的第一摘要结果存储至预设区块链网络,并生成当次链上存储对应的交易时间、区块高度;将交易时间、区块高度、原始交易数据和签名结果进行打包操作,并将打包得到的目标数据包存储至预设数据库。应用本发明所提供的交易数据的存储方法,提升了交易数据存储系统的协同性,提升了交易数据的追溯性,增强了交易数据存储系统的扩展性。本发明还公开了一种交易数据的存储装置、设备及存储介质,具有相应技术效果。(The invention discloses a method for storing transaction data, which comprises the following steps: receiving original transaction data and a signature result uploaded by target Internet of things equipment; performing consensus operation on the original transaction data and the signature result in a preset block chain network; judging whether the original transaction data and the signature result are successfully identified; if so, storing a first abstract result corresponding to the signature result to a preset block chain network, and generating corresponding transaction time and block height stored on a current chain; and packaging the transaction time, the block height, the original transaction data and the signature result, and storing a target data packet obtained by packaging into a preset database. By applying the method for storing the transaction data, the cooperativity of the transaction data storage system is improved, the traceability of the transaction data is improved, and the expansibility of the transaction data storage system is enhanced. The invention also discloses a storage device, equipment and a storage medium for transaction data, and the storage device, the equipment and the storage medium have corresponding technical effects.)

1. A method of storing transaction data, comprising:

receiving original transaction data and a signature result uploaded by target Internet of things equipment; the signature result is obtained by performing summary calculation on the original transaction data and performing signature on a calculated first summary result;

performing consensus operation on the original transaction data and the signature result in a preset block chain network;

judging whether the original transaction data and the signature result are successfully identified;

if yes, storing a first abstract result corresponding to the signature result to the preset block chain network, and generating corresponding transaction time and block height stored in the current chain;

and packaging the transaction time, the block height, the original transaction data and the signature result, and storing a packaged target data packet into a preset database.

2. The method for storing transaction data according to claim 1, further comprising, after storing the packed target data packet in a preset database:

when a verification request for the target data packet is received, searching the first summary result from the preset block chain network according to the transaction time, the block height and the signature result in the target data packet;

performing summary calculation on the original transaction data in the target data packet to obtain a second summary result;

judging whether the second abstract result is consistent with the first abstract result;

if yes, determining that the original transaction data is not distorted;

if not, determining that the original transaction data is distorted.

3. The method of storing transaction data according to claim 2, further comprising, after determining that the second digest result is consistent with the first digest result:

acquiring a device distributed identity corresponding to the first abstract result from the preset block chain network;

searching the target Internet of things equipment according to the equipment distributed identity;

sending the signature result in the target data packet to the target Internet of things equipment so that the target Internet of things equipment can verify the signature result by using a built-in security chip;

determining that the original transaction data is undistorted, comprising:

and when signature verification returned by the target Internet of things equipment is successfully received, determining that the original transaction data is not distorted.

4. The method of claim 2 or 3, wherein after determining that the original transaction data is not distorted, further comprising:

and uploading the target data packet to a data center constructed by each industry node.

5. The method for storing transaction data according to claim 4, wherein uploading the target data packet to a data center constructed by each industry node comprises:

uploading the target data packet to the preset block chain network so that each industry node performs consensus operation on the target data packet;

when the industry nodes successfully identify the target data packet, acquiring pre-stored anonymous identity credentials and industry distributed identity marks;

searching a target industry node corresponding to the industry distributed identity mark so as to verify the anonymous identity certificate by using the target industry node;

and uploading the target data packet to the data center when receiving prompt information that the identity certificate returned by the target industry node passes the verification.

6. The method of storing transaction data of claim 4, further comprising:

analyzing the received data query request to obtain the identity information of the query requester;

judging whether the identity information of the inquiry requester is legal or not;

and if so, carrying out corresponding transaction data query from the preset database or the data center.

7. The method for storing transaction data according to claim 6, further comprising, after the corresponding query for transaction data is made from the preset database or the data center:

and carrying out verification operation on the inquired target transaction data.

8. A transaction data storage device, comprising:

the data and signature receiving module is used for receiving original transaction data and signature results uploaded by target Internet of things equipment; the signature result is obtained by performing summary calculation on the original transaction data and performing signature on a calculated first summary result;

the data and signature consensus module is used for performing consensus operation on the original transaction data and the signature result in a preset block chain network;

the first judgment module is used for judging whether the original transaction data and the signature result are successfully identified;

the on-chain storage module is used for storing a first abstract result corresponding to the signature result to the preset block chain network and generating corresponding transaction time and block height stored on a secondary chain when the original transaction data and the signature result are determined to be successfully identified;

and the down-link storage module is used for packaging the transaction time, the block height, the original transaction data and the signature result and storing a target data packet obtained by packaging into a preset database.

9. A transaction data storage device, comprising:

a memory for storing a computer program;

a processor for implementing the steps of the method of storing transaction data according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method of storing transaction data according to any one of claims 1 to 7.

Technical Field

The present invention relates to the field of storage technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for storing transaction data.

Background

With the development of the internet, when transaction data is generated between nodes of two transaction parties, the transaction data needs to be stored, so that related transactions are recorded, and subsequent query and statistics on the related transactions are facilitated.

At present, a common transaction data storage mode is used for dispersedly and independently storing transaction data generated by each industry, and when transaction data interaction is required among internet of things devices in different industries, a third-party centralized system is required to complete the interaction, so that the transaction data storage system is weak in cooperativity, traceability and expansibility.

In summary, how to effectively solve the problems of the existing transaction data storage mode, weak cooperativity, traceability and expansibility of transaction data storage, and the like, is a problem that needs to be solved urgently by those skilled in the art at present.

Disclosure of Invention

The invention aims to provide a method for storing transaction data, which improves the cooperativity of a transaction data storage system, improves the traceability of the transaction data and enhances the expansibility of the transaction data storage system; another object of the present invention is to provide a storage device, an apparatus and a computer readable storage medium for transaction data.

In order to solve the technical problems, the invention provides the following technical scheme:

a method of storing transaction data, comprising:

receiving original transaction data and a signature result uploaded by target Internet of things equipment; the signature result is obtained by performing summary calculation on the original transaction data and performing signature on a calculated first summary result;

performing consensus operation on the original transaction data and the signature result in a preset block chain network;

judging whether the original transaction data and the signature result are successfully identified;

if yes, storing a first abstract result corresponding to the signature result to the preset block chain network, and generating corresponding transaction time and block height stored in the current chain;

and packaging the transaction time, the block height, the original transaction data and the signature result, and storing a packaged target data packet into a preset database.

In an embodiment of the present invention, after storing the packed target data packet in a preset database, the method further includes:

when a verification request for the target data packet is received, searching the first summary result from the preset block chain network according to the transaction time, the block height and the signature result in the target data packet;

performing summary calculation on the original transaction data in the target data packet to obtain a second summary result;

judging whether the second abstract result is consistent with the first abstract result;

if yes, determining that the original transaction data is not distorted;

if not, determining that the original transaction data is distorted.

In an embodiment of the present invention, after determining that the second digest result is consistent with the first digest result, the method further includes:

acquiring a device distributed identity corresponding to the first abstract result from the preset block chain network;

searching the target Internet of things equipment according to the equipment distributed identity;

sending the signature result in the target data packet to the target Internet of things equipment so that the target Internet of things equipment can verify the signature result by using a built-in security chip;

determining that the original transaction data is undistorted, comprising:

and when signature verification returned by the target Internet of things equipment is successfully received, determining that the original transaction data is not distorted.

In an embodiment of the present invention, after determining that the original transaction data is not distorted, the method further includes:

and uploading the target data packet to a data center constructed by each industry node.

In a specific embodiment of the present invention, uploading the target data packet to a data center constructed by each industry node includes:

uploading the target data packet to the preset block chain network so that each industry node performs consensus operation on the target data packet;

when the industry nodes successfully identify the target data packet, acquiring pre-stored anonymous identity credentials and industry distributed identity marks;

searching a target industry node corresponding to the industry distributed identity mark so as to verify the anonymous identity certificate by using the target industry node;

and uploading the target data packet to the data center when receiving prompt information that the identity certificate returned by the target industry node passes the verification.

In one embodiment of the present invention, the method further comprises:

analyzing the received data query request to obtain the identity information of the query requester;

judging whether the identity information of the inquiry requester is legal or not;

and if so, carrying out corresponding transaction data query from the preset database or the data center.

In an embodiment of the present invention, after the corresponding transaction data query is performed from the preset database or the data center, the method further includes:

and carrying out verification operation on the inquired target transaction data.

A storage device for transaction data, comprising:

the data and signature receiving module is used for receiving original transaction data and signature results uploaded by target Internet of things equipment; the signature result is obtained by performing summary calculation on the original transaction data and performing signature on a calculated first summary result;

the data and signature consensus module is used for performing consensus operation on the original transaction data and the signature result in a preset block chain network;

the first judgment module is used for judging whether the original transaction data and the signature result are successfully identified;

the on-chain storage module is used for storing a first abstract result corresponding to the signature result to the preset block chain network and generating corresponding transaction time and block height stored on a secondary chain when the original transaction data and the signature result are determined to be successfully identified;

and the down-link storage module is used for packaging the transaction time, the block height, the original transaction data and the signature result and storing a target data packet obtained by packaging into a preset database.

A storage device for transaction data, comprising:

a memory for storing a computer program;

a processor for implementing the steps of the method for storing transaction data as described above when executing the computer program.

A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of storing transaction data as set forth above.

The transaction data storage method provided by the invention receives original transaction data and a signature result uploaded by target Internet of things equipment; the signature result is obtained by performing summary calculation on original transaction data and performing signature on a calculated first summary result; performing consensus operation on the original transaction data and the signature result in a preset block chain network; judging whether the original transaction data and the signature result are successfully identified; if so, storing a first abstract result corresponding to the signature result to a preset block chain network, and generating corresponding transaction time and block height stored on a current chain; and packaging the transaction time, the block height, the original transaction data and the signature result, and storing a target data packet obtained by packaging into a preset database.

According to the technical scheme, the original transaction data and the corresponding signature result are identified in the preset block chain network, after the identification is successful, the first abstract result corresponding to the original transaction data is stored in the preset block chain network in a chain mode, the corresponding transaction time, the block height, the original transaction data and the signature result stored in the current chain are stored in a preset database in a packaging mode, and the storage under the chain is completed. By combining the summary storage on the chain with the full data storage under the chain, the transaction data of the multiple Internet of things devices is uniformly stored, the cooperativity of the transaction data storage system is improved, the safety of transaction data storage is improved by the storage on the chain, the traceability of the transaction data is improved, and the expansibility of the transaction data storage system is enhanced.

Correspondingly, the invention also provides a storage device, equipment and a computer readable storage medium of the transaction data corresponding to the storage method of the transaction data, which have the technical effects and are not described herein again.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

FIG. 1 is a flow chart of an implementation of a method for storing transaction data according to an embodiment of the invention;

FIG. 2 is a flow chart of another embodiment of a method for storing transaction data according to the present invention;

FIG. 3 is a block diagram illustrating an overall structure of a transaction data storage system according to an embodiment of the present invention;

FIG. 4 is a block diagram of a transaction data linked storage system according to an embodiment of the present invention;

FIG. 5 is a block diagram of a transaction data storage device according to an embodiment of the present invention;

FIG. 6 is a block diagram of a transaction data storage device according to an embodiment of the present invention;

fig. 7 is a schematic structural diagram of a storage device for transaction data according to this embodiment.

Detailed Description

In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a transaction data storage method according to an embodiment of the present invention, where the method may include the following steps:

s101: and receiving original transaction data and a signature result uploaded by the target Internet of things equipment.

And the signature result is obtained by performing summary calculation on the original transaction data and performing signature on the calculated first summary result.

A security chip responsible for key generation, calculation and sensitive data storage is deployed in target Internet of things equipment in advance. When the target Internet of things equipment needs to store the generated transaction data, the target Internet of things equipment performs summary calculation on the original transaction data to obtain a first summary result, the security chip is used for signing the first summary result to obtain a signature result, and the original transaction data and the signature result are uploaded to corresponding application nodes together. The application node receives original transaction data and a signature result uploaded by the target Internet of things equipment.

S102: and carrying out consensus operation on the original transaction data and the signature result in a preset block chain network.

The method comprises the steps of presetting a block chain network, and storing a target public key in a public and private key pair generated by a security chip in target Internet of things equipment in the preset block chain network. After receiving the original transaction data and the signature result uploaded by the target internet of things device, the application node performs consensus operation on the original transaction data and the signature result in the preset block chain network, namely, each node in the preset block chain network is used for performing transaction data verification according to the original transaction data and the signature result.

S103: and judging whether the original transaction data and the signature result are successfully identified, if not, executing the step S104, and if so, executing the step S105.

After the original transaction data and the signature result are subjected to consensus operation in the preset block chain network, whether the original transaction data and the signature result are successfully identified is judged, if not, distortion occurs in the original transaction data, step S104 is executed, if yes, the original transaction data is normally transmitted, and the distortion does not occur, and step S105 is executed.

S104: and outputting the transaction data with error prompt information.

When the common identification of the original transaction data and the signature result is determined to fail, the original transaction data is distorted, and the output transaction data has error prompt information so as to prompt a user that the current transaction data storage application fails.

S105: and storing the first abstract result corresponding to the signature result into a preset block chain network, and generating corresponding transaction time and block height stored on the current chain.

When the original transaction data and the signature result are successfully identified, the original transaction data are normally transmitted and are not distorted, the signature result is decrypted by using the prestored target public key, a first abstract result corresponding to the signature result is obtained, the first abstract result is stored to a preset block chain network, and corresponding transaction time and block height are generated and stored on a current chain, so that the transaction data are stored on the chain. In addition to this, the application node may generate storage status data.

S106: and packaging the transaction time, the block height, the original transaction data and the signature result, and storing a target data packet obtained by packaging into a preset database.

And presetting a database corresponding to the application node. After the corresponding transaction time and the block height stored in the current chain are generated, the transaction time, the block height, the original transaction data and the signature result are packaged, and a target data packet obtained by packaging is stored in a preset database, so that the transaction data is stored under the chain. The description in step S105 is accepted, and if the storage status data is generated, the storage status data may also be uploaded to the preset database together.

By storing the first abstract result in the preset block chain network and storing the target data packet obtained by packaging the transaction time, the block height, the original transaction data and the signature result in the preset database, the safety of the block chain technology is fully utilized, the excessive occupation of the storage space of the block chain is avoided, and the large data storage capacity of the database is fully utilized. By combining the summary storage on the chain with the full data storage under the chain, the transaction data of the multiple Internet of things devices is uniformly stored, the cooperativity of the transaction data storage system is improved, the safety of transaction data storage is improved by the storage on the chain, the traceability of the transaction data is improved, and the expansibility of the transaction data storage system is enhanced.

According to the technical scheme, the original transaction data and the corresponding signature result are identified in the preset block chain network, after the identification is successful, the first abstract result corresponding to the original transaction data is stored in the preset block chain network in a chain mode, the corresponding transaction time, the block height, the original transaction data and the signature result stored in the current chain are stored in a preset database in a packaging mode, and the storage under the chain is completed. By combining the summary storage on the chain with the full data storage under the chain, the transaction data of the multiple Internet of things devices is uniformly stored, the cooperativity of the transaction data storage system is improved, the safety of transaction data storage is improved by the storage on the chain, the traceability of the transaction data is improved, and the expansibility of the transaction data storage system is enhanced.

It should be noted that, based on the above embodiments, the embodiments of the present invention also provide corresponding improvements. In the following embodiments, steps that are the same as or correspond to those in the above embodiments may be referred to one another, and corresponding advantageous effects may also be referred to one another, which is not described in detail in the following modified embodiments.

Referring to fig. 2, fig. 2 is a flowchart of another implementation of a transaction data storage method according to an embodiment of the present invention, where the method may include the following steps:

s201: and receiving original transaction data and a signature result uploaded by the target Internet of things equipment.

And the signature result is obtained by performing summary calculation on the original transaction data and performing signature on the calculated first summary result.

S202: and carrying out consensus operation on the original transaction data and the signature result in a preset block chain network.

S203: and judging whether the original transaction data and the signature result are successfully identified, if not, executing the step S204, and if so, executing the step S205.

S204: and outputting the transaction data with error prompt information.

S205: and storing the first abstract result corresponding to the signature result into a preset block chain network, and generating corresponding transaction time and block height stored on the current chain.

S206: and packaging the transaction time, the block height, the original transaction data and the signature result, and storing a target data packet obtained by packaging into a preset database.

Referring to fig. 4, fig. 4 is a block diagram illustrating a structure of a transaction data linked-down storage system according to an embodiment of the present invention. After the transaction time, the block height, the original transaction data and the signature result are packaged by the application node, and a target data packet obtained by packaging is stored in a preset database.

In combination with practical application, a Smart Contract module is newly added to the Javacard-based Internet of things device, and the Smart Contract module supports various block chain protocols, keys and data security of the application. A security chip in Internet of things equipment relates to a plurality of relevant instructions. As shown in table 1, table 1 is a partial related instruction table related to the application of the internet of things of the security chip.

TABLE 1

Instructions Description of the invention
READ RECORD Reading a record file in a secure chip
UPDATE RECORD Updating a record file in a secure chip
WRITE KEY Secure chip generates a key pair
GENERATE PROOF Secure chip generated identity proof
GET DATA Obtaining secure chip data
GENERATE SIGNATURE Secure chip generation of data signatures
VERIFY SIGNATURE Security chip verification data signature

S207: when a verification request for the target data packet is received, searching a first abstract result from a preset block chain network according to the transaction time, the block height and the signature result in the target data packet.

After the packed target data packet is stored in a preset database, when an application node receives a verification request of the target data packet, searching a first abstract result from a preset block chain network according to the transaction time, the block height and the signature result in the target data packet.

S208: and performing summary calculation on the original transaction data in the target data packet to obtain a second summary result.

The method comprises the steps of obtaining original transaction data in a target data packet, and performing summary calculation on the original transaction data, for example, performing the summary calculation on the original transaction data in a HASH value (HASH) calculation mode, an MD5 value calculation mode and the like to obtain a second summary result.

It should be noted that the first and second summary results in the first and second summary results are only to distinguish the summary result found in the preset blockchain network from the summary result obtained by performing summary calculation on the original transaction data, and do not have a difference in size or order.

S209: judging whether the second abstract result is consistent with the first abstract result, if not, executing step S210, if yes, executing step S211,

after the first summary result is searched from the preset block chain network and the second summary result is obtained through calculation, whether the second summary result is consistent with the first summary result or not is judged, if not, the verification on the original transaction data chain in the target data packet is not passed, step S210 is executed, if yes, the verification on the original transaction data chain in the target data packet is passed, step S211 is executed,

s210: it is determined that the original transaction data is distorted.

And when the second abstract result is determined to be inconsistent with the first abstract result, the verification on the original transaction data chain in the target data packet is not passed, and the original transaction data is determined to be distorted.

S211: and acquiring the equipment distributed identity corresponding to the first abstract result from a preset block chain network.

When the second summary result is determined to be consistent with the first summary result, it is indicated that verification on the original transaction data chain in the target data packet is passed, a device Distributed Identity (DID) corresponding to the first summary result is stored in the preset block chain network, and the device distributed identity corresponding to the first summary result is obtained from the preset block chain network.

S212: and searching for target Internet of things equipment according to the equipment distributed identity.

After the device distributed identity corresponding to the first abstract result is obtained, the target Internet of things device is searched according to the device distributed identity.

S213: and sending the signature result in the target data packet to the target Internet of things equipment so that the target Internet of things equipment carries out verification operation on the signature result by utilizing a built-in security chip.

After the target Internet of things equipment is found, the signature result in the target data packet is sent to the target Internet of things equipment, the target Internet of things equipment decrypts and verifies the signature result by using a target public key in a built-in security chip, and if decryption is successful, the verification of the signature result is successful.

S214: and when signature verification returned by the target Internet of things equipment is successfully received, determining that the original transaction data is not distorted.

And when the target Internet of things equipment successfully verifies the signature result, returning feedback information of successful signature verification to the application node. When the application node receives the signature returned by the target Internet of things equipment and verifies successfully, the verification of the Internet of things equipment end is passed, and the original transaction data is not distorted.

S215: and uploading the target data packet to a data center constructed by each industry node.

After the original transaction data are determined to be undistorted, the target data packet is uploaded to the data center constructed by each industry node, so that the reliability of the transaction data uploaded to the data center is guaranteed, and cross-domain storage of the transaction data is realized.

In one embodiment of the present invention, step S215 may include the following steps:

the method comprises the following steps: uploading the target data packet to a preset block chain network so that each industry node performs consensus operation on the target data packet;

step two: when the target data packet is successfully identified by each industry node, acquiring a pre-stored anonymous identity certificate and an industry distributed identity mark;

step three: searching a target industry node corresponding to the industry distributed identity mark so as to verify the anonymous identity certificate by using the target industry node;

step four: and when receiving the prompt information that the identity certificate returned by the target industry node passes the verification, uploading the target data packet to the data center.

For convenience of description, the above four steps may be combined for illustration.

Referring to fig. 3, fig. 3 is a block diagram illustrating an overall structure of a transaction data storage system according to an embodiment of the present invention. The whole system mainly comprises a supervision node, an industry node, an application node and Internet of things equipment. The supervision node is mainly responsible for accessing, authenticating and managing the industry nodes, generally adopts the alliance chain technology, and is also responsible for DID rule making and providing DID generation and verification services of the industry nodes. The DID identification coding rule of the Internet of things equipment is set as follows: and (3) industry coding: applying coding: and (5) encoding the equipment. The industry codes are generated by corresponding industry nodes, the application codes are generated by corresponding application nodes, the equipment codes are generated by Internet of things equipment, and the equipment codes are generally obtained through public key calculation, so that the uniqueness of the equipment codes is ensured.

And the industry node is mainly responsible for accessing, authenticating and managing the application node and participating in DID generation and management of the application node.

Each node can be connected with a plurality of Internet of things devices and participates in DID generation and management of the application nodes. Meanwhile, the method is connected with a terminal manufacturer, and the initialization service of the Internet of things equipment is provided.

The equipment of the Internet of things is connected with the corresponding application node, and a safety chip is arranged in the equipment of the Internet of things and is responsible for key generation, calculation and sensitive data storage.

After the original transaction data are determined to be undistorted, the target data packet is uploaded to a preset block chain network, and all industry nodes perform consensus operation on the target data packet. And when the target data packet is successfully identified by each industry node, acquiring the pre-stored anonymous identity voucher and the industry distributed identity, and searching the target industry node corresponding to the industry distributed identity. The business nodes participate in the generation and management of the anonymous identity voucher of the corresponding application node, so after the target business node corresponding to the distributed identity identifier is found, the anonymous identity voucher is verified by using the target business node, and when the prompt message that the identity voucher returned by the target business node passes the verification is received, the target data packet is uploaded to the data center.

S216: and analyzing the received data query request to obtain the identity information of the query requester.

And after the target data packet containing the transaction time, the block height, the original transaction data and the signature result is completely stored, providing a subsequent transaction data query service. For special industry mechanisms, such as a supervision party and an industry party, data can be directly retrieved through a data center (mapped to a database service corresponding to an application node) through a special query platform. For the third-party application, data query can be carried out by accessing the industry node, and the data associated with the industry node and the application node can be determined according to the DID coding rule. In specific operation, identity authentication is required between different industry nodes (inquiry between different industry nodes), and whether the industry node inquiry service is supported or not is determined according to an inquiry strategy. When an inquiry requester needs to perform transaction data inquiry, a data inquiry request is sent to an application node, the data inquiry request comprises inquiry requester identity information, and the application node analyzes the received data inquiry request to obtain the inquiry requester identity information.

S217: it is determined whether the identity information of the inquiry requester is legal, if not, step S218 is performed, and if so, step S219 is performed.

After the identity information of the query requester is obtained through analysis, whether the identity information of the query requester is legal or not is judged, if not, the identity authentication of the query requester is not passed, step S218 is executed, and if yes, the identity authentication of the query requester is passed, and step S219 is executed.

S218: and outputting illegal prompt information of the identity information.

When the identity information of the query requester is determined to be illegal, the identity authentication of the query requester is not passed, and illegal prompt information of the identity information is output.

S219: and carrying out corresponding transaction data query from a preset database or a data center.

And when the identity information of the inquiry requester is determined to be legal, the inquiry requester passes the authentication, and corresponding transaction data inquiry is carried out from a preset database or a data center.

S220: and carrying out verification operation on the inquired target transaction data.

And after the corresponding target transaction data is inquired, carrying out verification operation on the inquired target transaction data. The verification process of the target transaction data may refer to the link verification process from step S207 to step S210, or refer to the internet of things device side verification process from step S211 to step S213, which is not described herein in detail in the embodiments of the present invention.

The invention unifies the generation, storage, verification and query of the transaction data, and is beneficial to fully mining the data value.

Corresponding to the above method embodiment, the present invention further provides a storage device for transaction data, and the storage device for transaction data described below and the storage method for transaction data described above may be referred to in correspondence with each other.

Referring to fig. 5, fig. 5 is a block diagram illustrating a transaction data storage device according to an embodiment of the present invention, where the transaction data storage device may include:

the data and signature receiving module 51 is configured to receive original transaction data and a signature result uploaded by the target internet of things device; the signature result is obtained by performing summary calculation on original transaction data and performing signature on a calculated first summary result;

the data and signature consensus module 52 is configured to perform consensus on the original transaction data and the signature result in a preset block chain network;

a first judging module 53, configured to judge whether the original transaction data and the signature result are successfully identified;

the on-chain storage module 54 is configured to, when it is determined that the common identification of the original transaction data and the signature result is successful, store a first digest result corresponding to the signature result in a preset block chain network, and generate a transaction time and a block height corresponding to the storage on the secondary chain;

and the down-link storage module 55 is configured to perform a packaging operation on 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.

According to the technical scheme, the original transaction data and the corresponding signature result are identified in the preset block chain network, after the identification is successful, the first abstract result corresponding to the original transaction data is stored in the preset block chain network in a chain mode, the corresponding transaction time, the block height, the original transaction data and the signature result stored in the current chain are stored in a preset database in a packaging mode, and the storage under the chain is completed. By combining the summary storage on the chain with the full data storage under the chain, the transaction data of the multiple Internet of things devices is uniformly stored, the cooperativity of the transaction data storage system is improved, the safety of transaction data storage is improved by the storage on the chain, the traceability of the transaction data is improved, and the expansibility of the transaction data storage system is enhanced.

In one embodiment of the present invention, the apparatus may further include:

the abstract result searching module is used for searching a first abstract result from a preset block chain network according to the transaction time, the block height and the signature result in the target data packet when a verification request for the target data packet is received;

the abstract result calculation module is used for carrying out abstract calculation on the original transaction data in the target data packet to obtain a second abstract result;

the second judgment module is used for judging whether the second abstract result is consistent with the first abstract result;

the undistorted determining module is used for determining that the original transaction data is undistorted when the second abstract result is determined to be consistent with the first abstract result;

and the distortion determining module is used for determining that the original transaction data is distorted when the second abstract result is determined to be inconsistent with the first abstract result.

In one embodiment of the present invention, the apparatus may further include:

the equipment identity acquisition module is used for acquiring an equipment distributed identity corresponding to the first abstract result from a preset block chain network after the second abstract result is determined to be consistent with the first abstract result;

the device searching module is used for searching the target Internet of things device according to the device distributed identity;

the signature result verification module is used for sending the signature result in the target data packet to the target Internet of things equipment so that the target Internet of things equipment can verify the signature result by using a built-in security chip;

the undistorted determining module is specifically a module for determining that the original transaction data is undistorted when the signature verification returned by the target internet of things device is received successfully.

In one embodiment of the present invention, the apparatus may further include:

and the data packet uploading module is used for uploading the target data packet to the data center constructed by each industry node after determining that the original transaction data is not distorted.

In a specific embodiment of the present invention, the packet uploading module includes:

the data packet consensus sub-module is used for uploading the target data packet to a preset block chain network so as to enable each industry node to perform consensus operation on the target data packet;

the voucher and industry identification obtaining submodule is used for obtaining a prestored anonymous identity voucher and an industry distributed identity identification when the target data packet is successfully identified by each industry node;

the identity certificate verification sub-module is used for searching a target industry node corresponding to the industry distributed identity mark so as to verify the anonymous identity certificate by using the target industry node;

and the data packet uploading sub-module is used for uploading the target data packet to the data center when the prompt message that the identity certificate returned by the target industry node passes the verification is received.

In one embodiment of the present invention, the apparatus may further include:

the query request analysis module is used for analyzing the received data query request to obtain the identity information of the query requester;

the third judging module is used for judging whether the identity information of the inquiry requester is legal or not;

and the transaction data query module is used for carrying out corresponding transaction data query from a preset database or a data center when the identity information of the query requester is determined to be legal.

In one embodiment of the present invention, the apparatus may further include:

and the transaction data verification module is used for verifying the inquired target transaction data after corresponding transaction data inquiry is carried out from a preset database or a data center.

Corresponding to the above method embodiment, referring to fig. 6, fig. 6 is a schematic diagram of a storage device for transaction data provided by the present invention, and the device may include:

a memory 332 for storing a computer program;

the processor 322 is configured to implement the steps of the storage method of transaction data of the above method embodiment when executing the computer program.

Specifically, referring to fig. 7, fig. 7 is a schematic diagram illustrating a specific structure of a transaction data storage device provided in this embodiment, the transaction data storage device may generate a relatively large difference due to different configurations or performances, and may include a processor (CPU) 322 (for example, one or more processors) and a memory 332, where the memory 332 stores one or more computer applications 342 or data 344. Memory 332 may be, among other things, transient or persistent storage. The program stored in memory 332 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a data processing device. Still further, the processor 322 may 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 the transaction data.

The storage of transaction data 301 may also include one or more power sources 326, one or more wired or wireless network interfaces 350, one or more input-output interfaces 358, and/or one or more operating systems 341.

The steps in the above-described method of storing transaction data may be implemented by the structure of a storage device for transaction data.

Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:

receiving original transaction data and a signature result uploaded by target Internet of things equipment; the signature result is obtained by performing summary calculation on original transaction data and performing signature on a calculated first summary result; performing consensus operation on the original transaction data and the signature result in a preset block chain network; judging whether the original transaction data and the signature result are successfully identified; if so, storing a first abstract result corresponding to the signature result to a preset block chain network, and generating corresponding transaction time and block height stored on a current chain; and packaging the transaction time, the block height, the original transaction data and the signature result, and storing a target data packet obtained by packaging into a preset database.

The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

For the introduction of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments, which are not described herein again.

The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.

The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于区块链的交易处理方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!