CN111416860B - 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
CN111416860B
CN111416860B CN202010187773.0A CN202010187773A CN111416860B CN 111416860 B CN111416860 B CN 111416860B CN 202010187773 A CN202010187773 A CN 202010187773A CN 111416860 B CN111416860 B CN 111416860B
Authority
CN
China
Prior art keywords
lightweight node
block chain
node devices
network
chain network
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.)
Active
Application number
CN202010187773.0A
Other languages
Chinese (zh)
Other versions
CN111416860A (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a transaction processing method, a transaction processing device, electronic equipment and a transaction processing medium based on a block chain, and relates to the technical field of block chains. When the method is executed by the activation server, the specific implementation scheme is as follows: acquiring an activation request which is sent by lightweight node equipment and applies for joining a block chain network; 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 transaction processing method and apparatus, an electronic device, and a medium based on a block chain.
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 equipment is equal to or greater than the number of the second total lightweight node equipment, controlling to create a new blockchain network, and establishing an association relationship between the lightweight node equipment 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 devices is equal to or more than the number of second total lightweight node devices expected to be accommodated by the existing block chain network, a new block chain network is created, so that the new block chain network processes uplink transaction requests of the lightweight node devices in time, and the processing burden of the existing block chain network is effectively relieved.
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 smaller than the number of second total lightweight node equipment expected to be accommodated by the existing block chain network, the light weight node equipment coordinates and distributes the block chain network to process the uplink transaction request according to the computing force condition of the existing block chain network, so that the load balance of the block chain network is realized, and the uplink transaction request of the light weight 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 embodiments have the following advantages or beneficial 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 that the single blockchain network is expected to accommodate 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 a 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 embodiments have the following advantages or beneficial effects: by sending an uplink transaction request to a blockchain network associated with the local node device, the associated blockchain network can process the uplink transaction request in time.
Further, sending the uplink transaction request to a blockchain network associated with a local node device 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 embodiments have the following advantages or beneficial effects: the uplink transaction requests are distributed orderly through the gateway equipment according to the incidence relation between the lightweight node equipment and the block chain network, and the distribution efficiency is improved.
The embodiment of the present application further discloses a transaction processing apparatus based on a block chain, configured on 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 distribution module is used for distributing 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 distributed 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 time length 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 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.
Also disclosed is a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a blockchain-based transaction processing method performed by an activation server as in any one of the embodiments of the present application or perform a blockchain-based transaction processing method performed by a lightweight node device as in 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 flowchart illustrating a method for processing a transaction based on a blockchain executed 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 transaction processing based on a blockchain executed 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 to assist in understanding, 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, are 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 blockchain-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 method for transaction processing based on a blockchain executed by an 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 the 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 for 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 for the lightweight node equipment, so that the blockchain network associated with the lightweight node equipment can timely and effectively process 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 the 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 constructing an inverted index by analyzing data in the block chain network 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 search results to improve search efficiency and hide the existence of multiple networks for 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 schematic flowchart of another block chain-based transaction processing method executed by an activation server according to an embodiment of the present application. This embodiment is an alternative proposed on the basis of the above-described embodiments. Referring to fig. 2, the transaction processing method based on a block chain 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 when the blockchain network receives the transaction request to when the processing result is uplink stored, and may be determined by performing a pressure 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 indicate that the blockchain network has redundant computation, so that the number of lightweight node devices expected to be accommodated by the blockchain network 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, a problem may be caused that the processing of the uplink transaction request fails or cannot be timely processed. 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 equipment, the activation server allocates the created new blockchain network for the newly added lightweight node equipment, establishes the association relationship between the newly added lightweight node equipment and the new blockchain network, so that when the lightweight node equipment generates an 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 allocation 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 the 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, and establishes 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 a 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 another specific implementation of a transaction processing method based on a blockchain executed 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. If the number of the activated lightweight nodes is smaller than that of lightweight nodes expected to be accommodated by the existing blockchain network, the load condition in the blockchain network is measured through the load balancing server, and the blockchain network with the processing capacity is adaptively distributed 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 device through the unified search server.
According to the embodiment of the application, when the number of the first total lightweight node equipment is equal to or greater than the number of the second total lightweight node equipment, the creation of the new blockchain network is controlled, and the incidence relation between the lightweight node equipment and the new blockchain network is established, so that new calculation power is introduced, and the uplink transaction request is ensured to be processed in time. When the number of the first total lightweight node equipment is smaller than that of the second total lightweight node equipment, distributing a block chain network for the lightweight node equipment from the existing block chain network, and establishing an association relation between the lightweight node equipment and the distributed block chain network, 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 block link 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. The details, such as the noun explanation, etc., 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:
s310, an activation request for applying for joining the block chain network is generated.
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 applying for joining the blockchain network may be generated first to request for joining the blockchain network, so as to avoid a problem that a large number of lightweight node devices collectively access the blockchain network in an unordered manner at the same time, which results in unbalanced load of the blockchain network, low processing capability, and incapability of timely processing an uplink transaction request of the lightweight node device.
S320, sending the activation request to an activation server to indicate the activation server to distribute the associated blockchain network for the local node equipment.
Exemplarily, an activation application for applying 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 device, and the problems that the blockchain network is unbalanced in load, large in processing pressure and difficult to process the uplink transaction request in time due to the centralized joining of a large number of lightweight node devices 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 for 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 for the lightweight node equipment, so that the blockchain network associated with the lightweight node equipment can timely and effectively process 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 association relationship between the lightweight node equipment and the block chain network, and the block chain network processes the uplink transaction request in time and in order.
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 time length 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 may execute the block chain-based transaction processing method executed by the activation server according to any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
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 transaction apparatus 500 based on a block chain, 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;
a uplink transaction request sending module, configured to send the uplink transaction request to the 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 may 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 exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 7, the electronic device may be an activation server or may be 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, if desired. Also, multiple electronic devices may be connected, with each electronic device providing some 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 allocation 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, which may be connected to the blockchain-based transaction electronics over a network. 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 electronic device based on transactions of the blockchain, such as a touch screen, keypad, mouse, trackpad, touchpad, pointing stick, one or more mouse buttons, trackball, joystick, or like input device. The output devices 604 may include display electronics, auxiliary lighting devices (e.g., LEDs), tactile feedback devices (e.g., vibrating motors), and the like. The display electronics may include, but are not limited to, liquid Crystal Displays (LCDs), light Emitting Diode (LED) displays, and plasma displays. In some implementations, the display electronics can be a touch screen.
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.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. 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 (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data electronic device), or that includes a middleware component (e.g., an application electronic device), 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 components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
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 devices 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, reordering, adding or deleting steps, may be used. 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, depending on 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 (10)

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;
distributing an associated block chain network for the lightweight node equipment, and processing an uplink transaction request initiated by the lightweight node equipment through the associated block chain network;
wherein the allocating an associated blockchain network for the lightweight node device 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;
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;
and if the number of the first total lightweight node devices is less 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.
2. The method of claim 1, wherein the second total number of lightweight node devices is determined according to a number of lightweight node devices expected to be accommodated by a single blockchain network and a number of existing blockchain networks.
3. The method of claim 2 wherein the number of lightweight node devices that the single blockchain network is expected to accommodate is determined based on an uplink duration of the single blockchain network.
4. 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 a 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;
wherein the allocating an associated blockchain network to a local node device 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;
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;
and if the number of the first total lightweight node devices is less 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.
5. The method of claim 4, wherein after sending the activation request to the 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.
6. The method of claim 5 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.
7. 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;
an allocating module, configured to allocate an associated blockchain network to the lightweight node device, and configured to process, through the associated blockchain network, an uplink transaction request initiated by the lightweight node device;
the distribution module comprises:
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;
a new block chain network creating unit, configured to control to create a new block chain network and establish an association relationship between the lightweight node devices and the new block chain network 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;
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.
8. 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;
an activation request sending module, 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;
wherein the allocating an associated blockchain network for local node devices 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;
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;
and if the number of the first total lightweight node devices is less 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.
9. A blockchain-based transaction device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
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 by the activation server of any one of claims 1-3 or to perform the blockchain based transaction method by the lightweight node device of any one of claims 4-6.
10. 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 3 or the blockchain based transaction method performed by a lightweight node device of any one of claims 4 to 6.
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 CN111416860A (en) 2020-07-14
CN111416860B true 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)

Families Citing this family (1)

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

Citations (4)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10783272B2 (en) * 2017-12-08 2020-09-22 Nec Corporation Method and system of preserving privacy for usage of lightweight blockchain clients

Patent Citations (4)

* 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
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
Lightweight key agreement with key chainingwith key chaining;Paul Krier等;《The 7th IEEE International Conference on Mobile Ad-hoc and Sensor Systems (IEEE MASS 2010)》;20101110;全文 *
区块链全节点与区块链轻节点的区别;ChainGood;《CSDN blog.csdn.net/ChainGood/article/details/89451209》;20190422;全文 *

Also Published As

Publication number Publication date
CN111416860A (en) 2020-07-14

Similar Documents

Publication Publication Date Title
CN111694646B (en) Resource scheduling method, device, electronic equipment and computer readable storage medium
JP7170768B2 (en) Development machine operation task processing method, electronic device, computer readable storage medium and computer program
CN111741026A (en) Cross-chain transaction request processing method, device, equipment and storage medium
CN111782147B (en) Method and device for cluster expansion and contraction capacity
US10924590B1 (en) Virtual workspace experience visualization and optimization
CN110458468A (en) A kind of task processing method, device, electronic equipment and storage medium
KR20140110486A (en) System for Resource Management in Mobile Cloud computing and Method thereof
US10673983B2 (en) Processing a unit of work
CN111740859B (en) Test environment deployment method and device, electronic equipment and storage medium
US9880884B2 (en) Resource allocation/de-allocation and activation/deactivation
US9509562B2 (en) Method of providing a dynamic node service and device using the same
CN113760638A (en) Log service method and device based on kubernets cluster
US8977752B2 (en) Event-based dynamic resource provisioning
CN111770176A (en) Traffic scheduling method and device
CN111416860B (en) Transaction processing method and device based on block chain, electronic equipment and medium
CN114924745A (en) Operation method and device of deep learning compiler and electronic equipment
US20150067097A1 (en) Managing data distribution to networked client computing devices
US20210264417A1 (en) Method and apparatus for processing resource of block chain, device and medium
CN111598571A (en) Transaction processing method, device, equipment and storage medium of block chain
CN112965806A (en) Method and apparatus for determining resources
CN111767149A (en) Scheduling method, device, equipment and storage equipment
CN113726902B (en) Micro-service calling method, system, server, equipment and storage medium
CN114090247A (en) Method, device, equipment and storage medium for processing data
CN112527368A (en) Cluster kernel version updating method and device, electronic equipment and storage medium
CN111835857A (en) Method and apparatus for accessing data

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