Data transmission method and device, electronic equipment, medium and product

By using blockchain technology to match hash values ​​and implement time-locking mechanisms between consortium blockchains, the problem of data tampering during resource exchange data transmission is solved, ensuring data security and integrity and improving management reliability.

CN121567290APending Publication Date: 2026-02-24CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511813319.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing resource replacement schemes cannot guarantee data integrity and security during data transmission, rely on the application system's own management, and are subject to the risk of data tampering.

Method used

By employing blockchain technology, and through hash value matching and time lock mechanisms between the first and second consortium chains, the security of data during transmission is ensured, including the generation of keys and verification of hash values, and the timely deletion of data that fails to be verified.

Benefits of technology

It ensures the security and integrity of resource data during transmission, improves the reliability and immutability of data management, and reduces the risk of data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567290A_ABST
    Figure CN121567290A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method and device, electronic equipment, a medium and a product, which are applied to the technical field of data transmission, and the method is applied to a first alliance chain comprising first data of a storage resource requester and a second alliance chain comprising second data to be replaced by the first data by the storage resource requester. Comprising the steps that a first alliance chain sends a first secret key and a first hash value corresponding to the first secret key to a second alliance chain; the second alliance chain stores the first secret key and sends the first secret key and second data to the first alliance chain under the condition that a second hash value generated based on the first secret key is matched with the first hash value and the current system time is within a first effective duration; and the first alliance chain sends the first data to the second alliance chain under the condition that a fourth hash value generated based on the first secret key is matched with the first hash value and the current system time is within a second effective duration. The management security of the resource data is improved, and meanwhile, the security in the resource data transmission process is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data processing technology, specifically relating to a data processing method, apparatus, electronic device, medium, and product. Background Technology

[0002] Resource swapping is an important supply chain service model in international trade, referring to a resource requester submitting documents such as bills of lading (which have the attributes of documents of title) to a resource provider in order to obtain short-term resources. In this business, the resource provider's verification of the authenticity of the bill of lading is the core step in mitigating the risks of resource swapping. Currently, common resource swapping solutions are often application-level interfaces, where the resource requester assembles the bill of lading data into a message and sends it to the resource provider via the internet. During network communication transmission, the message is encrypted, decrypted, and its signature is verified to ensure that the data is not tampered with during transmission.

[0003] Currently, resource swapping involves transmitting resource data at the application layer, which cannot guarantee that the data will not be tampered with during transmission. Furthermore, resource data management is handled by each of the transmitting parties within their respective systems, thus failing to guarantee that the data will not be tampered with during the actual operation of their respective applications. The integrity and correctness of the data depend on the application system itself, and once the system is threatened, the security of resource data management cannot be guaranteed. Summary of the Invention

[0004] This application provides a data transmission method, apparatus, electronic device, medium, and product to improve the security of resource data management and ensure security during resource data transmission.

[0005] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a data transmission method applied to a blockchain, the blockchain including a first consortium blockchain and a second consortium blockchain, wherein blocks in the first consortium blockchain are used to store first data of a resource requester, and blocks in the second consortium blockchain are used to store second data to be replaced by the first data by the resource requester, the method comprising: The first consortium chain sends a first data request to the second consortium chain, the first data request including a first key generated by the first consortium chain and a first hash value corresponding to the first key; The second consortium blockchain generates a second hash value based on the first key. If the second hash value matches the first hash value and the current system time is within a first valid duration, the first key is stored and the first key and the second data are sent to the first consortium blockchain. The first valid duration is generated based on the second consortium blockchain. The first consortium blockchain generates a fourth hash value based on the first key. If the fourth hash value matches the first hash value and the current system time is within the second valid duration, the first data is sent to the second consortium blockchain. The second valid duration is generated based on the first consortium blockchain, and the first valid duration is longer than the second valid duration.

