Data transmission method, apparatus, device, storage medium, and program product

By using a service gateway to listen to message queues and implement a re-request mechanism, the problem of unstable data transmission from the transaction execution system to the blockchain system was solved, thus achieving stable data transmission and processing.

CN119728718BActive Publication Date: 2025-12-16INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411894840.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-12-16
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Existing transaction execution systems suffer from unstable data transmission when transmitting transaction data to the blockchain system via HTTP calls. In particular, the blockchain system cannot actively send data requests after the connection is broken, resulting in unstable data transmission.

Method used

A service gateway is used to listen to the message queue. When transaction data to be uploaded to the blockchain is detected, the data is retrieved from the message queue. If an error occurs, the data is re-requested, sent to the blockchain node, and its processing and storage on the block are controlled.

Benefits of technology

The data request mechanism of the service gateway improves the transmission stability of transaction data to be uploaded to the blockchain, ensuring accurate data transmission and processing, and solving the problem of unstable data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728718B_ABST
    Figure CN119728718B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of data transmission method, device, equipment, storage medium and program product, involve financial technology field or other related fields.Blockchain system includes service gateway and multiple blockchain nodes;The method is applied to service gateway, the method includes: message queue is monitored, when it is monitored that there is pending on-chain transaction data in message queue, then pending on-chain transaction data is obtained from message queue, service gateway is not correctly received pending on-chain transaction data, it is also used to send request information to message queue, to reacquire the pending on-chain transaction data that is not correctly received, pending on-chain transaction data is sent to each blockchain node, and control blockchain node is handled to pending on-chain transaction data and the processing result is stored in block.This application method, pending on-chain transaction data is obtained by the way that service gateway sends data request to message queue, improves the stability of pending on-chain transaction data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of financial technology or other related fields, and in particular, relates to a data transmission method and device, equipment, storage medium and program product. BACKGROUND

[0002] A blockchain system is a kind of distributed database or record keeping system, which is used to record data in a system that is difficult to crack.

[0003] The transaction execution system can execute specific transactions to generate transaction data, and store the generated transaction data on the blockchain. At this time, the transaction execution system can transmit the transaction data to the blockchain system to achieve storing the transaction data on each blockchain node. When the transaction execution system transmits the data to be chained to the blockchain system, the http call method is usually used to achieve it. However, the above method has certain problems. The method needs to establish an http link between the transaction execution system and the blockchain system, and the http link may have a link disconnection problem, thereby causing instability of data transmission. When the link is disconnected, the blockchain system cannot actively send a data request to the transaction execution system, so that the data in the transaction execution system cannot be stably transmitted to the blockchain system. SUMMARY

[0004] The present application provides a data transmission method, device, equipment, storage medium and program product to solve the problem that the existing transaction execution system transmits transaction data to the blockchain system based on the http call method.

[0005] In a first aspect, the present application provides a data transmission method, wherein a blockchain system includes a service gateway and a plurality of blockchain nodes; the method is applied to the service gateway, and the method includes:

[0006] Listening to a message queue; the message queue is used to store transaction data transmitted by a transaction execution system;

[0007] When it is detected that there is transaction data to be chained in the message queue, the transaction data to be chained is obtained from the message queue; wherein the service gateway is further configured to send request information to the message queue to reacquire the transaction data to be chained that is not correctly received when the transaction data to be chained is not correctly received;

[0008] The transaction data to be chained is sent to each blockchain node, and the blockchain nodes are controlled to process the transaction data to be chained and store the processing results on the block.

[0009] In a second aspect, the present application provides a data transmission device, a blockchain system comprising a service gateway and a plurality of blockchain nodes; the device is applied to the service gateway, and the device comprises:

[0010] a listening module configured to listen to a message queue; the message queue is configured to store transaction data transmitted by a transaction execution system;

[0011] an obtaining module configured to obtain the to-be-chained transaction data from the message queue when it is found that the to-be-chained transaction data exists in the message queue; wherein the service gateway is further configured to send request information to the message queue to reacquire the to-be-chained transaction data that is not correctly received when the to-be-chained transaction data is not correctly received;

[0012] a processing module configured to send the to-be-chained transaction data to each blockchain node and control the blockchain nodes to process the to-be-chained transaction data and store the processing results on a block.

[0013] In a third aspect, the present application provides an electronic device, comprising: at least one processor and a memory;

[0014] the memory stores computer-executed instructions;

[0015] the at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the method of any one of the first aspect.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium, and the computer-readable storage medium stores computer-executed instructions, when the processor executes the computer-executed instructions, the method of any one of the first aspect is realized.

[0017] In a fifth aspect, the present application provides a computer program product, comprising a computer program, when the computer program is executed by the processor, the method of any one of the first aspect is realized.

[0018] The data transmission method, device, equipment, storage medium and program product provided by the application, the blockchain system includes a service gateway and a plurality of blockchain nodes; the method is applied to the service gateway, and the method comprises: listening to a message queue, the message queue is used for storing transaction data transmitted by a transaction execution system, when it is found that there is to-be-chained transaction data in the message queue, the to-be-chained transaction data is acquired from the message queue, wherein the service gateway is further used for sending request information to the message queue to reacquire the to-be-chained transaction data which is not correctly received, sending the to-be-chained transaction data to each blockchain node, and controlling the blockchain node to process the to-be-chained transaction data and store the processing result on a block, the to-be-chained transaction data is acquired by the service gateway sending a data request to the message queue, and the stability of to-be-chained transaction data transmission is improved. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.

[0020] Figure 1 An application scenario diagram of a data transmission method provided by the embodiment of the application is shown in the following figure.

[0021] Figure 2 A flowchart of a data transmission method provided by the embodiment of the application is shown in the following figure.

[0022] Figure 3 A flowchart of another data transmission method provided by the embodiment of the application is shown in the following figure.

[0023] Figure 4 A structure diagram of a data transmission device provided by the embodiment of the application is shown in the following figure.

[0024] Figure 5 A hardware structure diagram of an electronic device provided by the embodiment of the application is shown in the following figure.

[0025] The specific embodiments of the application have been shown in the above figures, and will be described in more detail hereinafter. These figures and textual descriptions are not intended to limit the scope of the concept of the application by any means, but to illustrate the concept of the application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0026] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals designate identical or similar elements in the several embodiments. The following exemplary embodiments are described with reference to the accompanying drawings. Unless specifically stated herein, the following description is not intended to represent all embodiments consistent with the present application. Instead, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.

[0027] It should be noted that the data transmission method, device, equipment, storage medium and program product provided by the present application can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application field of the data transmission method, device, equipment, storage medium and program product in the present application is not limited.

[0028] Figure 1 The application scenario diagram of the data transmission method provided by the embodiment of the present application is shown in Figure 1 As shown in the figure, the transaction execution system can transmit the generated transaction data to the message queue, the service gateway can listen to the message queue, and when the to-be-chained transaction data is listened to, the to-be-chained transaction data is transmitted to each block chain node, so as to realize storing the to-be-chained transaction data on the block in the block chain node.

[0029] The data transmission method provided by the present application aims to solve the above technical problems of the prior art.

[0030] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0031] Figure 2 The flowchart of the data transmission method provided by the embodiment of the present application is shown in the figure. The block chain system includes a service gateway and a plurality of block chain nodes. The method is applied to the service gateway, and the method includes steps S201 to S203.

[0032] Step S201, listening to the message queue; the message queue is used to store the transaction data transmitted by the transaction execution system.

[0033] The transaction execution system can be a system for executing data transactions. For example, when user A transfers 10 yuan to user B, the transaction execution system is the system for executing the above transaction. After the transaction execution system executes a transaction, the corresponding transaction data can be uploaded to the message queue to store the transaction data in the message queue.

[0034] For example, the message queue can be a component implemented based on RabbitMQ or Kafka RabbitMQ.

[0035] In step S202, when it is detected that there is to-be-chained transaction data in the message queue, the to-be-chained transaction data is obtained from the message queue. When there is an exception in receiving the to-be-chained transaction data, the service gateway is further configured to send request information to the message queue to reacquire the to-be-chained transaction data that is not correctly received.

