CN109819025B - Block chain extension method and system, electronic equipment and storage medium - Google Patents

Block chain extension method and system, electronic equipment and storage medium Download PDF

Info

Publication number
CN109819025B
CN109819025B CN201910046625.4A CN201910046625A CN109819025B CN 109819025 B CN109819025 B CN 109819025B CN 201910046625 A CN201910046625 A CN 201910046625A CN 109819025 B CN109819025 B CN 109819025B
Authority
CN
China
Prior art keywords
chain
extended
target
extension
block
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
CN201910046625.4A
Other languages
Chinese (zh)
Other versions
CN109819025A (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.)
Shenzhen Xunlei Network Technology Co Ltd
Original Assignee
Shenzhen Onething 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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201910046625.4A priority Critical patent/CN109819025B/en
Publication of CN109819025A publication Critical patent/CN109819025A/en
Priority to PCT/CN2019/094555 priority patent/WO2020147269A1/en
Application granted granted Critical
Publication of CN109819025B publication Critical patent/CN109819025B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a block chain extension method, a system, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: determining a chain to be expanded and the chain extension height of the chain to be expanded; creating an extended chain corresponding to the chain to be extended in a block chain system; synchronizing blocks in the extension chain before the chain extension height in the chain to be extended. According to the block chain extension method provided by the application, when the chain to be extended needs to be extended, a corresponding extended chain is established for the chain to be extended, and the block data of the extended chain is consistent with the chain to be extended. Before the chain extension is completed, the transaction routed to the chain to be extended can be normally processed, and after the chain extension is completed, part of requests on the chain to be extended are routed to the extended chain for processing, so that the chain extension operation of the block chain is realized.

Description

Block chain extension method and system, electronic equipment and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a method and a system for chain extension of a block chain, an electronic device, and a computer-readable storage medium.
Background
In a block chain system, the thunder chain is composed of 64 chains in total, the same program is run on each chain, and the requests of different users are forwarded to different chains for processing through a routing module. When excessive user requests from a chain result in reduced transaction processing performance, the chain needs to be extended, and the end result is that part of the requests from the old chain are routed to the new chain for processing.
Therefore, how to realize the chain extension operation of the block chain is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
An object of the present application is to provide a method and a system for chain extension of a block chain, an electronic device, and a computer-readable storage medium, which implement chain extension of the block chain.
To achieve the above object, the present application provides a method for chain extension of a block chain, comprising:
determining a chain to be expanded and the chain extension height of the chain to be expanded;
creating an extended chain corresponding to the chain to be extended in a block chain system;
synchronizing blocks in the extension chain before the chain extension height in the chain to be extended.
Wherein, determining the chain extension height of the chain to be extended comprises:
determining the current block height and the block growth speed of the chain to be expanded, and acquiring the expected chain extension duration of the chain to be expanded, which is set by a user terminal;
and determining the product of the expected chain extension time and the block growth speed and the sum of the current block height as the chain extension height of the chain to be extended.
The data structure of the block chain node in the block chain system comprises the identification of the block chain node, the chain extension height of a father node, the information of an extended chain, a start bit, an end bit and a modulus bit for calculating the extended chain.
Wherein, still include:
when a processing request is received, determining a target chain corresponding to a user account in the processing request;
judging whether the target chain has an extended chain or not and whether the current block height reaches the extended height of the target chain or not;
if yes, determining a response chain of the processing request according to the user account so that the response chain can process the processing request conveniently.
Determining a target chain corresponding to the user account in the processing request comprises:
determining a number of base chains of the blockchain system; wherein, the number of the basic chains is the number of the block chains when the block chain system is not subjected to chain extension operation;
performing a modulo operation of the base chain number on a first target bit of the user account in the processing request;
and determining the target chain according to the modulus obtaining result.
Wherein, still include:
and if the target chain does not have an extended chain or the current block height does not reach the extended height of the target chain, taking the target chain as a response chain of the processing request.
Determining a response chain of the processing request according to the user account includes:
determining the number of the extended chains of the target chain, and performing modulo operation of adding one to the number of the extended chains on a second target bit of the user account;
determining a candidate response chain according to the modulus result, and judging whether the candidate response chain is the same as the target chain;
if so, taking the target chain as the response chain; if not, judging whether the candidate response chain has an extended chain or not;
if yes, taking the candidate response chain as the target chain, and re-executing the step of judging whether the target chain has an extended chain and whether the current block height reaches the extended height of the target chain;
and if not, determining the candidate response chain as the response chain.
To achieve the above object, the present application provides an electronic device, which includes a memory and a processor, where the memory stores a block chain extension program executable on the processor, and the block chain extension program, when executed by the processor, implements the steps of the block chain extension method as described above.
To achieve the above object, the present application provides a block chain expanding system, comprising:
the determining module is used for determining a chain to be expanded and the chain extension height of the chain to be expanded;
the creating module is used for creating an extended chain corresponding to the chain to be extended in a block chain system;
and the synchronization module is used for synchronizing the blocks before the chain extension height in the chain to be extended in the extension chain.
To achieve the above object, the present application provides a computer readable storage medium, on which a block chain extension program is stored, and when executed by a processor, the block chain extension program implements the steps of the block chain extension method as described above.
To achieve the above object, the present application provides a computer program product comprising computer instructions which, when run on a computer, make the computer perform any of the block chain extension methods described above.
According to the scheme, the block chain extension method provided by the application comprises the following steps: determining a chain to be expanded and the chain extension height of the chain to be expanded; creating an extended chain corresponding to the chain to be extended in a block chain system; synchronizing blocks in the extension chain before the chain extension height in the chain to be extended.
According to the block chain extension method provided by the application, when the chain to be extended needs to be extended, a corresponding extended chain is established for the chain to be extended, and the block data of the extended chain is consistent with the chain to be extended. Before the chain extension is completed, the transaction routed to the chain to be extended can be normally processed, and after the chain extension is completed, part of requests on the chain to be extended are routed to the extended chain for processing, so that the chain extension operation of the block chain is realized. The application also discloses a block chain extension system, an electronic device and a computer readable storage medium, which can also achieve the technical effects.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flow chart of a block chain extension method disclosed in an embodiment of the present application;
fig. 2 is a flow chart of another block chain extension method disclosed in an embodiment of the present application;
fig. 3 is a flow chart of another block chain extension method disclosed in the embodiments of the present application;
FIG. 4 is a block diagram of a block chain expanding system according to an embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device disclosed in an embodiment of the present application;
fig. 6 is a block diagram of another electronic device disclosed in the embodiments of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
In the prior art, excessive user requests of a certain chain in the blockchain system may cause the performance of transaction processing to be reduced, so in the application, an extended chain is established for more user requests to be extended, and the blockdata of the extended chain is consistent with the chain to be extended. Before the chain extension is completed, the transaction routed to the chain to be extended can be normally processed, and after the chain extension is completed, part of requests on the chain to be extended are routed to the extended chain for processing, so that the chain extension operation of the block chain is realized.
The embodiment of the application discloses a block chain extension method, which realizes the chain extension operation of a block chain.
Referring to fig. 1, a flow chart of a block chain extension method disclosed in an embodiment of the present application is shown in fig. 1, and includes:
s101: determining a chain to be expanded and the chain extension height of the chain to be expanded;
in this step, firstly, the chain to be extended, which is requested by the user more, is determined, and the chain extension height of the chain is determined. As for the chain extension height, a user may directly set the chain extension height, or may set the desired chain extension time length in a manner, which is not specifically limited in this embodiment.
That is, the step of determining the chain extension height of the chain to be extended may include: determining the current block height and the block growth speed of the chain to be expanded, and acquiring the expected chain extension duration of the chain to be expanded, which is set by a user terminal; and determining the product of the expected chain extension time and the block growth speed and the sum of the current block height as the chain extension height of the chain to be extended.
The expected chain extension time is the interval time from the current time to the expected chain extension time. For example, the current block is 100, the block growth rate is 1 block per second, the user desires to perform automatic chain extension after 50 seconds, the desired chain extension time is 50, and the chain extension height is 100+ 50-150.
S102: creating an extended chain corresponding to the chain to be extended in a block chain system;
in this step, a corresponding extension chain is created for the chain to be extended. It should be noted that, in this embodiment, the number of extension chains is not limited, that is, one to-be-extended chain may correspond to one extension chain, or may correspond to multiple extension chains. In this embodiment, the level of chain extension is not limited, that is, the extended chain may be used as the chain to be extended again and the chain extension operation may be continued.
It should be noted that the correspondence between the chain to be extended and the extended chain may be stored according to the data structure of the block chain node. The data structure of the block chain node in this embodiment may include an identifier of the block chain node, a chain extension height, extension chain information, a start bit, an end bit, a modulus bit, and the like for calculating the extension chain. For example:
Figure BDA0001949403920000051
Figure BDA0001949403920000061
it can be understood that Sbit, Ebit and Mod can be used to calculate the extended chain, where Mod is the number of extended chains corresponding to the node plus one, and the child node information can store the identification information of the extended chain.
S103: synchronizing blocks in the extension chain before the chain extension height in the chain to be extended.
It can be understood that, in order to ensure that the extended chain can respond to the same processing request as the chain to be extended, in this step, it is necessary to synchronize, for the extended chain, the block before the chain extension Height in the chain to be extended, that is, synchronize the block with the Height value smaller than the Height value in the above data structure.
In the block chain extension method provided in this embodiment, when a chain to be extended needs to be extended, a corresponding extended chain is established for the chain to be extended, and block data of the extended chain is consistent with the chain to be extended. Before the chain extension is completed, the transaction routed to the chain to be extended can be normally processed, and after the chain extension is completed, part of requests on the chain to be extended are routed to the extended chain for processing, so that the chain extension operation of the block chain is realized.
The following describes in detail the routing rule of the block chain provided in the present application, specifically:
referring to fig. 2, a flow chart of another block chain extension method provided in the embodiment of the present application is shown in fig. 2, and includes:
s201: when a processing request is received, determining a target chain corresponding to a user account in the processing request;
in this step, when a processing request is received, a user account included in the processing request is determined first, and a corresponding target chain is determined according to the user account. As a preferred embodiment, the present step may include: determining a number of base chains of the blockchain system; performing a modulo operation of the base chain number on a first target bit of the user account in the processing request; and determining the target chain according to the modulus obtaining result.
The number of the basic chains is the number of the block chains when the block chain system is not subjected to the chain extension operation. The first target position is not specifically limited, and is preferably the last two positions of the user account. For example, the number of basic chains in the blockchain system is 64, the user account in the processing request is 12345, the modulo result of 64 is 57, and the target chain identifier corresponding to the processing request is 57.
S202: judging whether the target chain has an extended chain or not and whether the current block height reaches the extended height of the target chain or not; if yes, entering S203; otherwise, entering S204;
after the target chain is determined, whether the target chain has an extended chain is judged, if not, the step directly enters S204, if yes, whether the current height of the target chain reaches the chain extension height is judged, if yes, the step enters S203, and if not, the step enters S204.
S203: and determining a response chain of the processing request according to the user account so that the response chain processes the processing request.
In a specific implementation, when the target chain has an extended chain and reaches the chain extension height, the processing request falling into the target chain is divided into several parts, i.e., some processing requests are responded by the target chain, and other processing requests are responded by the extended chain. It is therefore necessary in this step to determine the chain of responses in order for the chain of responses to process the processing request.
S204: and taking the target chain as a response chain of the processing request so that the response chain processes the processing request.
In this embodiment, when the target chain does not have an extension chain or the current block height does not reach the extension height, the target chain is used as a response chain for processing the request, that is, the request is processed by using the target chain in response to the user account.
The present embodiment further describes and optimizes the technical solution with respect to the previous embodiment. Specifically, the method comprises the following steps:
referring to fig. 3, a flowchart of another block chain extension method provided in the embodiment of the present application is shown in fig. 3, and includes:
s301: determining a number of base chains of the blockchain system when a processing request is received; wherein, the number of the basic chains is the number of the block chains when the block chain system is not subjected to chain extension operation;
s302: performing modular operation of the number of the basic chains on a first target bit of the user account in the processing request, and determining a target chain corresponding to the processing request according to a modular result;
s303: judging whether the target chain has an extended chain or not and whether the current block height reaches the extended height of the target chain or not; if yes, entering S304; otherwise, entering S309;
s304: determining the number of the extended chains of the target chain, and performing modulo operation of adding one to the number of the extended chains on a second target bit of the user account;
the second target is not specifically limited in this embodiment, and preferably is the second bit of the user account, and may be defined in the data structure of the blockchain node, that is, the Sbit and the Ebit in the data structure described in the first embodiment. And the target chain and the extended chain thereof can respond to the processing request, and the second target bit of the user account is subjected to modulo operation of adding one to the number of the extended chains so as to determine a candidate response chain. And equivalently, establishing an array by using the identification of the target chain and the extension chain thereof, wherein the modulus result corresponds to the element bit number of the array. For example, when there are 3 extension chains in the target block chain, modulo a second target bit pair 4 of the user account, the candidate response chain with a modulo result of 0 is the target chain, the candidate response chain with a modulo result of 1 is the first extension chain, the candidate response chain with a modulo result of 2 is the second extension chain, and the candidate response chain with a modulo result of 3 is the third extension chain.
S305: determining a candidate response chain according to the modulus result, judging whether the candidate response chain is the same as the target chain, if so, entering S308; if not, entering S306;
it can be understood that when the candidate response chain is the target chain, the iteration process does not need to be continued, the candidate response chain (or the target chain) is directly used as the response chain, and when the candidate response chain is not the target chain, whether the candidate response chain has the extended chain or not is continuously judged.
S306: judging whether the candidate response chain has an extended chain or not; if yes, entering S307; if not, the step S308 is entered;
s307: taking the candidate response chain as the target chain, and entering S303 again;
s308: determining the candidate response chain as a response chain for processing a request;
and after determining the candidate response chain, judging whether the candidate response chain has an extension chain or not, if so, re-judging whether the candidate response chain has the extension chain or not and reaches the extension height, and if not, determining the candidate response chain as the response chain.
S309: determining the target chain as a response chain for processing the request;
the second target is not specifically limited in this embodiment, and is preferably the second place of the user account. In the example of the above embodiment, if there are 2 extension chains in the blockchain identified as 57, the identifiers are 70 and 71 respectively, and the blockchain 57 reaches the chain extension height, the modulo result of the second bit pair 3 of the user account 12345 is 2, so the blockchain 70 is taken as the candidate response chain. If the block chain 70 has the extension chain 72 and reaches the extension height, the block chain 70 is used as a target chain at this time, the second bit 2 of the user account 12345 is modulo 2, and the modulo result is 0, the block chain 70 is determined as a candidate response chain, and since the candidate response chain and the target chain are both the block chain 70, iteration does not need to be continued, the block chain 70 is a final response chain and is used for responding to the processing request of the user account 12345.
The block chain extension method provided by the present application is described below in the application examples. Specifically, in 64 chains of the current thunderbolt chain, the chain processing pressure of zoneid10 is too large, and chain extension operation is required. If the expansion scheme is to newly expand one chain zoneid65, the user account number originally processed by zoneid10 needs to be divided into two groups, wherein one group is processed by zoneid10 continuously, and the other group is processed by the new chain zoneid65, and the grouping rule is as follows:
1. taking a module of 2 by using a certain bit (assumed to be the 2 nd bit) or a plurality of bits of the user account address, wherein the module with the module result of 0 is processed by zoneid10, and the module with the module result of 1 is processed by a new chain zoneid 65;
2. assuming that the current block height of zoneid10 is 10000, one block appears after one second, and zoneid10 wants to perform automatic chain extension after 5000 seconds, i set the block height when chain extension to 15000(10000+5000), synchronize the new chain zoneid65 with 15000 and the previous block at least from zoneid10, before 15000 blocks, continue processing the account number originally processed by zoneid10, and start from 15001 blocks, route the transaction sent by the account number modulo 1 in the previous step to the new chain zoneid65 for processing.
The routing rule is as follows: the last 2 bits of the user address are modulo 64, if the modulo result is 10, then the second bit of the user address is modulo 2, if the modulo result is 0, the route is to zoneid10, and if the modulo result is 1, the route is to the new chain zoneid 65.
A block chain extending system provided in the embodiments of the present application is described below, and a block chain extending system described below and a block chain extending method described above may be referred to each other.
Referring to fig. 4, a block chain expanding system according to an embodiment of the present disclosure includes, as shown in fig. 4:
a determining module 401, configured to determine a chain to be extended and a chain extension height of the chain to be extended;
a creating module 402, configured to create an extension chain corresponding to the to-be-extended chain in a blockchain system;
a synchronizing module 403, configured to synchronize, in the extension chain, a block before the chain extension height in the chain to be extended.
In the block chain extending system provided in this embodiment, when a chain to be extended needs to be extended, a corresponding extended chain is established for the chain to be extended, and block data of the extended chain is consistent with the chain to be extended. Before the chain extension is completed, the transaction routed to the chain to be extended can be normally processed, and after the chain extension is completed, part of requests on the chain to be extended are routed to the extended chain for processing, so that the chain extension operation of the block chain is realized.
On the basis of the foregoing embodiment, as a preferred implementation manner, the determining module 401 includes:
the first determining unit is used for determining a chain to be expanded;
an obtaining unit, configured to determine a current block height and a block growth speed of the chain to be extended, and obtain an expected chain extension duration of the chain to be extended, where the expected chain extension duration is set by a user terminal;
a second determining unit, configured to determine, as the chain extension height of the chain to be extended, a sum of the current block height and a product of the desired chain extension time length and the block growth speed.
On the basis of the foregoing embodiment, as a preferred implementation manner, the data structure of the blockchain node in the blockchain system includes an identifier of the blockchain node, a chain extension height of a parent node, extended chain information, a start bit, an end bit, and a modulo bit number for calculating an extended chain.
On the basis of the above embodiment, as a preferred implementation, the method further includes:
the device comprises a receiving module, a processing module and a sending module, wherein the receiving module is used for determining a target chain corresponding to a user account in a processing request when the processing request is received;
the judging module is used for judging whether the target chain has an extended chain or not and whether the current block height reaches the extended height of the target chain or not;
and the first response chain determining module is used for determining a response chain of the processing request according to the user account when the target chain has an extension chain and the current block height reaches the extension height of the target chain, so that the response chain processes the processing request.
On the basis of the foregoing embodiment, as a preferred implementation, the receiving module includes:
a base chain number determining unit, configured to determine a base chain number of the blockchain system when a processing request is received; wherein, the number of the basic chains is the number of the block chains when the block chain system is not subjected to chain extension operation;
a first modulus unit, configured to perform a modulus operation on a first target bit of the user account in the processing request according to the number of the basic chains;
and determining a target chain unit, which is used for determining the target chain according to the modulus taking result.
On the basis of the above embodiment, as a preferred implementation, the method further includes:
and the second response chain determining module is used for taking the target chain as the response chain of the processing request if the target chain has no extension chain or the current block height does not reach the extension height of the target chain.
On the basis of the foregoing embodiment, as a preferred implementation, the first determination response chain module includes:
the second modulus taking unit is used for determining the number of the extended chains of the target chain and performing modulus taking operation of adding one to the number of the extended chains on a second target bit of the user account;
a candidate response chain determining unit, configured to determine a candidate response chain according to the modulus obtaining result, and determine whether the candidate response chain is the same as the target chain; if so, taking the target chain as the response chain; if not, starting the working process of the judging unit;
the judging unit is used for judging whether the candidate response chain has an extended chain or not; if yes, taking the candidate response chain as the target chain, and restarting the working process of the judgment module; and if not, determining the candidate response chain as the response chain.
The application also provides an electronic device, which can be a Personal Computer (PC), a smart phone, a tablet Computer, a palm Computer, a portable Computer and other terminal devices. The electronic device may be a node constituting a CDN network or a blockchain network.
Referring to fig. 5, a block diagram of an electronic device provided in an embodiment of the present disclosure, as shown in fig. 5, may include a memory 11, a processor 12, and a bus 13.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a flash Card (FlashCard), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software for installing the electronic device and various types of data, such as the code of the block chain extension program 01, but also to temporarily store data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data Processing chip in some embodiments, and is configured to execute program codes or process data stored in the memory 11 to implement the block chain extension method provided in any of the above embodiments, for example, execute the block chain extension program 01.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
In this embodiment, when the chain to be extended needs to be extended, a corresponding extended chain is established for the chain to be extended, and the block data of the extended chain is consistent with the chain to be extended. Before the chain extension is completed, the transaction routed to the chain to be extended can be normally processed, and after the chain extension is completed, part of requests on the chain to be extended are routed to the extended chain for processing, so that the chain extension operation of the block chain is realized.
On the basis of the above embodiment, as a preferred implementation, referring to fig. 6, the electronic device further includes:
and the input interface 14 is used for acquiring computer programs, parameters and instructions imported from the outside, and controlling and storing the computer programs, the parameters and the instructions into the memory 11 through the processor 12. The input interface 14 may be connected to an input device for receiving parameters or instructions manually input by a user. The input device may be a touch layer covered on a display screen, a button, a trackball or a touch pad arranged on a terminal housing, a Keyboard (Keyboard), a touch pad or a mouse.
A display unit 15 for displaying data processed by the processor 12 and for displaying a visualized user interface. The display unit 15 may be an LED display, a liquid crystal display, a touch-controlled liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, and the like.
And a network port 16 for performing communication connection with each external terminal device. The communication technology adopted by the communication connection can be a wired communication technology or a wireless communication technology, such as a mobile high definition link (MHL) technology, a Universal Serial Bus (USB), a High Definition Multimedia Interface (HDMI), a wireless fidelity (WiFi), a bluetooth communication technology, a low power consumption bluetooth communication technology, an ieee802.11 s-based communication technology, and the like.
Fig. 6 only shows the electronic device with the components 11-16 and the block chain extension procedure 01, and it will be understood by those skilled in the art that the structure shown in fig. 6 does not constitute a limitation of the electronic device, and may include fewer or more components than shown, or combine certain components, or a different arrangement of components.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A method of chain extending a block chain, comprising:
determining a chain to be expanded and the chain extension height of the chain to be expanded;
creating an extended chain corresponding to the chain to be extended in a block chain system;
synchronizing blocks in the extension chain before the chain extension height in the chain to be extended;
wherein, still include:
when a processing request is received, determining a target chain corresponding to a user account in the processing request;
judging whether the target chain has an extended chain or not and whether the current block height reaches the extended height of the target chain or not;
if yes, determining a response chain of the processing request according to the user account so that the response chain can process the processing request;
if the target chain does not have an extended chain or the current block height does not reach the extended height of the target chain, taking the target chain as a response chain of the processing request so that the response chain can process the processing request;
determining a response chain of the processing request according to the user account includes:
determining the number of the extended chains of the target chain, and adding one to the second position of the user account and the number of the extended chains to perform modular operation;
determining a candidate response chain according to the modulus result, and judging whether the candidate response chain is the same as the target chain; establishing an array by using the identifiers of the target chain and the extended chain, wherein the identifier of the candidate response chain is the nth element in the array, and n is the modulus result;
if so, taking the target chain as the response chain; if not, judging whether the candidate response chain has an extended chain or not;
if yes, taking the candidate response chain as the target chain, and re-executing the step of judging whether the target chain has an extended chain and whether the current block height reaches the extended height of the target chain;
and if not, determining the candidate response chain as the response chain.
2. The method for chain extending a block chain according to claim 1, wherein determining the chain extension height of the chain to be extended comprises:
determining the current block height and the block growth speed of the chain to be expanded, and acquiring the expected chain extension duration of the chain to be expanded, which is set by a user terminal;
and determining the product of the expected chain extension time and the block growth speed and the sum of the current block height as the chain extension height of the chain to be extended.
3. The method according to claim 1, wherein the data structure of the blockchain node in the blockchain system includes an identifier of the blockchain node, a chain extension height of a parent node, extension chain information, a start bit, an end bit, and a modulo bit number for calculating an extension chain.
4. The method for chain extending a block chain according to claim 1, wherein determining a target chain corresponding to a user account in the processing request comprises:
determining a number of base chains of the blockchain system; wherein, the number of the basic chains is the number of the block chains when the block chain system is not subjected to chain extension operation;
performing a modulo operation on the user account and the number of the basic chains in the processing request;
determining the target chain according to the modulus obtaining result; and the identification of the target chain is the modulus result.
5. An electronic device, comprising a memory and a processor, the memory having stored thereon a block chain extension program executable on the processor, the block chain extension program, when executed by the processor, implementing the steps of the block chain extension method according to any one of claims 1 to 4.
6. A block chain spreading system, comprising:
the determining module is used for determining a chain to be expanded and the chain extension height of the chain to be expanded;
the creating module is used for creating an extended chain corresponding to the chain to be extended in a block chain system;
a synchronization module, configured to synchronize, in the extension chain, a block before the chain extension height in the chain to be extended;
wherein, still include:
the device comprises a receiving module, a processing module and a sending module, wherein the receiving module is used for determining a target chain corresponding to a user account in a processing request when the processing request is received;
the judging module is used for judging whether the target chain has an extended chain or not and whether the current block height reaches the extended height of the target chain or not;
a first response chain determining module, configured to determine a response chain of the processing request according to the user account when the target chain has an extension chain and a current block height reaches an extension height of the target chain, so that the response chain processes the processing request;
a second determined response chain module, configured to use the target chain as a response chain of the processing request if the target chain does not have an extended chain or a current block height does not reach an extended height of the target chain;
wherein the first deterministic response chain module comprises:
the second module taking unit is used for determining the number of the extended chains of the target chain and adding one to the second position of the user account and the number of the extended chains to carry out module taking operation;
a candidate response chain determining unit, configured to determine a candidate response chain according to the modulus obtaining result, and determine whether the candidate response chain is the same as the target chain; establishing an array by using the identifiers of the target chain and the extended chain, wherein the identifier of the candidate response chain is the nth element in the array, and n is the modulus result; if so, taking the target chain as the response chain; if not, starting the working process of the judging unit;
the judging unit is used for judging whether the candidate response chain has an extended chain or not; if yes, taking the candidate response chain as the target chain, and restarting the working process of the judgment module; and if not, determining the candidate response chain as the response chain.
7. A computer readable storage medium, having stored thereon a block chain extension program, which when executed by a processor, performs the steps of the block chain extension method of any one of claims 1 to 4.
CN201910046625.4A 2019-01-14 2019-01-14 Block chain extension method and system, electronic equipment and storage medium Active CN109819025B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910046625.4A CN109819025B (en) 2019-01-14 2019-01-14 Block chain extension method and system, electronic equipment and storage medium
PCT/CN2019/094555 WO2020147269A1 (en) 2019-01-14 2019-07-03 Blockchain extension method and system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910046625.4A CN109819025B (en) 2019-01-14 2019-01-14 Block chain extension method and system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109819025A CN109819025A (en) 2019-05-28
CN109819025B true CN109819025B (en) 2020-11-06

Family

ID=66604606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910046625.4A Active CN109819025B (en) 2019-01-14 2019-01-14 Block chain extension method and system, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109819025B (en)
WO (1) WO2020147269A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819025B (en) * 2019-01-14 2020-11-06 深圳市网心科技有限公司 Block chain extension method and system, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256354A (en) * 2018-01-29 2018-07-06 张天 A kind of storage method and storage medium based on test data
CN109067863A (en) * 2018-07-25 2018-12-21 上海点融信息科技有限责任公司 For managing the method, apparatus and storage medium of the node identification of block chain link point
CN109087105A (en) * 2018-08-31 2018-12-25 深圳付贝科技有限公司 For digging the Hash Search method of mine, digging mine machine and block catenary system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11240035B2 (en) * 2017-05-05 2022-02-01 Jeff STOLLMAN Systems and methods for extending the utility of blockchains through use of related child blockchains
CN108600353B (en) * 2018-04-12 2021-01-12 北京天德科技有限公司 Parallel block synchronization method of block chain nodes
CN109086325A (en) * 2018-06-29 2018-12-25 阿里巴巴集团控股有限公司 Data processing method and device based on block chain
CN109819025B (en) * 2019-01-14 2020-11-06 深圳市网心科技有限公司 Block chain extension method and system, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256354A (en) * 2018-01-29 2018-07-06 张天 A kind of storage method and storage medium based on test data
CN109067863A (en) * 2018-07-25 2018-12-21 上海点融信息科技有限责任公司 For managing the method, apparatus and storage medium of the node identification of block chain link point
CN109087105A (en) * 2018-08-31 2018-12-25 深圳付贝科技有限公司 For digging the Hash Search method of mine, digging mine machine and block catenary system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"CHB-Consensus:一种基于一致性哈希算法的区块链共识机制研究";于雷等;《高技术通讯》;20181015;第28卷(第9-10期);第771-783页 *
"区块链关键技术中的数据一致性研究";翟社平;《计算机技术与发展》;20180930;第28卷(第9期);第94-100页 *

Also Published As

Publication number Publication date
WO2020147269A1 (en) 2020-07-23
CN109819025A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN112765271B (en) Block chain transaction index storage method and device, computer equipment and medium
CN108038114B (en) Path query method, terminal and computer readable storage medium
CN109492436A (en) A kind of file verification method and relevant apparatus
CN109933289B (en) Storage copy deployment method and system, electronic equipment and storage medium
US20160162271A1 (en) Application Migration Method, Device and System for Mobile Terminal
KR20130135134A (en) Installing application remotely
CN110286768B (en) Virtual object display method, terminal device and computer-readable storage medium
CN110933733B (en) Network distribution method, device, computer equipment and storage medium
US20170019459A1 (en) File transmission method, file transmission apparatus, and file transmission system
CN111277635B (en) Method, equipment, device and computer medium for accessing external node to block chain
CN109618174B (en) Live broadcast data transmission method, device, system and storage medium
CN110753339B (en) Data downloading method and management platform
CN109413207A (en) A kind of file uploading method, system, device and computer readable storage medium
CN105371850A (en) Route navigation method and mobile terminal
CN111414374B (en) Block chain transaction concurrent processing method, device and equipment
CN111026408A (en) Method and device for managing application and computer storage medium
CN106897162B (en) Communication mode selection method of component in application, communication system and mobile terminal
CN110704350A (en) Resource management method and device, electronic equipment and storage medium
CN111290907A (en) Distributed storage network pressure measurement method and device, computer device and storage medium
CN103618780A (en) Method and device for realizing multiple virtual machine mounted externally-arranged components
CN110730244A (en) Networking method and system of DHT (distributed hash table) system, network equipment and storage medium
CN109819025B (en) Block chain extension method and system, electronic equipment and storage medium
CN109739857B (en) Data distributed writing method and device under high concurrency, terminal and storage medium
CN110147328B (en) Database performance test method, system, electronic equipment and storage medium
CN111193804A (en) Distributed storage method and device, network node and 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
TR01 Transfer of patent right

Effective date of registration: 20211021

Address after: 518000 floors 21-23, block B, building 12, Shenzhen Bay science and technology ecological park, No. 18, community science and technology south road, high tech Zone, Yuehai street, Shenzhen, Guangdong

Patentee after: Xunlei Networking Technologies, Ltd.

Address before: 518052 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee before: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right