CN114157716A - Data processing method and device based on block chain and electronic equipment - Google Patents

Data processing method and device based on block chain and electronic equipment Download PDF

Info

Publication number
CN114157716A
CN114157716A CN202111462222.1A CN202111462222A CN114157716A CN 114157716 A CN114157716 A CN 114157716A CN 202111462222 A CN202111462222 A CN 202111462222A CN 114157716 A CN114157716 A CN 114157716A
Authority
CN
China
Prior art keywords
data
blocks
block
data blocks
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111462222.1A
Other languages
Chinese (zh)
Inventor
廖飞强
严强
李昊轩
贺双洪
王朝阳
李辉忠
张开翔
范瑞彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202111462222.1A priority Critical patent/CN114157716A/en
Publication of CN114157716A publication Critical patent/CN114157716A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides a data processing method and device based on a block chain and an electronic device, wherein data to be sent is obtained; partitioning the data to be transmitted according to a first data volume of the data to be transmitted and a maximum data volume corresponding to single transmission in a block chain to obtain a plurality of data blocks, wherein a second data volume of data included in each data block in the plurality of data blocks is not greater than the maximum data volume; and transmitting the plurality of data blocks to a receiving node in the block chain in times. According to the technical scheme provided by the embodiment of the application, a large amount of data to be sent can be transmitted based on the block chain, the second data volume of the data included in the data block is not larger than the maximum data volume corresponding to single transmission of the block chain, the data can be guaranteed to be successfully sent to the receiving node, and therefore the efficiency of data block transmission is improved.

Description

