CN111416860A - Transaction processing method and device based on block chain, electronic equipment and medium - Google Patents

Transaction processing method and device based on block chain, electronic equipment and medium Download PDF

Info

Publication number
CN111416860A
CN111416860A CN202010187773.0A CN202010187773A CN111416860A CN 111416860 A CN111416860 A CN 111416860A CN 202010187773 A CN202010187773 A CN 202010187773A CN 111416860 A CN111416860 A CN 111416860A
Authority
CN
China
Prior art keywords
lightweight node
block chain
blockchain network
network
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010187773.0A
Other languages
Chinese (zh)
Other versions
CN111416860B (en
Inventor
荆博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010187773.0A priority Critical patent/CN111416860B/en
Publication of CN111416860A publication Critical patent/CN111416860A/en
Application granted granted Critical
Publication of CN111416860B publication Critical patent/CN111416860B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Abstract

The application discloses a transaction processing method and device based on a block chain, electronic equipment and a medium, and relates to the technical field of block chains. When the method is executed by the activation server, the concrete implementation scheme is as follows: acquiring an activation request for applying to join a block chain network, which is sent by lightweight node equipment; and allocating an associated blockchain network for the lightweight node equipment, wherein the associated blockchain network is used for processing the uplink transaction request initiated by the lightweight node equipment through the associated blockchain network. According to the method and the device, the block chain network is allocated to the lightweight node equipment in a targeted manner through the activation server, and the block chain network processes the uplink transaction request of the lightweight node equipment, so that load balance of the block chain is achieved, and the uplink transaction request of the lightweight node equipment is guaranteed to be processed in time.

Description

Transaction processing method and device based on block chain, electronic equipment and medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a block chain technology, and in particular, to a method and an apparatus for transaction processing based on a block chain, an electronic device, and a medium.
Background
With the application of blockchain technology in various fields, the number of lightweight nodes in blockchain networks has rapidly increased, reaching hundreds of thousands.
A large number of lightweight node devices will generate uplink transaction requests every few seconds, and a blockchain network needs to process hundreds of thousands of transaction requests every second, which imposes a high requirement on the performance of the blockchain network. And with the increasing number of lightweight nodes, the requirement on performance is higher and higher. As lightweight nodes continue to grow, transaction requests generated by many lightweight nodes may not be processed in a timely manner.
Disclosure of Invention
The block chain-based transaction processing method, device, electronic equipment and medium provided by the embodiment of the application are used for timely processing the uplink transaction request of the lightweight node equipment.
The embodiment of the application discloses a transaction processing method based on a block chain, which is executed by an activation server, and comprises the following steps:
acquiring an activation request for applying to join a block chain network, which is sent by lightweight node equipment;
and allocating an associated blockchain network for the lightweight node equipment, wherein the associated blockchain network is used for processing the uplink transaction request initiated by the lightweight node equipment through the associated blockchain network.
The above embodiment has the following advantages or beneficial effects: the method has the advantages that the server is activated to distribute the associated block chain network for the lightweight node equipment in a targeted manner, the problem that the block chain network load is large and the uplink transaction request of the lightweight node equipment cannot be processed in time due to the fact that a large amount of lightweight node equipment accesses the block chain network in a centralized manner is solved, processing resources of the block chain network are reasonably allocated, and therefore the uplink transaction request of the lightweight node equipment is processed in time.
Further, assigning an associated blockchain network to the lightweight node device, comprising:
comparing the number of activated first total lightweight node devices in the existing block chain network with the number of second total lightweight node devices expected to be accommodated by the existing block chain network;
and if the number of the first total lightweight node devices is equal to or greater than the number of the second total lightweight node devices, controlling to create a new blockchain network, and establishing an association relationship between the lightweight node devices and the new blockchain network.
Accordingly, the above-described embodiments have the following advantages or advantageous effects: when the number of the activated first total lightweight node equipment is equal to or more than the number of second total lightweight node equipment expected to be accommodated by the existing blockchain network, a new blockchain network is created, so that the new blockchain network can process the uplink transaction request of the lightweight node equipment in time, and the processing burden of the existing blockchain network is effectively reduced.
Further, after comparing the activated first total lightweight node device number in the existing blockchain network with the second total lightweight node device number that the existing blockchain network is expected to accommodate, the method further includes:
and if the number of the first total lightweight node devices is less than the number of the second total lightweight node devices, allocating a block chain network for the lightweight node devices from the existing block chain network, and establishing an association relationship between the lightweight node devices and the allocated block chain network.
Accordingly, the above-described embodiments have the following advantages or advantageous effects: when the number of the activated first total lightweight node equipment is less than the number of second total lightweight node equipment expected to be accommodated by the existing blockchain network, the blockchain network is coordinated and distributed for the lightweight node equipment to process the uplink transaction request according to the calculation force condition of the existing blockchain network, so that the load balance of the blockchain network is realized, and the uplink transaction request of the lightweight node equipment is ensured to be processed timely and effectively.
Further, the second total number of lightweight node devices is determined according to the number of lightweight node devices expected to be accommodated by a single blockchain network and the number of existing blockchain networks.
Accordingly, the above-described embodiments have the following advantages or advantageous effects: and determining the number of second total lightweight node devices through the number of lightweight node devices expected to be accommodated by a single blockchain network and the number of the existing blockchain networks, thereby accurately calculating the number of second total lightweight node devices expected to be accommodated by the existing blockchain networks and further determining the processing capacity of the blockchain networks.
Further, the number of lightweight node devices expected to be accommodated by the single blockchain network is determined according to the uplink time length of the single blockchain network.
Accordingly, the above-described embodiments have the following advantages or advantageous effects: the number of lightweight node equipment expected to be accommodated by a single blockchain network is determined through the uplink time length of the single blockchain network, so that the number of the lightweight node equipment expected to be accommodated by the single blockchain network can accurately reflect the processing capacity of the single blockchain network.
The embodiment of the application also discloses a transaction processing method based on the block chain, which is executed by the lightweight node equipment, and the method comprises the following steps:
generating an activation request for applying to join the block chain network;
sending the activation request to an activation server to instruct the activation server to allocate an associated blockchain network for a local node device.
The above embodiment has the following advantages or beneficial effects: by generating the activation request and sending the activation request to the activation server, the activation server can know the number of the currently activated lightweight node devices, and then allocate the blockchain network to the local node devices in a targeted manner, so that the problem that the block chain network has a large load and cannot process the uplink transaction request of the lightweight node devices in time due to the fact that a large number of lightweight node devices access the blockchain network in a centralized manner is solved, the processing resources of the blockchain network are reasonably allocated, and the uplink transaction request of the lightweight node devices is processed in time.
Further, after sending the activation request to the activation server, the method further includes:
generating an uplink transaction request;
and sending the uplink transaction request to the block chain network associated with the local node equipment to instruct the associated block chain network to process the uplink transaction request.
Accordingly, the above-described embodiments have the following advantages or advantageous effects: the uplink transaction request is processed in time by the associated blockchain network by sending the uplink transaction request to the blockchain network associated with the local node device.
Further, sending the uplink transaction request to a blockchain network associated with a local node equipment, includes:
and sending the uplink transaction request to gateway equipment to indicate the gateway equipment to distribute the uplink transaction request to a block chain network associated with local node equipment according to the association relationship between the lightweight node equipment and the block chain network.
Accordingly, the above-described embodiments have the following advantages or advantageous effects: the gateway equipment uniformly distributes the uplink transaction requests in order according to the incidence relation between the lightweight node equipment and the block chain network, so that the distribution efficiency is improved.
The embodiment of the present application further discloses a block chain-based transaction processing apparatus configured in an activation server, where the apparatus includes:
the activation request acquisition module is used for acquiring an activation request which is sent by the lightweight node equipment and applies for joining the blockchain network;
and the allocating module is used for allocating the associated blockchain network for the lightweight node equipment, and is used for processing the uplink transaction request initiated by the lightweight node equipment through the associated blockchain network.
Further, the allocation module includes:
a comparing unit, configured to compare the number of activated first total lightweight node devices in an existing blockchain network with the number of second total lightweight node devices expected to be accommodated by the existing blockchain network;
and the new block chain network creating unit is used for controlling to create a new block chain network and establishing an association relation between the lightweight node equipment and the new block chain network if the number of the first total lightweight node equipment is equal to or greater than the number of the second total lightweight node equipment.
Further, the apparatus further comprises:
and the existing block chain network allocation module is used for allocating a block chain network for the lightweight node equipment from the existing block chain network and establishing an association relationship between the lightweight node equipment and the allocated block chain network if the number of the first total lightweight node equipment is less than the number of the second total lightweight node equipment.
Further, the second total number of lightweight node devices is determined according to the number of lightweight node devices expected to be accommodated by a single blockchain network and the number of existing blockchain networks.
Further, the number of lightweight node devices that the single blockchain network is expected to accommodate is determined according to the uplink duration of the single blockchain network.
The embodiment of the present application further discloses a block chain-based transaction processing apparatus configured in a lightweight node device, where the apparatus includes:
the activation request generation module is used for generating an activation request for applying to join the block chain network;
and the activation request sending module is used for sending the activation request to an activation server so as to instruct the activation server to distribute the associated blockchain network for the local node equipment.
Further, the apparatus further comprises:
a uplink transaction request generating module for generating an uplink transaction request;
an uplink transaction request sending module, configured to send the uplink transaction request to a blockchain network associated with the local node device, so as to instruct the associated blockchain network to process the uplink transaction request.
Further, the uplink transaction request sending module is specifically configured to:
and sending the uplink transaction request to gateway equipment to indicate the gateway equipment to distribute the uplink transaction request to a block chain network associated with local node equipment according to the association relationship between the lightweight node equipment and the block chain network.
The embodiment of the application also discloses an electronic device, which comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a blockchain based transaction method performed by an activation server as in any of the embodiments of the present application or to perform a blockchain based transaction method performed by a lightweight node device as in any of the embodiments of the present application.
The embodiments of the present application also disclose a non-transitory computer readable storage medium storing computer instructions for causing the computer to execute the blockchain based transaction processing method performed by the activation server according to any one of the embodiments of the present application, or execute the blockchain based transaction processing method performed by the lightweight node device according to any one of the embodiments of the present application.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
fig. 1 is a schematic flowchart of a block chain-based transaction processing method performed by an activation server according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another block chain-based transaction processing method performed by an activation server according to an embodiment of the present application;
fig. 3 is an overall block diagram of another specific implementation of a block chain-based transaction processing method performed by an activation server according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a method for block chain based transaction processing performed by a lightweight node device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a blockchain-based transaction processing device configured in an activation server according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a transaction processing apparatus configured in a lightweight node device according to an embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device for implementing a transaction processing method based on a block chain according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the embodiment of the application, the lightweight node is similar to a full node, and deployment data of a block chain, such as an intelligent contract and a consensus mechanism, is deployed. Therefore, can participate in the transaction request interaction process of the block chain, but not store all block data. When the lightweight node needs to query the transaction data in the block chain, the block data can be acquired from other nodes in real time, and the verification is carried out by adopting a set mode. The lightweight node has lower requirements on the hardware configuration of the deployed equipment, can be integrated on the operating system level, controls the hardware in the terminal equipment, can interact with the upper application software, and provides block chain support for the functions of the application software.
Fig. 1 is a flowchart illustrating a block chain based transaction processing method performed by an activation server according to an embodiment of the present application. The embodiment is applicable to the case where the blockchain network processes the uplink transaction request of the lightweight node device. Typically, this embodiment may be applied to a case where the activation service allocates an associated blockchain network for the lightweight node device according to the number of the lightweight node devices, so that the associated blockchain network processes the uplink transaction request of the lightweight node device. The transaction processing method based on the blockchain disclosed in this embodiment may be executed by an electronic device serving as an activation server, and specifically may be executed by a transaction processing apparatus based on the blockchain, where the apparatus may be implemented by software and/or hardware and configured in the electronic device. Referring to fig. 1, the block chain-based transaction processing method performed by the activation server according to this embodiment includes:
and S110, acquiring an activation request for applying to join the blockchain network, which is sent by the lightweight node equipment.
The activation request may be generated by the lightweight node device, and sent to the activation server, so as to apply for joining the blockchain network to the activation server.
The processing resources of the blockchain network and the capability of processing uplink transaction requests are limited, and if a large number of lightweight node devices are added into the blockchain network in an unordered and centralized manner, the transaction requests of the lightweight nodes may not be processed in time. In order to solve the above problem, in the embodiment of the present application, before the lightweight node joins the blockchain network, an activation application for applying for joining the blockchain may be sent to the activation server, so that the activation server allocates the blockchain network that can be used for processing the transaction request of the lightweight node device, and the problem that the blockchain network is unbalanced in load and high in processing pressure and is difficult to process the uplink transaction request in time due to centralized joining of a large number of lightweight node devices to the blockchain network is avoided.
And S120, distributing an associated block chain network for the lightweight node equipment, and processing the uplink transaction request initiated by the lightweight node equipment through the associated block chain network.
The uplink transaction request may be a write request, such as a transaction uplink request, a contract execution request, etc., or a read request, such as a transaction query request, a block query request, etc. For example, the activation server may assign an associated blockchain network to the lightweight node device, where the blockchain network may be an existing blockchain network or a new blockchain network created. Because the associated blockchain network is distributed to the lightweight node equipment by the activation server instead of enabling the lightweight node equipment to centrally access the blockchain network in an unordered manner at the same time, the blockchain network with calculation capability can be distributed to the lightweight node equipment, so that the blockchain network associated with the lightweight node equipment can be ensured to be capable of timely and effectively processing the uplink transaction request of the lightweight node equipment.
In this embodiment, after allocating the associated blockchain network to the lightweight node device, the activation server may store an association relationship between the lightweight node device and the blockchain network in a gateway device, where the gateway device may be at least one unified gateway. When the lightweight power-saving equipment generates an uplink transaction request, the uplink transaction request is sent to the gateway equipment, the gateway equipment sends the uplink transaction request to the block chain network associated with the lightweight node according to the pre-stored association relationship between the lightweight node equipment and the block chain network, and the block chain network processes the uplink transaction request.
In the embodiment of the application, in order to improve the search efficiency, a unified search service may be set for the search transaction request of the lightweight node. And analyzing the data in the block chain network to construct an inverted index so as to provide uniform search service. The lightweight node device can send the search request to a server providing unified search service, or send the search request to the server providing unified search service through the gateway device, and the unified search server provides the search result, so that the search efficiency is improved, and the existence of multiple networks is hidden in the lightweight node.
According to the technical scheme of the embodiment of the application, the associated block chain network is allocated to the lightweight node equipment in a targeted manner through the activation server, so that the problem that the block chain network load is large and the uplink transaction request of the lightweight node equipment cannot be processed in time due to the fact that a large number of lightweight node equipment access the block chain network in a centralized manner is solved, the processing resources of the block chain network are reasonably allocated, and the effect of processing the uplink transaction request of the lightweight node equipment in time is achieved.
Fig. 2 is a flowchart illustrating another block chain based transaction processing method performed by an activation server according to an embodiment of the present application. The present embodiment is an alternative proposed on the basis of the above-described embodiments. Referring to fig. 2, the block chain-based transaction processing method provided in this embodiment includes:
s210, an activation request for applying to join the block chain network, which is sent by the lightweight node equipment, is obtained.
S220, comparing the number of the activated first total lightweight node devices in the existing block chain network with the number of second total lightweight node devices expected to be accommodated by the existing block chain network.
And determining the second total lightweight node equipment quantity according to the lightweight node equipment quantity expected to be accommodated by a single blockchain network and the existing blockchain network quantity. For example, the second total number of lightweight node devices may be the product of the number of lightweight node devices expected to be accommodated by a single blockchain network and the number of existing blockchain networks. The number of lightweight node equipment expected to be accommodated by the single blockchain network is determined according to the uplink time length of the single blockchain network.
For example, the uplink duration of the blockchain network may be a duration from the time the blockchain network receives the transaction request to the time the processing result is uplink stored, and may be determined by performing a stress test on the blockchain network. Determining the number of lightweight node equipment expected to be accommodated by the blockchain network according to the uplink duration, so that the uplink duration of the blockchain network can be smaller than the uplink duration threshold when the number of activated lightweight node equipment in the blockchain network reaches the number of lightweight node equipment expected to be accommodated. For example, if the uplink duration of a certain blockchain network is less than the uplink duration threshold, it may be said that the blockchain network has redundant computing power, and therefore the number of lightweight node devices that the blockchain network is expected to accommodate may be increased; on the contrary, if the uplink duration of a certain blockchain network is greater than or equal to the uplink duration threshold, it may be said that the processing pressure of the blockchain network is large, so that the number of lightweight node devices expected to be accommodated by the blockchain network may be reduced.
And S230, if the number of the first total lightweight node devices is equal to or greater than the number of the second total lightweight node devices, controlling to create a new blockchain network, and establishing an association relationship between the lightweight node devices and the new blockchain network.
For example, if the number of the first total lightweight node devices is equal to or greater than the number of the second total lightweight node devices, it indicates that the current block chain network does not have the capability of timely processing the uplink transaction request of the newly added lightweight node device, and at this time, if the existing block chain network is still used to process the uplink transaction request of the lightweight node device, the uplink transaction request may be failed to be processed or cannot be processed in time. Therefore, in the embodiment of the present application, the activation service may generate a transaction request for organizing and creating a new blockchain network, control and create the new blockchain network, and introduce new computing power to improve the uplink transaction request processing capability of the entire blockchain network.
In this embodiment of the present application, the blockchain network may be an independent network, and a new blockchain network may be created through an existing node device according to a transaction request for creating a new blockchain network by an organization of an activation server. The blockchain may also be a three-dimensional blockchain network, i.e. a super-chain network, comprising at least two blockchain networks, e.g. nodes A, B and C form one blockchain network, and nodes E, D and F form another blockchain network. The three-dimensional block chain network comprises a basic chain and at least one parallel chain network. The three-dimensional blockchain network can create a transaction request of a new blockchain network according to the organization of the activation server, and construct a new parallel chain based on the basic connection so as to improve the processing capacity of the blockchain network.
Because the existing blockchain network does not have enough processing capacity to process the uplink transaction request of the newly added lightweight node device, the activation server allocates the created new blockchain network for the newly added lightweight node device, establishes an association relationship between the newly added lightweight node device and the new blockchain network, so that when the lightweight node device generates the uplink transaction request, the uplink transaction request is sent to the associated new blockchain network, and the uplink transaction request is processed in time by the associated new blockchain network. The allocation policy of the blockchain network may be: each blockchain network bears a basically consistent number of lightweight node devices, and the lightweight node devices can be all allocated to the newly created blockchain network before balance is achieved.
S240, if the number of the first total lightweight node devices is smaller than the number of the second total lightweight node devices, distributing a block chain network for the lightweight node devices from the existing block chain network, and establishing an association relationship between the lightweight node devices and the distributed block chain network.
For example, if the number of the first total lightweight node devices is less than the number of the second total lightweight node devices, it indicates that the currently existing blockchain network still has the capability of processing the uplink transaction request of the newly added blockchain node device, and therefore, the association relationship between the lightweight node devices and the existing blockchain network may be established. When the activation server establishes the association relationship between the lightweight node device and the existing blockchain network, the current processing capacity of each blockchain network can be considered, and the distribution is balanced. For example, the association relationship may be established with reference to the number of lightweight node devices that a single blockchain network is expected to accommodate. If the number of the lightweight node devices associated with one blockchain network is greater than or equal to the number of the lightweight node devices expected to be accommodated by the blockchain network, the association relationship between the blockchain network and other lightweight node devices is not established. If the number of lightweight nodes associated with one blockchain network is smaller than the number of lightweight node devices expected to be accommodated by the blockchain network, the activation server allocates the blockchain network to the lightweight node device sending the activation request to establish an association relationship. Whether the association relationship between the blockchain network and the lightweight node device is established can also be determined by detecting the transaction processing capability of each blockchain network.
In this embodiment of the present application, the execution sequence of S230 and S240 is not specifically limited, and the executed steps may be determined according to the comparison result between the first total lightweight node device number and the second total lightweight node device number.
Fig. 3 is an overall block diagram of a specific implementation of another block chain-based transaction processing method performed by an activation server according to an embodiment of the present application. As shown in fig. 3, the activation server determines whether to allocate an existing blockchain network to the lightweight node device or to create a new blockchain network according to the number of activated lightweight node devices, and allocates the new blockchain network to the lightweight node device. And if the number of the activated lightweight nodes is larger than or equal to the number of the lightweight nodes expected to be accommodated by the existing blockchain network, creating a new blockchain network. And if the number of the activated lightweight nodes is less than that of the lightweight nodes expected to be accommodated by the existing blockchain network, measuring the load condition in the blockchain network through the load balancing server, and adaptively allocating the blockchain network with the processing capacity to the lightweight node equipment. After the block chain network processes the data, the data can be gathered to establish an index, and a search result is provided for the lightweight node equipment through the unified search server.
According to the method and the device, when the number of the first total lightweight node devices is equal to or larger than the number of the second total lightweight node devices, the creation of the new blockchain network is controlled, and the incidence relation between the lightweight node devices and the new blockchain network is established, so that new calculation power is introduced, and the uplink transaction request is guaranteed to be processed in time. When the number of the first total lightweight node equipment is less than the number of the second total lightweight node equipment, a block chain network is distributed for the lightweight node equipment from the existing block chain network, and an incidence relation between the lightweight node equipment and the distributed block chain network is established, so that the load of the existing block chain network is balanced, and the balance processing of the uplink transaction request is realized.
Fig. 4 is a flowchart illustrating a method for block chain based transaction processing performed by a lightweight node device according to an embodiment of the present application. The embodiment is applicable to the case where the blockchain network processes the uplink transaction request of the lightweight node device. Typically, this embodiment may be applied to a case where the activation service allocates an associated blockchain network for the lightweight node device according to the number of the lightweight node devices, so that the blockchain network processes the uplink transaction request of the lightweight node device. The block chain-based transaction processing method disclosed in this embodiment may be executed by an electronic device bearing a lightweight node, and specifically may be executed by a block chain-based transaction processing apparatus, which may be implemented by software and/or hardware and configured in the electronic device. Details such as noun explanations and the like which are not described in detail in the embodiments of the present application are described in detail in the above embodiments. Referring to fig. 4, the block chain based transaction processing method performed by a lightweight node device according to this embodiment includes:
and S310, generating an activation request for applying to join the block chain network.
The activation request may be generated by the lightweight node device, and sent to the activation server, so as to apply for joining the blockchain network to the activation server.
For example, the processing resources of the blockchain network and the capability of processing uplink transaction requests are limited, and if a large number of lightweight node devices are added to the blockchain network in an out-of-order centralized manner, the transaction requests of the lightweight nodes may not be processed in time. In order to solve the above problem, in the embodiment of the present application, before the lightweight node joins the blockchain network, an activation request for joining the blockchain network may be generated first to request to join the blockchain network, so as to avoid a problem that a large number of lightweight node devices simultaneously and irregularly access the blockchain network, which causes unbalanced load of the blockchain network, low processing capability, and inability to process uplink transaction requests of the lightweight node devices in time.
S320, sending the activation request to an activation server to instruct the activation server to distribute the associated blockchain network for the local node equipment.
Illustratively, an activation application for joining a blockchain is sent to the activation server, so that the activation server allocates a blockchain network which can be used for processing the transaction request of the lightweight node equipment, and the problems that the blockchain network is unbalanced in load, high in processing pressure and difficult to process the uplink transaction request in time due to the fact that a large number of lightweight node equipment are intensively joined into the blockchain network are solved. The activation server may specifically allocate an associated blockchain network to the lightweight node device, where the blockchain network may be an existing blockchain network or a newly created blockchain network. Because the associated blockchain network is distributed to the lightweight node equipment by the activation server instead of enabling the lightweight node equipment to centrally access the blockchain network in an unordered manner at the same time, the blockchain network with calculation capability can be distributed to the lightweight node equipment, so that the blockchain network associated with the lightweight node equipment can be ensured to be capable of timely and effectively processing the uplink transaction request of the lightweight node equipment.
In this embodiment of the present application, after sending the activation request to the activation server, the method further includes: generating an uplink transaction request; and sending the uplink transaction request to the block chain network associated with the local node equipment to instruct the associated block chain network to process the uplink transaction request.
The uplink transaction request may be a write request, such as a transaction uplink request, a contract execution request, etc., or a read request, such as a transaction query request, a block query request, etc. The home node equipment may collectively send an uplink transaction request to its associated blockchain network to instruct the associated blockchain network to process the uplink transaction request. In an embodiment of the present application, the sending the uplink transaction request to the blockchain network associated with the local node device may include: and sending the uplink transaction request to gateway equipment to indicate the gateway equipment to distribute the transaction processing request to a block chain network associated with local node equipment according to the association relationship between the lightweight node equipment and the block chain network. For example, after allocating the associated blockchain network to the lightweight node device, the activation server stores the association relationship between the lightweight node device and the blockchain network in a gateway device, which may be at least one unified gateway. When the lightweight power-saving equipment generates an uplink transaction request, the uplink transaction request is sent to the gateway equipment, the gateway equipment sends the uplink transaction request to the block chain network associated with the lightweight node according to the pre-stored association relationship between the lightweight node equipment and the block chain network, and the block chain network carries out timely and orderly processing on the uplink transaction request.
According to the method and the device, the activation request is generated and sent to the activation server, so that the activation server can know the number of the currently activated lightweight node devices, and then the block chain network is allocated to the local node devices in a targeted manner, the problem that the block chain network is large in load and cannot process the uplink transaction request of the lightweight node devices in time due to the fact that a large number of lightweight node devices visit the block chain network in a centralized manner is solved, processing resources of the block chain network are reasonably allocated, and the effect of processing the uplink transaction request of the lightweight node devices in time is achieved.
Fig. 5 is a schematic structural diagram of a block chain-based transaction processing device configured in an activation server according to an embodiment of the present application. Referring to fig. 5, an embodiment of the present application discloses a block chain-based transaction processing apparatus 400, where the apparatus 400 includes: an activation request acquisition module 401 and an allocation module 402.
The activation request obtaining module 401 is configured to obtain an activation request, which is sent by a lightweight node device and applies for joining a blockchain network;
an allocating module 402, configured to allocate an associated blockchain network for the lightweight node device, and configured to process an uplink transaction request initiated by the lightweight node device through the associated blockchain network.
Further, the allocating module 402 includes:
a comparing unit, configured to compare the number of activated first total lightweight node devices in an existing blockchain network with the number of second total lightweight node devices expected to be accommodated by the existing blockchain network;
and the new block chain network creating unit is used for controlling to create a new block chain network and establishing an association relation between the lightweight node equipment and the new block chain network if the number of the first total lightweight node equipment is equal to or greater than the number of the second total lightweight node equipment.
Further, the apparatus further comprises:
and the existing block chain network allocation module is used for allocating a block chain network for the lightweight node equipment from the existing block chain network and establishing an association relationship between the lightweight node equipment and the allocated block chain network if the number of the first total lightweight node equipment is less than the number of the second total lightweight node equipment.
Further, the second total number of lightweight node devices is determined according to the number of lightweight node devices expected to be accommodated by a single blockchain network and the number of existing blockchain networks.
Further, the number of lightweight node devices that the single blockchain network is expected to accommodate is determined according to the uplink duration of the single blockchain network.
The block chain-based transaction processing device configured in the activation server according to the embodiment of the present application can execute the block chain-based transaction processing method executed by the activation server according to any embodiment of the present application, and has functional modules corresponding to the execution method and advantageous effects.
Fig. 6 is a schematic structural diagram of a transaction processing apparatus configured in a lightweight node device and based on a blockchain according to an embodiment of the present disclosure. Referring to fig. 6, an embodiment of the present application discloses a block chain based transaction processing apparatus 500, where the apparatus 500 includes: an activation request generation module 501 and an activation request transmission module 502.
The activation request generating module 501 is configured to generate an activation request for applying to join a blockchain network;
an activation request sending module 502, configured to send the activation request to an activation server to instruct the activation server to allocate an associated blockchain network for a local node device.
Further, the apparatus further comprises:
a uplink transaction request generating module for generating an uplink transaction request;
an uplink transaction request sending module, configured to send the uplink transaction request to a blockchain network associated with the local node device, so as to instruct the associated blockchain network to process the uplink transaction request.
Further, the uplink transaction request sending module is specifically configured to:
and sending the uplink transaction request to gateway equipment to indicate the gateway equipment to distribute the uplink transaction request to a block chain network associated with local node equipment according to the association relationship between the lightweight node equipment and the block chain network.
The block chain-based transaction processing device configured in the lightweight node device according to the embodiment of the present application can execute the block chain-based transaction processing method executed by the lightweight node device according to any embodiment of the present application, and has functional modules corresponding to the execution method and beneficial effects.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 7, fig. 7 is a block diagram of an electronic device for implementing a transaction processing method based on a blockchain according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, electronic devices, blade electronics, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable electronic devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 7, the electronic device may be an activation server or a lightweight node device, and the electronic device includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The electronic device may implement the method performed by the activation server, or the method performed by the lightweight node device, or the method performed by the electricity vendor. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output device (such as a display electronic device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each electronic device providing portions of the necessary operations (e.g., as an array of electronic devices, a set of blade-like electronic devices, or a multi-processor system). Fig. 7 illustrates an example of a processor 601.
The memory 602 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the blockchain based transaction method provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the blockchain based transaction method provided herein.
The memory 602, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method for blockchain based transaction processing in the embodiments of the present application (for example, the activation request obtaining module 401 and the assignment module 402 shown in fig. 4, or the activation request generating module 501 and the activation request sending module 502 shown in fig. 5). The processor 601 executes various functional applications and data processing of the electronic device by running non-transitory software programs, instructions and modules stored in the memory 602, that is, implements the block chain based transaction processing method in the above method embodiment.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created from use of the electronic device based on transactions of the block chain, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 602 optionally includes memory located remotely from processor 601, and these remote memories may be connected over a network to the blockchain based transaction electronics. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the transaction processing method based on the blockchain may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 7 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the blockchain based transaction electronic device, such as a touch screen, keypad, mouse, track pad, touch pad, pointing stick, one or more mouse buttons, track ball, joystick, etc. the output device 604 may include display electronics, auxiliary lighting devices (e.g., L ED), and tactile feedback devices (e.g., vibrating motors), etc.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, electronic device, and/or apparatus (e.g., magnetic discs, optical disks, memory, programmable logic devices (P L D)) that provides machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal.
The systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or L CD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer for providing interaction with the user.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as data electronics), or that includes a middleware component (e.g., AN application electronics), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with AN implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components.
The computer system may include a client and an electronic device. The client and the electronic device are generally remote from each other and typically interact through a communication network. The relationship of client and electronic device arises by virtue of computer programs running on the respective computers and having a client-electronic device relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A blockchain-based transaction processing method, performed by an activation server, the method comprising:
acquiring an activation request for applying to join a block chain network, which is sent by lightweight node equipment;
and allocating an associated blockchain network for the lightweight node equipment, wherein the associated blockchain network is used for processing the uplink transaction request initiated by the lightweight node equipment through the associated blockchain network.
2. The method of claim 1, wherein assigning the lightweight node device with an associated blockchain network comprises:
comparing the number of activated first total lightweight node devices in the existing block chain network with the number of second total lightweight node devices expected to be accommodated by the existing block chain network;
and if the number of the first total lightweight node devices is equal to or greater than the number of the second total lightweight node devices, controlling to create a new blockchain network, and establishing an association relationship between the lightweight node devices and the new blockchain network.
3. The method of claim 2, wherein comparing the activated first total lightweight node device count in the existing blockchain network with the expected second total lightweight node device count accommodated by the existing blockchain network further comprises:
and if the number of the first total lightweight node devices is less than the number of the second total lightweight node devices, allocating a block chain network for the lightweight node devices from the existing block chain network, and establishing an association relationship between the lightweight node devices and the allocated block chain network.
4. The method according to claim 2 or 3, wherein the second total number of lightweight node devices is determined according to the number of lightweight node devices expected to be accommodated by a single blockchain network and the number of existing blockchain networks.
5. The method of claim 4, wherein the number of lightweight node devices that the single blockchain network is expected to accommodate is determined according to an uplink duration of the single blockchain network.
6. The transaction data processing method based on the block chain is characterized by being executed by a lightweight node device, and comprises the following steps:
generating an activation request for applying to join the block chain network;
sending the activation request to an activation server to instruct the activation server to allocate an associated blockchain network for a local node device.
7. The method of claim 6, wherein after sending the activation request to an activation server, further comprising:
generating an uplink transaction request;
and sending the uplink transaction request to the block chain network associated with the local node equipment to instruct the associated block chain network to process the uplink transaction request.
8. The method of claim 7 wherein sending the uplink transaction request to a blockchain network associated with a local node equipment comprises:
and sending the uplink transaction request to gateway equipment to indicate the gateway equipment to distribute the uplink transaction request to a block chain network associated with local node equipment according to the association relationship between the lightweight node equipment and the block chain network.
9. A blockchain-based transaction processing apparatus configured to an activation server, the apparatus comprising:
the activation request acquisition module is used for acquiring an activation request which is sent by the lightweight node equipment and applies for joining the blockchain network;
and the allocating module is used for allocating the associated blockchain network for the lightweight node equipment, and is used for processing the uplink transaction request initiated by the lightweight node equipment through the associated blockchain network.
10. A blockchain-based transaction processing apparatus configured to be deployed in a lightweight node device, the apparatus comprising:
the activation request generation module is used for generating an activation request for applying to join the block chain network;
and the activation request sending module is used for sending the activation request to an activation server so as to instruct the activation server to distribute the associated blockchain network for the local node equipment.
11. A blockchain-based transaction device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the blockchain based transaction method performed by the activation server of any one of claims 1 to 5 or to perform the blockchain based transaction method performed by the lightweight node device of any one of claims 6 to 8.
12. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the blockchain based transaction method performed by an activation server of any one of claims 1 to 5 or the blockchain based transaction method performed by a lightweight node device of any one of claims 6 to 8.
CN202010187773.0A 2020-03-17 2020-03-17 Transaction processing method and device based on block chain, electronic equipment and medium Active CN111416860B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010187773.0A CN111416860B (en) 2020-03-17 2020-03-17 Transaction processing method and device based on block chain, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010187773.0A CN111416860B (en) 2020-03-17 2020-03-17 Transaction processing method and device based on block chain, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN111416860A true CN111416860A (en) 2020-07-14
CN111416860B CN111416860B (en) 2023-03-10

Family

ID=71494214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010187773.0A Active CN111416860B (en) 2020-03-17 2020-03-17 Transaction processing method and device based on block chain, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN111416860B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363348A (en) * 2021-10-28 2022-04-15 安徽中科晶格技术有限公司 Block chain-based packet network secure communication method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077674A (en) * 2016-12-29 2017-08-18 深圳前海达闼云端智能科技有限公司 Transaction verification processing method and device and node equipment
US20190180047A1 (en) * 2017-12-08 2019-06-13 Nec Europe Ltd. Method and system of preserving privacy for usage of lightweight blockchain clients
CN110493268A (en) * 2019-09-24 2019-11-22 腾讯科技(深圳)有限公司 A kind of data processing method and device based on block chain network
CN110601816A (en) * 2019-09-18 2019-12-20 腾讯科技(深圳)有限公司 Lightweight node control method and device in block chain system
WO2020006138A1 (en) * 2018-06-29 2020-01-02 Arcblock, Inc. Blockchain adapter, protocol, and access layer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107077674A (en) * 2016-12-29 2017-08-18 深圳前海达闼云端智能科技有限公司 Transaction verification processing method and device and node equipment
US20190180047A1 (en) * 2017-12-08 2019-06-13 Nec Europe Ltd. Method and system of preserving privacy for usage of lightweight blockchain clients
WO2020006138A1 (en) * 2018-06-29 2020-01-02 Arcblock, Inc. Blockchain adapter, protocol, and access layer
CN110601816A (en) * 2019-09-18 2019-12-20 腾讯科技(深圳)有限公司 Lightweight node control method and device in block chain system
CN110493268A (en) * 2019-09-24 2019-11-22 腾讯科技(深圳)有限公司 A kind of data processing method and device based on block chain network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHAINGOOD: "区块链全节点与区块链轻节点的区别", 《CSDN BLOG.CSDN.NET/CHAINGOOD/ARTICLE/DETAILS/89451209》 *
PAUL KRIER等: "Lightweight key agreement with key chainingwith key chaining", 《THE 7TH IEEE INTERNATIONAL CONFERENCE ON MOBILE AD-HOC AND SENSOR SYSTEMS (IEEE MASS 2010)》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363348A (en) * 2021-10-28 2022-04-15 安徽中科晶格技术有限公司 Block chain-based packet network secure communication method and device

Also Published As

Publication number Publication date
CN111416860B (en) 2023-03-10

Similar Documents

Publication Publication Date Title
US11700300B2 (en) Cluster resource management in distributed computing systems
US7970852B2 (en) Method for moving operating systems between computer electronic complexes without loss of service
CN104299466A (en) Remote hardware experimental method and system based on cloud computing platform
CN103369054B (en) A kind of acquisition tasks management method and system
CN110458468A (en) A kind of task processing method, device, electronic equipment and storage medium
EP2603857A2 (en) Methods and systems for platform optimized design
CN109729106A (en) Handle the method, system and computer program product of calculating task
US11843674B2 (en) Virtual workspace experience visualization and optimization
WO2020119189A1 (en) Method, system and apparatus for sharing of fpga board by multiple virtual machines
US20120144157A1 (en) Allocation of Mainframe Computing Resources Using Distributed Computing
WO2022199204A1 (en) Method and apparatus for determining resources
Singh et al. Auto-sizing for Stream Processing Applications at {LinkedIn}
US10673983B2 (en) Processing a unit of work
CN111416860B (en) Transaction processing method and device based on block chain, electronic equipment and medium
CN111740859B (en) Test environment deployment method and device, electronic equipment and storage medium
CN113760638A (en) Log service method and device based on kubernets cluster
CN112181942A (en) Time sequence database system and data processing method and device
Shelar et al. Efficient virtual machine placement with energy saving in cloud data center
Li et al. Building an HPC-as-a-service toolkit for user-interactive HPC services in the cloud
CN103634344A (en) Method and apparatus for unit operation multiple MySQL database examples
CN113726902A (en) Calling method and system of microservice
US20210109786A1 (en) Virtual machine operation management in computing devices
US11509562B1 (en) System and method for a system level data sharding analysis of information handling systems
Jun et al. GPGPU enabled HPC cloud platform based on OpenStack
US11782872B2 (en) Distribution of over-configured logical processors

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant