Information transmission method, device, equipment and medium based on historical data tacit understanding
By using the block marks and key generation rule marks of historical blocks and recent blocks for encryption in blockchain data transmission, the problems of high resource consumption and low key update frequency of traditional encryption systems are solved, achieving high efficiency and security. data transmission.
Patent Information
- Application Number
- CN202210017816.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-07
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-01-07
AI Technical Summary
In blockchain data transmission, the traditional one-to-many encryption system consumes large resources and has high latency, making it difficult to meet high security requirements. Especially in alliance blockchains, the key update frequency is low and it is difficult to guarantee every transmission. All keys are updated, causing serious problems in real-time and efficiency of the system.
Adopt an information transmission method based on tacit understanding of historical data. Each transmission uses the block mark and key generation rule mark of historical blocks and recent blocks for encryption, avoiding direct transmission of keys, reducing key update pressure, and improving key quality. Update frequency to enhance data transmission security.
By replacing the symmetric encryption key during each transmission, the resource consumption and delay of key update are reduced, the security and real-time performance of blockchain data transmission are improved, and high security requirements are met.
Smart Images

Figure CN114465778B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of communication encryption, and in particular to an information transmission method, device, equipment and medium based on historical data tacit understanding. Background Art
[0002] Given the complexity of the current wide area network, the existence of factors such as internal and external network isolation, NAT traversal, edge computing, relay / proxy nodes and a large number of intermediate intelligent nodes, some blockchains with high encryption requirements, such as consortium blockchains, need to consider data encryption during transmission, thereby reducing the possibility of data being intercepted and monitored by malicious third parties other than blockchain members.
[0003] In data encryption, considering resource consumption, symmetric encryption is generally used for actual data transmission, while the key for symmetric encryption is transmitted using asymmetric encryption. If the key is secure, the data is secure.
[0004] In the blockchain system, in addition to one-to-one or point-to-point communication modes, there are also a large number of one-to-many, rumor spreading, multicast or broadcast data communication mode requirements. The blockchain network layer has situations where CDN, data multicast and data broadcast are used for acceleration. These one-to-many communication modes also need to consider data encryption. In traditional one-to-many systems, data encryption mainly uses symmetric encryption, but the transmission of keys is relatively complex. Generally, one-to-many key transmission is converted into multiple one-to-one key transmissions, or conditional access similar to radio and television is used to encrypt data by using multicast or broadcast data channels to update keys.
[0005] The key update of the radio and television conditional access system introduces hardware chips to reduce the possibility of being hacked. If blockchain transmission adopts the radio and television type of conditional access system, while adding hardware, it also introduces a third party link, which reduces security and increases costs.
[0006] If the key update is converted from one-to-many key transmission to multiple one-to-one key transmissions, the system will consume large resources and have high latency. If the key is updated every time a blockchain data transmission is performed to ensure the security of the blockchain data transmission, the system will have serious problems in real-time performance and efficiency. Therefore, it is difficult for the system to perform an update every time a transmission is performed, and it is difficult to meet the needs of alliance blockchain data transmission with high security requirements. Summary of the invention
[0007] In order to improve the security of data transmission, the present application provides an information transmission method, device, equipment and medium based on historical data tacit understanding.
[0008] In the first aspect, the present application provides an information transmission method based on historical data tacit understanding, which adopts the following technical solution:
[0009] An information transmission method based on historical data tacit understanding, applied to a first blockchain node, the method comprising:
[0010] Obtain at least one historical block within a predetermined tacit agreement period, and obtain a block mark of the at least one historical block;
[0011] Selecting a preset key generation rule and reading a rule tag of the key generation rule;
[0012] Performing operations on first information based on the key generation rule to generate a key, wherein the first information includes data of the at least one historical block;
[0013] Encrypting the block to be transmitted based on the key;
[0014] The second information is sent to the second blockchain node, wherein the second information also includes the encrypted block to be transmitted, the block mark of the at least one historical block, and the rule mark of the key generation rule.
[0015] By adopting the above technical solution, when the block to be transmitted is encrypted and transmitted using a key, the symmetric encryption key can be replaced each time the data is transmitted, and when transmitting, the key is not transmitted directly, but the rule mark of the key generation rule used to generate the key and the block number of the historical block used are transmitted. Even if the key generation rule and the block mark are intercepted by a malicious third party, since the data access of the alliance blockchain is secure, the malicious third party cannot easily know the block data corresponding to the block mark, and therefore cannot obtain the key, and cannot decrypt the encrypted block to be transmitted. Since only the rule mark and block number for generating the key need to be transmitted, the pressure of key update is reduced and the key update frequency is increased, thereby improving the security of blockchain data transmission.
[0016] Optionally, the first information includes data of the at least one recent block, and the second information also includes a block tag of the at least one recent block; before operating the first information based on the key generation rule to generate the key, the method further includes:
[0017] At least one recent block is obtained, and a block tag of the at least one recent block is obtained.
[0018] Optionally, the block mark of the recent block is the first block number; or,
[0019] The block mark of the recent block is the first conversion information, and obtaining the block mark of the at least one recent block includes:
[0020] Reading a first block number of the at least one recent block;
[0021] Selecting a preset first conversion rule, and converting the first block number of each recent block into first conversion information based on the first conversion rule;
[0022] The second information further includes a rule tag of the first conversion rule.
[0023] Optionally, the block mark of the historical block is a second block number; or,
[0024] The block mark of the historical block is the second conversion information, and obtaining the block mark of the at least one historical block includes:
[0025] Reading a second block number of the at least one historical block;
[0026] Selecting a preset second conversion rule, and converting the second block number of each historical block into second conversion information based on the second conversion rule;
[0027] The second information further includes a rule tag of the second conversion rule.
[0028] Optionally, acquiring at least one recent block includes:
[0029] A current block and a promotion rule are obtained, and a number of promotion blocks is calculated based on the promotion rule, so that the current block is promoted by the number of promotion blocks in a direction of decreasing block height to obtain a promoted block, and at least one block is selected from blocks whose block height is not greater than the block height of the promoted block as the at least one recent block.
[0030] In the second aspect, the present application provides an information transmission method based on historical data tacit understanding, which adopts the following technical solution:
[0031] An information transmission method based on historical data tacit understanding, applied to a second blockchain node, the method comprising:
[0032] Receiving second information sent by the first blockchain node, the second information including an encrypted block to be transmitted, a block mark of at least one historical block, and a rule mark of a key generation rule;
[0033] Acquire data of the at least one historical block based on the block mark of the at least one historical block;
[0034] Acquire the key generation rule based on the rule tag of the key generation rule;
[0035] Performing operations on first information based on the key generation rule to generate a key, wherein the first information includes data of the at least one historical block;
[0036] The encrypted block to be transmitted is decrypted based on the key to obtain the block to be transmitted.
[0037] By adopting the above technical solution, when the block to be transmitted is encrypted and transmitted using a key, the symmetric encryption key can be replaced each time the data is transmitted, and when transmitting, the key is not transmitted directly, but the rule mark of the key generation rule used to generate the key and the block number of the historical block used are transmitted. Even if the key generation rule and the block mark are intercepted by a malicious third party, since the data access of the alliance blockchain is secure, the malicious third party cannot easily know the block data corresponding to the block mark, and therefore cannot obtain the key, and cannot decrypt the encrypted block to be transmitted. Since only the rule mark and block number for generating the key need to be transmitted, the pressure of key update is reduced and the key update frequency is increased, thereby improving the security of blockchain data transmission.
[0038] Optionally, the first information further includes data of at least one recent block, the second information further includes a block mark of the at least one recent block, and before decrypting the encrypted block to be transmitted based on the key to obtain the block to be transmitted, the method further includes:
[0039] Based on the block mark of the at least one recent block, data of the at least one recent block is obtained.
[0040] Optionally, the method further includes:
[0041] If the second information does not include the rule mark of the first conversion rule, the block mark of the recent block is the first block number, and the data of the recent block is obtained based on the first block number;
[0042] If the second information includes a rule mark of a first conversion rule, the block mark of the recent block is the first block number conversion information, and acquiring data of the at least one recent block based on the block mark of the at least one recent block includes:
[0043] Acquire a third conversion rule based on the rule tag of the first conversion rule;
[0044] Converting the first conversion information into a first block number based on the third conversion rule;
[0045] The data of the recent block is obtained based on the first block number.
[0046] Optionally, the method further includes:
[0047] If the second information does not include the rule mark of the second conversion rule, the block mark of the historical block is the second block number, and the data of the historical block is obtained based on the second block number;
[0048] If the second information includes a rule mark of a second conversion rule, the block mark of the historical block is second block number conversion information, and acquiring data of the at least one historical block based on the block mark of the at least one historical block includes:
[0049] acquiring a fourth conversion rule based on the rule tag of the second conversion rule;
[0050] converting the second conversion information into a second block number based on the fourth conversion rule;
[0051] The data of the historical block is obtained based on the second block number.
[0052] In a third aspect, the present application provides an information transmission device based on historical data tacit understanding, which adopts the following technical solution:
[0053] An information transmission device based on historical data tacit understanding, applied to a first blockchain node, the device comprising:
[0054] A historical block acquisition module, used to acquire at least one historical block within a predetermined tacit agreement period, and acquire a block mark of the at least one historical block;
[0055] A first rule acquisition module, used for selecting a preset key generation rule and reading a rule tag of the key generation rule;
[0056] A first key generation module, configured to generate a key by operating first information based on the key generation rule, wherein the first information includes data of the at least one historical block;
[0057] A block encryption module, used for encrypting the block to be transmitted based on the key;
[0058] An information sending module is used to send second information to a second blockchain node, wherein the second information includes an encrypted block to be transmitted, a block mark of the at least one historical block, and a rule mark of the key generation rule.
[0059] By adopting the above technical solution, when the block to be transmitted is encrypted and transmitted using a key, the symmetric encryption key can be replaced each time the data is transmitted, and when transmitting, the key is not transmitted directly, but the rule mark of the key generation rule used to generate the key and the block number of the historical block used are transmitted. Even if the key generation rule and the block mark are intercepted by a malicious third party, since the data access of the alliance blockchain is secure, the malicious third party cannot easily know the block data corresponding to the block mark, and therefore cannot obtain the key, and cannot decrypt the encrypted block to be transmitted. Since only the rule mark and block number for generating the key need to be transmitted, the pressure of key update is reduced and the key update frequency is increased, thereby improving the security of blockchain data transmission.
[0060] In a fourth aspect, the present application provides an information transmission device based on historical data tacit understanding, which adopts the following technical solution:
[0061] An information transmission device based on historical data tacit understanding, applied to a second blockchain node, the device comprising:
[0062] An information receiving module, configured to receive second information sent by the first blockchain node, wherein the second information includes an encrypted block to be transmitted, a block mark of at least one historical block, and a rule mark of a key generation rule;
[0063] A data acquisition module, configured to acquire data of the at least one historical block based on a block tag of the at least one historical block;
[0064] A second rule acquisition module, configured to acquire the key generation rule based on the rule tag of the key generation rule;
[0065] A second key generation module, configured to generate a key by operating the first information based on the key generation rule, wherein the first information includes data of the at least one historical block;
[0066] The block decryption module is used to decrypt the encrypted block to be transmitted based on the key to obtain the block to be transmitted.
[0067] By adopting the above technical solution, when the block to be transmitted is encrypted and transmitted using a key, the symmetric encryption key can be replaced each time the data is transmitted, and when transmitting, the key is not transmitted directly, but the rule mark of the key generation rule used to generate the key and the block number of the historical block used are transmitted. Even if the key generation rule and the block mark are intercepted by a malicious third party, since the data access of the alliance blockchain is secure, the malicious third party cannot easily know the block data corresponding to the block mark, and therefore cannot obtain the key, and cannot decrypt the encrypted block to be transmitted. Since only the rule mark and block number for generating the key need to be transmitted, the pressure of key update is reduced and the key update frequency is increased, thereby improving the security of blockchain data transmission.
[0068] In a fifth aspect, the present application provides a blockchain node device, which adopts the following technical solution:
[0069] A blockchain node device comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executes the historical data tacit understanding method described in any one of the first aspect and / or the second aspect.
[0070] In a sixth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0071] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute the historical data-based tacit understanding method described in any one of the first aspect and / or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 It is a flowchart of an information transmission method based on historical data tacit understanding applied to a first blockchain node in an embodiment of the present application.
[0073] Figure 2 It is a flowchart of an information transmission method based on historical data tacit understanding applied to a second blockchain node in an embodiment of the present application.
[0074] Figure 3 This is a structural block diagram of an information transmission device based on historical data tacit understanding applied to a first blockchain node in an embodiment of the present application.
[0075] Figure 4 This is a structural block diagram of an information transmission device based on historical data tacit understanding applied to a second blockchain node in an embodiment of the present application.
[0076] Figure 5 This is a structural block diagram of a blockchain node device according to an embodiment of the present application. DETAILED DESCRIPTION
[0077] The present application is further described in detail below in conjunction with the accompanying drawings.
[0078] Figure 1 A flowchart of an information transmission method based on historical data tacit understanding applied to a first blockchain node provided in an embodiment of the present application.
[0079] like Figure 1 As shown, the main process of the method is described as follows (steps S101 to S105):
[0080] Step S101, obtaining at least one historical block within a predetermined tacit agreement period, and obtaining a block mark of at least one historical block.
[0081] In this embodiment, the method is applied to data broadcasting or rumor spreading, but the prerequisite is that the sender and the receiver must eventually strictly synchronize the data, and the predetermined tacit agreement period is the time period for data synchronization before the channel is not passed.
[0082] The blocks within the predetermined tacit agreement period are historical blocks. When data broadcasting is used, the predetermined tacit agreement period is the period before the block distribution is broadcast through the data broadcast channel. When rumor spreading is used, the blocks within the predetermined tacit agreement period can use other Internet protocol encryption synchronization, hard disk data exchange and other methods when synchronizing data, which are not specifically limited here.
[0083] The historical block data within the predetermined tacit agreement period has strict security level control and is not widely available. It is difficult for malicious third parties to obtain historical block data, so the use of historical blocks for encryption improves the security of encryption. Before broadcasting, the historical block data stored by each node in the blockchain system is ultimately consistent, so that when using historical block data to generate keys, the historical block data in each blockchain node is consistent.
[0084] Step S102, selecting a preset key generation rule and reading the rule tag of the key generation rule.
[0085] Step S103, performing operation on the first information based on a key generation rule to generate a key, wherein the first information includes data of at least one historical block.
[0086] In this embodiment, the key generation rule needs to ensure that the calculation result is a unique function. When only historical blocks are used, the key generation rule includes but is not limited to the following rules:
[0087] (1) Perform a hash operation on the data of at least one historical block to obtain a hash value, which is the key. (2) Perform an XOR operation on the data of at least one historical block, and perform a hash operation on the XOR result to obtain the key. (3) Select data from the non-signature area of at least one historical block, shuffle and combine them in bytes to obtain the key.
[0088] In this embodiment, for the key generation rule (1), if multiple historical blocks are selected, when calculating the first Hash value for the multiple historical blocks, the multiple historical block data can be arranged and combined to obtain combined data, and then the combined data can be hashed to obtain a Hash value, or each historical block data can be hashed to obtain multiple Hash values, and then the multiple Hash values can be hashed to obtain a Hash value. There is no specific limitation here.
[0089] In this embodiment, for the key generation rule (2), if multiple historical blocks are selected, when performing XOR on the multiple historical blocks, each historical block data can be first XORed to obtain multiple XOR results, and then the multiple XOR results can be XORed, and finally the final XOR result can be hashed, without specific limitation here.
[0090] Step S104: encrypt the block to be transmitted based on the key.
[0091] Step S105, sending the second information to the second blockchain node, wherein the second information includes the encrypted block to be transmitted, the block mark of at least one historical block, and the rule mark of the key generation rule.
[0092] In some embodiments, in addition to using historical blocks within the predetermined tacit agreement period to generate keys for the currently transmitted block data, recent blocks after the predetermined tacit agreement period can also be combined with historical blocks to generate keys. Once the system is compromised and a malicious third party obtains data from all historical blocks, the data from recent blocks can also be used for encryption. Among the data used to generate the key, there is still data that is difficult for malicious third parties to obtain in a timely manner, which further ensures the security of blockchain data transmission.
[0093] Specifically, the first information includes data of at least one recent block, and the second information also includes a block mark of at least one recent block; before step S104, the method further includes: obtaining at least one recent block, and obtaining a block mark of at least one recent block.
[0094] In this embodiment, the block mark of the recent block is the first block number; or, the block mark of the recent block is the first conversion information, and obtaining the block mark of at least one recent block includes: reading the first block number of at least one recent block; selecting a preset first conversion rule, and converting the first block number of each recent block into the first conversion information based on the first conversion rule; the second information also includes a rule mark of the first conversion rule.
[0095] In this embodiment, since the number of recent blocks is large, the number of block numbers of the recent blocks is large, and each block number needs to be kept within a fixed bit during transmission, so a conversion rule is set to redefine the block number of the recent block, that is, the block number of the recent block is obtained through a function operation to obtain a block mark. After the second blockchain node receives the block mark of the recent block, the block mark is restored to the block number of the recent block through the conversion rule, thereby obtaining the block data of the recent block.
[0096] In this embodiment, the block mark of the historical block is the second block number; or, the block mark of the historical block is the second conversion information, and obtaining the block mark of at least one historical block includes: reading the second block number of at least one historical block; selecting a preset second conversion rule, and converting the second block number of each historical block into the second conversion information based on the second conversion rule; the second information also includes a rule mark of the second conversion rule.
[0097] In this embodiment, when the historical blocks and the recent blocks are used to generate the key, it is only necessary to add the recent blocks to the above-mentioned key generation rules. The key generation rules include but are not limited to the following rules.
[0098] For the key generation rule (1), the hash value of at least one historical block is recorded as the first hash value, and the data of at least one recent block is hashed to obtain the second hash value. Based on the first hash value and the second hash value, the two values are combined, and the result of the combination is the key; and when calculating the hash value of multiple recent blocks, the calculation method is the same as the calculation method of calculating the hash values of multiple historical blocks. For the key generation rule (2), it is necessary to perform an XOR operation on the data of at least one historical block and the data of at least one recent block at the same time; if multiple historical blocks and recent blocks are selected, when performing an XOR operation on multiple historical blocks and recent blocks, the data of multiple historical blocks can be XORed first to obtain an XOR result, and the data of multiple recent blocks can be XORed to obtain an XOR result, and then the XOR result of the historical block can be XORed with the XOR result of the recent block, and finally the final XOR result can be hashed. For the key generation rule (3), the number of non-signature areas in at least one recent block can be selected.
[0099] In this embodiment, the current block and the advancement rule are obtained, and the number of advancement blocks is calculated based on the advancement rule, so that the current block is advanced by the number of advancement blocks in the direction of decreasing block height to obtain the advanced block, and at least one block is selected from blocks whose block height is not greater than the block height of the advanced block as at least one recent block.
[0100] In this embodiment, the data synchronization in each block of the blockchain requires a certain amount of transmission time. In order to make the recent blocks used to generate keys in each blockchain node consistent, it is necessary to advance forward based on the current block when selecting the recent block. When calculating the number of blocks to be advanced through the advancement rule, the advancement rule needs to be set according to actual needs. It only needs to ensure that the selected recent block can be offset to avoid the short-term inconsistent area in the blockchain. It can be set to a fixed number, or it can be a certain series, function or other number obtained by feedback from the blockchain monitoring system, which is not specifically limited here.
[0101] In this embodiment, the blockchain starts broadcasting after running for a period of time to generate a predetermined tacit agreement period. At this time, the block to be transmitted is the first block to be transmitted after the start of the broadcast. When the first block to be transmitted is encrypted, there are only a large number of historical blocks in the blockchain, but no recent blocks are available. At this time, at least one historical block can be selected again from the historical blocks within the predetermined tacit agreement period as a recent block for encryption.
[0102] In this embodiment, the acquisition of blocks or rules such as historical blocks, recent blocks, conversion rules, etc. can be performed randomly or in a fixed manner. When acquiring in a fixed manner, the fixed manner can be set to a fixed advancement or postponement order, or it can be set to perform a function operation on the block mark or rule mark based on the last acquisition, and use the operation result as the block mark of the selected block or the rule mark of the rule, which is not specifically limited here.
[0103] Figure 2 A flowchart of an information transmission method based on historical data tacit understanding applied to a second blockchain node provided in an embodiment of the present application.
[0104] like Figure 2 As shown, the main process of the method is described as follows (steps S201 to S205):
[0105] Step S201, receiving second information sent by the first blockchain node, the second information including an encrypted block to be transmitted, a block mark of at least one historical block, and a rule mark of a key generation rule;
[0106] Step S202, acquiring data of at least one historical block based on a block tag of at least one historical block;
[0107] Step S203, obtaining a key generation rule based on the rule tag of the key generation rule;
[0108] Step S204, performing operation on the first information based on a key generation rule to generate a key, wherein the first information includes data of at least one historical block;
[0109] Step S205 , decrypting the encrypted block to be transmitted based on the key to obtain the block to be transmitted.
[0110] In this embodiment, the first information further includes data of at least one recent block, the second information further includes a block tag of at least one recent block, and before step S205, the step further includes: acquiring data of at least one recent block based on the block tag of at least one recent block.
[0111] In this embodiment, if the second information does not include the rule mark of the first conversion rule, the block mark of the recent block is the first block number, and the data of the recent block is obtained based on the first block number; if the second information includes the rule mark of the first conversion rule, the block mark of the recent block is the first block number conversion information, and based on the block mark of at least one recent block, obtaining the data of at least one recent block includes: obtaining a third conversion rule based on the rule mark of the first conversion rule; converting the first conversion information into the first block number based on the third conversion rule; and obtaining the data of the recent block based on the first block number.
[0112] In this embodiment, if the second information does not include the rule mark of the second conversion rule, the block mark of the historical block is the second block number, and the data of the historical block is obtained based on the second block number; if the second information includes the rule mark of the second conversion rule, the block mark of the historical block is the second block number conversion information, and based on the block mark of at least one historical block, obtaining the data of at least one historical block includes: obtaining a fourth conversion rule based on the rule mark of the second conversion rule; converting the second conversion information into the second block number based on the fourth conversion rule; and obtaining the data of the historical block based on the second block number.
[0113] In this embodiment, the first conversion rule and the third conversion rule, and the second conversion rule and the fourth conversion rule are opposite operation rules. For example, the first conversion rule converts block number 10000 to block mark 1, and the third conversion rule converts block mark 1 to block number 10000. It should be noted that the first conversion rule and the third conversion rule and the second conversion rule and the fourth conversion rule can be two sets of identical opposite operation rules, or two sets of different opposite operation rules. It is only necessary to ensure that the first conversion rule and the third conversion rule, the second conversion rule and the fourth conversion rule are opposite operation rules when performing conversion operations, and no specific limitation is made here.
[0114] In this embodiment, when the first blockchain node notifies the second blockchain node to receive information, the notification is performed according to the transmission protocol, and the file transmission protocol includes the following situations:
[0115] (1) Broadcasting generally uses the MPEG TS (Transport Stream) transmission method, which includes data pipes, synchronous data streams, and asynchronous data streams. The block mark (16 bits) of the historical block and the rule mark (16 bits) of the key generation rule can be added before the section Payload data field, and 6 bytes are used to transmit the key and related data information. When the recent block is also used, the block mark (16 bits) of the historical block, the block mark (16 bits) of the recent block, and the rule mark (16 bits) of the key generation rule are added before the section Payload data field, and 6 bytes are used to transmit the key and related data information; (2) If a file transfer protocol such as FLUTE is used to transmit blocks, 6 bytes can be added to the file header data to transmit the key and related data information.
[0116] It should be noted that the transmission protocol includes but is not limited to the above situations.
[0117] The information transmission method based on historical data tacit understanding applied to the first blockchain node and the second blockchain node is described by taking a specific example:
[0118] If the key is generated in the form of a combination of historical blocks and recent blocks, and there are 50 historical blocks within the predetermined tacit agreement period, these 50 historical blocks are sorted in time sequence as historical blocks 1 to historical blocks 50, and at least one block is selected from historical blocks 1 to historical blocks 50 as a historical block. If historical block 2 is selected as the historical block used to generate the key this time, the block number of the historical block for generating the key this time is 2. If the current block is block 1000, when the advancement rule is a fixed advancement number of 5, at least one block is selected from the blocks with a block height not greater than 995 as a recent block. If block 995 is selected as the recent block used to generate the key this time, the block number of the recent block for generating the key this time is 995. If the key generation rule is shuffled and combined by bytes using the data of the non-signature area in the selected historical blocks and recent blocks, if the key generation rule is sorted as 3, the rule for generating the key this time is key generation rule 3.
[0119] A key is generated based on the historical block 2, the recent block 995 and the key generation rule 3, and the block to be transmitted is encrypted using the key.
[0120] The information sent from the first blockchain node to the second blockchain node is: the encrypted block to be transmitted, the block number 2 of the historical block, the block number 995 of the recent block and the key generation rule 3. The second blockchain node receives the information sent by the first blockchain node, generates a key based on the block number 2 of the historical block, the block number 995 of the recent block and the rule mark 3 of the key generation rule, and decrypts the block to be transmitted based on the key, thereby obtaining the data information in the block to be transmitted.
[0121] Figure 3 A structural block diagram of an information transmission device 300 based on historical data consensus and applied to a first blockchain node provided in an embodiment of the application.
[0122] like Figure 3 As shown, an information transmission device 300 based on historical data tacit understanding applied to a first blockchain node mainly includes:
[0123] The historical block acquisition module 301 is used to acquire at least one historical block within a predetermined tacit agreement period and acquire a block mark of at least one historical block;
[0124] A first rule acquisition module 302, used to select a preset key generation rule and read a rule tag of the key generation rule;
[0125] A first key generation module 303, configured to generate a key by operating the first information based on a key generation rule, wherein the first information includes data of at least one historical block;
[0126] A block encryption module 304, configured to encrypt the block to be transmitted based on a key;
[0127] The information sending module 305 is used to send the second information to the second blockchain node, wherein the second information includes the encrypted block to be transmitted, the block mark of at least one historical block, and the rule mark of the key generation rule.
[0128] As an optional implementation of this embodiment, the device is also used to mark the block of the recent block as the first block number; or, the block mark is the first conversion information, and obtaining the block mark of at least one recent block includes: reading the first block number of at least one recent block; selecting a preset first conversion rule, and converting the first block number of each recent block into the first conversion information based on the first conversion rule; the second information also includes a rule mark of the first conversion rule.
[0129] As an optional implementation of this embodiment, the device is also used to mark the block of the historical block as the second block number; or, the block mark is the second conversion information, and obtaining the block mark of at least one historical block includes: reading the second block number of at least one historical block; selecting a preset second conversion rule, and converting the second block number of each historical block into the second conversion information based on the second conversion rule; the second information also includes a rule mark of the second conversion rule.
[0130] As an optional implementation manner of this embodiment, the device is further used to obtain at least one recent block and obtain a block mark of at least one recent block.
[0131] In this optional embodiment, the device is also used to obtain the current block and the advancement rule, calculate the number of advancement blocks based on the advancement rule, advance the current block by the number of advancement blocks in the direction of decreasing block height, obtain the advanced block, and select at least one block from the blocks whose block height is not greater than the block height of the advanced block as at least one recent block.
[0132] Figure 4 A structural block diagram of an information transmission device 400 based on historical data consensus and applied to a second blockchain node provided in an embodiment of the application.
[0133] like Figure 4 As shown, an information transmission device 400 based on historical data tacit understanding applied to a second blockchain node mainly includes:
[0134] The information receiving module 401 is used to receive the second information sent by the first blockchain node, where the second information includes the encrypted block to be transmitted, the block mark of at least one historical block, and the rule mark of the key generation rule;
[0135] A data acquisition module 402, configured to acquire data of at least one historical block based on a block tag of at least one historical block;
[0136] A second rule acquisition module 403, used to acquire a key generation rule based on a rule tag of the key generation rule;
[0137] A second key generation module 404, configured to generate a key by operating the first information based on a key generation rule, wherein the first information includes data of at least one historical block;
[0138] The block decryption module 405 is used to decrypt the encrypted block to be transmitted based on the key to obtain the block to be transmitted.
[0139] As an optional implementation manner of this embodiment, the device is also used to obtain data of at least one recent block based on a block mark of at least one recent block.
[0140] As an optional implementation manner of this embodiment, the device is also used for, if the second information does not include the rule mark of the first conversion rule, the block mark of the recent block is the first block number, and the data of the recent block is obtained based on the first block number; if the second information includes the rule mark of the first conversion rule, the block mark of the recent block is the first block number conversion information, and based on the block mark of at least one recent block, obtaining the data of at least one recent block includes: obtaining a third conversion rule based on the rule mark of the first conversion rule; converting the first conversion information into the first block number based on the third conversion rule; and obtaining the data of the recent block based on the first block number.
[0141] As an optional implementation manner of this embodiment, the device is also used for, if the second information does not include the rule mark of the second conversion rule, the block mark of the historical block is the second block number, and the data of the historical block is obtained based on the second block number; if the second information includes the rule mark of the second conversion rule, the block mark of the historical block is the second block number conversion information, and based on the block mark of at least one historical block, obtaining the data of at least one historical block includes: obtaining a fourth conversion rule based on the rule mark of the second conversion rule; converting the second conversion information into the second block number based on the fourth conversion rule; and obtaining the data of the historical block based on the second block number.
[0142] In one example, the module in any of the above devices can be one or more integrated circuits configured to implement the above methods, such as: one or more application specific integrated circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.
[0143] For another example, when the modules in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0144] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0145] Figure 5 A structural block diagram of a blockchain node device 500 provided in an embodiment of the present application.
[0146] like Figure 5 As shown, the blockchain node device 500 includes a processor 501 and a memory 502, and may further include an information input / information output (I / O) interface 505, one or more of the communication components 504, and a communication bus 505.
[0147] The processor 501 is used to control the overall operation of the blockchain node device 500 to complete all or part of the steps of the above-mentioned information transmission method based on historical data tacit understanding; the memory 502 is used to store various types of data to support the operation of the blockchain node device 500, and these data may include, for example, instructions for any application or method used to operate on the blockchain node device 500, and application-related data. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. One or more.
[0148] The I / O interface 505 provides an interface between the processor 501 and other interface modules, which may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 504 is used for wired or wireless communication between the blockchain node device 500 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 5G or 4G, or a combination of one or more of them, so the corresponding communication component 104 may include: Wi-Fi components, Bluetooth components, NFC components.
[0149] The blockchain node device 500 can be implemented by one or more application-specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the information transmission method based on historical data tacit understanding given in the above embodiment.
[0150] The communication bus 505 may include a path to transmit information between the above components. The communication bus 505 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 505 may be divided into an address bus, a data bus, a control bus, etc.
[0151] The blockchain node device 500 may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., and may also be servers, etc.
[0152] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned information transmission method based on historical data tacit understanding are implemented.
[0153] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0154] The terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus.
[0155] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.
Claims
1. A method for information transmission based on historical data tacit understanding, characterized in that: Applied to a first blockchain node, the method includes: Obtain at least one historical block within a predetermined tacit agreement period, and obtain a block mark of the at least one historical block; the predetermined tacit agreement period is a time period during which data synchronization has been performed before the channel is not passed; Selecting a preset key generation rule and reading a rule tag of the key generation rule; Performing operations on first information based on the key generation rule to generate a key, wherein the first information includes data of the at least one historical block; Encrypting the block to be transmitted based on the key; The second information is sent to the second blockchain node, wherein the second information also includes the encrypted block to be transmitted, the block mark of the at least one historical block, and the rule mark of the key generation rule.
2. The method according to claim 1, characterized in that The first information includes data of the at least one recent block, and the second information also includes a block mark of the at least one recent block; Before operating the first information based on the key generation rule to generate a key, the method further includes: At least one recent block is obtained, and a block tag of the at least one recent block is obtained.
3. The method according to claim 2, characterized in that The block mark of the recent block is the first block number; or, The block mark of the recent block is the first conversion information, and obtaining the block mark of the at least one recent block includes: Reading a first block number of the at least one recent block; Selecting a preset first conversion rule, and converting the first block number of each recent block into first conversion information based on the first conversion rule; The second information further includes a rule tag of the first conversion rule.
4. The method according to any one of claims 1 to 3, characterized in that: The block mark of the historical block is the second block number; or, The block mark of the historical block is the second conversion information, and obtaining the block mark of the at least one historical block includes: Reading a second block number of the at least one historical block; Selecting a preset second conversion rule, and converting the second block number of each historical block into second conversion information based on the second conversion rule; The second information further includes a rule tag of the second conversion rule.
5. The method according to claim 2 or 3, characterized in that: The acquiring of at least one recent block comprises: A current block and a promotion rule are obtained, and a number of promotion blocks is calculated based on the promotion rule, so that the current block is promoted by the number of promotion blocks in a direction of decreasing block height to obtain a promoted block, and at least one block is selected from blocks whose block height is not greater than the block height of the promoted block as the at least one recent block.
6. A method for information transmission based on historical data tacit understanding, characterized in that: Applied to a second blockchain node, the method comprises: Receiving second information sent by the first blockchain node, the second information including an encrypted block to be transmitted, a block mark of at least one historical block, and a rule mark of a key generation rule; Acquire data of the at least one historical block based on the block mark of the at least one historical block; Acquire the key generation rule based on the rule tag of the key generation rule; Performing operations on first information based on the key generation rule to generate a key, wherein the first information includes data of the at least one historical block; The encrypted block to be transmitted is decrypted based on the key to obtain the block to be transmitted.
7. The method according to claim 6, characterized in that The first information further includes data of at least one recent block, the second information further includes a block mark of the at least one recent block, and before decrypting the encrypted block to be transmitted based on the key to obtain the block to be transmitted, the method further includes: Based on the block mark of the at least one recent block, data of the at least one recent block is obtained.
8. The method according to claim 7, characterized in that The method further comprises: If the second information does not include the rule mark of the first conversion rule, the block mark of the recent block is the first block number, and the data of the recent block is obtained based on the first block number; If the second information includes a rule mark of a first conversion rule, the block mark of the recent block is the first block number conversion information, and acquiring data of the at least one recent block based on the block mark of the at least one recent block includes: Acquire a third conversion rule based on the rule tag of the first conversion rule; Converting the first conversion information into a first block number based on the third conversion rule; The data of the recent block is obtained based on the first block number.
9. The method according to any one of claims 6 to 8, characterized in that: The method further comprises: If the second information does not include the rule mark of the second conversion rule, the block mark of the historical block is the second block number, and the data of the historical block is obtained based on the second block number; If the second information includes a rule mark of a second conversion rule, the block mark of the historical block is second block number conversion information, and acquiring data of the at least one historical block based on the block mark of the at least one historical block includes: acquiring a fourth conversion rule based on the rule tag of the second conversion rule; Converting the second conversion information into a second block number based on the fourth conversion rule; The data of the historical block is obtained based on the second block number.
10. An information transmission device based on historical data tacit understanding, characterized in that: Applied to a first blockchain node, the device comprises: A historical block acquisition module is used to acquire at least one historical block within a predetermined tacit agreement period and acquire a block mark of the at least one historical block; the predetermined tacit agreement period is a time period during which data synchronization has been performed before the channel is not passed; A first rule acquisition module, used for selecting a preset key generation rule and reading a rule tag of the key generation rule; A first key generation module, configured to generate a key by operating first information based on the key generation rule, wherein the first information includes data of the at least one historical block; A block encryption module, used for encrypting the block to be transmitted based on the key; An information sending module is used to send second information to a second blockchain node, wherein the second information includes an encrypted block to be transmitted, a block mark of the at least one historical block, and a rule mark of the key generation rule.
11. An information transmission device based on historical data tacit understanding, characterized in that: Applied to a second blockchain node, the device comprises: An information receiving module, configured to receive second information sent by the first blockchain node, wherein the second information includes an encrypted block to be transmitted, a block mark of at least one historical block, and a rule mark of a key generation rule; A data acquisition module, configured to acquire data of the at least one historical block based on a block tag of the at least one historical block; A second rule acquisition module, configured to acquire the key generation rule based on the rule tag of the key generation rule; A second key generation module, configured to generate a key by operating the first information based on the key generation rule, wherein the first information includes data of the at least one historical block; The block decryption module is used to decrypt the encrypted block to be transmitted based on the key to obtain the block to be transmitted.
12. A blockchain node device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes the method according to any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 9.