Data processing method and device based on block chain and electronic equipment
Technical Field
The application relates to the technical field of science and technology finance, in particular to a data processing method and device based on a block chain and electronic equipment.
Background
With the development of computer technology, more and more technologies are applied in the financial field, the traditional financial industry is gradually changing to financial technology (Finteh), and data processing technology is no exception, but due to the requirements of security and real-time performance of the financial industry, higher requirements are put forward on the data processing technology. Particularly, with the increasing of data volume, a data processing technology based on a block chain puts higher requirements on a data transmission technology of the block chain.
In order to keep the stability of the network, a separate data transmission protocol needs to be designed when transmitting data, the data amount of a node which transmits and receives at a single time cannot exceed a data amount threshold, and the data amount threshold is small, for example, an on-chain messenger protocol in a alliance chain, the data amount of which is transmitted at a time does not exceed 32M. When the amount of data transmitted at one time by the block chain is large but does not exceed the threshold of the amount of data, the limitation of the bandwidth may result in a slower speed of transmission, thereby reducing the efficiency of data transmission. However, when the data amount exceeds the threshold of the data amount that can be transmitted by the blockchain at one time, the data transmission fails, thereby causing the service that needs to transmit a large amount of data to be unavailable.
Disclosure of Invention
The embodiment of the application provides a data processing method and device based on a block chain and an electronic device.
In a first aspect, an embodiment of the present application provides a data processing method based on a block chain, where the data processing method based on the block chain includes:
and acquiring data to be transmitted.
And partitioning the data to be transmitted according to the first data volume of the data to be transmitted and the maximum data volume corresponding to single transmission in a block chain to obtain a plurality of data blocks, wherein the second data volume of the data included in each data block in the plurality of data blocks is not greater than the maximum data volume.
And sending the data blocks to a receiving node in the block chain in times.
Optionally, the partitioning the data to be sent according to the first data size of the data to be sent and the maximum data size corresponding to single transmission in the block chain to obtain a plurality of data blocks includes:
and determining the number of the blocks according to the first data volume and the maximum data volume.
And partitioning the data to be sent according to the number of the partitioned blocks to obtain a plurality of data blocks.
Optionally, the sending the multiple data blocks to the receiving node in the block chain in multiple times includes:
and determining characteristic information corresponding to each data block, wherein the characteristic information comprises at least one of the number of blocks, a service identifier corresponding to the data block and a sequence number of the data block.
And carrying the characteristic information in the corresponding data block and sending the characteristic information to the receiving node.
Optionally, the characteristic information includes a sequence number of the data block.
Carrying the characteristic information in the corresponding data block and sending the characteristic information to the receiving node, wherein the method comprises the following steps:
and carrying the characteristic information in the corresponding data blocks in sequence according to the sequence numbers corresponding to the data blocks respectively, and sending the characteristic information to the receiving node.
Optionally, the sending the multiple data blocks to the receiving node in the block chain in multiple times includes:
and respectively determining the head information of each data block, wherein the head information comprises the identification information of the target node and the service identification corresponding to the data block.
And respectively adding corresponding head information in each data block.
And sending the data blocks added with the header information to corresponding receiving nodes in a plurality of times.
Optionally, the partitioning the data to be sent according to the first data size of the data to be sent and the maximum data size corresponding to single transmission in the block chain includes:
and judging whether the first data volume is larger than the maximum data volume.
And if the first data volume is larger than the maximum data volume, partitioning the data to be sent according to the first data volume of the data to be sent and the maximum data volume corresponding to single transmission in a block chain.
In a second aspect, an embodiment of the present application provides a data processing method based on a block chain, which is applied to a receiving node, and the data processing method based on the block chain includes:
and sequentially receiving a plurality of data blocks sent by a sending node, wherein a second data volume of data included in each data block in the plurality of data blocks is not more than a maximum data volume corresponding to single transmission in a block chain.
And merging the plurality of data blocks to obtain target data.
Optionally, the merging the multiple data blocks to obtain target data includes:
and analyzing the plurality of data blocks respectively to obtain characteristic information corresponding to each data block, wherein the characteristic information comprises at least one of the number of blocks, the service identification corresponding to the data block and the serial number of the data block.
And merging the plurality of data blocks according to the characteristic information corresponding to each data block to obtain target data.
Optionally, the feature information includes a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block.
The merging the data blocks according to the feature information corresponding to each data block to obtain target data includes:
and screening a plurality of data blocks with the same service identification from all the received data blocks.
Judging whether the number of the plurality of data blocks with the same service identification is equal to the number of the blocks;
and if the data blocks are equal, combining the plurality of data blocks with the same service identification in sequence according to the sequence number of each data block to obtain the target data.
Optionally, each data block further includes header information, where the header information includes identification information of the target node.
The analyzing the plurality of data blocks respectively includes:
and respectively judging whether the identification information of the target node corresponding to each data block is the same as the identification information of the receiving node.
And if the data blocks are the same, analyzing the data blocks respectively.
Optionally, the header information further includes a service identifier corresponding to the data block.
The analyzing the plurality of data blocks respectively includes:
and respectively judging whether the service identifier corresponding to each data block is a preset identifier.
And if the data blocks are the preset identifications, analyzing the data blocks respectively.
In a third aspect, an embodiment of the present application provides a data processing apparatus based on a block chain, where the data processing apparatus based on a block chain includes:
and the acquisition module is used for acquiring data to be transmitted.
And the processing module is configured to block the data to be sent according to the first data size of the data to be sent and a maximum data size corresponding to single transmission in a block chain to obtain a plurality of data blocks, where a second data size of data included in each of the plurality of data blocks is not greater than the maximum data size.
And the sending module is used for sending the data blocks to the receiving nodes in the block chain in a plurality of times.
Optionally, the processing module is specifically configured to determine the number of blocks according to the first data amount and the maximum data amount; and partitioning the data to be sent according to the number of the partitioned blocks to obtain a plurality of data blocks.
Optionally, the sending module is specifically configured to determine feature information corresponding to each data block, where the feature information includes at least one of a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; and carrying the characteristic information in the corresponding data block and sending the characteristic information to the receiving node.
Optionally, the characteristic information includes a sequence number of the data block; the sending module is specifically configured to carry the characteristic information in the corresponding data blocks in sequence according to the sequence numbers corresponding to the multiple data blocks, and send the characteristic information to the receiving node.
Optionally, the sending module is specifically configured to determine header information of each data block, where the header information includes identification information of a target node and a service identifier corresponding to the data block; adding corresponding header information in each data block respectively; and sending the data blocks added with the header information to corresponding receiving nodes in a plurality of times.
Optionally, the processing module is specifically configured to determine whether the first data amount is greater than the maximum data amount; and when the first data volume is larger than the maximum data volume, partitioning the data to be sent according to the first data volume of the data to be sent and the maximum data volume corresponding to single transmission in a block chain.
In a fourth aspect, an embodiment of the present application provides a block chain-based data processing apparatus, where the block chain-based data processing apparatus includes:
the receiving module is configured to sequentially receive a plurality of data blocks sent by a sending node, where a second data amount of data included in each of the plurality of data blocks is not greater than a maximum data amount corresponding to a single transmission in a block chain.
And the merging module is used for merging the data blocks to obtain target data.
Optionally, the merging module is specifically configured to analyze the multiple data blocks respectively to obtain feature information corresponding to each data block, where the feature information includes at least one of a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; and merging the plurality of data blocks according to the characteristic information corresponding to each data block to obtain target data.
Optionally, the feature information includes a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; the merging module is specifically configured to screen a plurality of data blocks with the same service identifier from all the received data blocks; judging whether the number of the plurality of data blocks with the same service identification is equal to the number of the blocks; and when the data blocks are equal, combining the data blocks with the same service identification in sequence according to the sequence number of each data block to obtain the target data.
Optionally, each data block further includes header information, where the header information includes identification information of the target node; the merging module is specifically configured to respectively determine whether the identification information of the target node corresponding to each data block is the same as the identification information of the receiving node; and when the data blocks are the same, analyzing the data blocks respectively.
Optionally, the header information further includes a service identifier corresponding to the data block; the merging module is specifically configured to respectively determine whether the service identifier corresponding to each data block is a preset identifier; and when the preset identification is obtained, analyzing the plurality of data blocks respectively.
In a fifth aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the method for processing data based on a blockchain in any one of the possible implementation manners of the first aspect.
In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method for processing data based on a block chain in any one of the foregoing possible implementation manners of the first aspect is implemented.
In a seventh aspect, an embodiment of the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for processing data based on a blockchain in any one of the possible implementation manners of the first aspect is implemented.
Therefore, the embodiment of the application provides a data processing method and device based on a block chain and an electronic device, and data to be sent is obtained; partitioning the data to be transmitted according to a first data volume of the data to be transmitted and a maximum data volume corresponding to single transmission in a block chain to obtain a plurality of data blocks, wherein a second data volume of data included in each data block in the plurality of data blocks is not greater than the maximum data volume; and transmitting the plurality of data blocks to a receiving node in the block chain in times. According to the technical scheme provided by the embodiment of the application, the data to be transmitted is divided into the plurality of data blocks, the second data volume of the data included in each data block is not larger than the maximum data volume corresponding to single transmission of the block chain, the data to be transmitted can be successfully transmitted to the receiving node, the limit of the data volume threshold value of the block chain transmission data is broken, a large amount of data can be transmitted, the data transmission efficiency is effectively improved, the problem that the data transmission fails due to the fact that the transmitted data volume exceeds the data volume threshold value is avoided, and therefore the success rate of the data transmission is improved.
Drawings
Fig. 1 is a schematic view of an application scenario of a data processing method based on a block chain according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method based on a block chain according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another data processing method based on a blockchain according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a streaming packet based on a blockchain according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a flow process of a sending node performing streaming processing on and sending privacy ciphertext data according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a receiving node receiving and merging streaming data packets according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data processing apparatus based on a block chain according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another data processing apparatus based on a blockchain according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device provided in the present application.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. In the description of the text of the present application, the character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The technical scheme provided by the embodiment of the application can be applied to a data processing scene, in particular to data processing based on a block chain. The block chain is a chain formed by a series of blocks, and the Hash value of each block is recorded on each block in addition to the data of the block, so that the chain is formed. The block chain has two core ideas, one is a cryptography technology, the other is a decentralization idea, and based on the two ideas, historical information on the block chain cannot be tampered. Privacy computation, secure multi-party computation, and the like can be performed by using the blockchain.
The privacy calculation refers to a class of information technology for analyzing and calculating data on the premise that a data provider does not reveal original data, and guarantees that the data is 'available and invisible' in each link of the whole process of information processes such as generation, storage, calculation, application, destruction and the like. Private computing includes secure multi-party computing, federal learning, trusted execution environments, and the like. Secure Multi-Party computing (MPC) refers to a method in which multiple parties cooperatively compute an agreed function without a trusted third Party, and each Party is guaranteed to obtain its own Computation result only, and input and output data of any other Party cannot be inferred through interactive data in the Computation process.
When the blockchain is used for transmitting data, in order to keep the stability of the network, a separate data transmission protocol needs to be designed when the data is transmitted, the amount of data sent and received by a node of the blockchain at a time is less than a data amount threshold value, and the data amount threshold value is small, for example, the on-chain messenger protocol in a alliance chain, the amount of data transmitted at a time does not exceed 32M. When the amount of data transmitted at one time by the block chain is large but does not exceed the threshold of the amount of data, the limitation of the transmission bandwidth may be received, so that the transmission speed is slow, thereby reducing the efficiency of data transmission. In addition, when the data amount exceeds the threshold of the data amount which can be transmitted by the blockchain at one time, the problem of data transmission failure occurs, so that services which need to transmit a large amount of data, such as privacy calculation, cannot be used.
In order to solve the problem of low data transmission efficiency of the block chain, a large amount of data can be processed in a blocking mode, data transmission is carried out in a data block mode, the problem of low transmission speed caused by bandwidth limitation is solved, and only the data volume in the data block is not larger than the maximum data volume corresponding to single transmission of the block chain, so that the database can be successfully sent to a receiving node. In addition, the technical scheme provided by the application can be applied to a scene that the privacy computing service based on the block chain sends large-scale data.
Fig. 1 is a schematic view of an application scenario of a data processing method based on a block chain according to an embodiment of the present application. As shown in fig. 1, when a sending node sends data to be sent to a receiving node 100, it can be determined that the data to be sent is divided into 3 parts according to a maximum data amount corresponding to a single transmission in a block chain and a first data amount of the data to be sent, and the 3 parts are respectively placed in 3 data blocks 200. For example, the first data amount of the data to be transmitted is 16, and the maximum data amount corresponding to a single transmission in the block chain is 8, so that the number of the data to be transmitted stored in 3 data blocks may be 5, 5, 6, or other allocation manners not exceeding 8.
Further, after obtaining 3 data blocks, the 3 data blocks are sent to the receiving node 103 in the block chain in a divided manner. The receiving node 103 combines the data in the received 3 data blocks to obtain data to be sent.
The technical scheme provided by the embodiment of the application can place a large amount of data in a plurality of data blocks and send the data blocks to the receiving node in a grading manner, and the data transmission efficiency is improved. And the second data volume of the data included in each data block is not more than the maximum data volume corresponding to the word transmission in the block chain, so that the success rate in the data transmission process can be ensured. Therefore, when the method provided by the application is used for transmitting the data exceeding the data volume threshold, the problem of transmission failure is avoided, and the normal use of services such as privacy calculation and the like which need to transmit a large amount of data can be realized.
Hereinafter, the block chain-based data processing method provided in the present application will be described in detail by specific embodiments. It is to be understood that the following detailed description may be combined with other embodiments, and that the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a schematic flowchart of a data processing method based on a block chain according to an embodiment of the present disclosure. The blockchain-based data processing method may be performed by software and/or hardware means, for example, the hardware means may be a blockchain-based data processing apparatus, and the blockchain-based data processing apparatus may be a terminal or a processing chip in the terminal. For example, referring to fig. 2, the data processing method based on a block chain may include:
s201, obtaining data to be sent.
In this step, when acquiring data to be transmitted, the data to be transmitted may be acquired from a plurality of data sources through a plurality of channels, for example, data of each dimension of a specific enterprise may be acquired from a plurality of data sources. The obtained data to be sent is related to the currently executed service, for example, when the currently executed service is a privacy calculation service, the obtained data to be sent is related to privacy calculation. The embodiment of the application does not limit the acquisition of the data to be sent and the content of the data to be sent.
S202, according to a first data size of data to be sent and a maximum data size corresponding to a single transmission in a block chain, partitioning the data to be sent to obtain a plurality of data blocks, where a second data size of data included in each of the plurality of data blocks is not greater than the maximum data size.
In this step, when the data to be transmitted is partitioned according to the first data size of the data to be transmitted and the maximum data size corresponding to single transmission in the block chain to obtain a plurality of data blocks, the number of the partitioned blocks can be determined according to the first data size and the maximum data size; and partitioning the data to be sent according to the number of the partitions to obtain a plurality of data blocks.
For example, the maximum data size is a maximum data size corresponding to a single transmission in a block chain, and may be 10M, or 30M, or other numbers, which are specifically set according to an actual situation, and this is not limited in this embodiment of the present application.
In the embodiment of the application, the data to be sent is divided into the plurality of data blocks, so that a large amount of data is split into a plurality of small amounts of data, the efficiency of a data transmission process can be improved, and the probability of wireless errors of the data blocks in the transmission process is low, so that the safety of the data can be effectively ensured, and the data to be sent can be accurately sent to the receiving node.
For example, when the data to be sent is partitioned according to a first data size of the data to be sent and a maximum data size corresponding to single transmission in a block chain, whether the first data size is larger than the maximum data size is judged; and if the first data volume is larger than the maximum data volume, partitioning the data to be sent according to the first data volume of the data to be sent and the maximum data volume corresponding to single transmission in the block chain.
For example, when the data to be transmitted is partitioned according to the first data size of the data to be transmitted and the maximum data size corresponding to a single transmission in the block chain, a data threshold allowed in each data block needs to be determined, where the data threshold may be equal to the maximum data size or smaller than the maximum data size threshold, and may be specifically set according to an actual situation. For example, in the privacy computation service, the value range of the data threshold is greater than 9 and smaller than the difference between the maximum data amount and the data amount occupied by the fixed parameter, and the data threshold may be specifically set according to the actual conditions of the block chain and the privacy computation, for example, the data threshold may be one half of the maximum data amount.
In the embodiment of the application, the data to be sent is blocked according to the maximum data volume corresponding to the single transmission in the block chain, so that the data volume in the data block is not more than the maximum data volume corresponding to the single transmission in the block chain, and the data block can be further ensured to be sent to the receiving node quickly and accurately.
And S203, transmitting the plurality of data blocks to a receiving node in the block chain in a grading manner.
In this step, when a plurality of data blocks are sent to a receiving node in a block chain in a plurality of times, characteristic information corresponding to each data block may be determined, where the characteristic information includes at least one of the number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; and carrying the characteristic information in the corresponding data block and sending the characteristic information to a receiving node.
Illustratively, the data block may be in the form of an attrition data packet streamPacket. The number of blocks is the number of data blocks, and the number of blocks may be a character string type, and the number of bytes occupied by the number of blocks is fixed, for example, the number of bytes occupied by the number of blocks is 4 bytes. The service identifier corresponding to the data block may be a character string type, and the number of bytes occupied by the service identifier is fixed, for example, the number of bytes occupied by the service identifier corresponding to the data block is 16 bytes. The sequence number of the data block may be an integer type, and the number of bytes occupied by the sequence number is fixed, for example, the number of bytes occupied by the sequence number of the data block is 4 bytes. The number of the blocks, the service identifier corresponding to the data block, and the number of bytes occupied by the sequence number of the data block are not specifically limited in the embodiments of the present application.
According to the above steps, when the data to be sent is blocked to obtain a plurality of data blocks, the number of blocks, the service identifier corresponding to the data block, and the number of bytes occupied by the serial number of the data block need to be considered, and the influence on the amount of data that can be stored in the data block is considered. For example, the maximum allowable data amount in the data block is 120, and the number of the partitions, the service identifier corresponding to the data block, and the sequence number of the data block occupy 20, then the maximum allowable data amount of the data block becomes 100.
It is understood that the characteristic information may include, in addition to at least one of the number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block, a receiving node identifier to indicate that the data block is sent to a receiving node specified in the blockchain.
In the embodiment of the application, by carrying at least one piece of feature information of the number of the blocks, the service identifier corresponding to the data block, and the serial number of the data block in the corresponding data block and sending the feature information and the data to be sent in the data block to the receiving node, the progress of data block transmission can be determined according to the feature information, and whether errors occur in the data block transmission process, so that the safety of data transmission is further improved.
For example, if the characteristic information includes sequence numbers of data blocks, when the characteristic information is carried in the corresponding data blocks and sent to the receiving node, the characteristic information may be carried in the corresponding data blocks in sequence according to the sequence numbers corresponding to the plurality of data blocks and sent to the receiving node.
In the embodiment of the application, the characteristic information is carried in the corresponding data blocks in sequence according to the respective corresponding sequence numbers of the first data block and is sent to the receiving node, so that when the data blocks are sent, the same sequence of data to be sent in the sending sequence of the data blocks can be ensured, and the efficiency of the receiving node in combining the received data blocks is higher. Furthermore, it can be determined whether a problem occurs with the data block when it is transmitted to the receiving node.
For example, the data block may further include header information of the data block, and when the plurality of data blocks are respectively sent to the receiving node in the block chain, the header information of each data block may be respectively determined, where the header information includes identification information of the target node and a service identifier corresponding to the data block; adding corresponding header information in each data block respectively; and sending the data blocks added with the header information to corresponding receiving nodes in a plurality of times.
In the prior art, when receiving a plurality of data sent by a sending node, a receiving node needs to analyze the data to obtain service information of the data. In the embodiment of the application, the header information including the identification information of the target node and the service identification corresponding to the data block is added to the data block, so that the receiving module can directly determine the service identification corresponding to the data block according to the header information without analyzing the data block, and the efficiency of data transmission is further improved.
Therefore, in the data processing method based on the block chain provided by the embodiment of the application, data to be sent is obtained; partitioning the data to be transmitted according to a first data volume of the data to be transmitted and a maximum data volume corresponding to single transmission in a block chain to obtain a plurality of data blocks, wherein a second data volume of data included in each data block in the plurality of data blocks is not greater than the maximum data volume; and transmitting the plurality of data blocks to a receiving node in the block chain in times. According to the technical scheme provided by the embodiment of the application, the data to be sent is sent to the receiving node in a data block mode, so that the block chain can transmit a large amount of data. And the second data volume of the data included in the data block is not more than the maximum data volume corresponding to the single transmission of the block chain, so that the efficiency and the success rate of data transmission are improved.
Fig. 3 is a schematic flowchart of another data processing method based on a blockchain according to an embodiment of the present disclosure. The data processing method based on the blockchain is applied to a receiving node and can be executed by software and/or hardware devices, for example, the hardware devices can be data processing devices based on the blockchain, and the data processing devices based on the blockchain can be terminals or processing chips in the terminals. The data processing method based on the blockchain is applied to a receiving node, for example, please refer to fig. 3, and the data processing method based on the blockchain may include:
s301, a plurality of data blocks sent by a sending node are sequentially received, wherein a second data volume of data included in each data block in the plurality of data blocks is not larger than a maximum data volume corresponding to single transmission in a block chain.
According to the above embodiment, when the sending node sends the plurality of data blocks to the receiving node in the block chain in several times, the receiving node receives the plurality of data blocks in sequence according to the order sent by the sending node.
And S302, merging the plurality of data blocks to obtain target data.
For example, when a plurality of data blocks are merged to obtain target data, the plurality of data blocks may be analyzed respectively to obtain characteristic information corresponding to each data block, where the characteristic information includes at least one of a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; and combining the plurality of data blocks according to the characteristic information corresponding to each data block to obtain target data. The embodiment of the present application does not limit the specific analysis manner at all.
After obtaining the characteristic information corresponding to each data block, the receiving node receiving side may perform local caching, for example, may cache each data block by using the characteristic information of each data block through data stream caching and count caching. When the data block is cached, the cache key may be set to the receiving node identifier + the service identifier corresponding to the data block + the block number, and the cache value may be set to the data block to indicate that the cached content is the data block. After the data block cache is set, a count cache may be set, and a key of the count cache may be set to receive node identifier + service identifier corresponding to the data block, so that when a data block is received, the value corresponding to the count cache is increased by 1, so as to count the received data block.
In the application, a plurality of data blocks are combined, and the obtained target data is to-be-sent data sent by a sending node.
In the embodiment of the present application, the characteristic information of the data block includes at least one of a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block. Therefore, the data blocks can be rapidly combined according to the characteristic information corresponding to each data block, and the target obtained after combination is more ordered.
For example, when the feature information includes the number of blocks, the service identifier corresponding to the data block, and the sequence number of the data block; a plurality of data blocks with the same service identification can be screened from all the received data blocks; judging whether the number of a plurality of data blocks with the same service identification is equal to the number of the blocks; and if the data blocks are equal, combining the data blocks with the same service identification in sequence according to the sequence number of each data block to obtain target data.
It is understood that a receiving node may receive data blocks belonging to the same service from multiple sending nodes at a uniform time or within a uniform time period, or may receive data blocks belonging to different services from different sending nodes. Therefore, the receiving node needs to screen out a plurality of data blocks with the same service identifier, and determine whether the number of the plurality of data blocks with the same service identifier is equal to the number of the blocks. For example, the number of the multiple data blocks with the same service identifier may be determined by counting the cached value, where if the number of the multiple data blocks with the same service identifier is equal to the number of the split data blocks, it indicates that all the data blocks with the service identifier have been received, and the multiple data blocks with the same service identifier may be sequentially merged according to the sequence number of each data block.
In the embodiment of the present application, whether the data blocks of the same service identifier have been completely received is determined by determining whether the number of the multiple data blocks with the same service identifier is equal to the number of the partitions, and when the number of the multiple data blocks with the same service identifier is equal to the number of the partitions, the multiple data blocks with the same service identifier are sequentially merged, so that the target data obtained after merging is arranged according to the sequence number of the data blocks, that is, the sequence of the target data is completely consistent with the sequence of the data to be sent by the sending node, thereby ensuring the accuracy of the received data.
For example, each data block may further include header information, where the header information includes identification information of the target node; therefore, when the plurality of data blocks are analyzed respectively, whether the identification information of the target node corresponding to each data block is the same as the identification information of the receiving node can be judged respectively; and if the data blocks are the same, analyzing the data blocks respectively. It is understood that the target node is a receiving node.
In the embodiment of the application, whether the identification information of the target node corresponding to each data block is the same as the identification information of the receiving node is judged, and when the identification information of the target node corresponding to each data block is the same as the identification information of the receiving node, the data blocks are analyzed respectively, so that whether the data blocks belong to the current explaining node can be determined, the receiving node can be prevented from analyzing the data blocks which do not belong to the receiving node, the data in the analyzed data blocks cause interference on correct data received by the receiving node, and the accuracy of the target data obtained by the receiving node can be improved.
For example, the header information may further include a service identifier corresponding to the data block; when the plurality of data blocks are analyzed respectively, whether the service identifier corresponding to each data block is a preset identifier can be judged respectively; and if the data blocks are the preset identifications, analyzing the data blocks respectively.
It can be understood that the preset identifier may be a service identifier determined in advance by the receiving node and the sending node, or a service identifier set for the receiving node, which is not limited in this embodiment of the present application.
For example, the service identifiers corresponding to the multiple data blocks may include numbers, and for example, the service identifiers corresponding to the multiple data blocks belonging to the same service may be a service-1, a service-2, a service-3, a service-4, and a service-5, so that the arrangement order of the multiple data blocks may be determined according to the service identifiers corresponding to the multiple data blocks, so that the sequence numbers of the multiple data blocks may be determined without parsing the data blocks.
In the embodiment of the application, only the plurality of data blocks with the preset service identifiers corresponding to the data blocks are analyzed, so that the receiving node can be prevented from analyzing the data blocks with the wrong service identifiers, that is, the data in the wrong data blocks can be prevented from influencing the target data obtained by the receiving node, and in addition, the target data can be prevented from being influenced by the data in the wrong data blocks
Therefore, in the data processing method based on the blockchain provided by the embodiment of the application, a plurality of data blocks sent by a sending node are sequentially received, wherein a second data volume of data included in each data block in the plurality of data blocks is not greater than a maximum data volume corresponding to single transmission in the blockchain; and merging the plurality of data blocks to obtain target data. The method and the device can realize the ordered receiving of the data, so that the obtained target data is completely the same as the data to be sent by the sending node, the accuracy of receiving the data by the receiving node is improved, and the efficiency of combining the data can be effectively improved.
In order to facilitate understanding of the data processing method based on the block chain provided in the embodiment of the present application, the following will take the data block as a streaming data packet based on the block chain as an example, and describe in detail the technical solution provided in the embodiment of the present application. For example, the structure of a streaming data packet may be shown in fig. 4, where fig. 4 is a schematic structural diagram of a streaming data packet based on a blockchain according to an embodiment of the present application. As shown in fig. 4, the streaming packet may include a receiving node identifier nodeId, which is a character string type and represents a receiving node identifier of a block chain, and the size of the receiving node identifier is fixed to 16 bytes; the business identifier businessId is a character string type, represents the business identifier and has the fixed size of 16 bytes; the number dataBlockCount of the data packets, namely the number of the sub-blocks, and the total number of the streaming data packets, which are of an integer type, represent the total number of the streaming sub-blocks, and the size of the streaming data packets is fixed to 4 bytes; the data packet sequence number blockSerialNumber is an integer type, represents the sequence number of the streaming block data and has the fixed size of 4 bytes; the streaming data content dataStream, which is a byte data type and represents the streaming data content, has a size smaller than the single transmission data amount of the block chain, i.e., the maximum data amount described in the above embodiment.
Illustratively, according to the streaming data packet illustrated in fig. 4, the sending node performs streaming processing on the privacy ciphertext data and sends the privacy ciphertext data. Specifically, as shown in fig. 5, fig. 5 is a schematic flowchart of a flow process performed by a sending node on privacy ciphertext data and sending the privacy ciphertext data according to an embodiment of the present application. As shown in fig. 5, the streaming processing and sending of the privacy ciphertext data by the sending node may include the following steps:
step 1, obtaining privacy ciphertext data and determining a data threshold value.
The streaming data threshold is the maximum allowable data amount of the data packet as described in the above embodiment.
For example, assuming that the maximum data amount that can be transmitted by the blockchain at one time is m, the specified streaming data threshold r may be set according to the actual situation of the blockchain and the privacy computation service. Because the receiving node identifier nodeId, the service identifier businessId, the packet number dataBlockCount and the packet sequence number blockSerialNumber in the streaming data structure need to fixedly occupy 16+16+4+ 4-40 bytes, r needs to satisfy 0< r ≦ m-40. The data size of block chain transmission can be adjusted through the data threshold r, and the smaller the data size output in a single time is, the more the transmission times are. The larger the amount of data output at a single time, the fewer the number of transmissions. For example, r can be taken to be m/2.
And 2, judging whether the size of the data is larger than a data threshold value, if so, executing the step 3, and if not, directly transmitting the data.
And step 3, converting the data into byte stream data bdata.
For example, a character string "c 2VsZWN0 IHNvdX" is passed through an ASCII code table to associate each character with its ASCII value, each ASCII code value being a direct number from 0-127. Converted into byte stream data bdata of [99, 50, 86, 115, 90, 87, 78, 48, 73, 72, 78, 118, 100, 88], and the size I of byte stream data bdata is 14.
Where ASCII code is a combination of binary numbers using a specified 7-bit number to represent 128 possible characters, including all upper and lower case letters, the numbers 0 to 9, punctuation marks.
And 4, dividing the byte stream data bdata into a plurality of stream type data packets, and determining the sequence number of the data packets and the stream type data content of each stream type data packet.
For example, when the byte stream data bdata is divided into a plurality of streaming packets, the byte stream data bdata may be sliced according to a data threshold r, the size of the byte stream data bdata is denoted as I, and the number of sliced streaming packets datablockackcount is I// r, where// represents a division rounded up, for example, 3//2 is 2, and 4//2 is 2. The packet sequence numbers blockSerialNumber are 1, 2, … and dataBlockCount, respectively. The streaming data content dataStream is bdata [0, r-1], bdata [ r, 2r-1], … and bdata [ (dataBlockCount-1) × r, I-1 ].
For the example in step 3, assuming that the value of the number threshold r is set to 5, the number of streaming packets dataBlockCount I// r 14//5 3, and the packet sequence numbers blockSerialNumber 1, 2, and 3, respectively. The streaming data content dataStream is bdata [0, 4] ═ 99, 50, 86, 115, 90], bdata [5, 9] ═ 87, 78, 48, 73, 72], bdata [10, 13] ═ 78, 118, 100, 88, respectively.
And 5, assembling a plurality of streaming data packets according to the data packet sequence number and the streaming data content of each streaming data packet.
Illustratively, a plurality of streaming packets as shown in fig. 4 are assembled, and according to the example in step 4, the packet sequence numbers blockSerialNumber are 1, 2, and 3; the streaming data content dataStream is a streaming packet in which bdata [0, 4] - [99, 50, 86, 115, 90], bdata [5, 9] - [87, 78, 48, 73, 72], bdata [10, 13] - [78, 118, 100, 88], a receiving node identification nodeId, a service identification businessId, a packet number dataBlockCount, and a streaming data content dataStream are set, respectively. Wherein the receiving node identification nodeId can be set according to the world level situation, for example, the receiving node identification is node 1. The service identification businessId is related to the service corresponding to the streaming data, and for example, the service identification may be job 1. The number of packets dataBlockCount is 3.
And 6, adding the head information of the streaming data packet.
For example, to make the data transmission orderly, the data packet may be transmitted by subject listening in conjunction with a packet sequence number blockserial number mechanism. Specifically, before sending data, both the sending node and the receiving node need to set a monitoring theme, so that the two nodes of the block chain can send and receive data according to a specific theme. For example, the subject of the listening may be header information of the streaming packet. The subject of the monitoring may also be directly set as the form of the transmitted data, i.e. the normal data or the streaming data packet, and the embodiment of the present application does not specifically limit the subject of the monitoring.
When header information is added to a streaming packet, the header information may be represented by a character string, for example, the header information of the streaming packet sent by one blockchain sending node1 is node2-job1, where node2 represents an identifier of a receiving node, job1 represents a first streaming packet whose task is job, and therefore node2-job1 represents that the sent data is a streaming packet for node2 and job 1. In the streaming data packet under the same job joba, the sending sequence of the data is distinguished through the block serial number of the data packet, so that a receiving party can conveniently merge and restore the data in sequence, and the block chain can realize bidirectional multi-round ordered data sending.
And 7, sending the streaming data packet added with the header information.
Fig. 6 is a schematic flow chart of a receiving node receiving and merging streaming data packets according to an embodiment of the present application. As shown in fig. 6, receiving and combining streaming packets by a receiving node may include the steps of:
step 1, receiving data.
And 2, judging whether a streaming data packet is received or not, if the streaming data packet is received, executing the step 2, and if the common data is received, processing according to a block chain native transmission data receiving mode.
For example, when determining whether a streaming data packet is received, the determination may be performed by using a set monitoring subject, if the monitoring subject is in the form of received data, that is, normal data or the streaming data packet, the determination may be directly performed, and if the monitoring subject is header information of the streaming data packet, the streaming data packet may be received when the header information exists. The embodiments of the present application are described by way of example only, and do not represent that the embodiments of the present application are limited thereto.
And 3, analyzing the streaming data packet to obtain streaming data packet information.
Illustratively, a streaming packet streamack is obtained, and the receiving node identifier nodeId, the service identifier businessId, the number of packets dataBlockCount, the packet sequence number blockSerialNumber and the streaming data content dataStream are obtained through parsing.
And 4, setting a data stream cache and a counting cache.
For example, when setting the data stream cache and the technical cache, the receiving node sets two caches locally, namely a data stream cache and a count cache. The data stream buffer is used for storing the stream data, the key of the data stream buffer is set to nodeId + businessId + blockSerialNumber, and the value of the data stream buffer is set to dataStream. When the data stream cache is successfully set, a counting cache is set, the key of the counting cache is set to nodeId + businessId, and when a streaming data packet is received, the value of the corresponding counting cache is increased by 1 so as to determine the number of the received streaming data packets through the counting cache.
And 5, judging whether the value of the counting cache is equal to the number of the data packets, if so, executing the step 6, and if not, executing the steps 1-3.
For example, when determining whether the value of the count buffer is equal to the number of packets, the number of packets obtained by parsing the streaming packets in step 3 may be compared with the value of the buffer in the prior art, if the value of the count buffer is equal to the number of packets, it indicates that all the streaming packets have been received, and if the value of the count buffer is not equal to the number of packets, it indicates that there are no received packets, and it is necessary to continue receiving the streaming packets until all the streaming packets have been received.
And 6, merging the streaming data packet to obtain the privacy ciphertext data.
Illustratively, the keys traversing the query stream cache in turn are the values of nodeId + businessId +1, nodeId + businessId +2, …, nodeId + businessId + dataBlockCount. The inquired data stream cache values are combined in sequence according to the inquiry sequence, so that the problem that the transmitted and received data are inconsistent due to disorder of the stream data packet in the transmitting or receiving process can be avoided. According to the method for dividing data into a plurality of streaming data packets in the foregoing embodiment, when merging the streaming data packets, the data may be sequentially stored into a bdata byte array with a length of I according to bdata [0, r-1], bdata [ r, 2r-1], …, and bdata [ (dataBlockCount-1) × r, l-1], so as to ensure consistency between data received by a receiving node and data sent by a sending node.
And 7, deleting the data stream cache and the counting cache.
For example, after merging the streaming packets, the counting buffer with the key nodeId + businessId and the streaming buffer with the key nodeId + businessId + blockSerialNumber may be deleted.
Fig. 7 is a schematic structural diagram of a block chain-based data processing apparatus 70 according to an embodiment of the present application, and for example, please refer to fig. 7, the block chain-based data processing apparatus 70 may include:
an obtaining module 701 is configured to obtain data to be sent.
The processing module 702 is configured to block data to be sent according to a first data amount of the data to be sent and a maximum data amount corresponding to single transmission in a block chain to obtain a plurality of data blocks, where a second data amount of data included in each of the plurality of data blocks is not greater than the maximum data amount.
A sending module 703 is configured to send the multiple data blocks to a receiving node in the block chain in multiple times.
Optionally, the processing module 702 is specifically configured to determine the number of blocks according to the first data amount and the maximum data amount; and partitioning the data to be sent according to the number of the partitions to obtain a plurality of data blocks.
Optionally, the sending module 703 is specifically configured to determine feature information corresponding to each data block, where the feature information includes at least one of a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; and carrying the characteristic information in the corresponding data block and sending the characteristic information to a receiving node.
Optionally, the characteristic information includes a sequence number of the data block; the sending module 703 is specifically configured to carry the feature information in the corresponding data blocks in sequence according to the sequence numbers corresponding to the multiple data blocks, and send the feature information to the receiving node.
Optionally, the sending module 703 is specifically configured to determine header information of each data block, where the header information includes identification information of a target node and a service identifier corresponding to the data block; adding corresponding header information in each data block respectively; and sending the data blocks added with the header information to corresponding receiving nodes in a plurality of times.
Optionally, the processing module 702 is specifically configured to determine whether the first data amount is greater than the maximum data amount; and when the first data volume is larger than the maximum data volume, partitioning the data to be sent according to the first data volume of the data to be sent and the maximum data volume corresponding to single transmission in the block chain.
The data processing apparatus based on a block chain provided in this embodiment of the present application may execute the technical solution of the data processing method based on a block chain in any of the above embodiments, and its implementation principle and beneficial effect are similar to those of the data processing method based on a block chain, and reference may be made to the implementation principle and beneficial effect of the data processing method based on a block chain, which are not described herein again.
Fig. 8 is a schematic structural diagram of another block chain-based data processing apparatus 80 according to an embodiment of the present application, for example, please refer to fig. 8, where the block chain-based data processing apparatus 80 may include:
a receiving module 801, configured to receive multiple data blocks sent by a sending node in sequence, where a second data amount of data included in each data block in the multiple data blocks is not greater than a maximum data amount corresponding to a single transmission in a block chain.
A merging module 802, configured to merge multiple data blocks to obtain target data.
Optionally, the merging module 802 is specifically configured to analyze the multiple data blocks respectively to obtain feature information corresponding to each data block, where the feature information includes at least one of a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; and combining the plurality of data blocks according to the characteristic information corresponding to each data block to obtain target data.
Optionally, the characteristic information includes a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block; a merging module 802, specifically configured to screen multiple data blocks with the same service identifier from all received data blocks; judging whether the number of a plurality of data blocks with the same service identification is equal to the number of the blocks; and when the data blocks are equal, combining the data blocks with the same service identification in sequence according to the sequence number of each data block to obtain target data.
Optionally, each data block further includes header information, where the header information includes identification information of the target node; a merging module 802, configured to respectively determine whether the identification information of the target node corresponding to each data block is the same as the identification information of the receiving node; when the data blocks are the same, the data blocks are analyzed respectively.
Optionally, the header information further includes a service identifier corresponding to the data block; a merging module 802, specifically configured to respectively determine whether a service identifier corresponding to each data block is a preset identifier; and when the preset identification is obtained, analyzing the plurality of data blocks respectively.
The data processing apparatus based on a block chain provided in this embodiment of the present application may execute the technical solution of the data processing method based on a block chain in any of the above embodiments, and its implementation principle and beneficial effect are similar to those of the data processing method based on a block chain, and reference may be made to the implementation principle and beneficial effect of the data processing method based on a block chain, which are not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device provided in the present application. As shown in fig. 9, the electronic device 900 may include: at least one processor 901 and memory 902.
And a memory 902 for storing programs. In particular, the program may include program code including computer operating instructions.
Memory 902 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 901 is configured to execute computer-executable instructions stored in the memory 902 to implement the blockchain-based data processing method described in the foregoing method embodiments. The processor 901 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present Application. Specifically, when the data processing method based on the block chain described in the foregoing method embodiment is implemented, the electronic device may be, for example, an electronic device with a processing function, such as a terminal and a server.
Optionally, the electronic device 900 may also include a communication interface 903. In a specific implementation, if the communication interface 903, the memory 902 and the processor 901 are implemented independently, the communication interface 903, the memory 902 and the processor 901 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. Buses may be classified as address buses, data buses, control buses, etc., but do not represent only one bus or type of bus.
Optionally, in a specific implementation, if the communication interface 903, the memory 902, and the processor 901 are integrated into a chip, the communication interface 903, the memory 902, and the processor 901 may complete communication through an internal interface.
The present application also provides a computer-readable storage medium, which 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, and in particular, the computer-readable storage medium stores program instructions, and the program instructions are used in the method in the foregoing embodiments.
The present application also provides a program product comprising execution instructions stored in a readable storage medium. The at least one processor of the electronic device may read the execution instruction from the readable storage medium, and the execution of the execution instruction by the at least one processor causes the electronic device to implement the block chain-based data processing method provided in the various embodiments described above.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (15)

