Transaction verification method and related device
By allocating transaction records to the client on the target node of the blockchain network for verification, the problem of the existing technology failing to make full use of computing resources is solved, and the effect of improving the data processing efficiency of blockchain network is achieved.
Patent Information
- Application Number
- CN202111181721.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-10-11
AI Technical Summary
The existing technology has failed to make full use of computing power resources in the blockchain network, affecting the data processing efficiency of the blockchain network.
By implementing the transaction verification method on the target node of the blockchain network, the transaction records to be allocated and allocated to the communication-connected client, the client verifies and feedbacks the legitimate transaction records, the target node makes full use of the client's computing power resources.
It improves the data processing efficiency of blockchain networks and makes full use of computing resources in the network.
Smart Images

Figure CN113888180B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain, and more specifically, to a transaction verification method and related devices. Background Art
[0002] Equipment computing power has always been one of the core bottlenecks in the development of the blockchain industry, affecting the development speed of the blockchain industry. In order to improve the efficiency of the blockchain network, improvements are currently being made mainly at the software and hardware levels.
[0003] At the software level, the industry has proposed various innovative consensus algorithms to reduce the time it takes to reach consensus between nodes, thereby increasing the throughput of the entire system. At the hardware level, some dedicated acceleration chips have been developed and industrial application demonstrations have begun.
[0004] However, the inventors found that the current related technologies in the industry have not fully utilized the computing power resources in the blockchain network. Summary of the invention
[0005] In order to overcome at least one deficiency in the prior art, the present application provides a transaction verification method and a related device, including:
[0006] In a first aspect, this embodiment provides a transaction verification method, which is applied to a target node in a blockchain network, wherein the target node is communicatively connected to at least one client, and the method includes:
[0007] Get the transaction records to be allocated;
[0008] distributing the transaction record to the at least one client, wherein the at least one client is used to verify the transaction record;
[0009] A legitimate transaction sent by the at least one client is received, wherein the legitimate transaction includes the verified transaction record.
[0010] In a second aspect, this embodiment provides a transaction verification device, which is applied to a target node in a blockchain network, wherein the target node is communicatively connected to at least one client, and the transaction verification device includes:
[0011] A transaction acquisition module, used to acquire transaction records to be allocated;
[0012] a transaction allocation module, configured to allocate the transaction record to the at least one client, wherein the at least one client is configured to verify the transaction record;
[0013] The transaction processing module is used to receive a legal transaction sent by the at least one client, wherein the legal transaction includes the verified transaction record.
[0014] In a third aspect, this embodiment provides a target node, the target node includes a processor and a memory, the memory stores a computer program, and when the computer program is executed by the processor, the transaction verification method is implemented.
[0015] In a fourth aspect, this embodiment provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the transaction verification method is implemented.
[0016] Compared with the prior art, this application has the following beneficial effects:
[0017] In the transaction verification method and related device provided in this embodiment, after the target node obtains the transaction record to be allocated, it allocates it to the client connected to it so that each client can verify whether the allocated transaction record is a legal record; then, each client feeds back the legal record after verification to the target node. In this way, the target node can make full use of the computing power resources in the blockchain network to improve the data processing efficiency in the blockchain network. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A network diagram provided for an embodiment of the present application;
[0020] Figure 2 A schematic diagram of the target node structure provided in an embodiment of the present application;
[0021] Figure 3 A flow chart of a transaction verification method provided in an embodiment of the present application;
[0022] Figure 4 This is a structural diagram of the transaction verification device provided in an embodiment of the present application.
[0023] Icon: 120 - memory; 130 - processor; 140 - communication unit; 201 - transaction acquisition module; 202 - transaction allocation module; 203 - transaction processing module. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0025] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0026] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0027] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. In addition, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0028] It should be understood that the operations of the flow chart may not be implemented in order, and steps without logical contextual relationships may be reversed in order or implemented simultaneously. In addition, those skilled in the art may add one or more other operations to the flow chart, or may remove one or more operations from the flow chart, under the guidance of the content of this application.
[0029] The inventors have found that in the current blockchain related technologies, computing efficiency is mostly improved from the software level or the hardware level, and there is a problem of not fully utilizing the computing power resources in the blockchain network.
[0030] In view of this, in order to at least partially solve the above-mentioned problem, this embodiment provides a transaction verification method, which is applied to a target node in a blockchain network; wherein the target node is communicatively connected with at least one client.
[0031] In order to facilitate those skilled in the art to implement this solution, Figure 1 The blockchain network in this embodiment is introduced. The blockchain network provided in this embodiment can be regarded as a blockchain node as a whole, and the network includes multiple device nodes, and the multiple device nodes can be further divided according to the functions they undertake.
[0032] For example, multiple device nodes may include packaging nodes, test nodes, and verification nodes, where packaging nodes are used to generate blocks, test nodes are used to test network latency, and verification nodes are used to verify the legitimacy of transactions. Of course, in some embodiments, the same node can assume multiple functions. For example, the same node can serve as both a test node and a verification node.
[0033] The target node provided in this embodiment is any one of the multiple verification nodes. In different implementation scenarios, the target node can be different types of devices as long as they can provide corresponding computing power.
[0034] For example, in some embodiments, the target node may be a server. For example, it may be a Web server, an FTP server, a data processing server, etc. In addition, the server may be a single server or a server group. The server group may be centralized or distributed (for example, the server may be a distributed system). In some embodiments, the server may be local or remote relative to the client. In some embodiments, the server may be implemented on a cloud platform; as an example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, etc., or any combination thereof. In some embodiments, the server may be implemented on an electronic device having one or more components.
[0035] Of course, the client provided in this embodiment can also be different devices in different implementation scenarios, as long as the corresponding computing power can be provided. For example, the client can be, but not limited to, a mobile terminal, a tablet computer, a laptop computer, or a built-in device in a motor vehicle, or any combination thereof. In some embodiments, the mobile terminal may include a smart home device, a wearable device, a smart mobile device, a virtual reality device, or an augmented reality device, or any combination thereof. In some embodiments, the smart home device may include a smart lighting device, a control device for a smart electrical device, a smart monitoring device, a smart TV, a smart camera, or an intercom, or any combination thereof. In some embodiments, the wearable device may include a smart bracelet, a smart shoelace, a smart glass, a smart helmet, a smart watch, a smart clothing, a smart backpack, a smart accessory, or any combination thereof. In some embodiments, the smart mobile device may include a smart phone, a personal digital assistant (PDA), a gaming device, a navigation device, or a point of sale (POS) device, or any combination thereof.
[0036] As an example to facilitate understanding of this embodiment, a schematic diagram of the structure of the target node is also provided. Figure 2 As shown, the target node includes a memory 120, a processor 130, and a communication unit 140. The memory 120, the processor 130, and the communication unit 140 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0037] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.
[0038] The communication unit 140 is used to send and receive data through a network. The network may include a wired network, a wireless network, a fiber optic network, a telecommunication network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, or a near field communication (NFC) network, or any combination thereof. In some embodiments, the network may include one or more network access points. For example, the network may include a wired or wireless network access point, such as a base station and / or a network switching node, through which one or more components of the service request processing system may be connected to the network to exchange data and / or information.
[0039] The processor 130 may be an integrated circuit chip having a signal processing capability, and the processor may include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), or a microprocessor, or any combination thereof.
[0040] Combine the following Figure 3The transaction verification method provided is elaborated in detail, such as Figure 3 As shown, the method includes:
[0041] S101, obtaining transaction records to be allocated.
[0042] In some implementations, considering that the target node is a dedicated node in the blockchain, its computing power is much higher than that of the client. Therefore, after the target node obtains the records to be verified, it will be verified by the target node first; when the records to be verified exceed its own computing power, the remaining records to be verified will be used as transaction records to be allocated and allocated to each client for verification.
[0043] For example, assuming that the target node can process a maximum of 1,000 records to be verified, and the number of records to be verified obtained is 1,500, the excess 500 records will be allocated to the client as transaction records to be allocated, so that the client can help verify the legitimacy of these 500 records.
[0044] Among them, a transaction record can be considered illegal in many cases. For example, suppose a transaction record pays 100 virtual currencies, but the payer's wallet only has 50 virtual currencies. Therefore, before packaging the transaction records into blocks, illegal transaction records need to be removed.
[0045] S102, allocating the transaction record to at least one client.
[0046] In some embodiments, the target node is allocated based on the computing power of each client. That is, the target node can obtain the computing power of at least one client; then, based on the computing power of at least one client, the transaction record is allocated to at least one client, wherein the transaction record allocated to each client is positively correlated with the computing power of the client.
[0047] For example, the allocation can be made according to the following formula:
[0048]
[0049] In the formula, Num i Indicates the number of transaction records allocated to the i-th client, cap i It represents the computing power of the i-th client, and txs represents the total amount of transaction records to be allocated.
[0050] In some implementations, for each client, the target node obtains the computing resources of the client and determines the computing power of the client based on a preset metric.
[0051] The computing resources may include the client's memory information, CPU information, and network quality information. For example, the memory information may include information such as the capacity and frequency of the memory; the CPU information may include information such as the CPU model, frequency, and number of cores; and the network quality information may include information such as communication delay and packet loss rate.
[0052] As a computing power measurement standard, this embodiment pre-configures corresponding weights for various types of computing resources, and uses the weighted results of various types of computer resources as computing power.
[0053] For example, the calculation can be performed according to the following formula:
[0054] cap source =M*0.2+C*0.5+Q net *0.3;
[0055] In the formula, cap source Indicates the computing power of the client, M indicates memory information, C indicates CPU information, Q net Indicates network quality information.
[0056] S103, receiving a legal transaction sent by at least one client.
[0057] Among them, legal transactions include verified transaction records.
[0058] Based on the above design, after the target node obtains the transaction records to be allocated, it allocates them to the clients that are connected to it so that each client can verify whether the allocated transaction records are legal records; then, each client will feedback the legal records that have passed the verification to the target node. In this way, the target node can make full use of the computing power resources in the blockchain network to improve the data processing efficiency in the blockchain network.
[0059] In this embodiment, when acquiring the communication quality information of the client, in order to make the communication quality information obtained by the test more objective, a test node is periodically selected from a plurality of verification nodes.
[0060] For example, serial numbers may be configured for multiple verification nodes in advance, and then the test node may be determined from them according to the following formula:
[0061]
[0062] Where t represents the time when the test node is selected, T * represents the reference time, Δt is the time interval, N represents the number of test nodes, index represents the sequence number corresponding to the selected test node, and ceil represents rounding up. For example, ceil(0.3)=1.
[0063] In some implementations, for the test node selected in the above manner, each client in this embodiment sends a test message to the test node and then receives a response message to the test message; then, the time difference between the two is used as network quality information.
[0064] In this embodiment, in order to encourage clients to participate in verifying transaction records, the target node also counts the verification workload of each client; the verification workload is used as a free transaction certificate in the blockchain network.
[0065] It should be understood that when a blockchain wallet is configured in the client, when the client initiates a transaction, in addition to the virtual currency required for the transaction, a certain handling fee must also be paid. In this embodiment, a conversion relationship between the verification workload and the free transaction voucher is configured; when the client has a free transaction voucher, the transaction can be initiated without paying a handling fee.
[0066] In some embodiments, the target node is used to package the right of the block, generate a block including legal transactions, and send the block to the blockchain network.
[0067] In some other embodiments, the blockchain network includes a packaging node, and the target node sends the received legal transactions to the packaging node. The packaging node receives legal transactions from all verification nodes, packages them into blocks, and sends them to the network.
[0068] Based on the same inventive concept as the transaction verification method, this embodiment also provides a device related to the method, including:
[0069] This embodiment provides a transaction verification device, which is applied to a target node in a blockchain network, and the target node is connected to at least one client. The transaction verification device includes at least one functional module that can be stored in a memory in the form of software. Figure 4 As shown, from a functional perspective, the transaction verification device may include:
[0070] The transaction acquisition module 201 is used to acquire the transaction records to be allocated.
[0071] In this embodiment, the transaction acquisition module 201 is used to implement Figure 3 For a detailed description of the transaction acquisition module 201, please refer to the detailed description of S101.
[0072] The transaction allocation module 202 is used to allocate the transaction record to at least one client, wherein the at least one client is used to verify the transaction record.
[0073] In this embodiment, the transaction allocation module 202 is used to implement Figure 3For a detailed description of the transaction allocation module 202 , please refer to the detailed description of S102 .
[0074] The transaction processing module 203 is used to receive a legal transaction sent by at least one client, wherein the legal transaction includes a verified transaction record.
[0075] In this embodiment, the transaction processing module 203 is used to implement Figure 3 For a detailed description of the transaction processing module 203, please refer to the detailed description of S103.
[0076] It should be noted that the transaction verification device may also include other software modules for implementing other steps or sub-steps of the transaction verification method; of course, the transaction acquisition module 201, the transaction allocation module 202, and the transaction processing module 203 may also be used to implement other steps or sub-steps of the transaction verification method. This embodiment does not make specific limitations on this, and those skilled in the art may make appropriate adjustments according to their respective classification standards, and this embodiment does not make specific limitations on this.
[0077] This embodiment also provides a target node, which includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, a transaction verification method is implemented.
[0078] This embodiment also provides a computer storage medium, which stores a computer program. When the computer program is executed by a processor, a transaction verification method is implemented.
[0079] In summary, in the transaction verification method and related device provided by this embodiment, after the target node obtains the transaction record to be allocated, it allocates it to the client connected to it so that each client can verify whether the allocated transaction record is a legal record; then, each client feeds back the legal record after verification to the target node. In this way, the target node can make full use of the computing power resources in the blockchain network to improve the data processing efficiency in the blockchain network.
[0080] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0081] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0082] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0083] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A transaction verification method, characterized in that: Applied to a target node in a blockchain network, the blockchain network as a whole is regarded as a blockchain node, the blockchain network includes multiple node devices, the multiple node devices include multiple verification nodes, the target node is any one of the multiple verification nodes, the target node is connected to at least one client, and the method includes: Obtain the records to be verified. When the records to be verified exceed its own computing power, the remaining records to be verified will be used as transaction records to be allocated; distributing the transaction record to the at least one client, wherein the at least one client is used to verify the transaction record; A legitimate transaction sent by the at least one client is received, wherein the legitimate transaction includes the verified transaction record.
2. The transaction verification method according to claim 1, characterized in that: The allocating the transaction record to the at least one client comprises: Obtaining computing power of each of the at least one client; The transaction record is allocated to the at least one client according to the respective computing power of the at least one client, wherein the transaction record allocated to each of the clients is positively correlated with the computing power of the client.
3. The transaction verification method according to claim 2, characterized in that: The obtaining of the computing power of each of the at least one client comprises: For each of the clients, obtaining computing resources of the client, wherein the computing resources include memory information, CPU information, and network quality information of the client; The computing power of the client is determined based on the computing resources.
4. The transaction verification method according to claim 3, characterized in that: The blockchain network includes multiple verification nodes, and the target node is any one of the multiple verification nodes; The network quality information is obtained from a communication test between the client and a test node, and the test node is periodically selected from the plurality of verification nodes.
5. The transaction verification method according to claim 1, characterized in that: The method further comprises: For each of the clients, counting the verification workload of the client; The verification workload is used as a free transaction voucher in the blockchain network.
6. The transaction verification method according to claim 1, characterized in that: The blockchain network also includes a packaging node, and the method further includes: The legitimate transaction is sent to the encapsulation node.
7. The transaction verification method according to claim 1, characterized in that: The method further comprises: Generate a block including the legal transaction; The block is sent to the blockchain network.
8. A transaction verification device, characterized in that: Applied to a target node in a blockchain network, the blockchain network as a whole is regarded as a blockchain node, the blockchain network includes multiple node devices, the multiple node devices include multiple verification nodes, the target node is any one of the multiple verification nodes, the target node is connected to at least one client for communication, and the transaction verification device includes: The transaction acquisition module is used to obtain the records to be verified. When the records to be verified exceed its own computing power, the remaining records to be verified are used as transaction records to be allocated; a transaction allocation module, configured to allocate the transaction record to the at least one client, wherein the at least one client is configured to verify the transaction record; The transaction processing module is used to receive a legal transaction sent by the at least one client, wherein the legal transaction includes the verified transaction record.
9. A target node, characterized in that: The target node includes a processor and a memory, the memory stores a computer program, and when the computer program is executed by the processor, the transaction verification method according to any one of claims 1 to 7 is implemented.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by a processor, the transaction verification method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Blockchain distributed account book storage method and server
CN107169144A
Lightweight terminal block chain system
CN107317672A