[0006] Secondly, embodiments of this application provide a data transmission system, the system comprising: The first consortium blockchain, in which blocks are used to store first data of the resource requester and to send a first data request to the second consortium blockchain, the first data request including a first key generated by the first consortium blockchain and a first hash value corresponding to the first key; The second consortium blockchain, wherein blocks in the second consortium blockchain are used to store the second data that the resource requester wants to replace with the first data, and are used to generate a second hash value based on the first key, and when the second hash value and the first hash value match and the current system time is within a first valid duration, store the first key, and send the first key and the second data to the first consortium blockchain, wherein the first valid duration is generated based on the second consortium blockchain; The first consortium blockchain is further configured to generate a fourth hash value based on the first key, and send the first data to the second consortium blockchain if the fourth hash value matches the first hash value and the current system time is within a second valid duration. The second valid duration is generated based on the first consortium blockchain, and the first valid duration is longer than the second valid duration.

[0007] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory storing computer program instructions; the processor executes the computer program instructions to implement the above-described data transmission method.

[0008] Fourthly, embodiments of this application provide a computer storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above-described data transmission method is implemented.

[0009] Fifthly, embodiments of this application provide a computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the aforementioned data transmission method.

[0010] The method provided in this application can be applied to a blockchain, which includes a first consortium blockchain and a second consortium blockchain. Blocks in the first consortium blockchain store first data from the resource requester, while blocks in the second consortium blockchain store second data to be exchanged by the resource requester using the first data. Thus, both the first data and the second data to be exchanged by the resource requester are stored in the blockchain, improving the security of the management of both the first data and the second data to be exchanged. Simultaneously, during the resource exchange process, the first consortium blockchain sends a first key generated by the first consortium blockchain and its corresponding first hash value to the second consortium blockchain. The second consortium blockchain then verifies the first hash value. If the verification is successful within a first valid time period, the second data and the stored first key are sent to the first consortium blockchain. The first consortium blockchain then verifies the first key. If the verification is successful within a second valid time period, the first data is sent to the second consortium blockchain. Therefore, during data transmission between the first and second consortium blockchains, a hash time lock is used to verify the data transmitted between them, ensuring the security of resource data transmission. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a schematic flowchart of a data transmission method provided in one embodiment of this application; Figure 2 This is a schematic flowchart of a data transmission method provided in one embodiment of this application; Figure 3 This is a schematic diagram of the structure of a data transmission system provided in another embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0013] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0014] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0015] The acquisition, transmission, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0016] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0017] The terminology used in the embodiments of this invention will be explained below.

[0018] Blockchain is a decentralized, distributed database that is stored in a block-chain format, is immutable, secure, and reliable. A blockchain consists of multiple blocks, each storing multiple pieces of data. Each block has a unique cryptographic lock (hash value). This lock is special because it is not only determined by the content of the current block but also records the cryptographic lock of the previous block. In this way, the blocks are linked together through these cryptographic locks, forming a blockchain.

[0019] Hash value: A hash function transforms input data of arbitrary length into output data of fixed length.

[0020] Merkle Tree: In computer science, a Merkle tree, also known as a hash tree, is a tree-like data structure. It's a tree-like structure that aggregates large amounts of data into a short digital fingerprint through layered hashing. Each leaf node (the lowest level node) contains the hash value of a data block, while each non-leaf node (including the root node) contains the hash value of the combination of the hash values ​​of all its child nodes.

[0021] Merkle root: Also known as the root node of a Merkle tree, it is located at the top of the Merkle tree and has only one node. It is a hash value that is ultimately formed by summing all the underlying data.

[0022] The identifiers in this application are text, symbols, images, etc. used to indicate information, and can be displayed in the form of controls or other containers, including but not limited to text identifiers, symbol identifiers, and image identifiers.

[0023] The technical solution of this application embodiment can be applied to scenarios where one resource data is used to replace another resource data. For example, if company A wants to apply for a loan from financial institution B, then company A needs to have corresponding collateral, that is, company A needs to use the collateral to replace the loan. In the process of company A replacing the loan with collateral, company A needs to provide a bill of lading of collateral to financial institution B, and then financial institution B sends the loan to company A.

[0024] Figure 1 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. The execution entity of this data transmission method can be a blockchain, which may include a first consortium blockchain and a second consortium blockchain. Here, the first consortium blockchain and the second consortium blockchain can be two different blockchains. Specifically, blocks in the first consortium blockchain can be used to store the first data of the resource requester, and blocks in the second consortium blockchain can be used to store the second data that the resource requester wants to replace with the first data.