1. A data processing method based on a block chain is characterized by comprising the following steps:
acquiring data to be transmitted;
partitioning the data to be sent according to the first data volume of the data to be sent and the maximum data volume corresponding to single transmission in a block chain to obtain a plurality of data blocks, wherein the second data volume of the data included in each data block in the plurality of data blocks is not greater than the maximum data volume;
and sending the data blocks to a receiving node in the block chain in times.
2. The method of claim 1, wherein the partitioning the data to be transmitted into a plurality of data blocks according to the first data size of the data to be transmitted and a maximum data size corresponding to a single transmission in a block chain comprises:
determining the number of blocks according to the first data volume and the maximum data volume;
and partitioning the data to be sent according to the number of the partitioned blocks to obtain a plurality of data blocks.
3. The method according to claim 1 or 2, wherein the transmitting the plurality of data blocks to the receiving node in the block chain in multiple times comprises:
determining characteristic information corresponding to each data block, wherein the characteristic information comprises at least one of the number of blocks, a service identifier corresponding to the data block and a sequence number of the data block;
and carrying the characteristic information in the corresponding data block and sending the characteristic information to the receiving node.
4. The method of claim 3, wherein the characteristic information comprises a sequence number of the data block;
carrying the characteristic information in the corresponding data block and sending the characteristic information to the receiving node, wherein the method comprises the following steps:
and carrying the characteristic information in the corresponding data blocks in sequence according to the sequence numbers corresponding to the data blocks respectively, and sending the characteristic information to the receiving node.
5. The method of claim 4, wherein the transmitting the plurality of data blocks to the receiving node in the block chain in multiple times comprises:
respectively determining the head information of each data block, wherein the head information comprises the identification information of a target node and the service identification corresponding to the data block;
adding corresponding header information in each data block respectively;
and sending the data blocks added with the header information to corresponding receiving nodes in a plurality of times.
6. The method of claim 4, wherein the partitioning the data to be transmitted according to the first data amount of the data to be transmitted and a maximum data amount corresponding to a single transmission in a block chain comprises:
judging whether the first data volume is larger than the maximum data volume;
and if the first data volume is larger than the maximum data volume, partitioning the data to be sent according to the first data volume of the data to be sent and the maximum data volume corresponding to single transmission in a block chain.
7. A data processing method based on a block chain is applied to a receiving node, and the method comprises the following steps:
sequentially receiving a plurality of data blocks sent by a sending node, wherein a second data volume of data included in each data block in the plurality of data blocks is not more than a maximum data volume corresponding to single transmission in a block chain;
and merging the plurality of data blocks to obtain target data.
8. The method of claim 7, wherein the merging the plurality of data blocks to obtain the target data comprises:
analyzing the data blocks respectively to obtain characteristic information corresponding to each data block, wherein the characteristic information comprises at least one of the number of blocks, service identification corresponding to the data block and the serial number of the data block;
and merging the plurality of data blocks according to the characteristic information corresponding to each data block to obtain target data.
9. The method according to claim 8, wherein the characteristic information includes a number of blocks, a service identifier corresponding to the data block, and a sequence number of the data block;
the merging the data blocks according to the feature information corresponding to each data block to obtain target data includes:
screening a plurality of data blocks with the same service identification from all the received data blocks;
judging whether the number of the plurality of data blocks with the same service identification is equal to the number of the blocks;
and if the data blocks are equal, combining the plurality of data blocks with the same service identification in sequence according to the sequence number of each data block to obtain the target data.
10. The method according to claim 8 or 9, wherein each data block further includes header information, and the header information includes identification information of the target node;
the analyzing the plurality of data blocks respectively includes:
respectively judging whether the identification information of the target node corresponding to each data block is the same as the identification information of the receiving node;
and if the data blocks are the same, analyzing the data blocks respectively.
11. The method according to claim 10, wherein the header information further includes a service identifier corresponding to the data block;
the analyzing the plurality of data blocks respectively includes:
respectively judging whether the service identification corresponding to each data block is a preset identification;
and if the data blocks are the preset identifications, analyzing the data blocks respectively.
12. A blockchain-based data processing apparatus, comprising:
the acquisition module is used for acquiring data to be transmitted;
a processing module, configured to block the data to be sent according to a first data amount of the data to be sent and a maximum data amount corresponding to single transmission in a block chain to obtain a plurality of data blocks, where a second data amount of data included in each of the plurality of data blocks is not greater than the maximum data amount;
and the sending module is used for sending the data blocks to the receiving nodes in the block chain in a plurality of times.
13. A blockchain-based data processing apparatus, comprising:
a receiving module, configured to receive multiple data blocks sent by a sending node in sequence, where a second data amount of data included in each data block in the multiple data blocks is not greater than a maximum data amount corresponding to a single transmission in a block chain;
and the merging module is used for merging the data blocks to obtain target data.
14. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of any of claims 1-11.
15. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, perform the method of any one of claims 1-11.
CN202111462222.1A 2021-12-02 2021-12-02 Data processing method and device based on block chain and electronic equipment Pending CN114157716A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111462222.1A CN114157716A (en) 2021-12-02 2021-12-02 Data processing method and device based on block chain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111462222.1A CN114157716A (en) 2021-12-02 2021-12-02 Data processing method and device based on block chain and electronic equipment

