Disclosure of Invention
The inventor thinks that: the data transmitting party and the data receiving party of the related data transmission technology directly interact to transmit data, so that the anonymity is poor, and the privacy safety is low.
In view of the above technical problems, the present disclosure provides a solution, which increases anonymity and improves privacy security.
According to a first aspect of the present disclosure, there is provided a data transmission method based on a block chain, including: acquiring data; generating a data code according to the data; sending the data to a data container; and sending the data codes to a block chain.
In some embodiments, generating a data encoding from the data comprises: decomposing the data to obtain a plurality of data blocks; respectively allocating a label to each data block; and generating a data code according to the labels of the plurality of data blocks.
In some embodiments, assigning a label to each data block comprises: each data block is assigned a base tag comprising adenine a, guanine G, cytosine C, or thymine T.
In some embodiments, generating the data encoding from the tags of the plurality of data blocks comprises: and generating a data code according to the base label by using a base pairing principle.
In some embodiments, the plurality of data blocks each have a sequence number, and the sequence number is used to identify the sequence of each data block.
In some embodiments, sending the data to a data container comprises: disordering the sequence of the plurality of data blocks to obtain processed data; and sending the processed data to a data container.
In some embodiments, the plurality of data blocks and the data encoding have the same time stamp.
In some embodiments, the data container includes a plurality of data partitions, each corresponding to a respective time period, and sending the data to the data container includes: and sending each data block of the data to the corresponding data partition according to the corresponding relation between the time stamp of each data block corresponding to the data and the time period of each data partition.
In some embodiments, the data transmission method further comprises: generating a broadcast message according to the data code; performing private key signature on the broadcast message; broadcasting the broadcast message signed by the private key to the blockchain.
According to a second aspect of the present disclosure, there is provided a data transmission method based on a block chain, including: acquiring data codes from a block chain; and acquiring corresponding data from the data container according to the data code.
In some embodiments, obtaining corresponding data from a data container according to the data encoding comprises: acquiring a plurality of data blocks corresponding to the data from a data container according to the data codes; and restoring to obtain corresponding data according to the plurality of data blocks.
In some embodiments, obtaining, from the data container, a plurality of data chunks corresponding to the data according to the data encoding includes: and acquiring a plurality of data blocks of corresponding data from the data container according to the data codes and the time stamps corresponding to the data codes.
In some embodiments, the data encoding includes a base tag corresponding to each data chunk, and obtaining a plurality of data chunks of corresponding data from the data container based on the time stamps corresponding to the data encoding and the data encoding includes: and acquiring a plurality of data blocks of corresponding data from the data container by using a base pairing principle according to the base label corresponding to each data block and the time stamp.
In some embodiments, the data container includes a plurality of data partitions, each data partition corresponds to a time period, and obtaining a plurality of data blocks of corresponding data from the data container according to the data codes and the time stamps corresponding to the data codes includes: and acquiring a plurality of data blocks from the corresponding data partitions according to the corresponding relation between the time stamps corresponding to the data and the time periods corresponding to the data partitions of the data container.
In some embodiments, each data block includes a sequence number, and restoring to obtain corresponding data according to the plurality of data blocks includes: and sequencing each data block according to the sequence number of each data block, and restoring to obtain corresponding data.
In some embodiments, obtaining the data encoding from the blockchain comprises: receiving and browsing the broadcast message signed by the private key of the block chain; and acquiring data codes from the broadcast messages signed by the private key.
According to a third aspect of the present disclosure, there is provided a block chain-based data transmission apparatus, including: an acquisition module configured to acquire data; a generating module configured to generate a data code from the data; a first sending module configured to send the data to a data container; a second transmitting module configured to transmit the data encoding to a block chain.
According to a fourth aspect of the present disclosure, there is provided a block chain-based data transmission apparatus, including: a first obtaining module configured to obtain a data code from a blockchain; and the second acquisition module is configured to acquire corresponding data from the data container according to the data codes.
According to a fifth aspect of the present disclosure, there is provided a method for data transmission based on a block chain, including: the data transmission method of any of the above embodiments; and a data transmission method as in any of the above embodiments.
According to a sixth aspect of the present disclosure, there is provided a block chain-based data transmission apparatus, including: the data transmission apparatus according to any of the above embodiments; and a data transmission apparatus as described in any of the above embodiments.
According to a seventh aspect of the present disclosure, there is provided a data transmission apparatus based on a block chain, including: a memory; and a processor coupled to the memory, the processor configured to perform the data transmission method of any of the above embodiments based on instructions stored in the memory.
According to an eighth aspect of the present disclosure, a computer-storable medium has stored thereon computer program instructions which, when executed by a processor, implement the data transmission method of any of the above embodiments.
In the embodiment, the anonymity is increased, and the privacy security is improved.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Fig. 1 illustrates a flow diagram of a data transmission method according to some embodiments of the present disclosure.
As shown in fig. 1, the data transmission method includes steps S110 to S140. In some embodiments, the data transmission method is performed by a terminal. For example, a data sender or a terminal of a data provider may perform a data transmission operation through Dapp (Decentralized Application).
In step S110, data is acquired. For example, the data is a packet. In some embodiments, the data sender uploads the data packet to the terminal.
In step S120, a data code is generated from the data. The data code is generated, for example, as follows.
The step of generating the data encoding S120 will be described in detail below in conjunction with fig. 2.
Fig. 2 illustrates a schematic diagram of generating a data encoding, according to some embodiments of the present disclosure.
First, data is decomposed to obtain a plurality of data blocks. As shown in fig. 2, the data is, for example, 500 packets (e.g., 100M in size). The 500 packets are broken up into 100 data blocks, each of 1M size. In some embodiments, each of the plurality of data blocks has a sequence number. The sequence number is used to identify the order of the individual data blocks. As shown in fig. 2, for example, 100 data blocks are sorted to obtain sequence numbers 1, 2, 3, and 4 … of the respective data blocks. Sequence numbers 1, 2, 3, 4 … identify the order of the individual data blocks. It should be noted that the size of each data block may be set according to actual circumstances.
Each data block is then assigned a label. In some embodiments, each data block is assigned a base tag comprising adenine a, guanine G, cytosine C, or thymine T. Adenine A, guanine G, cytosine C, and thymine T are four different bases in genetics. As shown in FIG. 2, for example, one base tag is randomly assigned to each of 100 data blocks to obtain a base code of-A-T-C-G-A-T-C-G- ….
And finally, generating a data code according to the labels of the plurality of data blocks. In some embodiments, the data encoding is generated based on base labeling using base pairing rules. The base pairing rule is that A corresponds to T, C and G corresponds to G. As shown in FIG. 2, for mut mutexample, the data encoding-T-A-G-C-T-A-G-C- … corresponding to the base code is obtained by using the base pairing rule.
In step S130, the data is transmitted to the data container. For example, the order of a plurality of data blocks is first scrambled to obtain processed data, and then the processed data is sent to a data container. As shown in fig. 2, for example, the order of the scrambled data blocks is 4, 3, 2, 100, 56 ….
In some embodiments, the data container is a public cloud or data intermediate storage device, providing data storage functionality.
In some embodiments, the plurality of data blocks and the data encoding have the same time stamp. The time stamp is, for example, a data generation time. For example, the data container includes a plurality of data partitions. Each data partition corresponds to a time period.
The data may be sent to the data container, for example, as follows. And sending each data block of the data to the corresponding data partition according to the corresponding relation between the time stamp of each data block corresponding to the data and the time period of each data partition.
In some embodiments, the data container breaks up the data blocks corresponding to the data packets, and uniformly mixes the data blocks corresponding to all the data packets of the data container, thereby further improving the security. The data container has a large number of data blocks, which increases the difficulty of maliciously acquiring data through the permutation and combination scheme.
In step S140, the data encoding is sent to the block chain. For example, a data sender uploads data to a block chain through a terminal.
In some embodiments, the data transmission method further comprises the following steps.
First, a broadcast message is generated according to data encoding. In some embodiments, the data sender writes the data codes into the blocks through the terminal, and generates the triple < data codes, the account of the data sender, and the account of the data receiver >.
The broadcast message is then private key signed. In some embodiments, the data sender also pays for the blockchain system usage fee fuel GAS through the terminal.
And finally, broadcasting the broadcast message signed by the private key to the block chain. In some embodiments, the broadcast message includes a data encoding and message digest plaintext. The message digest plaintext is, for example, a description of the data source, the data amount, and the data type. In some embodiments, the summary plaintext of a broadcast message is a description of the name of the sender of data, 500 data, and the full amount of data.
Fig. 3 illustrates a flow diagram of a method of data transmission according to further embodiments of the present disclosure.
As shown in fig. 3, the data transmission method includes steps S310 to S320. For example, the data receiving side performs the data transmission method through the terminal.
In step S310, data codes are acquired from the blockchain. In some embodiments, obtaining data encoding from a blockchain is accomplished as follows.
First, a broadcast message signed by a private key of a block chain is received and browsed. For example, browse the summary plaintext of the broadcast message, generate the browsing record quadruplet < data code, browsing record, account of the data sender, account of the data receiver >.
Then, the data code is obtained from the broadcast message signed by the private key. For example, the data receiver signs the browsing record through a terminal by a private key, pays the TOKEN and the blockchain system usage charge GAS to the data sender, and broadcasts to the blockchain whole network.
In some embodiments, after receiving the browsing record of the data receiving party, the miners browse and extract the transaction hash values, pair the transaction hash values, obtain the merkel roots by adopting the prior art, assemble the blocks, and link the blocks to the main block chain. So far, the data receiver can browse and acquire the data codes in the broadcast message. It should be understood that the present disclosure is built based on public chains, and therefore POW or POS can be adopted as the prior art of consensus algorithm, etc., which is not described herein in detail.
In step S320, corresponding data is acquired from the data container according to the data encoding. In some embodiments, the corresponding data is obtained from the data container as follows.
First, a plurality of data blocks corresponding to data are acquired from a data container according to data encoding. For example, a plurality of data chunks of corresponding data are retrieved from the data container according to the data encoding and the timestamp corresponding to the data encoding. In some embodiments, the data encoding includes a base tag corresponding to each data block. And acquiring a plurality of data blocks of corresponding data from the data container by using a base pairing principle according to the base label corresponding to each data block and the time stamp. For example, T, G, A, C, G data chunks comprising base labels of corresponding data are obtained from the data container according to the data code A-C-T-G-C and timestamp 1.
In some embodiments, the data container includes a plurality of data partitions, each corresponding to a respective time period. And acquiring a plurality of data blocks from the corresponding data partitions according to the corresponding relation between the time stamps corresponding to the data and the time periods corresponding to the data partitions of the data container. For example, with a timestamp of 1, multiple data blocks should be retrieved from a data partition with a time period of 0-3.
And then, restoring to obtain corresponding data according to the plurality of data blocks. In some embodiments, each data block includes a sequence number. And sequencing each data block according to the sequence number of each data block, and restoring to obtain corresponding data. For example, T, G, A, C, G data blocks having base labels include sequence numbers 1, 4, 3, and 2. And sequencing the data blocks according to the sequence numbers to obtain corresponding data 1(T) -2(G) -3(C) -4 (G). It should be noted that due to the randomness in generating the data blocks, the probability of the existence of data blocks with consistent time stamps and consistent base labels is low, and this disclosure will not be discussed in detail at this time.
The data codes generated by the data transmission method have uniqueness and are not influenced by a data sender and a data receiver. The two data transmission parties do not need to verify whether the hash values corresponding to the data packets are consistent, the link that whether the hash values of the data packets acquired by the data receiving party and the hash values of the data packets directly acquired from the data transmitting party are consistent is reduced, operation is reduced, and therefore the efficiency of the block chain is improved.
Fig. 4 illustrates a flow diagram of a data transmission method according to some embodiments of the present disclosure.
As shown in fig. 4, the data transmission method includes steps S110 to S140 shown in fig. 1 and steps S310 to S320 shown in fig. 3.
Fig. 5 illustrates a block diagram of a data transmission device according to some embodiments of the present disclosure.
As shown in fig. 5, the data transmission device 5 includes: an acquisition module 51 configured to acquire data, for example to perform step S110 as shown in fig. 1; a generating module 52 configured to generate a data code according to the data, for example, to execute step S120 shown in fig. 1; a first sending module 53 configured to send data to the data container, for example, to perform step S130 as shown in fig. 1; a second sending module 54 configured to send the data code to the block chain, for example, to perform step S140 shown in fig. 1.
Fig. 6 illustrates a block diagram of a data transmission device of some embodiments of the present disclosure.
As shown in fig. 6, the data transmission apparatus 6 includes a first obtaining module 61 configured to obtain the data codes from the block chain, for example, execute step S310 shown in fig. 3; and a second obtaining module 62 configured to obtain corresponding data from the data container according to the data encoding, for example, perform step S320 as shown in fig. 3.
Fig. 7 illustrates a block diagram of a data transmission device according to some embodiments of the present disclosure.
As shown in fig. 7, the data transmission device 7 includes a memory 71; and a processor 72 coupled to the memory 71, the memory 71 being configured to store instructions for executing the corresponding embodiment of the data transmission method. For example, the memory 71 stores a program of Dapp. The processor 72 is configured to perform the data transfer method in any of the embodiments of the present disclosure based on instructions stored in the memory 71.
FIG. 8 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
As shown in FIG. 8, computer system 80 may take the form of a general purpose computing device. Computer system 80 includes a memory 810, a processor 820, and a bus 800 that connects the various system components.
The memory 810 may include, for example, system memory, non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), and other programs. The system memory may include volatile storage media such as Random Access Memory (RAM) and/or cache memory. The non-volatile storage medium stores, for instance, instructions to perform corresponding embodiments of at least one of the data transfer methods. Non-volatile storage media include, but are not limited to, magnetic disk storage, optical storage, flash memory, and the like.
The processor 820 may be implemented as discrete hardware components, such as a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gates or transistors, or the like. Accordingly, each of the modules, such as the judging module and the determining module, may be implemented by a Central Processing Unit (CPU) executing instructions in a memory for performing the corresponding step, or may be implemented by a dedicated circuit for performing the corresponding step.
The bus 800 may use any of a variety of bus architectures. For example, bus structures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, and Peripheral Component Interconnect (PCI) bus.
The computer system 80 may also include an input-output interface 830, a network interface 840, a storage interface 850, and the like. These interfaces 830, 840, 850 and the memory 810 and the processor 820 may be connected by a bus 800. The input/output interface 830 may provide a connection interface for input/output devices such as a display, a mouse, and a keyboard. The network interface 840 provides a connection interface for various networking devices. The storage interface 850 provides a connection interface for external storage devices such as a floppy disk, a usb disk, and an SD card.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable apparatus to produce a machine, such that the execution of the instructions by the processor results in an apparatus that implements the functions specified in the flowchart and/or block diagram block or blocks.
These computer-readable program instructions may also be stored in a computer-readable memory that can direct a computer to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and/or block diagram block or blocks.
The present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
Through the data transmission method, the data transmission device and the computer storage medium in the embodiment, the anonymity is increased, and the privacy security is improved.
So far, the data transmission method, the apparatus thereof, and the computer-storable medium according to the present disclosure have been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.