[0025] The resource requester mentioned above can be a request method that wants to exchange resources; for example, the resource requester can be Company A in the example above. The first data mentioned above can be the data of the resource that the resource requester wants to exchange; for example, the first data can be the collateral of Company A in the example above. The second data mentioned above can be the data that the resource requester wants to exchange using the first data; for example, the second data can be the loan provided by financial institution B in the example above.

[0026] like Figure 1 As shown, the data transmission method provided in this application embodiment may include steps 110-130.

[0027] Step 110: Send a first data request to the second consortium chain through the first consortium chain. The first data request includes the first key generated by the first consortium chain and the first hash value corresponding to the first key.

[0028] The first data request may be a request for second data sent by the first consortium chain to the second consortium chain. The first data request may include a first key generated by the first consortium chain and a first hash value corresponding to the first key.

[0029] The aforementioned first key can be a key generated by the first consortium blockchain based on the data stored in its chain. The first hash value can be a hash value generated based on the first key. Specifically, the first hash value can be calculated based on the SHA-256 algorithm using the first key.

[0030] Step 120: Generate a second hash value based on the first key through the second consortium chain, and if the second hash value matches the first hash value and the current system time is within the first valid duration, store the first key and send the first key and second data to the first consortium chain.

[0031] The second hash value can be a hash value generated by the second consortium chain based on the first key, or the specific second hash value can be calculated based on the SHA-256 algorithm on the first key.

[0032] The current system time can be the current system time. For example, if the current time is 10:00 AM on October 30, 2025, then the current system time is 10:00 AM on October 30, 2025.

[0033] The first valid duration can be the validity period for the second data transmission set by the second consortium blockchain. In other words, if the transmission of the second data is completed within this first valid duration, the transmission is considered complete. If the transmission of the second data is not completed within the first valid duration, the second consortium blockchain will not continue transmitting the second data. The aforementioned first valid duration is generated based on the second consortium blockchain.

[0034] In some embodiments of this application, after receiving the first hash value, the second consortium chain can verify the first hash value. Only if the verification is successful can the second consortium chain send the second data to the first consortium chain. Specifically, the second consortium chain can generate a second hash value based on the first key and check whether the second hash value matches the first hash value. If they match and the current system time is within a first valid duration, the second consortium chain can store the first key and send the first key and the second data to the first consortium chain.

[0035] In some embodiments of this application, to further ensure the security of data transmission, after generating the second hash value based on the first key via the second consortium blockchain, the method described above may further include: If the second hash value does not match the first hash value, and / or the current system time is after the first valid duration, the second data is deleted via the second consortium chain.

[0036] In some embodiments of this application, if the second hash value does not match the first hash value when verified by the second consortium chain, and / or if the transmission of the second data is not completed within the first valid duration (i.e., the current system time is after the first valid duration), the second data can be deleted through the second consortium chain.

[0037] In the embodiments of this application, if the second consortium chain fails to verify the first hash value, and / or the transmission of the second data is not completed within the first valid time period, the second data can be deleted, thereby avoiding the leakage of the second data and further ensuring the security of the data transmission process.

[0038] Step 130: Generate a fourth hash value based on the first key through the first consortium blockchain, and send the first data to the second consortium blockchain if the fourth hash value matches the first hash value and the current system time is within the second valid duration.

[0039] The fourth hash value can be the hash value generated by the first consortium chain based on the first key sent by the second consortium chain. Alternatively, the fourth hash value can be calculated based on the SHA-256 algorithm using the first key sent by the second consortium chain.

[0040] The second valid duration can be the valid duration for the first data transmission set by the first consortium blockchain. In other words, if the transmission of the first data is completed within this second valid duration, the transmission is considered complete. If the transmission of the first data is not completed within the second valid duration, the first consortium blockchain will not continue transmitting the first data. The aforementioned second valid duration is generated based on the first consortium blockchain, and the first valid duration is longer than the second valid duration.

[0041] In some embodiments of this application, after the second consortium chain provides the second data to the first consortium chain, the second consortium chain also needs to obtain the first data. Specifically, after receiving the first key sent by the first consortium chain, the second consortium chain needs to verify the first key. Specifically, it can calculate a fourth hash value for the first key, and then compare the fourth hash value with the first hash value of the first key obtained earlier. If they match, and the current system time is within the second valid duration, then the first consortium chain can send the first data to the second consortium chain.

[0042] In some embodiments of this application, to further ensure the security of data transmission, after generating the fourth hash value based on the first key via the first consortium blockchain, the method described above may further include: If the fourth hash value does not match the first hash value, and / or the current system time is after the second valid duration, the first data is deleted through the first consortium chain.

[0043] In some embodiments of this application, if the first consortium blockchain verifies that the fourth hash value does not match the first hash value, and / or the first data is not transmitted within the first valid duration, i.e., the current system time is after the second valid duration, the first data can be deleted through the first consortium blockchain.

[0044] In the embodiments of this application, if the verification of the first key sent by the first consortium chain to the second consortium chain fails, and / or if the transmission of the first data is not completed within the second valid time period, the first data can be deleted to avoid leakage of the first data and further ensure the security of the data transmission process.

[0045] In some embodiments of this application, to further enhance the security of data transmission, after the first consortium blockchain obtains the second data from the second consortium blockchain, it can also verify the second data to prevent errors in the obtained second data. Specifically, the first consortium blockchain may store the block header information of the second consortium blockchain. The block header information may include the first Merkle root corresponding to the second data. This first Merkle root may be the Merkle root obtained after encrypting the second data. The specific method for determining the first Merkle root will be described in subsequent embodiments.

[0046] After sending the first key and second data to the first consortium blockchain, the above-mentioned method may further include: The second Merkle root corresponding to the second data is obtained by hashing the second data through the first consortium blockchain; If the first Merkle root matches the second Merkle root, the first transaction identifier is sent to the second consortium chain via the first consortium chain.

[0047] The second Merkle root can be the Merkle root obtained by the first consortium chain after performing a hash calculation on the second data received from the second consortium chain.

[0048] The first transaction identifier can be an identifier used to indicate the completion of the second data transmission.

[0049] In some embodiments of this application, the second data can be hashed by the first consortium blockchain to obtain the second Merkle root corresponding to the second data. Then, if the first Merkle root matches the second Merkle root, the first transaction identifier is sent to the second consortium blockchain through the first consortium blockchain. This determines that the second data transmission is complete, that is, that the first consortium blockchain has received the correct second data.

[0050] In the embodiments of this application, the first consortium blockchain obtains the second data from the second consortium blockchain and verifies the second data using the Merkel verification method. If the second data is verified successfully, the transmission of the second data is determined to be complete. This avoids the second data received by the first consortium blockchain being erroneous, thus improving the security of the second data transmission. At the same time, the transmission status of the second data can be intuitively determined through the first transaction identifier, thus improving the visualization of the transmission status of the second data.

[0051] In some embodiments of this application, the second consortium blockchain described above may include multiple blocks, each storing data, and each block corresponds to a hash value. To ensure the security of data in the consortium blockchain, the method described above further includes: The second consortium blockchain calculates the fifth hash value corresponding to each block based on the data stored in each block. Based on the fifth hash value corresponding to each block, determine the Merkle tree corresponding to the second data; The first Merkle root is generated based on the Merkle tree corresponding to the second data.

[0052] For each block, the fifth hash value can be the hash value of the data in the block obtained by the second consortium chain based on the data stored in the block. Specifically, it can be calculated based on the SHA-256 algorithm for the data in the block.

[0053] In some embodiments of this application, for each block in the second consortium chain, the fifth hash value corresponding to the block is calculated through the second consortium chain based on the data stored in the block. Then, for the fifth hash value corresponding to each block, a hash tree is constructed to obtain the Merkle tree corresponding to the second data. The top hash tree of the Merkle tree corresponding to the second data is then the first Merkle root.

[0054] In the embodiments of this application, by taking each block in the second consortium blockchain and obtaining the fifth hash value of the block based on the data in the block, a hash tree can be constructed based on the fifth hash value of each block, and the first Merkle root can be obtained based on the hash tree. In this way, the storage in the consortium blockchain can be encrypted, thus ensuring the security of the data in the consortium blockchain.

