Blockchain-based transaction method, apparatus, and system
By using a network card with built-in blockchain transaction processing logic and data storage in a personal computer, the problems of energy waste and security risks in public blockchain networks are solved, achieving the effects of environmental protection, energy saving and network stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-05-05
- Publication Date
- 2026-06-02
AI Technical Summary
In public blockchain networks, keeping personal computers powered on for extended periods leads to energy waste and security risks. Furthermore, prolonged internet connectivity can make computers vulnerable to hacking, impacting network stability.
By embedding blockchain transaction processing logic and business data storage into a personal computer, the network card operates with low power consumption when the host is off, processes blockchain transactions and caches the results, and synchronizes data when the host starts up, ensuring uninterrupted blockchain service.
It achieves environmental protection and energy conservation, improves computer security and the stability of the blockchain network, and reduces power consumption and network attack risks.
Smart Images

Figure CN116389493B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and more specifically, to a blockchain-based transaction method, apparatus, and system. Background Technology
[0002] Public blockchain networks are maintained by numerous individual users who join as nodes. These users install blockchain software on their personal computers, provide blockchain consensus services, and become nodes in the blockchain network.
[0003] Once personal computers are added to a blockchain network, they need to remain powered on for extended periods, consuming a significant amount of electricity and accelerating hardware aging. Furthermore, prolonged internet connectivity can make computers vulnerable to hacking, posing security risks. Summary of the Invention
[0004] The main objective of this invention is to provide a blockchain-based transaction method, device, and system that is environmentally friendly and energy-saving, and improves computer security and the stability of the blockchain network.
[0005] To achieve the above objectives, embodiments of the present invention provide a blockchain-based transaction method, comprising:
[0006] Receive blocks from the blockchain network based on the host's first host state;
[0007] The first execution result is obtained by executing the transactions in the block based on the full service data of the network card.
[0008] Update the processed data and the full service data of the network card according to the first execution result;
[0009] The first host state is updated to the second host state based on the information from the host, and the processed data and the block are sent to the host based on the second host state.
[0010] In one embodiment, it further includes:
[0011] The number of processed blocks and the total number of blocks are obtained based on the status of the first host.
[0012] The processed data corresponding to the processed blocks is obtained based on the comparison result between the number of processed blocks and the total number of blocks;
[0013] Update the network interface card's full service data and receive block based on the processed data;
[0014] The corresponding business data to be executed is obtained based on the comparison result between the number of received blocks and the total number of blocks;
[0015] The pending business data is executed to obtain a second execution result, and the processed data and the full business data of the network card are updated according to the second execution result.
[0016] In one embodiment, it further includes:
[0017] Receive blocks from the blockchain network based on the state of the third host;
[0018] When the duration of the third host state exceeds a preset time, the third host state is updated to the first host state.
[0019] In one embodiment, it further includes:
[0020] Based on the second host status, a block from the blockchain network is sent to the host, so that the host executes the transaction in the block according to the business data corresponding to the block to obtain a third execution result;
[0021] The processed data and the full service data of the network interface card are updated based on the third execution result from the host.
[0022] In one embodiment, it further includes:
[0023] The network interface card (NIC) full service data is updated based on the NIC status and the host full service data from the host.
[0024] The network card status is updated to the second host status based on information from the host.
[0025] This invention also provides a blockchain-based transaction device, comprising:
[0026] The block receiving module is used to receive blocks from the blockchain network based on the host's first host state;
[0027] The first execution result module is used to execute the transactions in the block based on the full service data of the network card to obtain the first execution result;
[0028] The first data update module is used to update the processed data and the full service data of the network card according to the first execution result;
[0029] The data sending module is used to update the first host state to a second host state based on information from the host, and to send the processed data and the block to the host based on the second host state.
[0030] In one embodiment, it further includes:
[0031] The block count acquisition module is used to acquire the number of processed blocks and the total number of blocks based on the status of the first host.
[0032] The processed data acquisition module is used to acquire the processed data corresponding to the processed blocks based on the comparison result between the number of processed blocks and the total number of blocks;
[0033] The first update module is used to update the full service data and receive block of the network card according to the processed data;
[0034] The pending business data acquisition module is used to acquire the corresponding pending business data based on the comparison result between the number of received blocks and the total number of blocks;
[0035] The execution module is used to execute the business data to be executed to obtain a second execution result, and update the processed data and the full business data of the network card according to the second execution result.
[0036] In one embodiment, it further includes:
[0037] The receiving module is used to receive blocks from the blockchain network based on the state of the third host;
[0038] The second update module is used to update the third host state to the first host state when the duration of the third host state exceeds a preset time.
[0039] In one embodiment, it further includes:
[0040] The sending module is used to send a block from the blockchain network to the host according to the second host status, so that the host can execute the transaction in the block according to the business data corresponding to the block to obtain a third execution result;
[0041] The third update module is used to update the processed data and the full service data of the network card based on the third execution result from the host.
[0042] In one embodiment, it further includes:
[0043] The fourth update module is used to update the network card's full service data based on the network card status by receiving the host's full service data from the host.
[0044] The fifth update module is used to update the network card status to the second host status based on information from the host.
[0045] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the blockchain-based transaction method.
[0046] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the blockchain-based transaction method.
[0047] This invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the blockchain-based transaction method.
[0048] The blockchain-based transaction method, apparatus, and system of this invention first receive blocks from the blockchain network according to the first host state of the host, and then execute transactions in the blocks to update the processed data and the full network card service data according to the full network card service data. Then, the first host state is updated to the second host state according to the information from the host, and the processed data and the full network card service data are sent to the host. This can be environmentally friendly and energy-saving, and improve computer security and the stability of the blockchain network scale. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is a flowchart of a blockchain-based transaction method in an embodiment of the present invention;
[0051] Figure 2 This is a flowchart illustrating the normal shutdown process of the host in this embodiment of the invention;
[0052] Figure 3 This is a flowchart illustrating the abnormal shutdown of the host in an embodiment of the present invention;
[0053] Figure 4 This is a flowchart of the network card's first startup in an embodiment of the present invention;
[0054] Figure 5 This is a flowchart illustrating the normal operating state of the host in this embodiment of the invention;
[0055] Figure 6 This is a structural block diagram of a blockchain-based transaction device in an embodiment of the present invention;
[0056] Figure 7 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application.
[0057] Figure 8This is a schematic diagram of a blockchain-based transaction system in an embodiment of the present invention. Detailed Implementation
[0058] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] Those skilled in the art will recognize that embodiments of the present invention can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0060] Given that ordinary home computers need to remain powered on for extended periods when joining a public blockchain network, leading to energy waste, hardware wear and tear, and security risks, this invention provides a method, device, and system for locating air pollution sources. The core component is a network interface card (NIC) with built-in blockchain transaction processing logic and business data storage. This NIC can operate with low power consumption without starting the host computer, processing blockchain transactions and storing incremental blockchain transactions (in contrast, the host's blockchain software stores all blockchain transactions) and incremental blockchain business data, maintaining the normal function of the blockchain network. All data other than blockchain transactions is discarded. When the host computer and its blockchain software are started, the incremental blockchain transactions and data stored on the NIC are synchronously updated to the host computer, and the host's blockchain software takes over the transaction processing function of the blockchain NIC, providing maximum transaction processing performance. The invention will be described in detail below with reference to the accompanying drawings.
[0061] Figure 1 This is a flowchart of a blockchain-based transaction method in an embodiment of the present invention. Figure 1 As shown, Figure 1 This includes the transaction processing flow when the host is powered off and the data synchronization flow when the host starts up. When the computer's operating system is shut down but the power supply is not completely disconnected, the host is in a powered-off state, but a small amount of current is supplied to the network interface card (NIC). The NIC can receive and process new blockchain transactions at a lower performance level and cache the transaction processing results to ensure uninterrupted blockchain service. When the computer restarts its operating system while still being powered on, the host resumes normal operation. The NIC synchronizes the cached blockchain transactions and transaction processing results from the host shutdown period to the host, ensuring the host quickly returns to normal operation.
[0062] Blockchain-based transaction methods include:
[0063] S101: Receive blocks from the blockchain network based on the host's first host state.
[0064] In the first host state, the host is off (i.e., the network card receives a new block, records it on the network card unit, executes the transactions in the block, and records the results on the network card unit). At this time, the network card writes the block from the blockchain network into the network card's first memory.
[0065] Figure 2 This is a flowchart illustrating the normal shutdown process of the host in an embodiment of the present invention. For example... Figure 2 As shown, when the user manually closes the blockchain software on the computer or shuts down the operating system, the host performs a shutdown operation, stops processing blockchain transactions, and the network card performs the necessary data initialization operations, and then takes over the processing of blockchain transactions from the host.
[0066] The blockchain-based transaction method of the present invention further includes:
[0067] S201: Obtain the number of processed blocks and the total number of blocks based on the first host status.
[0068] In practice, after receiving a shutdown command from the user or operating system, the host sends a corresponding message to the network interface card (NIC), and the NIC changes the host state to the first host state. The NIC then retrieves the number of processed blocks from its second memory and the total number of blocks from its third memory.
[0069] S202: Obtain the processed data corresponding to the processed blocks based on the comparison result between the number of processed blocks and the total number of blocks.
[0070] In specific implementation, when the number of processed blocks is greater than the total number of blocks, the processed data corresponding to the processed blocks located in the second memory of the network card is obtained.
[0071] S203: Update the network card's full service data and receive block based on the processed data.
[0072] In practice, the network card's full service data in the third network card's memory is updated based on the processed data, and the processed data in the second network card's memory and the corresponding receiving blocks stored in the first network card's memory are deleted.
[0073] S204: Obtain the corresponding business data to be executed based on the comparison result between the number of received blocks and the total number of blocks.
[0074] In practice, when the number of received blocks is greater than the total number of blocks in the network card, the pending service data located in the third memory of the network card is obtained.
[0075] S205: Execute the pending service data to obtain a second execution result, and update the processed data and the full service data of the network card according to the second execution result.
[0076] In practice, the network interface card (NIC) full service data in the third NIC memory is updated according to the second execution result until the number of received blocks equals the total number of NIC blocks. The total number of NIC blocks is the number of blocks corresponding to the full service data of the NIC.
[0077] Figure 3 This is a flowchart illustrating the abnormal shutdown of the host in an embodiment of the present invention. Figure 3 As shown, when the operating system or blockchain software unexpectedly stops working, the host loses its ability to process blockchain transactions. However, it is too late to notify the network interface card (NIC) to take over the blockchain transaction processing, and it loses the ability to change the host state to "host started" (i.e., the NIC receives a new block, records it on the NIC, and forwards it to the host, but does not execute the transactions in the block). At this point, the NIC detects that the host has stopped responding and actively takes over the blockchain transaction processing.
[0078] The blockchain-based transaction method of the present invention further includes:
[0079] S301: Receive blocks from the blockchain network based on the state of the third host.
[0080] The third host status is "Waiting for host", meaning the network card is waiting for a host response. If the host does not respond in time, the status will be changed to "Host off".
[0081] S302: When the duration of the third host state exceeds a preset time, the third host state is updated to the first host state.
[0082] After S302 is executed, the subsequent processing steps are the same as those in S201 to S205.
[0083] S102: Execute the transactions in the block based on the full service data of the network card to obtain the first execution result.
[0084] In practice, the corresponding full network card service data is read from the network card's third memory, and the transactions in the block are executed to obtain the first execution result.
[0085] S103: Update the processed data and the full service data of the network card according to the first execution result.
[0086] In practice, the processed data in the second network card memory and the full network card service data in the third network card memory are updated based on the first execution result.
[0087] S104: Update the first host state to the second host state based on the information from the host, and send the processed data and the block to the host based on the second host state.
[0088] In practice, the host starts up and sends information to the network interface card (NIC). The NIC updates the first host state to the second host state based on the information from the host, and sends the processed data and the block to the host. The host stores the block in its first memory (used to store the host's total blocks) and the processed data in its second memory (used to store all of the host's service data). The NIC then deletes the processed data from its second memory and the block from its first memory.
[0089] Figure 4 This is a flowchart illustrating the initial startup process of the network card in an embodiment of the present invention. For example... Figure 4 As shown, when the power is completely disconnected and then powered on to start up, the network card and the host go from a completely power-off state to a normal working state. The host needs to complete the transaction, then synchronize the blocks from the network, and then synchronize them to the network card.
[0090] The blockchain-based transaction method of the present invention further includes:
[0091] S401: Update the network card's full service data based on the network card status and the host's full service data from the host.
[0092] In practical implementation, the network interface card (NIC) status indicator can be set to "device initialization" (i.e., the NIC receives a new block, performs no processing, and only forwards it to the host). The NIC's first memory stores blocks from the blockchain network (only receiving unprocessed blocks), the second memory stores processed data, and the third memory stores all NIC service data. The host checks the host's total blocks (all blocks in the blockchain network) stored in its first memory and the host's total service data (all service data in the blockchain network) stored in its second memory. When the host's total blocks exceed the number of blocks corresponding to the host's total service data, the host executes the unprocessed blocks to obtain the execution result, writes the result to the host's second memory, updates the host's total service data, and sends the host's total service data to the NIC. The NIC then updates its total service data based on the host's total service data.
[0093] S402: Update the network card status to the second host status based on the information from the host.
[0094] In practice, the network card will update the "device initialization" status to "host startup" status.
[0095] Figure 5 This is a flowchart illustrating the normal operating state of the host in an embodiment of the present invention. For example... Figure 5 As shown, when the computer is powered on normally, its host and network card work simultaneously. The host provides high-performance blockchain transaction processing, and the processing results are synchronized to the network card.
[0096] The blockchain-based transaction method of the present invention further includes:
[0097] S501: Based on the second host status, a block from the blockchain network is sent to the host, so that the host executes the transaction in the block according to the business data corresponding to the block to obtain a third execution result.
[0098] In specific implementation, the second host state is host started. The network card writes the block from the blockchain network into the network card's first memory and then sends it to the host, updating the host start state to the third host state (waiting for host). The host stores the aforementioned block in the host's first memory, executes the transactions in the block according to the business data corresponding to the block, obtains the second execution result, and then sends it to the network card's second memory.
[0099] S502: Update the processed data and the full service data of the network card according to the third execution result from the host.
[0100] In specific implementation, the network card updates the host status to host startup based on the second execution result from the host, updates the network card's full service data in the network card's third memory with the second execution result in the network card's second memory, and deletes the second execution result in the network card's second memory and the corresponding block in the network card's first memory.
[0101] Figure 1 The entity executing the blockchain-based transaction method shown can be a network interface card (NIC). Figure 1 As shown in the process, the blockchain-based transaction method, device, and system of this invention first receive blocks from the blockchain network according to the first host state of the host, and then execute transactions in the blocks to update the processed data and the full network card service data according to the full network card service data. Then, the first host state is updated to the second host state according to the information from the host, and the processed data and the full network card service data are sent to the host. This can be environmentally friendly and energy-saving, and improve computer security and the stability of the blockchain network scale.
[0102] Based on the same inventive concept, this invention also provides a blockchain-based transaction device. Since the principle of this device in solving the problem is similar to that of the blockchain-based transaction method, the implementation of this device can refer to the implementation of the method, and the repeated parts will not be described again.
[0103] Figure 6 This is a structural block diagram of a blockchain-based transaction device in an embodiment of the present invention. Figure 6As shown, the blockchain-based transaction device includes:
[0104] The block receiving module is used to receive blocks from the blockchain network based on the host's first host state;
[0105] The first execution result module is used to execute the transactions in the block based on the full service data of the network card to obtain the first execution result;
[0106] The first data update module is used to update the processed data and the full service data of the network card according to the first execution result;
[0107] The data sending module is used to update the first host state to a second host state based on information from the host, and to send the processed data and the block to the host based on the second host state.
[0108] In one embodiment, it further includes:
[0109] The block count acquisition module is used to acquire the number of processed blocks and the total number of blocks based on the status of the first host.
[0110] The processed data acquisition module is used to acquire the processed data corresponding to the processed blocks based on the comparison result between the number of processed blocks and the total number of blocks;
[0111] The first update module is used to update the full service data and receive block of the network card according to the processed data;
[0112] The pending business data acquisition module is used to acquire the corresponding pending business data based on the comparison result between the number of received blocks and the total number of blocks;
[0113] The execution module is used to execute the business data to be executed to obtain a second execution result, and update the processed data and the full business data of the network card according to the second execution result.
[0114] In one embodiment, it further includes:
[0115] The receiving module is used to receive blocks from the blockchain network based on the state of the third host;
[0116] The second update module is used to update the third host state to the first host state when the duration of the third host state exceeds a preset time.
[0117] In one embodiment, it further includes:
[0118] The sending module is used to send a block from the blockchain network to the host according to the second host status, so that the host can execute the transaction in the block according to the business data corresponding to the block to obtain a third execution result;
[0119] The third update module is used to update the processed data and the full service data of the network card based on the third execution result from the host.
[0120] In one embodiment, it further includes:
[0121] The fourth update module is used to update the network card's full service data based on the network card status by receiving the host's full service data from the host.
[0122] The fifth update module is used to update the network card status to the second host status based on information from the host.
[0123] In summary, the blockchain-based transaction device of this invention first receives a block from the blockchain network according to the first host state of the host, and then executes the transaction in the block to update the processed data and the full service data of the network card according to the full service data of the network card. Then, it updates the first host state to the second host state according to the information from the host, and sends the processed data and the full service data of the network card to the host. This can be environmentally friendly and energy-saving, and improve computer security and the stability of the blockchain network scale.
[0124] Figure 7 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 7 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 7 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0125] In one embodiment, the blockchain-based transaction method functionality can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:
[0126] Receive blocks from the blockchain network based on the host's first host state;
[0127] The first execution result is obtained by executing the transactions in the block based on the full service data of the network card.
[0128] Update the processed data and the full service data of the network card according to the first execution result;
[0129] The first host state is updated to the second host state based on the information from the host, and the processed data and the block are sent to the host based on the second host state.
[0130] As can be seen from the above description, the blockchain-based transaction method provided in this application first receives a block from the blockchain network according to the first host state of the host, and then executes the transaction in the block to update the processed data and the full service data of the network card according to the full service data of the network card. Then, it updates the first host state to the second host state according to the information from the host, and sends the processed data and the full service data of the network card to the host. This method can be environmentally friendly and energy-saving, and improve computer security and the stability of the blockchain network scale.
[0131] In another implementation, the blockchain-based transaction device can be configured separately from the central processing unit 9100. For example, the blockchain-based transaction device can be configured as a chip connected to the central processing unit 9100, and the blockchain-based transaction method can be implemented through the control of the central processing unit.
[0132] like Figure 7 As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 7 All components shown; in addition, the electronic device 9600 may also include Figure 7 For components not shown, please refer to existing technologies.
[0133] like Figure 7 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.
[0134] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.
[0135] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0136] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer 9141 (sometimes referred to as a buffer memory). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.
[0137] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0138] The communication module 9110 is a transmitter / receiver 9110 that transmits and receives signals via the antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processing unit 9100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.
[0139] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 9130 is coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored sound via the speaker 9131.
[0140] This invention also provides a computer-readable storage medium capable of implementing all steps of the blockchain-based transaction method described above, where the execution subject is a server or client. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the blockchain-based transaction method described above. For example, when the processor executes the computer program, it implements the following steps:
[0141] Receive blocks from the blockchain network based on the host's first host state;
[0142] The first execution result is obtained by executing the transactions in the block based on the full service data of the network card.
[0143] Update the processed data and the full service data of the network card according to the first execution result;
[0144] The first host state is updated to the second host state based on the information from the host, and the processed data and the block are sent to the host based on the second host state.
[0145] In summary, the computer-readable storage medium of this embodiment first receives a block from the blockchain network according to the first host state of the host to execute transactions in the block to update the processed data and the full service data of the network card according to the full service data of the network card. Then, it updates the first host state to a second host state according to the information from the host to send the processed data and the full service data of the network card to the host. This can be environmentally friendly and energy-saving, and improve computer security and the stability of the blockchain network scale.
[0146] This invention also provides a computer program product capable of implementing all steps of the blockchain-based transaction method described above, where the execution subject is a server or client. The computer program product includes a computer program / instruction that, when executed by a processor, implements all steps of the blockchain-based transaction method described above. For example, when the processor executes the computer program, it implements the following steps:
[0147] Receive blocks from the blockchain network based on the host's first host state;
[0148] The first execution result is obtained by executing the transactions in the block based on the full service data of the network card.
[0149] Update the processed data and the full service data of the network card according to the first execution result;
[0150] The first host state is updated to the second host state based on the information from the host, and the processed data and the block are sent to the host based on the second host state.
[0151] In summary, the computer program product of this invention first receives a block from the blockchain network according to the first host state of the host, and then executes the transaction in the block to update the processed data and the full service data of the network card according to the full service data of the network card. Then, it updates the first host state to the second host state according to the information from the host, and sends the processed data and the full service data of the network card to the host. This can be environmentally friendly and energy-saving, and improve computer security and the stability of the blockchain network scale.
[0152] Based on the same inventive concept, this invention also provides a blockchain-based transaction system. Since the principle of this system in solving the problem is similar to that of the blockchain-based transaction method, the implementation of this system can refer to the implementation of the method, and the repeated parts will not be described again.
[0153] Figure 8 This is a schematic diagram of a blockchain-based transaction system according to an embodiment of the present invention. Figure 8 As shown, a blockchain-based transaction system includes:
[0154] The blockchain-based transaction device described above;
[0155] The host is used to send host information to the blockchain-based transaction device and to receive processed data and blocks from the blockchain-based transaction device.
[0156] In summary, the blockchain-based transaction system of this invention has the following three beneficial effects:
[0157] I. Improve the stability of the blockchain network scale: Even if the host is shut down, the network card can still provide blockchain services, ensuring the continuity of the node's blockchain services, thus improving the stability of the blockchain network.
[0158] II. Environmental protection and energy saving: When users are not using the computer, they can turn off the host and the blockchain service will be provided by the network card alone. The network card has low power consumption, thus saving electricity.
[0159] Third, improve computer security: The host does not need to be online for a long time, and the host can be protected from network attacks when the user is offline, thus improving the security of the computer system.
[0160] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, hardware + program embodiments are relatively simple in description because they are fundamentally similar to method embodiments; relevant parts can be referred to the descriptions in the method embodiments.
[0161] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0162] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0163] While this specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, 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, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded.
[0164] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0165] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.
[0166] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0167] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0168] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0169] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0170] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0171] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0172] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0173] The embodiments described in this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0174] The embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0175] The above description is merely an embodiment of the present specification and is not intended to limit the embodiments of the present specification. For those skilled in the art, various modifications and variations can be made to the embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present specification should be included within the scope of the claims of the embodiments of the present specification.
Claims
1. A blockchain-based transaction method, characterized in that, include: The host receives blocks from the blockchain network based on its first host state, where the first host state is host off. The first execution result is obtained by executing the transactions in the block based on the full service data of the network card read from the third memory of the network card; Update the processed data and the full service data of the network card according to the first execution result; The first host state is updated to a second host state based on host startup information from the host, and the processed data and the block are sent to the host based on the second host state; wherein, the second host state is host startup; The method further includes: The number of processed blocks and the total number of blocks are obtained based on the status of the first host. The processed data corresponding to the processed blocks is obtained based on the comparison result between the number of processed blocks and the total number of blocks; Update the network interface card's full service data and receive block based on the processed data; The corresponding business data to be executed is obtained based on the comparison result between the number of received blocks and the total number of blocks; The pending business data is executed to obtain a second execution result, and the processed data and the full business data of the network card are updated according to the second execution result.
2. The blockchain-based transaction method according to claim 1, characterized in that, Also includes: Receive blocks from the blockchain network based on the state of the third host; When the duration of the third host state exceeds a preset time, the third host state is updated to the first host state.
3. The blockchain-based transaction method according to claim 1, characterized in that, Also includes: Based on the second host status, a block from the blockchain network is sent to the host, so that the host executes the transaction in the block according to the business data corresponding to the block to obtain a third execution result; The processed data and the full service data of the network interface card are updated based on the third execution result from the host.
4. The blockchain-based transaction method according to claim 1, characterized in that, Also includes: The network interface card (NIC) full service data is updated based on the NIC status and the host full service data from the host. The network card status is updated to the second host status based on information from the host.
5. A blockchain-based transaction device, characterized in that, include: The first block receiving module is used to receive blocks from the blockchain network according to the first host state of the host; wherein the first host state is that the host is off. The first execution result module is used to execute the transactions in the block based on the full service data of the network card read from the third memory of the network card to obtain the first execution result; The first data update module is used to update the processed data and the full service data of the network card according to the first execution result; The first data sending module is configured to update the first host state to a second host state based on host startup information from the host, and send the processed data and the block to the host based on the second host state; wherein the second host state is host startup; The device further includes: The block count acquisition module is used to acquire the number of processed blocks and the total number of blocks based on the status of the first host. The processed data acquisition module is used to acquire the processed data corresponding to the processed blocks based on the comparison result between the number of processed blocks and the total number of blocks; The first update module is used to update the full service data and receive block of the network card according to the processed data; The pending business data acquisition module is used to acquire the corresponding pending business data based on the comparison result between the number of received blocks and the total number of blocks; The execution module is used to execute the business data to be executed to obtain a second execution result, and update the processed data and the full business data of the network card according to the second execution result.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the blockchain-based transaction method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the blockchain-based transaction method according to any one of claims 1 to 4.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the blockchain-based transaction method according to any one of claims 1 to 4.
9. A blockchain-based transaction system, characterized in that, include: The blockchain-based transaction device as described in claim 5; The host is used to send host information to the blockchain-based transaction device; Receive processed data and blocks from the blockchain-based transaction device.