Data transmission method and system based on block chain
Technical Field
The present invention relates to the field of blockchain, and in particular, to a blockchain-based data transmission method and system.
Background
Data security refers to protecting and managing data owned by an organization to ensure the integrity, availability, and confidentiality of the data. Data security is critical to the business operations and development of an organization because data is an important property of an organization, including various business data inside an organization, personal information of a client, and the like. Protecting such data from any unauthorized access, theft, vandalism and tampering is one of the important issues that organizations need to solve.
Existing techniques include, but are not limited to, the following: using encryption protocols, such as TLS/SSL, to protect the security of the data during transmission; access control is implemented, and only authenticated users can access data; the integrity and the authenticity of the data are ensured by adopting a digital signature technology; implementing data backup and disaster recovery measures to ensure the availability of data; the firewall, the intrusion detection system and other technologies are adopted to protect the data in the network from unauthorized access and attack; secure remote connections are established using a Virtual Private Network (VPN), data is encrypted using data encryption software, secure communications are performed using Secure Sockets Layer (SSL) protocols, and so on.
Without any error, the prior art can improve the security of data transmission to some extent, but note that such security is not absolute. Because any network behavior of the user is marked, when the user's behavior is sufficiently high, even the most sophisticated encryption method is used, any data transmitted by the user is undoubtedly lost. This is because, in addition to the data itself, the user's behavior itself may be collected, for example, what time, what place, what content the user has clicked on may be known by the content provider or the operator even by ordinary people, the user may not know that his own behavior data has been collected when the behavior data is collected, and when the user's behavior is collected enough, almost any data that it transmits may be guessed.
For example, when Zhang san passes a milky tea store, a cup of milky tea is purchased and a photo is taken, when he opens the chat software, he is likely to send the photo just taken to Lisi four if he is often in contact with the IP address where Lisi four is located, and although other people do not know whether Zhang san sent a message to Lisi four or not, he does not have to send the photo he just taken, the prior art has guessed that Bajiu is not ten. This is just a simple example, but it is what has happened in reality.
To solve the above problem, zhang Sanhe tries to send the picture to Wang five, wang five then to Zhao Liu, zhao Liu then to Sun Qi, …, after a series of people, and finally to Lifour. The forwarding method can increase the security of data transmission to a certain extent, but is not an ultimate method, because when Zhang three can be found to send certain data to Wang five, wang five in turn sends certain data to Zhao Liu, however, the data can be tracked in the transmission process, and the end can be easily found only by connecting each piece of data.
The blockchain is a decentralised distributed database technology, which realizes the improvement of the security, the transparency and the credibility of data by distributing the data on a plurality of nodes and using the cryptography technology to ensure that the data cannot be tampered with.
Although the blockchain can realize transparent transmission of data, both the sender and the receiver exist in the blockchain with a certain ID identity, if the ID on the chain is known, the ID and the individual have a corresponding relationship, that is, the ID on the chain is known, and the transmission object can be known.
Therefore, forwarding nodes are specially introduced into the blockchain, and the forwarding nodes are further assembled and encrypted, so that the data tracking security problem possibly existing in the centralized network and the traditional blockchain data transmission is solved.
Disclosure of Invention
The invention provides a data transmission method based on a block chain, which is characterized by comprising the following steps:
s1, constructing a data transmission network, wherein the data transmission network is a decentralised blockchain, the blockchain is composed of a plurality of nodes, and the nodes comprise storage spaces and synchronous clocks.
S2, determining a main sending node and a main receiving node, and encrypting main sending data at the main sending node to obtain encrypted main sending data; and determining a plurality of slave sending nodes, and encrypting the plurality of slave sending data at the plurality of slave sending nodes to obtain a corresponding plurality of encrypted slave sending data.
S3, determining a master random factor f of the master transmitting node and a slave random factor hi of each slave transmitting node, wherein i represents an ith slave transmitting node.
S4, randomly dividing the encrypted main transmission data into f sub-data, and randomly dividing each encrypted sub-transmission data into hi sub-data respectively.
S5, randomly selecting a plurality of forwarding nodes, receiving and assembling sub-data from a master sending node and a plurality of slave sending nodes in a forwarding period T of each forwarding node to form assembled data, if the forwarding node is the master receiving node, receiving and reserving the sub-data from the master sending node, assembling the sub-data with reserved data to be received data, updating the forwarding node to be a new master sending node, and updating the assembled data to be the master sending data of the forwarding node.
S6, recursively executing the steps S2-S5 until the size of the received data of the main receiving node is consistent with the size of the original encrypted main sending data, and obtaining final receiving data.
S7, the main receiving node decrypts the final received data in the step S6 to obtain the original main sending data.
In addition, to implement the above method, we also propose a data transmission system based on a blockchain, which is characterized in that the system includes:
the main sending node is used for encrypting the main sending data to obtain encrypted main sending data, determining a main random factor f, randomly dividing the encrypted main sending data into f sub-data, and sending each sub-data to the forwarding node;
the slave transmitting node is used for encrypting the slave transmitting data to obtain encrypted slave transmitting data, determining a slave random factor hi, dividing the encrypted slave transmitting data into hi sub-data randomly, and transmitting each sub-data to the forwarding node.
And (3) a forwarding node: in the forwarding period T, sub-data from a master sending node and a plurality of slave sending nodes are received and assembled to form assembled data, the assembled data is updated to be a new master sending node, the assembled data is forwarded to the next forwarding node, if the forwarding node is a master receiving node, the sub-data from the master sending node is reserved in the node, and the sub-data and the reserved data are assembled to be received data.
The master receiving node: and receiving the data from the main sending node, and decrypting and restoring the data into original main sending data.
From the receiving node: data from the slave transmitting node is received and decrypted to restore the original slave transmitting data.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following description refers to the drawings to be used in the embodiments.
Fig. 1 is a flowchart of a data transmission method based on a blockchain.
Fig. 2 is a schematic diagram of forwarding nodes forwarding data from different sending nodes in a data transmission method based on a blockchain, wherein 110a is encrypted master sending data, 110b and 110c are encrypted slave sending data, and 110d is data assembled by the forwarding nodes.
Detailed Description
The present invention will be further described with reference to the drawings in this embodiment, and it should be noted that the embodiments provided herein are only some of the embodiments of the present invention. Based on this summary, one of ordinary skill in the art can obtain other methods or products from this summary that may be used to practice the invention, and any modifications of the embodiments set forth in accordance with the embodiments of the invention or further modifications thereof as would be apparent to one of ordinary skill in the art are intended to be within the scope of this application.
Embodiment 1, fig. 1 provides a flowchart of a data transmission method based on a blockchain, which includes the following steps: s1, constructing a data transmission network, wherein the data transmission network is a decentralised blockchain, the blockchain is composed of a plurality of nodes, and the nodes comprise storage spaces and synchronous clocks.
S2, determining a main sending node and a main receiving node, encrypting main sending data at the main sending node to obtain encrypted main sending data, wherein the encrypted main sending data is shown as data indicated by 110a in FIG. 2; a plurality of slave transmitting nodes are determined, and the plurality of slave transmitting data are encrypted at the plurality of slave transmitting nodes to obtain a corresponding plurality of encrypted slave transmitting data, such as data represented by 110b and 110c in fig. 2.
In step S2, the master transmitting node and the slave transmitting node are only logically master-slave, and their positions in the blockchain are equal and master-slave. For example, for user a, node a is used as a master transmitting node, and all other nodes in the blockchain are regarded as slave transmitting nodes of node a, but at a certain moment, when other users transmit data, the other nodes are corresponding master transmitting nodes, and node a is a slave transmitting node of the master transmitting node.
S3, determining a master random factor f of the master transmitting node and a slave random factor hi of each slave transmitting node, wherein i represents an ith slave transmitting node.
S4, randomly dividing the encrypted main transmission data into f sub-data, wherein one sub-data is like a five-pointed star of 110a in FIG. 2, randomly dividing each encrypted sub-transmission data into hi sub-data respectively, and two groups of sub-encryption data are shown in FIG. 2, one group is data shown as 110b, and the other group is data shown as 110 c.
S5, randomly selecting a plurality of forwarding nodes, receiving and assembling sub-data from a master sending node and a plurality of slave sending nodes in a forwarding period T of each forwarding node to form assembled data, if the forwarding node is the master receiving node, receiving and reserving the sub-data from the master sending node, assembling the sub-data with reserved data to be received data, updating the forwarding node to be a new master sending node, and updating the assembled data to be the master sending data of the forwarding node.
As shown in fig. 2, the forwarding node p_a receives the encrypted master transmission data 110a from the master transmission node and the two encrypted slave transmission data 110b and 110c from the slave transmission nodes, the sub-data of which are reassembled into a plurality of sets of data in the forwarding node p_a, one of which is shown as 110 d.
In step S5, the forwarding period T is a fixed time, the forwarding period of each node is the same, the starting time of the forwarding period is the same, and the period and the starting time are synchronized according to the synchronization clock in the node; at the forwarding node, since the data from the master transmitting node and the data from the plurality of slave transmitting nodes are secondarily assembled and then transmitted in the form of new data, rather than directly forwarding the received data from a certain node, the forwarding node functions to perform new encryption on the data from different nodes in addition to forwarding the data.
S6, recursively executing the steps S2-S5 until the size of the received data of the main receiving node is consistent with the size of the original encrypted main sending data, and obtaining final receiving data.
S7, the main receiving node decrypts the final received data in the step S6 to obtain the original main sending data.