[0055] Accordingly, after the second consortium blockchain obtains the first data from the first consortium blockchain, it can also verify the first data to avoid errors. Specifically, the second consortium blockchain can store the block header information of the first consortium blockchain. This block header information can include the third Merkle root corresponding to the first data. This third Merkle root can be the Merkle root obtained after encrypting the first data. The specific method for determining this third Merkle root will be described in subsequent embodiments.

[0056] After sending the first data to the second consortium blockchain, the aforementioned method may further include: The fourth Merkle root corresponding to the first data is obtained by hashing the first data through the second consortium chain; If the fourth Merkle root matches the third Merkle root, the second transaction identifier is sent to the first consortium chain via the second consortium chain.

[0057] The fourth Merkle root can be the Merkle root obtained by the second consortium chain after performing a hash calculation on the first data received from the first consortium chain.

[0058] The second transaction identifier can be an identifier used to indicate the completion of the first data transmission.

[0059] In some embodiments of this application, the first data can be hashed by the second consortium blockchain to obtain the fourth Merkle root corresponding to the first data. Then, if the third Merkle root matches the fourth Merkle root, the second transaction identifier is sent to the first consortium blockchain through the second consortium blockchain. This determines that the first data transmission is complete, that is, that the second consortium blockchain has received the correct first data.

[0060] In the embodiments of this application, the second consortium chain obtains the first data from the first consortium chain and verifies the first data using the Merkel verification method. If the first data is verified successfully, the transmission of the first data is determined to be complete. This avoids errors in the first data received by the second consortium chain and improves the security of the first data transmission. At the same time, the transmission status of the first data can be intuitively determined through the second transaction identifier, improving the visualization of the transmission status of the first data.

[0061] In some embodiments of this application, the first consortium blockchain described above may include multiple blocks, each block storing data, and each block corresponds to a hash value. To ensure the security of data in the consortium blockchain, the method described above further includes: The first consortium blockchain calculates the sixth hash value corresponding to each block based on the data stored in each block. Based on the sixth hash value corresponding to each block, determine the Merkle tree corresponding to the first data; The third Merkle root is generated based on the Merkle tree corresponding to the first data.

[0062] For each block, the sixth hash value can be the hash value of the data in the block obtained by the first consortium chain based on the data stored in the block. Specifically, it can be calculated based on the SHA-256 algorithm for the data in the block.

[0063] In some embodiments of this application, for each block in the first consortium chain, the sixth hash value corresponding to the block is calculated by the first consortium chain based on the data stored in the block. Then, for the sixth hash value corresponding to each block, a hash tree is constructed to obtain the Merkle tree corresponding to the first data. The top hash tree of the Merkle tree corresponding to the first data is then the third Merkle root.

[0064] In the embodiments of this application, by taking each block in the first consortium blockchain and obtaining the sixth hash value of the block based on the data in the block, a hash tree can be constructed based on the sixth hash value of each block, and a third Merkle root can be obtained based on the hash tree. In this way, the storage in the consortium blockchain can be encrypted, thus ensuring the security of the data in the consortium blockchain.

[0065] To better understand the data transmission method provided in the embodiments of this application, the data transmission method provided in the embodiments of this application will be described below with specific scenarios. Figure 2 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. The execution entity of this data transmission method can be a blockchain, which may include a first consortium blockchain and a second consortium blockchain. Here, the first consortium blockchain and the second consortium blockchain can be two different blockchains. Specifically, blocks in the first consortium blockchain can be used to store the first data of the resource requester, and blocks in the second consortium blockchain can be used to store the second data that the resource requester wants to replace with the first data.

[0066] like Figure 2 As shown, the data transmission method provided in this application embodiment may include steps 21-34.

[0067] Step 21: Generate a first key, a first hash value corresponding to the first key, and a second validity period through the first consortium blockchain.

[0068] In step 21, before data transmission, the first consortium chain must first perform preparatory work, specifically generating a first key, a first hash value corresponding to the first key, and a second validity period.

[0069] Step 22: Synchronize the first hash value to the second consortium chain through the first consortium chain.

[0070] Step 23: Generate a smart contract through the first consortium blockchain.

[0071] In step 23, the parameters included in the smart contract generated by the first consortium chain are: transaction requester chain: second consortium chain, transaction receiver chain: first consortium chain, key: first key, hash value: first hash value, transaction data: first data, transaction flag: whether the transaction is completed, and validity period: second validity period.