[0036] The message queue can store various transaction data. In practice, not all transaction data needs to be uploaded to the blockchain system. Therefore, the service gateway can monitor the message queue to determine whether there is to-be-chained transaction data. The service gateway is used for communication between the blockchain system and the outside world. Specifically, when the service gateway detects that there is new transaction data in the message queue, it can determine whether the new transaction data meets the preset condition. When the preset condition is met, the new transaction data is to-be-chained transaction data, that is, it is detected that there is to-be-chained transaction data in the message queue.

[0037] When the service gateway detects that there is to-be-chained transaction data in the message queue, the service gateway can actively obtain the to-be-chained transaction data from the message queue.

[0038] In addition, when the network is abnormal, the service gateway has an exception when obtaining to-be-chained transaction data from the message queue, or the service gateway has an exception when uploading to-be-chained transaction data to the blockchain node, so that the blockchain system does not correctly obtain the to-be-chained transaction data. When this happens, the service gateway can send request information to the message queue again to reacquire the to-be-chained transaction data, so as to accurately transmit the to-be-chained transaction data to the blockchain system.

[0039] On the contrary, when no to-be-chained transaction data is detected, no operation is performed.

[0040] In step S203, the to-be-chained transaction data is sent to each blockchain node, and the blockchain node is controlled to process the to-be-chained transaction data and store the processing result on the block.

[0041] When the service gateway obtains the to-be-chained transaction data, the to-be-chained transaction data can be sent to each blockchain node, and each blockchain node can process the to-be-chained transaction data, so that the processing result can be stored on the block.

[0042] Optionally, the blockchain system can include a plurality of hardware devices, that is, physical devices such as servers or computer devices, and each blockchain node can drift between the plurality of hardware devices. Each blockchain node is provided with a plurality of smart contracts, and each smart contract can process the to-be-chained transaction data to obtain a processing result. For example, a transfer smart contract can be included, and when user A transfers 10 yuan to user B, the balance of user A and the balance of user B after the transfer can be determined according to the current balance of user A and the current balance of user B and the transfer amount, and the balance of each user after the transfer can be considered as the processing result, so that the processing result can be stored on a block.

[0043] The application provides a data transmission method, a blockchain system includes a service gateway and a plurality of blockchain nodes; the method is applied to the service gateway, and the method includes: listening to a message queue, the message queue is used for storing transaction data transmitted by a transaction execution system, when it is listened that there is to-be-chained transaction data in the message queue, the to-be-chained transaction data is acquired from the message queue, wherein, when there is an exception in receiving to-be-chained transaction data, the service gateway is further used for sending request information to the message queue to reacquire the to-be-chained transaction data that is not correctly received, sending the to-be-chained transaction data to each blockchain node, and controlling the blockchain node to process the to-be-chained transaction data and store a processing result on a block, the to-be-chained transaction data is acquired in the mode of sending a data request to the message queue by the service gateway, and the stability of to-be-chained transaction data transmission is improved.

[0044] Figure 3 Another flowchart of a data transmission method provided by the embodiment of the application.

[0045] Optionally, the method further includes:

[0046] Step S301, when it is listened that there is new transaction data in the message queue, the identification information of the new transaction data is acquired.

[0047] Step S302, it is judged whether the identification information is one of target identification information, the target identification information is used for indicating the identification information of to-be-chained transaction data; the identification information corresponds to a transaction scenario.

[0048] Step S303, if yes, it is determined that the to-be-chained transaction data exists in the message queue.

[0049] When the transaction execution system generates transaction data, the corresponding identification information can be set for the transaction data, and optionally, different identification information can be set according to a transaction scenario; for example, identification information 1 can be set for transaction scenario 1, identification information 2 can be set for transaction scenario 2, and so on.

[0050] The process in which the service gateway determines whether there is to-be-chained transaction data in the message queue can be: the service gateway can first listen whether there is newly-added transaction data in the message queue, and when there is newly-added transaction data, the identification information of the newly-added transaction data can be acquired, so as to determine whether the transaction data is to-be-chained transaction data according to the identification information. Specifically, the target identification information corresponding to the to-be-chained transaction data can be set in the service gateway, and when the identification information corresponding to the newly-added transaction data is one of the target identification information, it can be determined that the newly-added transaction data is to-be-chained transaction data.

[0051] By setting different identification information for different transaction data, the service gateway can determine whether the newly-added transaction data in the message queue is to-be-chained transaction data, and accurately filter to-be-chained transaction data.

[0052] Optionally, the method further comprises:

[0053] For any blockchain node, the operation and maintenance parameter information of the hardware device where the blockchain node is located is acquired;

[0054] According to the operation and maintenance parameter information and the information of whether there is to-be-chained transaction data at present, the to-be-dormant smart contract in the blockchain node is determined;

[0055] The container corresponding to the to-be-dormant smart contract in the blockchain node is controlled to stop running, so that the to-be-dormant smart contract is in a dormant state.

[0056] Each blockchain node in the blockchain system can be provided with a plurality of smart contracts, each smart contract corresponds to a to-be-chained transaction data, that is, is used to process a to-be-chained transaction data. When the smart contract is in an activated state on the blockchain node, it needs to consume the resources of the hardware device where the blockchain node is located, therefore, the container corresponding to the smart contract can be controlled to stop running according to actual conditions, so as to realize the dormancy of the smart contract, thereby reducing the occupation of resources by the smart contract.

[0057] Optionally, since the hardware device where each blockchain node is located can be different, for each blockchain node, the smart contract that needs to be dormant can be determined separately. Specifically, for each blockchain node, the operation and maintenance parameter information of the hardware device where the blockchain node is located can be acquired, and the operation and maintenance parameter information can reflect the running state of the hardware device, such as busy or idle. When the operation and maintenance parameter information is acquired, the to-be-dormant smart contract can be determined according to the operation and maintenance parameter information and the information of whether there is to-be-chained transaction data at present, and when it is determined that the hardware device is idle according to the operation and maintenance parameter information, it can be determined that there is no to-be-dormant smart contract, that is, there is no need to control any smart contract to be dormant.

[0058] Exemplarily, the smart contract that needs to be hibernated on each blockchain node can be determined every preset time, and the container corresponding to the smart contract that needs to be hibernated is controlled to stop running.

[0059] By determining the smart contract that needs to be hibernated and controlling the container corresponding to the smart contract that needs to be hibernated to stop running, the occupation of resources by the smart contract can be reduced, and the data processing capability of the hardware device can be improved.

[0060] Optionally, the smart contract that needs to be hibernated in the blockchain node is determined according to the operation and maintenance parameter information and information about whether there is to-be-chained transaction data currently, and the method comprises the following steps.

[0061] When the operation and maintenance parameter information meets the target condition and there is no to-be-chained transaction data currently, all the smart contracts in the blockchain node are determined as the smart contract that needs to be hibernated.

[0062] Or, when the operation and maintenance parameter information meets the target condition and there is to-be-chained transaction data currently, a first smart contract corresponding to the to-be-chained transaction data is determined, and each smart contract in the blockchain node except the first smart contract is determined as the smart contract that needs to be hibernated.

[0063] The operation and maintenance parameters comprise CPU occupation information, memory occupation information and IO information; and the target condition is met when each operation and maintenance parameter information is greater than a corresponding preset value.

[0064] When each operation and maintenance parameter information is greater than a corresponding preset value, it can be indicated that the hardware device is in a busy state. Specifically, a preset value can be set for each operation and maintenance parameter information. Exemplarily, for the CPU occupation information, a preset value 1 can be set, for the memory occupation information, a preset value 2 can be set, and for the IO information, a preset value 3 can be set. When the operation and maintenance parameter information is greater than the corresponding preset value, it can be reflected that the corresponding device in the hardware device is busy; and when each operation and maintenance parameter information is greater than the corresponding preset value, it can be indicated that the hardware device is in a busy state.

[0065] When the operation and maintenance parameter information meets the target condition, the smart contract that needs to be hibernated can be determined; and when the operation and maintenance parameter information does not meet the preset condition, it can be determined that there is no smart contract that needs to be hibernated in the blockchain node.

[0066] When the operation and maintenance parameter information meets the target condition, it can also be determined whether there is to-be-chained transaction data currently. When there is no to-be-chained transaction data currently, each smart contract in the blockchain node can be determined as the smart contract that needs to be hibernated.

[0067] On the contrary, when the operation and maintenance parameter information meets the target condition, but there is currently pending transaction data to be chained, the first smart contract corresponding to the pending transaction data to be chained can be determined. Each transaction data has a smart contract for processing the transaction data. The data table of the smart contract corresponding to each transaction data can be set in advance. When there is pending transaction data to be chained, the data table can be queried to determine the corresponding first smart contract. After determining the first smart contract, the smart contracts in the blockchain node other than the first smart contract can be determined as the smart contract to be dormant.

[0068] Optionally, the target condition can also be that the number of operation and maintenance parameters greater than the corresponding preset value is greater than the target value. For example, when there are 3 operation and maintenance parameter information, when 2 operation and maintenance parameter information respectively meets the corresponding preset value, it means that the target condition is met. The data of the target value can be set according to the actual situation, which is not limited here.

[0069] By determining the smart contract to be dormant according to the pending transaction data to be chained when the operation and maintenance parameter information meets the target condition, the smart contract to be dormant in the corresponding blockchain node can be accurately determined.

[0070] Optionally, the control of the blockchain node to process the pending transaction data to be chained and store the processing result on the block comprises:

[0071] determining a second smart contract corresponding to the pending transaction data to be chained, determining each target blockchain node in which the second smart contract is in a dormant state;

[0072] sending a wake-up instruction for the second smart contract to each target blockchain node to wake up the second smart contract in each target blockchain node;

[0073] processing the pending transaction data to be chained according to the second smart contract in each blockchain node, and storing the processing result on the block.

[0074] When the blockchain node processes the pending transaction data to be chained, since the processing of the pending transaction data to be chained needs to be implemented based on the smart contract, the corresponding second smart contract can be determined according to the pending transaction data to be chained first, and it is judged whether the second smart contract is in a dormant state. Specifically, the service gateway can send a dormant state request information for the second smart contract to each blockchain node, so as to obtain the dormant state information, and determine whether the second smart contract in each blockchain node is in a dormant state. When the second smart contract of the blockchain node is in a dormant state, the blockchain node is a target blockchain node, so the service gateway can send a wake-up instruction to these target blockchain nodes, and the wake-up instruction is used to wake up the second smart contract in each target blockchain node.

[0075] When the second smart contract in each target blockchain node is woken up, the to-be-chained transaction data can be processed based on the second smart contract, so as to store the processing result on the block of the corresponding blockchain node.

[0076] When the smart contract is dormant, when the to-be-chained transaction data is uploaded to the blockchain node, it can be first judged whether the corresponding smart contract is dormant, and when it is dormant, it is activated to realize the accurate uploading of the to-be-chained transaction data.

[0077] Optionally, the method further comprises:

[0078] When receiving the trigger information sent by the third-party application system, the control each blockchain node executes the third smart contract corresponding to the trigger information to generate contract execution information; the third-party application system is used to trigger the target transaction of the transaction execution system;

[0079] Receiving the contract execution information sent by each blockchain node, and performing deduplication processing on each contract execution information to obtain retained contract execution information; the contract execution information represents the basic information of the target transaction;

[0080] Transmit the retained contract execution information to the transaction execution system, so that the transaction execution system executes the target transaction.

[0081] Generally, the transaction execution system can first generate transaction data, and each blockchain node in the blockchain system can process and store the transaction data.

[0082] For the blockchain system, there is a special scenario that needs to first chain the transaction data in the blockchain system, and then execute the specific data transaction through the transaction execution system. For example, there are system 1 and system 2, system 1 is a transaction execution system, and system 2 is a third-party application system, or a channel application system, which can trigger the execution of the transaction based on the channel application system. There is a scenario of sending red packets to users in system 2, and the strategy of sending red packets is stored on the blockchain. When system 2 is triggered to send red packets, the contract execution information will be stored on the blockchain, and then the contract execution information is sent to system 1 to make system 1 change the account information. For the above scenario, the blockchain system needs to transmit data to the transaction execution system.

[0083] In the above scenario, since there are multiple blockchain nodes in the blockchain system, each blockchain node will obtain contract execution information according to the smart contract, and each blockchain node can send the contract execution information to the service gateway. If the service gateway directly sends each contract execution information to the transaction execution system, the transaction execution system will perform a data transaction for each contract execution information, and there will be a problem of multiple executions for one transaction, resulting in errors. Therefore, the service gateway can receive the contract execution information sent by each blockchain node, and perform deduplication processing on the received contract execution information, thereby obtaining retained contract execution information. The contract execution information can be basic information of a transaction, such as the amount of the red packet sent to user A, the amount of the red packet sent to user B, etc.

[0084] When the retained contract execution information is determined, the retained contract execution information can be sent to the transaction execution system, so that the transaction execution system can only process the retained contract execution information, thereby avoiding multiple executions of the same transaction by the transaction execution system.

[0085] After the transaction execution system processes the contract execution information, an execution result can be obtained, such as information about whether the red packet is successfully sent, etc. The transaction execution system can send the execution result to the message queue, and the service gateway obtains the execution result from the message queue and stores it in each blockchain node.

[0086] By performing deduplication processing on the contract execution information of each blockchain node through the service gateway, multiple executions of the same transaction by the transaction execution system can be avoided, and the accuracy of transaction processing by the transaction execution system can be improved.

[0087] Figure 4 A structural schematic diagram of a data transmission device provided by an embodiment of the present application is provided, and the blockchain system includes a service gateway and multiple blockchain nodes. The device 40 is applied to the service gateway, and the device includes:

[0088] The listening module 401 is configured to listen to a message queue. The message queue is configured to store transaction data transmitted by a transaction execution system.

[0089] The acquisition module 402 is configured to acquire the to-be-chained transaction data from the message queue when it is found that the to-be-chained transaction data exists in the message queue. When the service gateway does not correctly receive the to-be-chained transaction data, the service gateway is further configured to send request information to the message queue to reacquire the to-be-chained transaction data that is not correctly received.

[0090] The processing module 403 is configured to send the to-be-chained transaction data to each blockchain node, and control the blockchain nodes to process the to-be-chained transaction data and store the processing result on a block.

[0091] Optionally, the apparatus further comprises a judging module configured to:

[0092] when it is detected that there is new transaction data in the message queue, obtaining identification information of the new transaction data;

[0093] judging whether the identification information is one of target identification information, the target identification information being used to represent identification information of to-be-chained transaction data; the identification information corresponding to a transaction scenario;

[0094] if yes, it is determined that the to-be-chained transaction data is detected in the message queue.

[0095] Optionally, the apparatus further comprises a hibernation control module configured to:

[0096] for any blockchain node, obtaining operation and maintenance parameter information of a hardware device where the blockchain node is located;

[0097] determining a to-be-hibernated smart contract in the blockchain node according to the operation and maintenance parameter information and information about whether there is to-be-chained transaction data at present;

[0098] controlling a container corresponding to the to-be-hibernated smart contract in the blockchain node to stop running, so that the to-be-hibernated smart contract is in a hibernation state.

[0099] Optionally, when determining the to-be-hibernated smart contract in the blockchain node according to the operation and maintenance parameter information and the information about whether there is to-be-chained transaction data at present, the hibernation control module is specifically configured to:

[0100] when the operation and maintenance parameter information meets a target condition and there is no to-be-chained transaction data at present, determining all smart contracts in the blockchain node as the to-be-hibernated smart contract;

[0101] or, when the operation and maintenance parameter information meets the target condition and there is to-be-chained transaction data at present, determining a first smart contract corresponding to the to-be-chained transaction data, and determining each smart contract in the blockchain node except the first smart contract as the to-be-hibernated smart contract;

[0102] the operation and maintenance parameters include CPU occupation information, memory occupation information and IO information; the target condition being met means that each operation and maintenance parameter information is greater than a corresponding preset value.

[0103] Optionally, when controlling the blockchain node to process the to-be-chained transaction data and store a processing result in a block, the processing module 403 is specifically configured to:

[0104] determine a second smart contract corresponding to the to-be-chained transaction data, and determine each target blockchain node in which the second smart contract is in a dormant state;

[0105] send a wake-up instruction for the second smart contract to each target blockchain node to wake up the second smart contract in each target blockchain node;

[0106] process the to-be-chained transaction data according to the second smart contract in each blockchain node, and store the processing result on a block.

[0107] Optionally, the apparatus further includes a transmission module configured to:

[0108] when receiving trigger information sent by a third-party application system, control each blockchain node to execute a third smart contract corresponding to the trigger information to generate contract execution information; the third-party application system is configured to trigger the transaction execution system to execute a target transaction;

[0109] receive the contract execution information sent by each blockchain node, and perform deduplication processing on each contract execution information to obtain retained contract execution information; the contract execution information represents basic information of the target transaction;

[0110] transmit the retained contract execution information to the transaction execution system to enable the transaction execution system to execute the target transaction.

[0111] The data transmission apparatus provided by the embodiment of the present application can implement the data transmission method of the above-described embodiment as shown in Figure 2 The implementation principle and technical effects are similar, and will not be described here.

[0112] Figure 5 A hardware structure schematic diagram of an electronic device provided by the embodiment of the present application is shown in Figure 5 The electronic device provided by the embodiment includes at least one processor 501 and a memory 502. The processor 501 and the memory 502 are connected through a bus 503.

[0113] In the specific implementation process, the at least one processor 501 executes the computer execution instructions stored in the memory 502, so that the at least one processor 501 executes the method in the above-mentioned method embodiment.

[0114] The specific implementation process of the processor 501 can refer to the above-mentioned method embodiment, and the implementation principle and technical effects are similar, which will not be described here.

[0115] The above-mentioned Figure 5In the illustrated embodiment, it is to be understood that the processor can be a central processing unit (CPU), but can also be other general purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in connection with the application can be directly embodied as execution by a hardware processor, or a combination of hardware and software modules in the processor.

[0116] The memory can contain a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk memory.

[0117] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0118] The embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions, when the processor executes the computer execution instructions, the method of the above method embodiment is realized.

[0119] The embodiment of the application further provides a computer program product, comprising a computer program, and the computer program is executed by the processor to realize the method of the above method embodiment.

[0120] The above computer readable storage medium, the readable storage medium can be realized by any type of volatile or non-volatile storage device or their combination, 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 storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0121] An example readable storage medium is coupled to the processor such that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can be a part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.

[0122] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0123] Further, it should be noted that although the steps in the flowchart are shown in sequence according to the arrows, these steps are not necessarily executed in sequence according to the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be alternately executed with other steps or sub-steps or stages of other steps.

[0124] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be realized by other means. For example, the division of units / modules in the above-mentioned embodiments is only a logical functional division, and actual implementation can have another division manner. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0125] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application can be integrated in one unit / module, or each unit / module can exist physically, or two or more units / modules can be integrated together. The integrated unit / module can be realized in the form of hardware or in the form of a software program module.

[0126] In the above embodiments, the description of each of the embodiments focuses on different aspects of the embodiments. The parts not described in detail in a certain embodiment can be seen in the relevant description of the other embodiments. The technical features of the above embodiments can be combined in any manner. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as falling within the scope of the disclosure.

[0127] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.

[0128] It should be understood that the application is not limited to the precise construction and combinations of the components and steps described above and shown in the accompanying drawings. The scope of the application is limited only by the claims that follow.

Claims

1. A data transmission method, characterized in that, The blockchain system includes a service gateway and multiple blockchain nodes; the method is applied to the service gateway, and the method includes: Listen to the message queue; the message queue is used to store transaction data transmitted by the transaction execution system; When the message queue contains transaction data to be uploaded to the blockchain, the service gateway retrieves the transaction data from the message queue. If the service gateway fails to receive the transaction data correctly, it also sends a request to the message queue to retrieve the incorrectly received transaction data. Send the transaction data to be uploaded to the blockchain to each blockchain node, and control the blockchain node to process the transaction data to be uploaded to the blockchain and store the processing result on the block; The method further includes: For any given blockchain node, obtain the operation and maintenance parameter information of the hardware device where the blockchain node is located; Based on the operation and maintenance parameter information and the information on whether there is currently any transaction data to be uploaded to the blockchain, determine the dormant smart contracts in the blockchain node; The container corresponding to the smart contract to be dormant in the blockchain node is controlled to stop running, so that the smart contract to be dormant is put into a dormant state.

2. The method according to claim 1, characterized in that, The method further includes: When new transaction data is detected in the message queue, the identification information of the new transaction data is obtained; Determine whether the identification information is one of the target identification information, wherein the target identification information is used to represent the identification information of the transaction data to be uploaded to the blockchain; the identification information corresponds to the transaction scenario. If so, it is confirmed that the transaction data to be uploaded to the blockchain exists in the message queue.

3. The method according to claim 1, characterized in that, Based on the aforementioned operation and maintenance parameter information and the information regarding whether there is currently any transaction data to be uploaded to the blockchain, the dormant smart contracts in the blockchain node are determined, including: If the operation and maintenance parameter information meets the target conditions and there is currently no transaction data to be uploaded to the chain, then all smart contracts in the blockchain node are determined to be the smart contracts to be dormant. Alternatively, when the operation and maintenance parameter information meets the target conditions and there is currently transaction data to be uploaded to the blockchain, the first smart contract corresponding to the transaction data to be uploaded to the blockchain is determined, and all smart contracts other than the first smart contract in the blockchain node are determined as the smart contracts to be dormant. The operation and maintenance parameters include CPU usage information, memory usage information, and I / O information; meeting the target conditions means that each operation and maintenance parameter is greater than its corresponding preset value.

4. The method according to claim 1, characterized in that, Controlling the blockchain nodes to process the transaction data to be uploaded to the blockchain and storing the processing results on a block includes: Determine the second smart contract corresponding to the transaction data to be uploaded to the blockchain, and determine each target blockchain node in which the second smart contract is in a dormant state; Send a wake-up command for the second smart contract to each target blockchain node to wake up the second smart contract in each target blockchain node; The transaction data to be uploaded to the blockchain is processed according to the second smart contract in each blockchain node, and the processing result is stored on the block.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: Upon receiving a trigger message from a third-party application system, the system controls each blockchain node to execute the third smart contract corresponding to the trigger message, thereby generating contract execution information; the third-party application system is used to trigger the transaction execution system to execute the target transaction. The system receives contract execution information sent by each blockchain node, performs deduplication on each contract execution information to obtain retained contract execution information; the contract execution information represents the basic information of the target transaction. The retained contract execution information is transmitted to the transaction execution system so that the transaction execution system can execute the target transaction.

6. A data transmission device, characterized in that, The blockchain system includes a service gateway and multiple blockchain nodes; the device is applied to the service gateway, and the device includes: A listening module is used to listen to the message queue; the message queue is used to store transaction data transmitted by the transaction execution system. The acquisition module is used to acquire the transaction data to be uploaded to the blockchain from the message queue when it is detected that there is transaction data to be uploaded to the blockchain in the message queue; wherein, when the service gateway fails to receive the transaction data to be uploaded to the blockchain correctly, it is also used to send a request message to the message queue to reacquire the incorrectly received transaction data to be uploaded to the blockchain. The processing module is used to send the transaction data to be uploaded to the blockchain to each blockchain node, and control the blockchain node to process the transaction data to be uploaded to the blockchain and store the processing results on the block. The hibernation control module is used to: for any blockchain node, obtain the operation and maintenance parameter information of the hardware device where the blockchain node is located, determine the smart contract to be hibernated in the blockchain node based on the operation and maintenance parameter information and the information on whether there is currently transaction data to be uploaded to the chain, and control the container corresponding to the smart contract to be hibernated in the blockchain node to stop running, so that the smart contract to be hibernated is in a hibernation state.

7. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Intelligent contract running environment control method and system, equipment and medium

    CN111274576A

  • Intelligent contract management system and method in block chain, medium and product

    CN113312429A