Publications (1)

Publication Number Publication Date
CN114157716A true CN114157716A (en) 2022-03-08

Family

ID=80456023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111462222.1A Pending CN114157716A (en) 2021-12-02 2021-12-02 Data processing method and device based on block chain and electronic equipment

Country Status (1)

Country Link
CN (1) CN114157716A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295036A (en) * 2016-03-31 2017-10-24 华为技术有限公司 A kind of data transmission method for uplink and data merge equipment
CN110071876A (en) * 2019-04-28 2019-07-30 阿里巴巴集团控股有限公司 A kind of data transmission method based on block chain, device and electronic equipment
CN110418376A (en) * 2019-07-29 2019-11-05 国广东方网络(北京)有限公司 Data transmission method and device
US20200351310A1 (en) * 2019-05-03 2020-11-05 Virtustream Ip Holding Company Llc Adaptive distributive data protection system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295036A (en) * 2016-03-31 2017-10-24 华为技术有限公司 A kind of data transmission method for uplink and data merge equipment
CN110071876A (en) * 2019-04-28 2019-07-30 阿里巴巴集团控股有限公司 A kind of data transmission method based on block chain, device and electronic equipment
US20200351310A1 (en) * 2019-05-03 2020-11-05 Virtustream Ip Holding Company Llc Adaptive distributive data protection system
CN110418376A (en) * 2019-07-29 2019-11-05 国广东方网络(北京)有限公司 Data transmission method and device

Similar Documents

Publication Publication Date Title
US9717011B2 (en) Event management in telecommunications networks
CN107295036B (en) Data sending method and data merging equipment
US9356844B2 (en) Efficient application recognition in network traffic
CN110741573A (en) Method and system for selectively propagating transactions using network coding in a blockchain network
CN115037700B (en) Complex network data packet transmission method, system, terminal and storage medium
CN114268957B (en) Abnormal business data processing method, device, server and storage medium
CN112202623B (en) Data processing method and device
CN114050994B (en) Network telemetry method based on SRv6
CN115278775A (en) Reflection QoS control method, UPF entity, communication system and storage medium
CN108460044B (en) Data processing method and device
CN112422434A (en) IPFIX message processing method, application thereof and ASIC chip
CN112566123B (en) Method and device for determining abnormal network node
CN114157716A (en) Data processing method and device based on block chain and electronic equipment
US9130827B2 (en) Sampling from distributed streams of data
CN107592361B (en) Data transmission method, device and equipment based on dual IB network
CN106850153B (en) Data retransmission method and system
CN108737264B (en) Data transmission method and device
CN110908798B (en) Multi-process cooperative network traffic analysis method and device
CN114630327A (en) Method and equipment for protecting integrity of data packet
CN114579490A (en) Data transmission method and device, electronic equipment and storage medium
CN111064801B (en) OSD communication method, device and medium based on distributed file system
CN117041272B (en) Data processing method, device, equipment and storage medium
CN117857649B (en) Transmission method and system for transmission control protocol data packet
CN115499338B (en) Data processing method, device, medium and cloud network observation system
CN116389466B (en) Enterprise data cloud office digital management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination