CN113282570B - Block link point allocation method, computer device and storage medium - Google Patents
Block link point allocation method, computer device and storage medium Download PDFInfo
- Publication number
- CN113282570B CN113282570B CN202110569235.2A CN202110569235A CN113282570B CN 113282570 B CN113282570 B CN 113282570B CN 202110569235 A CN202110569235 A CN 202110569235A CN 113282570 B CN113282570 B CN 113282570B
- Authority
- CN
- China
- Prior art keywords
- node
- query
- nodes
- current node
- configuration
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Abstract
The invention provides a block link point allocation method, computer equipment and a storage medium, wherein the method comprises the following steps: in response to the current node configuration being modified from a common node to a query service node, rejecting to receive transactions sent by a user terminal or other blockchain nodes, stopping broadcasting transactions to other blockchain nodes, stopping a consensus function, synchronizing new blocks successfully consensus from other nodes and executing to update a local state database; and in response to the current node configuration being modified from a common node to a query unorthodox node, closing a block chain query interface which is open to the outside by the current node. The invention ensures the query response speed on one hand and ensures that tps of transaction execution is not influenced by receiving a large number of query requests on the other hand by separating the query service and the consensus correlation function.
Description
Technical Field
The application relates to the technical field of internet, in particular to a block link point configuration method, computer equipment and a storage medium.
Background
In current blockchain systems, each blockchain node typically performs the same procedure, and each node typically needs to both participate in the consensus of the blockchain (typically including broadcasting transactions, storing transactions in a local transaction pool, packing some or all transactions in the transaction pool into blocks under certain conditions, performing each transaction in a block, broadcasting the block, or receiving and verifying a block, etc.), and respond to a query from the user.
In the system, on one hand, the query response speed of the block chain node is limited by applying most of computing resources and network resources of the node to consensus-related operations; on the other hand, when a large number of query requests are received in the node set, the efficiency of participation in consensus of the node is also affected, and tps of transaction execution is reduced.
Disclosure of Invention
In view of the above-mentioned drawbacks or deficiencies in the prior art, it is desirable to provide a block link point configuration method, a computer device, and a storage medium, which separately secure query response speed by separating query service and consensus-related functions, and which do not affect tps of transaction execution by a large number of query requests.
In a first aspect, the present invention provides a block link point allocation method, including:
responding to the modification of the configuration of the current node from a common node to an inquiry service node, refusing to receive transactions sent by a user terminal or other blockchain nodes, stopping broadcasting the transactions to other blockchain nodes, stopping a consensus function, synchronizing new blocks successfully consensus from other nodes and executing to update a local state database;
and in response to the current node configuration being modified from a common node to a query unorthodox node, closing a block chain query interface which is open to the outside by the current node.
In a second aspect, the present invention also provides a computer apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a block link point allocation method provided according to embodiments of the present invention.
In a third aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute the block link point allocation method provided according to the embodiments of the present invention.
On one hand, the block link point configuration method, the computer device and the storage medium provided by the embodiments of the present invention stop the transceiving transaction and the consensus function when the current node is configured as the query service node, and only synchronize and agree successfully from other nodes for a new block, thereby greatly reducing the consumption of the computing resources and the network resources on the consensus related function by the node, and ensuring the query response speed of the query service node; on the other hand, the block chain query interface of the current node is closed when the current node is configured as a query unorthodox node, so that tps of transaction execution is not influenced by receiving a large number of query requests.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a block link point allocation method according to an embodiment of the present invention.
FIG. 2 is a flow diagram of a preferred embodiment of the method shown in FIG. 1.
FIG. 3 is a flow diagram of a preferred embodiment of the method shown in FIG. 1.
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of a block link point allocation method according to an embodiment of the present invention.
As shown in fig. 1, in the present embodiment, the present invention provides a block link point arrangement method, including:
s11: responding to the modification of the configuration of the current node from a common node to an inquiry service node, refusing to receive transactions sent by a user terminal or other blockchain nodes, stopping broadcasting the transactions to other blockchain nodes, stopping a consensus function, synchronizing new blocks successfully consensus from other nodes and executing to update a local state database;
s12: and closing the block chain query interface which is opened to the outside by the current node in response to the condition that the configuration of the current node is modified from the common node to the query unorthodox node.
Specifically, the method shown in fig. 1 can be applied to both an application scenario of a federation chain and an application scenario of a public chain. Which will be illustrated separately below.
First, taking an example that a federation chain network includes 15 federation chain nodes 1-node15, the methods shown in fig. 1 are applied to the 15 nodes respectively:
if the 15 nodes are under the control of the same control party, the control party can directly carry out configuration; if the 15 nodes are under the control of a plurality of control parties, each control party can make an agreement on what configuration should be performed on each node by means of negotiation or the like.
For example, multiple controllers negotiate an agreement to configure node1-node3 as a query serving node, node4-node15 as a query servant node;
then, node1-node3 respectively perform step S11, and node4-node15 respectively perform step S12.
Take node1 and node4 as examples respectively:
after a controller of node1 modifies the configuration of node1 from a common node to an inquiry service node, node1 rejects transactions submitted by a receiving user side, rejects transactions broadcast by node2-node15, stops storing the received transactions in a memory pool, and packages the transactions in the memory pool into blocks and other multiple consensus functions; at this point, node1 only needs to receive and execute the new blocks broadcast by node4-node15 that pass through consensus to update the local state database and focus on processing the received query request;
after a controller of node4 modifies the configuration of node4 from a common node to an inquiry inode, node4 closes a block chain inquiry interface opened to the outside by current node 4; at this time, node4 does not need to process the query request sent by the user end or other node.
Taking an example that a public chain comprises 3000 blockchain link nodes 0001-node3000, and a developer applying a blockchain applies the method shown in fig. 1 on 3 nodes 2000-node2002 controlled by the developer:
For a public chain comprising 3000 blockchain nodes, it is clear that no individual or organization can coordinate all the nodes to apply the method shown in fig. 1 at the same time; however, when a certain block chain application suddenly explodes, a large number of newly added users may bring a large number of newly added query requests, and for the existing scheme, it is certain that the query response speed of some block chain nodes is slow, resulting in poor user experience of the newly added users.
To address the above problem, the developer of the application may then configure the 3 nodes 2000-2002 that it controls as query service nodes.
The process of the node2000-node2002 for executing the step S11 is the same as the process of the node1 for executing the step S11, and is not described in detail.
After the node2000-node2002 is configured as the query service node, the user experience of the newly added user is not influenced by slow query response speed, and the influence of other nodes on receiving a large number of query requests is greatly reduced.
On one hand, the embodiments greatly reduce the computing resources and network resources consumed by the nodes on the consensus related function by stopping the transceiving transaction and the consensus function and only synchronizing the new blocks successfully in the consensus from other nodes when the current node is configured as the query service node, thereby ensuring the query response speed of the query service node; on the other hand, the block chain query interface of the current node is closed when the current node is configured as a query unorthodox node, so that tps of transaction execution is not influenced by receiving a large number of query requests.
FIG. 2 is a flow diagram of a preferred embodiment of the method of FIG. 1. As shown in fig. 2, in a preferred embodiment, the method further comprises:
s13: responding to the configuration of the current node, modifying the current node from the inquiry service node to a common node, recovering the transaction sent by the receiving user terminal or other block chain nodes, recovering the broadcast transaction to other block chain nodes, and recovering the consensus function;
s14: and opening a block chain query interface opened to the outside by the current node in response to the modification of the configuration of the current node from the query unorthodox node to the normal node.
Specifically, the reverse operation of step S13, step S11, the reverse operation of step S14, step S12, the control of the node can be flexibly configured by a combination of steps S11-S14.
FIG. 3 is a flow diagram of a preferred embodiment of the method shown in FIG. 1. As shown in fig. 3, in a preferred embodiment, the method further includes:
s15: responding to the modification of the configuration of the current node from the query unorthodox node to the query service node, opening a blockchain query interface opened by the current node to the outside, refusing to receive transactions sent by a user terminal or other blockchain nodes, stopping broadcasting the transactions to other blockchain nodes, stopping a consensus function, synchronizing new blocks successfully known from other nodes and executing to update a local state database;
S16: and in response to the current node configuration being modified from the query service node to the query unorthodox node, closing the block chain query interface opened to the outside by the current node, recovering the transaction sent by the receiving user terminal or other block chain nodes, recovering the transaction broadcast to other block chain nodes, and recovering the consensus function.
Specifically, steps S15 and S16 are used to directly switch the node configuration between the query service node and the query unorthodox node, so that the controller of the node does not need to modify the node configuration back to the ordinary node. The control of the nodes can be flexibly configured by a combination of steps S11-S16.
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
As shown in fig. 4, as another aspect, the present application also provides a computer apparatus 400 including one or more Central Processing Units (CPUs) 401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the device 400 are also stored. The CPU401, ROM402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input portion 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411.
As still another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present application.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (4)
1. A block link point allocation method, comprising:
in response to the current node configuration being modified from a common node to a query service node, rejecting to receive transactions sent by a user terminal or other blockchain nodes, stopping broadcasting transactions to other blockchain nodes, stopping a consensus function, synchronizing new blocks successfully consensus from other nodes and executing to update a local state database;
Responding to the configuration of the current node, modifying the configuration from a common node to a query unorthodox node, and closing a block chain query interface which is opened by the current node to the outside;
responding to the modification of the configuration of the current node from the query unrelated node to the query service node, opening a blockchain query interface opened by the current node to the outside, refusing to receive transactions sent by a user terminal or other blockchain nodes, stopping broadcasting transactions to other blockchain nodes, stopping a consensus function, synchronizing new blocks successfully known by the consensus from other nodes, and executing to update a local state database;
and in response to the current node configuration being modified from the query service node to the query unorthodox node, closing the block chain query interface opened to the outside by the current node, recovering the transaction sent by the receiving user terminal or other block chain nodes, recovering the transaction broadcast to other block chain nodes, and recovering the consensus function.
2. The method of claim 1, further comprising:
responding to the modification of the configuration of the current node from the inquiry service node to a common node, recovering the transaction sent by the receiving user terminal or other block chain nodes, recovering the broadcast transaction to other block chain nodes, and recovering the consensus function;
And in response to the configuration of the current node being modified from the query-agnostic node to a normal node, opening a blockchain query interface opened by the current node to the outside.
3. A computer device, characterized in that the device comprises:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited by any of claims 1-2.
4. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110569235.2A CN113282570B (en) | 2021-05-25 | 2021-05-25 | Block link point allocation method, computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110569235.2A CN113282570B (en) | 2021-05-25 | 2021-05-25 | Block link point allocation method, computer device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113282570A CN113282570A (en) | 2021-08-20 |
CN113282570B true CN113282570B (en) | 2022-06-28 |
Family
ID=77281279
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110569235.2A Active CN113282570B (en) | 2021-05-25 | 2021-05-25 | Block link point allocation method, computer device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113282570B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107018125A (en) * | 2017-02-17 | 2017-08-04 | 阿里巴巴集团控股有限公司 | A kind of block catenary system, date storage method and device |
CN107257341A (en) * | 2017-06-21 | 2017-10-17 | 济南浪潮高新科技投资发展有限公司 | A kind of student status based on block chain reviews authentication method |
CN109408551A (en) * | 2018-08-06 | 2019-03-01 | 杭州复杂美科技有限公司 | Data query method and system, common recognition method and system, equipment and storage medium |
JP2020126409A (en) * | 2019-02-04 | 2020-08-20 | 株式会社日立製作所 | Data managing system and data managing method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107395659B (en) * | 2017-03-28 | 2021-08-24 | 创新先进技术有限公司 | Method and device for service acceptance and consensus |
-
2021
- 2021-05-25 CN CN202110569235.2A patent/CN113282570B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107018125A (en) * | 2017-02-17 | 2017-08-04 | 阿里巴巴集团控股有限公司 | A kind of block catenary system, date storage method and device |
CN107257341A (en) * | 2017-06-21 | 2017-10-17 | 济南浪潮高新科技投资发展有限公司 | A kind of student status based on block chain reviews authentication method |
CN109408551A (en) * | 2018-08-06 | 2019-03-01 | 杭州复杂美科技有限公司 | Data query method and system, common recognition method and system, equipment and storage medium |
JP2020126409A (en) * | 2019-02-04 | 2020-08-20 | 株式会社日立製作所 | Data managing system and data managing method |
Non-Patent Citations (1)
Title |
---|
郭上铜等.区块链技术原理与应用综述.《计算机科学》.2021, * |
Also Published As
Publication number | Publication date |
---|---|
CN113282570A (en) | 2021-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020001370A1 (en) | Multi-chain concurrent transaction method | |
CN107045454B (en) | Cross-process distributed transaction control method and related system | |
US7801997B2 (en) | Asynchronous interconnect protocol for a clustered DBMS | |
US9055065B2 (en) | Managing participant order in distributed transactions | |
US9218401B2 (en) | Systems and methods for remote access to DB2 databases | |
US9218226B2 (en) | System and methods for remote access to IMS databases | |
US20090234906A1 (en) | Computer processing system for realizing data upgrade and a data upgrading method | |
CN111078516A (en) | Distributed performance test method and device and electronic equipment | |
CA3059719A1 (en) | Payment processing method, device, medium and electronic device | |
CN114358921A (en) | System switching method, apparatus, device, medium, and program product | |
CN105373563B (en) | Database switching method and device | |
CN113282570B (en) | Block link point allocation method, computer device and storage medium | |
CN109889406A (en) | For managing method, apparatus, equipment and the storage medium of network connection | |
CN116954944A (en) | Distributed data stream processing method, device and equipment based on memory grid | |
CN111597035A (en) | Simulation engine time advancing method and system based on multiple threads | |
CN114979286B (en) | Access control method, device, equipment and computer storage medium for container service | |
US10102032B2 (en) | Fast transitions for massively parallel computing applications | |
CN116414527A (en) | Method and system for greatly improving performance of distributed transaction coordinator | |
CN109491768A (en) | A kind of distributed transaction method for dynamically processing and system based on subtransaction stream | |
CN115170321A (en) | Method and device for processing batch transaction data | |
CN110381150B (en) | Data processing method and device on block chain, electronic equipment and storage medium | |
CN115250276A (en) | Distributed system and data processing method and device | |
US20160110216A1 (en) | System and method for supporting transaction affinity based request handling in a middleware environment | |
CN111866171B (en) | Message processing method, device, electronic equipment and medium | |
CN111292028A (en) | Inventory information processing method and system, computer system and readable storage medium |
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 |