[0072] It should be noted that, in the subsequent process, the first data in the first consortium chain is the data requested by the second consortium chain. Therefore, in the smart contract generated by the first consortium chain, the transaction requesting chain is the second consortium chain, and the transaction receiving chain is the first consortium chain.

[0073] Step 24: Send the first data request to the second consortium blockchain through the first consortium blockchain.

[0074] Step 24 is the same as step 110 above, and will not be repeated here.

[0075] Step 25: Receive the first hash value through the second consortium link.

[0076] In step 25, after the second consortium link receives the first hash value, a valid duration can be generated.

[0077] Step 26: Generate a smart contract through the second consortium blockchain.

[0078] In step 26, after receiving the first hash value sent by the first consortium chain, the second consortium chain can construct a smart contract. The smart contract contains the following parameters: transaction request chain: first consortium chain, transaction receiver chain: second consortium chain, key: empty, hash value: first hash value, transaction data: second data, transaction flag: whether the transaction is completed, and validity period: first validity period.

[0079] It should be noted that, for the second consortium blockchain, it needs to receive data requests from the first consortium blockchain. Therefore, in the smart contract generated by the second consortium blockchain, the transaction requesting chain is the first consortium blockchain, and the transaction receiving chain is the second consortium blockchain.

[0080] Furthermore, since the second consortium blockchain has not yet received the first consortium blockchain's first key initially, the key field in the smart contract generated by the second consortium blockchain is initially empty. Similarly, because the first consortium blockchain needs to request resource swaps from the second consortium blockchain, the second consortium blockchain may not provide the corresponding data to the first consortium blockchain. That is, if the second consortium blockchain does not need to provide the requested data back to the first consortium blockchain, the transaction data field in the smart contract generated by the second consortium blockchain is also empty.

[0081] Step 27: Determine whether the current system time is within the first valid duration through the second consortium chain. If yes, proceed to step 28; otherwise, end the process.

[0082] In step 27, if the second consortium blockchain determines that the current system time is not within the first valid duration, the process can end. If the second consortium blockchain stored the second data when generating the smart contract, it can delete the second data in the second consortium blockchain if it determines that the current system time is not within the first valid duration.

[0083] Step 28: Generate a second hash value based on the first key using the second consortium blockchain.

[0084] In step 28, the method of generating the second hash value based on the first key through the second consortium blockchain can refer to the process of generating the second hash value based on the first key through the second consortium blockchain in step 120 of the above embodiment, and will not be repeated here.

[0085] Step 29: Determine whether the second hash value matches the first hash value using the second consortium chain. If yes, proceed to step 30; otherwise, end the process.

[0086] Step 30: Store the first key through the second consortium blockchain and send the first key and second data to the first consortium blockchain.

[0087] In steps 29-30, if the second consortium chain determines that the second hash value matches the first hash value, it can store the first key and send the first key and the second data to the first consortium chain. This process is consistent with the process in step 120 in the above embodiment, and will not be described again here.

[0088] It should be noted that after the second consortium blockchain stores the first key, without requiring the first consortium blockchain to continue Merkel verification of the acquired second data, the second consortium blockchain can also update the transaction status field in its generated smart contract to "transaction completed," indicating that the first consortium blockchain has completed the verification of the second data.

[0089] Step 31: Determine whether the current system time is within the second valid duration through the first consortium blockchain. If yes, proceed to step 32; otherwise, end the process.

[0090] In step 31, similar to step 27 above, if the first consortium blockchain determines that the current system time is not within the second valid duration, the process can end. If the first consortium blockchain stored the first data when generating the smart contract, then if the first consortium blockchain determines that the current system time is not within the second valid duration, the first consortium blockchain can delete the first data in the first consortium blockchain at the same time, that is, the first consortium blockchain executes the rollback mechanism.

[0091] Step 32: Generate a fourth hash value based on the first key using the first consortium blockchain.

[0092] Step 33: Determine whether the fourth hash value and the first hash value match through the first consortium chain. If they match, proceed to step 34; otherwise, end the process.

[0093] Step 34: Send the first data to the second consortium blockchain via the first consortium blockchain.

[0094] The solution in this application embodiment realizes decentralized storage of data throughout the entire process, ensuring data consistency, reliability and immutability, making the data more trustworthy and independent of application management at the application level.

[0095] The data transmission method provided in this application can be executed by a data transmission system. This application uses the example of a data transmission system executing the data transmission method to illustrate the data transmission system provided in this application.

[0096] Figure 3 This is a schematic diagram illustrating the structure of a data transmission system according to an exemplary embodiment. For example... Figure 3 As shown, the data transmission system 300 may include: a first consortium blockchain 310 and a second consortium blockchain 320.

[0097] Among them, the blocks in the first consortium chain 310 are used to store the first data of the resource requester and to send the first data request to the second consortium chain. The first data request includes the first key generated by the first consortium chain and the first hash value corresponding to the first key. The blocks in the second consortium chain 320 are used to store the second data that the resource requester wants to replace with the first data, to generate a second hash value based on the first key, and to store the first key and send the first key and the second data to the first consortium chain when the second hash value matches the first hash value and the current system time is within a first valid duration. The first valid duration is generated based on the second consortium chain. The first consortium chain 310 is further configured to generate a fourth hash value based on the first key, and send the first data to the second consortium chain when the fourth hash value matches the first hash value and the current system time is within a second valid duration. The second valid duration is generated based on the first consortium chain, and the first valid duration is longer than the second valid duration.

[0098] The system provided in this application embodiment may include a first consortium blockchain and a second consortium blockchain. Blocks in the first consortium blockchain are used to store first data from the resource requester, while blocks in the second consortium blockchain are used to store second data to be exchanged by the resource requester using the first data. Thus, both the first data and the second data to be exchanged by the resource requester are stored in the blockchain, improving the security of the management of the first data and the second data to be exchanged. Simultaneously, during the resource exchange process, the first consortium blockchain sends a first key generated by the first consortium blockchain and a first hash value corresponding to the first key to the second consortium blockchain. The second consortium blockchain then verifies the first hash value. If the verification of the first hash value is successful within a first valid time period, the second data and the stored first key are sent to the first consortium blockchain. The first consortium blockchain then verifies the first key. If the verification of the first key is successful within a second valid time period, the first data is sent to the second consortium blockchain. Thus, during data transmission between the first and second consortium blockchains, a hash time lock is used to verify the data transmitted between the first and second consortium blockchains, ensuring the security of resource data transmission.

[0099] In some embodiments of this application, after generating a second hash value based on the first key, the second consortium chain is further configured to: delete the second data through the second consortium chain if the second hash value and the first hash value do not match, and / or if the current system time is after the first valid duration.

[0100] In some embodiments of this application, after generating a fourth hash value based on the first key, the first consortium blockchain is further configured to: delete the first data through the first consortium blockchain if the fourth hash value does not match the first hash value, and / or if the current system time is after the second valid duration.

[0101] In some embodiments of this application, the first consortium blockchain stores the block header information of the second consortium blockchain, and the block header information includes the first Merkle root corresponding to the second data; After sending the first key and the second data to the first consortium chain, the second consortium chain is further configured to: perform a hash calculation on the second data through the first consortium chain to obtain the second Merkle root corresponding to the second data; and, if the first Merkle root matches the second Merkle root, send a first transaction identifier to the second consortium chain through the first consortium chain, wherein the first transaction identifier indicates that the second data transmission is complete.

[0102] In some embodiments of this application, the second consortium blockchain includes multiple blocks, each block stores data, and each block corresponds to a hash value; the second consortium blockchain is also used to calculate the fifth hash value corresponding to each block based on the data stored in each block; determine the Merkle tree corresponding to the second data based on the fifth hash value corresponding to each block; and determine the first Merkle root according to the Merkle tree corresponding to the second data.

[0103] In some embodiments of this application, the first hash value is calculated from the first key based on the SHA-256 algorithm.

[0104] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application is shown. The electronic device may include a processor 401 and a memory 402 storing computer program instructions.

[0105] Specifically, the processor 401 may include a central processing unit, or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0106] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 402 is non-volatile solid-state memory.

[0107] In a particular embodiment, memory 402 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0108] The processor 401 implements any of the data transmission methods described in the above embodiments by reading and executing computer program instructions stored in the memory 402.

[0109] In one example, the electronic device may also include a communication interface 403 and a bus 410. For example, Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.

[0110] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0111] Bus 410 includes hardware, software, or both, that couples components of an online data flow metering device together. For example, and not limited to, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standard Association (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.

[0112] Furthermore, in conjunction with the data transmission methods described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the data transmission methods described in the above embodiments.

[0113] This application also provides a computer program product, including a computer program, which, when executed, implements any of the data transmission methods described in the above embodiments.

[0114] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0115] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet or intranets.

[0116] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0117] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0118] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A data transmission method, characterized in that, Applied to blockchain, the blockchain including a first consortium blockchain and a second consortium blockchain, blocks in the first consortium blockchain are used to store first data of a resource requester, and blocks in the second consortium blockchain are used to store second data that the resource requester wants to replace with the first data. The method includes: The first consortium chain sends a first data request to the second consortium chain, the first data request including a first key generated by the first consortium chain and a first hash value corresponding to the first key; The second consortium blockchain generates a second hash value based on the first key. If the second hash value matches the first hash value and the current system time is within a first valid duration, the first key is stored and the first key and the second data are sent to the first consortium blockchain. The first valid duration is generated based on the second consortium blockchain. The first consortium blockchain generates a fourth hash value based on the first key. If the fourth hash value matches the first hash value and the current system time is within the second valid duration, the first data is sent to the second consortium blockchain. The second valid duration is generated based on the first consortium blockchain, and the first valid duration is longer than the second valid duration.

2. The method according to claim 1, characterized in that, After generating the second hash value based on the first key using the second consortium blockchain, the method further includes: If the second hash value and the first hash value do not match, and / or the current system time is after the first valid duration, the second data is deleted via the second consortium blockchain.

3. The method according to claim 1, characterized in that, After generating the fourth hash value based on the first key using the first consortium blockchain, the method further includes: If the fourth hash value and the first hash value do not match, and / or if the current system time is after the second valid duration, the first data is deleted via the first consortium blockchain.

4. The method according to claim 1, characterized in that, The first consortium blockchain stores the block header information of the second consortium blockchain, and the block header information includes the first Merkle root corresponding to the second data; After sending the first key and the second data to the first consortium blockchain, the method further includes: The second Merkle root corresponding to the second data is obtained by hashing the second data using the first consortium blockchain. If the first Merkle root matches the second Merkle root, a first transaction identifier is sent from the first consortium blockchain to the second consortium blockchain, and the first transaction identifier indicates that the second data transmission is complete.

5. The method according to claim 4, characterized in that, The second consortium blockchain includes multiple blocks, each storing data, and each block corresponds to a hash value; the method further includes: The second consortium blockchain calculates the fifth hash value corresponding to each block based on the data stored in each block. Based on the fifth hash value corresponding to each block, the Merkle tree corresponding to the second data is determined; The first Merkle root is determined based on the Merkle tree corresponding to the second data.

6. The method according to any one of claims 1-5, characterized in that, The first hash value is calculated from the first key based on the SHA-256 algorithm.

7. A data transmission system, characterized in that, The system includes: The first consortium blockchain, in which blocks are used to store first data of the resource requester and to send a first data request to the second consortium blockchain, the first data request including a first key generated by the first consortium blockchain and a first hash value corresponding to the first key; The second consortium blockchain, wherein blocks in the second consortium blockchain are used to store the second data that the resource requester wants to replace with the first data, and are used to generate a second hash value based on the first key, and when the second hash value and the first hash value match and the current system time is within a first valid duration, store the first key, and send the first key and the second data to the first consortium blockchain, wherein the first valid duration is generated based on the second consortium blockchain; The first consortium blockchain is further configured to generate a fourth hash value based on the first key, and send the first data to the second consortium blockchain if the fourth hash value matches the first hash value and the current system time is within a second valid duration. The second valid duration is generated based on the first consortium blockchain, and the first valid duration is longer than the second valid duration.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the data transmission method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the data transmission method as described in any one of claims 1-6.

10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the data transmission method as described in any one of claims 1-6.