CN109327349B - Method, medium, device and system for limiting block chain account during creation - Google Patents

Method, medium, device and system for limiting block chain account during creation Download PDF

Info

Publication number
CN109327349B
CN109327349B CN201810927538.5A CN201810927538A CN109327349B CN 109327349 B CN109327349 B CN 109327349B CN 201810927538 A CN201810927538 A CN 201810927538A CN 109327349 B CN109327349 B CN 109327349B
Authority
CN
China
Prior art keywords
delay time
broadcast packet
queue
current
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810927538.5A
Other languages
Chinese (zh)
Other versions
CN109327349A (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.)
Ke'an (Xiamen) Technology Co.,Ltd.
Original Assignee
Tailian Xiamen 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 Tailian Xiamen Technology Co ltd filed Critical Tailian Xiamen Technology Co ltd
Priority to CN201810927538.5A priority Critical patent/CN109327349B/en
Publication of CN109327349A publication Critical patent/CN109327349A/en
Application granted granted Critical
Publication of CN109327349B publication Critical patent/CN109327349B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1073Registration or de-registration
    • 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/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The invention discloses a limiting method for block chain account creation in a block chain system, which comprises the following steps: when the node receives the broadcast packet, analyzing the broadcast packet to obtain the initiation time of the operation in the broadcast packet, and obtaining the time difference between the current time and the initiation time as delay time; judging whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue or not; if yes, deleting the head data of the broadcast packet delay time queue, and calculating the current average delay time; then judging whether the current average delay time is less than the maximum average delay time tolerable by the block chain system; if so, allowing a new blockchain account to be created; if not, new blockchain account creation is prohibited. Therefore, the invention can restrict the account from increasing endlessly by stopping the function of creating the block chain account and protecting the scale of the block chain user, thereby greatly improving the network access quality of the block chain.

Description

Method, medium, device and system for limiting block chain account during creation
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method, a medium, an apparatus, and a system for limiting creation of a blockchain account in a blockchain system.
Background
Blockchain is a decentralized, distributed accounting technique derived from bitcoin that generates persistent, non-modifiable records by time-wise stacking of encrypted blockchain data and stores the records in individual nodes of the blockchain network, such that the individual nodes participating in the blockchain collectively maintain a reliable database. Therefore, the blockchain has the technical advantages of decentralization, non-tampering, transparent and traceable process and the like, and is considered to have wide application prospects in numerous fields such as finance, credit investigation, internet of things, economic trade settlement, asset management and the like.
However, in the existing block chain system, due to the lack of an automated network resource monitoring system, the increase of users at the later stage of the use of the block chain system causes the response of the block chain link point to the user request to be not timely, and even the node is broken down, which makes the network access quality of the block chain worse and worse.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above.
Therefore, a first objective of the present invention is to provide a method for restricting the creation of a blockchain account in a blockchain system, which can restrict the unlimited increase of accounts under the condition of protecting the user scale of the blockchain by automatically disabling the function of creating the blockchain account, thereby avoiding the network resources of the blockchain system from being exhausted, and greatly improving the network access quality of the blockchain.
A second object of the invention is to propose a computer-readable storage medium.
A third object of the present invention is to provide a limiting device for block chain account creation in a block chain system.
A fourth objective of the present invention is to provide a block chain system.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for restricting creation of a blockchain account in a blockchain system, where the method includes the following steps: when any node in a block chain system receives a broadcast packet, analyzing the broadcast packet to obtain the initiation time of the operation in the broadcast packet, obtaining the time difference between the current time and the initiation time as delay time, and placing the delay time at the tail of a broadcast packet delay time queue stored by the node; judging whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue; if the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, deleting the head data of the broadcast packet delay time queue, and calculating the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue; judging whether the current average delay time is less than the maximum average delay time tolerable by the block chain system; if the current average delay time is less than the maximum average delay time tolerable by the blockchain system, allowing a new blockchain account to be created; and if the current average delay time is larger than or equal to the maximum average delay time tolerable by the blockchain system, forbidding the creation of a new blockchain account.
According to the limiting method for block chain account creation in the block chain system, when any node in the block chain system receives a broadcast packet, the broadcast packet is analyzed to obtain the initiation time of operation in the broadcast packet, the time difference between the current time and the initiation time is obtained to be used as delay time, the delay time is placed at the tail of a broadcast packet delay time queue stored by the node, whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue or not is judged, the head data of the broadcast packet delay time queue is deleted when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, the current average delay time is calculated according to the sum of all delay time in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue, and whether the current average delay time is smaller than the maximum average delay time tolerable by the block chain system or not is further judged Wherein if the current average delay time is less than the maximum average delay time tolerable by the blockchain system, then a new blockchain account is allowed to be created; and if the current average delay time is more than or equal to the maximum average delay time tolerable by the blockchain system, forbidding the creation of a new blockchain account. Therefore, the invention can judge whether the block chain account creating function is stopped or not by comparing the current average delay time with the maximum average delay time tolerable by the system, so that the account is limited to be increased endlessly under the condition of protecting the user scale of the block chain, thereby avoiding the network resources of the block chain system from being exhausted and greatly improving the network access quality of the block chain.
In addition, the restriction method for creating a blockchain account in the blockchain system according to the embodiment of the present invention may further have the following additional technical features:
optionally, when the current length of the broadcast packet delay time queue does not exceed the maximum length allowed by the queue, the current average delay time is directly calculated according to the sum of all delay times in the broadcast packet delay time queue and the current length of the broadcast packet delay time queue.
Optionally, the broadcast packet delay time queue is established after an initial node of the blockchain system starts and creates a created block, and is synchronized to each node within the blockchain system.
Optionally, the maximum allowed length of the queue is a global constant, and the maximum average delay time that the blockchain system can tolerate is a global variable and can be voted for change by the blockchain system with a consensus mechanism.
In order to achieve the above object, a second embodiment of the present invention provides a computer-readable storage medium, on which a restriction program for restricting the creation of a blockchain account in a blockchain system is stored, where the restriction program for restricting the creation of a blockchain account in a blockchain system implements the restriction method for restricting the creation of a blockchain account in a blockchain system as described above when executed by a processor.
According to the computer-readable storage medium of the embodiment of the invention, the restriction program during creation of the blockchain account in the blockchain system is stored, so that when the restriction program during creation of the blockchain account in the blockchain system is executed by the processor, the restriction method during creation of the blockchain account in the blockchain system is realized, and therefore, whether the blockchain account creation function is stopped or not can be judged by comparing the current average delay time with the maximum average delay time tolerable by the system, so that under the condition of protecting the user scale of the blockchain, the restricted accounts are increased endlessly, network resources of the blockchain system are prevented from being exhausted, and the network access quality of the blockchain is greatly improved.
In order to achieve the above object, an embodiment of a third aspect of the present invention provides a limiting device for block chain account creation in a block chain system, including an analyzing module, configured to, when any node in the block chain system receives a broadcast packet, analyze the broadcast packet to obtain initiation time of an operation in the broadcast packet, obtain a time difference between a current time and the initiation time as a delay time, and place the delay time at a tail of a delay time queue of the broadcast packet stored in the node; the first judging module is used for judging whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue; the delay time calculation module is used for deleting the head data of the broadcast packet delay time queue when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, and calculating the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue; a second determining module, configured to determine whether the current average delay time is less than a maximum average delay time tolerable by the block chain system; and the limiting module is used for allowing the creation of a new blockchain account when the current average delay time is less than the maximum average delay time tolerable by the blockchain system, and is also used for forbidding the creation of the new blockchain account when the current average delay time is greater than or equal to the maximum average delay time tolerable by the blockchain system.
According to the limiting device for block chain account creation in the block chain system of the embodiment of the invention, when any node in the block chain system receives a broadcast packet, the broadcast packet is analyzed through an analyzing module to obtain the initiation time of the operation in the broadcast packet, the time difference between the current time and the initiation time is obtained to be used as the delay time, the delay time is placed at the tail of a broadcast packet delay time queue stored by the node, whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue or not is judged through a first judging module, then a delay time calculating module deletes the head data of the broadcast packet delay time queue when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, and calculates the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue, and finally, judging whether the current average delay time is less than the maximum average delay time tolerable by the blockchain system or not through a second judgment, so that the limiting module allows the creation of a new blockchain account when the current average delay time is less than the maximum average delay time tolerable by the blockchain system, and forbids the creation of the new blockchain account when the current average delay time is more than or equal to the maximum average delay time tolerable by the blockchain system. Therefore, the invention can judge whether the block chain account creating function is stopped or not by comparing the current average delay time with the maximum average delay time tolerable by the system, so that the account is limited to be increased endlessly under the condition of protecting the user scale of the block chain, thereby avoiding the network resources of the block chain system from being exhausted and greatly improving the network access quality of the block chain.
In addition, the limiting device in the blockchain system according to the embodiment of the present invention may further have the following additional technical features:
optionally, the delay time calculation module is further configured to, when the current length of the broadcast packet delay time queue does not exceed a maximum length allowed by the queue, directly calculate a current average delay time according to a sum of all delay times in the broadcast packet delay time queue and the current length of the broadcast packet delay time queue.
Optionally, the broadcast packet delay time queue is established after an initial node of the blockchain system starts and creates a created block, and is synchronized to each node within the blockchain system.
Optionally, the maximum allowed length of the queue is a global constant, and the maximum average delay time that the blockchain system can tolerate is a global variable and can be voted for change by the blockchain system with a consensus mechanism.
In order to achieve the above object, a fourth aspect of the present invention provides a blockchain system, which includes a restriction device in creation of a blockchain account in the blockchain system as described above.
According to the block chain system of the embodiment of the invention, by the limiting device in the block chain system when the block chain account is created, whether the block chain account creating function is stopped or not can be judged by comparing the current average delay time with the maximum average delay time tolerable by the system, so that the account is limited to be increased endlessly under the condition of protecting the scale of the block chain user, the network resource of the block chain system is prevented from being exhausted, and the network access quality of the block chain is greatly improved.
Drawings
Fig. 1 is a flowchart illustrating a restriction method for creating a blockchain account in a blockchain system according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a restriction method for blockchain account creation in a blockchain system according to another embodiment of the invention;
fig. 3 is a block diagram illustrating a limiting device in a blockchain account creation process in a blockchain system according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
In the existing block chain system, data records are stored in each node of the block chain system, and due to the lack of an automatic network resource monitoring system, when the block chain system is used in a later period, due to the fact that a plurality of users are used, the request response of a block chain node point to a user is not timely, and even the condition of node paralysis occurs. In order to ensure the network access quality of a block chain, the embodiment of the invention provides a method for limiting the block chain account creation in a block chain system, when any node in the block chain system receives a broadcast packet, the broadcast packet is analyzed to obtain the initiation time of an operation in the broadcast packet, the time difference between the current time and the initiation time is obtained as a delay time, the delay time is placed at the tail of a broadcast packet delay time queue stored by the node, whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue is judged, the head data of the broadcast packet delay time queue is deleted when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, and the current average delay time is calculated according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue, then further judging whether the current average delay time is less than the maximum average delay time tolerable by the blockchain system, wherein if the current average delay time is less than the maximum average delay time tolerable by the blockchain system, the creation of a new blockchain account is allowed; and if the current average delay time is more than or equal to the maximum average delay time tolerable by the blockchain system, forbidding the creation of a new blockchain account. Therefore, the invention can judge whether the block chain account creating function is stopped or not by comparing the current average delay time with the maximum average delay time tolerable by the system, so that the account is limited to be increased endlessly under the condition of protecting the user scale of the block chain, thereby avoiding the network resources of the block chain system from being exhausted and greatly improving the network access quality of the block chain.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a flowchart illustrating a limiting method for creating a blockchain account in a blockchain system according to an embodiment of the present invention.
As shown in fig. 1, the limiting method for creating a blockchain account in the blockchain system includes the following steps:
step 101, when any node in the block chain system receives a broadcast packet, analyzing the broadcast packet to obtain the initiation time of the operation in the broadcast packet, and obtaining the time difference between the current time and the initiation time as the delay time, and placing the delay time at the tail of the broadcast packet delay time queue stored by the node.
The block chain system comprises a plurality of nodes, wherein when any node in the block chain system receives a broadcast packet sent by other nodes in the block chain system, the any node analyzes the broadcast packet to obtain the initiation time of operation in the broadcast packet and obtain the current time, then the initiation time and the current time are differenced to obtain the delay time of the broadcast packet sending, and the delay time is placed at the tail of a broadcast packet delay time queue stored by any node.
As an embodiment, the broadcast packet delay time queue is established after the initial node of the blockchain system starts and creates the created block, and is synchronized to each node in the blockchain system. That is, each node in the blockchain system has a broadcast packet delay time queue.
It should be noted that, before the initial node is connected to another node, no data exists in the broadcast packet delay time queue because no broadcast packet is received from another node.
Step 102, judging whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue.
That is, after the delay time is placed at the tail of the broadcast packet delay time queue stored in the node, it is determined whether the current length of the broadcast packet delay time queue exceeds the preset maximum length allowed by the queue.
As an embodiment, the maximum allowed length of the queue is a global constant, and the value represents the maximum length of the queue.
And 103, if the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, deleting the head data of the broadcast packet delay time queue, and calculating the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue.
As an embodiment, the above calculation formula of the current average delay time is: and the sum of all delay time in the current broadcast packet delay time queue/the length of the current broadcast packet delay time queue is equal to the current average delay time.
Step 104, determine whether the current average delay time is less than the maximum average delay time tolerable by the blockchain system. If yes, go to step 105; if not, step 106 is performed.
As an example, the maximum average delay time that can be tolerated by the blockchain system is a global variable, and the variable can be voted for change by the blockchain system using a consensus mechanism.
If the current average delay time is less than the maximum average delay time that the blockchain system can tolerate, a new blockchain account is allowed to be created, step 105.
As an embodiment, if the current average delay time is less than the maximum average delay time that can be tolerated by the blockchain system, the new account registration permission flag in the blockchain system is set to 1, allowing a new blockchain account to be created.
And 106, if the current average delay time is greater than or equal to the maximum average delay time tolerable by the blockchain system, forbidding the creation of a new blockchain account.
As an embodiment, if the current average delay time is greater than or equal to the maximum average delay time tolerable by the blockchain system, the new account registration permission flag in the blockchain system is set to 0, and creation of a new blockchain account is prohibited.
That is to say, in the embodiment of the present invention, when a new user connects to a blockchain node to initiate an operation of registering a new blockchain account, if the new account registration permission flag is set to 0, the registration request sent by the user is not permitted to connect to the new user; if the position of the new account registration permission flag is 1, the registration request sent by the access user is permitted, and normal registration can be carried out.
According to the limiting method for block chain account creation in the block chain system, when any node in the block chain system receives a broadcast packet, the broadcast packet is analyzed to obtain the initiation time of operation in the broadcast packet, the time difference between the current time and the initiation time is obtained to be used as delay time, the delay time is placed at the tail of a broadcast packet delay time queue stored by the node, whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue or not is judged, the head data of the broadcast packet delay time queue is deleted when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, the current average delay time is calculated according to the sum of all delay time in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue, and whether the current average delay time is smaller than the maximum average delay time tolerable by the block chain system or not is further judged Wherein if the current average delay time is less than the maximum average delay time tolerable by the blockchain system, then a new blockchain account is allowed to be created; and if the current average delay time is more than or equal to the maximum average delay time tolerable by the blockchain system, forbidding the creation of a new blockchain account. Therefore, the invention can judge whether the block chain account creating function is stopped or not by comparing the current average delay time with the maximum average delay time tolerable by the system, so that the account is limited to be increased endlessly under the condition of protecting the user scale of the block chain, thereby avoiding the network resources of the block chain system from being exhausted and greatly improving the network access quality of the block chain.
In order to further understand the above technical solution, the above technical solution will be described in detail by fig. 2.
Fig. 2 is a flowchart illustrating a restriction method for creating a blockchain account in a blockchain system according to an embodiment of the present invention.
As shown in fig. 2, the limiting method for creating a blockchain account in the blockchain system includes the following steps:
in step 201, node X receives broadcast packets from other nodes.
It should be noted that the blockchain system includes a plurality of nodes, and each node is connected to another node, wherein any node X can receive the broadcast packet transmitted from another node.
In step 202, node X parses the broadcast packet.
At step 203, node X obtains the initiation time of the operation within the packet.
In step 204, the node X makes a difference between the initiation time and the current time to obtain an operation delay time.
As an embodiment, the node X in the blockchain system makes a difference between the initiation time of the broadcast packet and the current time of receiving the broadcast packet, so as to obtain the delay time of the operation.
In step 205, the node X puts the delay time into the tail of the broadcast packet delay time queue stored in the node.
As an embodiment, the broadcast packet delay time queue is established after the initial node of the blockchain system starts and creates the created block, and is synchronized to each node in the blockchain system.
It should be noted that, before the initial node is connected to another node, no data exists in the broadcast packet delay time queue because no broadcast packet is received from another node.
Step 206, determine whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue. If yes, go to step 207; if not, step 208 is performed.
As an embodiment, the maximum allowed length of the queue is a global constant.
Step 207, delete the head data of the broadcast packet delay time queue.
And step 208, calculating the current average delay time according to the sum of all delay times in the delay time queue of the current broadcast packet and the length of the delay time queue of the current broadcast packet.
As an example, assume that all delay times in the time queue when broadcasting a packet are a1、a2...an(ii) a The length of the current broadcast packet delay time queue is n; the current average delay time is d; then the current average delay time
Figure GDA0002415698970000071
In step 209, it is determined whether the current average delay time is less than the maximum average delay time tolerable by the blockchain system. If so, go to step 210; if not, step 212 is performed.
As an example, the maximum average delay time that can be tolerated by the blockchain system is a global variable, and the variable can be voted for change by the blockchain system using a consensus mechanism.
At step 210, node X allows the connected user to send a registration request.
It should be noted that, when the current average delay time is less than the maximum average delay time tolerable by the blockchain system, the new account registration permission flag bit in node X is 1, and node X allows the connected user to send a registration request.
Step 211, register normally.
At step 212, node X does not allow the connected user to send a registration request.
It should be noted that, when the current average delay time is greater than or equal to the maximum average delay time tolerable by the blockchain system, the new account registration permission flag bit in the node X is 0, and the node X allows the connected user to send a registration request; i.e., forbid the creation of new blockchain accounts.
The request returns a failure, step 213.
According to the limiting method for block chain account creation in the block chain system, when any node in the block chain system receives a broadcast packet, the broadcast packet is analyzed to obtain the initiation time of operation in the broadcast packet, the time difference between the current time and the initiation time is obtained to be used as delay time, the delay time is placed at the tail of a broadcast packet delay time queue stored by the node, whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue or not is judged, the head data of the broadcast packet delay time queue is deleted when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, the current average delay time is calculated according to the sum of all delay time in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue, and whether the current average delay time is smaller than the maximum average delay time tolerable by the block chain system or not is further judged Wherein if the current average delay time is less than the maximum average delay time tolerable by the blockchain system, then a new blockchain account is allowed to be created; and if the current average delay time is more than or equal to the maximum average delay time tolerable by the blockchain system, forbidding the creation of a new blockchain account. Therefore, the invention can judge whether the block chain account creating function is stopped or not by comparing the current average delay time with the maximum average delay time tolerable by the system, so that the account is limited to be increased endlessly under the condition of protecting the user scale of the block chain, thereby avoiding the network resources of the block chain system from being exhausted and greatly improving the network access quality of the block chain.
In order to implement the foregoing embodiment, an embodiment of the present invention provides a computer-readable storage medium, on which a restriction program for use in creating a blockchain account in a blockchain system is stored, where the restriction program for use in creating a blockchain account in the blockchain system is executed by a processor to implement the restriction method for use in creating a blockchain account in the blockchain system.
According to the computer-readable storage medium of the embodiment of the invention, the restriction program during creation of the blockchain account in the blockchain system is stored, so that when the restriction program during creation of the blockchain account in the blockchain system is executed by the processor, the restriction method during creation of the blockchain account in the blockchain system is realized, therefore, the invention can judge whether to stop the function of creating the blockchain account by comparing the current average delay time with the maximum average delay time tolerable by the system, so that under the condition of protecting the user scale of the blockchain, the restricted accounts are increased endlessly, thereby avoiding the network resources of the blockchain system from being exhausted, and greatly improving the network access quality of the blockchain.
Fig. 3 is a block diagram illustrating a limiting device when a blockchain account is created in the blockchain system according to an embodiment of the present invention. As shown in fig. 3, the restricting device includes: the device comprises an analysis module 301, a first judgment module 302, a delay time calculation module 303, a second judgment module 304 and a limitation module 305.
The parsing module 301 is configured to, when any node in the blockchain system receives a broadcast packet, parse the broadcast packet to obtain initiation time of an operation in the broadcast packet, obtain a time difference between current time and the initiation time as delay time, and place the delay time at a tail of a broadcast packet delay time queue stored in the node.
The first determining module 302 is configured to determine whether the current length of the broadcast packet delay time queue exceeds a maximum length allowed by the queue.
The delay time calculation module 303 is configured to delete the header data of the broadcast packet delay time queue when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, and calculate the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue.
The second determining module 304 is configured to determine whether the current average delay time is less than the maximum average delay time tolerable by the blockchain system.
A limiting module 305, configured to allow creation of a new blockchain account when the current average delay time is less than the maximum average delay time tolerable by the blockchain system, and further configured to prohibit creation of a new blockchain account when the current average delay time is greater than or equal to the maximum average delay time tolerable by the blockchain system.
As an embodiment, the delay time calculating module 303 is further configured to, when the current length of the broadcast packet delay time queue does not exceed the maximum length allowed by the queue, directly calculate the current average delay time according to the sum of all delay times in the broadcast packet delay time queue and the current length of the broadcast packet delay time queue.
As an embodiment, the broadcast packet delay time queue is established after the initial node of the blockchain system starts and creates the created block, and is synchronized to each node in the blockchain system.
For one embodiment, the maximum allowed length of the queue is a global constant, and the maximum average delay time tolerable by the blockchain system is a global variable and can be voted for change by the blockchain system with a consensus mechanism.
According to the limiting device for block chain account creation in the block chain system of the embodiment of the invention, when any node in the block chain system receives a broadcast packet, the broadcast packet is analyzed through an analyzing module to obtain the initiation time of the operation in the broadcast packet, the time difference between the current time and the initiation time is obtained to be used as the delay time, the delay time is placed at the tail of a broadcast packet delay time queue stored by the node, whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue or not is judged through a first judging module, then a delay time calculating module deletes the head data of the broadcast packet delay time queue when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, and calculates the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue, and finally, judging whether the current average delay time is less than the maximum average delay time tolerable by the blockchain system or not through a second judgment, so that the limiting module allows the creation of a new blockchain account when the current average delay time is less than the maximum average delay time tolerable by the blockchain system, and forbids the creation of the new blockchain account when the current average delay time is more than or equal to the maximum average delay time tolerable by the blockchain system. Therefore, the invention can judge whether the block chain account creating function is stopped or not by comparing the current average delay time with the maximum average delay time tolerable by the system, so that the account is limited to be increased endlessly under the condition of protecting the user scale of the block chain, thereby avoiding the network resources of the block chain system from being exhausted and greatly improving the network access quality of the block chain.
In order to implement the foregoing embodiment, an embodiment of the present invention provides a blockchain system, where the blockchain system includes a limiting device in creating a blockchain account in the blockchain system.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for limiting block chain account creation in a block chain system is characterized by comprising the following steps:
when any node in the block chain system receives a broadcast packet, analyzing the broadcast packet to obtain the initiation time of the operation in the broadcast packet, obtaining the time difference between the current time and the initiation time as delay time, and placing the delay time at the tail of a broadcast packet delay time queue stored by the node;
judging whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue;
if the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, deleting the head data of the broadcast packet delay time queue, and calculating the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue;
judging whether the current average delay time is less than the maximum average delay time tolerable by the block chain system;
if the current average delay time is less than the maximum average delay time tolerable by the blockchain system, allowing a new blockchain account to be created;
and if the current average delay time is larger than or equal to the maximum average delay time tolerable by the blockchain system, forbidding the creation of a new blockchain account.
2. The method for limiting blockchain account creation in a blockchain system of claim 1, wherein when the current length of the broadcast packet delay time queue does not exceed the maximum allowed length of the queue, the current average delay time is directly calculated according to the sum of all delay times in the broadcast packet delay time queue and the current length of the broadcast packet delay time queue.
3. The method of restricting blockchain account creation in a blockchain system of claim 1 or 2, wherein the broadcast packet delay time queue is established after an initial node of the blockchain system starts and creates a created block and is synchronized to each node within the blockchain system.
4. The method for limiting blockchain account creation in a blockchain system according to claim 1 or 2, wherein the maximum allowed length of the queue is a global constant, and the maximum average delay time tolerable by the blockchain system is a global variable and can be changed by the blockchain system by voting with a consensus mechanism.
5. A computer-readable storage medium, on which a restriction program at the time of creation of a blockchain account in a blockchain system is stored, the restriction program at the time of creation of a blockchain account in the blockchain system implementing a restriction method at the time of creation of a blockchain account in the blockchain system according to any one of claims 1 to 4 when executed by a processor.
6. A device for restricting blockchain accounts in a blockchain system during creation, comprising:
the analysis module is used for analyzing the broadcast packet to obtain the initiation time of the operation in the broadcast packet when any node in the block chain system receives the broadcast packet, obtaining the time difference between the current time and the initiation time as the delay time, and placing the delay time at the tail of a broadcast packet delay time queue stored by the node;
the first judging module is used for judging whether the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue;
the delay time calculation module is used for deleting the head data of the broadcast packet delay time queue when the current length of the broadcast packet delay time queue exceeds the maximum length allowed by the queue, and calculating the current average delay time according to the sum of all delay times in the current broadcast packet delay time queue and the length of the current broadcast packet delay time queue;
a second determining module, configured to determine whether the current average delay time is less than a maximum average delay time tolerable by the block chain system;
and the limiting module is used for allowing the creation of a new blockchain account when the current average delay time is less than the maximum average delay time tolerable by the blockchain system, and is also used for forbidding the creation of the new blockchain account when the current average delay time is greater than or equal to the maximum average delay time tolerable by the blockchain system.
7. The apparatus for limiting blockchain account creation in a blockchain system of claim 6, wherein the delay time calculating module is further configured to calculate a current average delay time directly according to a sum of all delay times in the broadcast packet delay time queue and a current length of the broadcast packet delay time queue when the current length of the broadcast packet delay time queue does not exceed a maximum allowed length of the queue.
8. The apparatus for restricting blockchain account creation in a blockchain system according to claim 6 or 7, wherein the broadcast packet delay time queue is established after an initial node of the blockchain system starts and creates a created block and is synchronized to each node within the blockchain system.
9. The apparatus for limiting blockchain account creation in a blockchain system according to claim 6 or 7, wherein the maximum allowed length of the queue is a global constant, and the maximum average delay time tolerable by the blockchain system is a global variable and can be changed by the blockchain system by voting with a consensus mechanism.
10. A blockchain system comprising means for restricting blockchain accounts from being created in the blockchain system according to any one of claims 6 to 9.
CN201810927538.5A 2018-08-15 2018-08-15 Method, medium, device and system for limiting block chain account during creation Active CN109327349B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810927538.5A CN109327349B (en) 2018-08-15 2018-08-15 Method, medium, device and system for limiting block chain account during creation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810927538.5A CN109327349B (en) 2018-08-15 2018-08-15 Method, medium, device and system for limiting block chain account during creation

Publications (2)

Publication Number Publication Date
CN109327349A CN109327349A (en) 2019-02-12
CN109327349B true CN109327349B (en) 2020-06-16

Family

ID=65263758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810927538.5A Active CN109327349B (en) 2018-08-15 2018-08-15 Method, medium, device and system for limiting block chain account during creation

Country Status (1)

Country Link
CN (1) CN109327349B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020172881A1 (en) * 2019-02-28 2020-09-03 云图有限公司 Block generation method and apparatus, computer device and storage medium
CN113194143B (en) * 2021-04-30 2022-09-16 支付宝(杭州)信息技术有限公司 Block chain account creating method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483181A (en) * 2017-08-28 2017-12-15 北京金股链科技有限公司 Measure of managing contract, device and terminal
CN107911216A (en) * 2017-10-26 2018-04-13 矩阵元技术(深圳)有限公司 A kind of block chain transaction method for secret protection and system
CN107958371A (en) * 2017-11-13 2018-04-24 深圳超级区块链信息技术有限公司 A kind of distributed block chain identity card

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170236102A1 (en) * 2016-02-12 2017-08-17 D+H Usa Corporation Peer-to-Peer Financial Transactions Using A Private Distributed Ledger

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483181A (en) * 2017-08-28 2017-12-15 北京金股链科技有限公司 Measure of managing contract, device and terminal
CN107911216A (en) * 2017-10-26 2018-04-13 矩阵元技术(深圳)有限公司 A kind of block chain transaction method for secret protection and system
CN107958371A (en) * 2017-11-13 2018-04-24 深圳超级区块链信息技术有限公司 A kind of distributed block chain identity card

Also Published As

Publication number Publication date
CN109327349A (en) 2019-02-12

Similar Documents

Publication Publication Date Title
CN108768943B (en) Method and device for detecting abnormal account and server
CN108776616B (en) Method for determining credible state of block chain node, block chain link point and system
CN111639363B (en) Data analysis method based on block chain and edge computing server
CN108710681B (en) File acquisition method, device, equipment and storage medium
CN106155812A (en) Method, device, system and the electronic equipment of a kind of resource management to fictitious host computer
CN106921504B (en) Method and equipment for determining associated paths of different users
CN110457175B (en) Service data processing method and device, electronic equipment and medium
CN109327349B (en) Method, medium, device and system for limiting block chain account during creation
CN110659441A (en) Information release management method and device based on block chain
CN108833450A (en) A kind of realization server anti-attack method and device
CN105991596A (en) Access control method and system
CN110995684A (en) Vulnerability detection method and device
CN112486535A (en) Remote upgrading method and system for NB-IoT (NB-IoT) equipment
CN110503297B (en) Service scene acquisition method and device, electronic equipment and medium
CN103995901B (en) A kind of method for determining back end failure
US20090043709A1 (en) Method and system for detecting trace status, trace agent and trace control server
CN115811483A (en) Network state monitoring method and device, electronic equipment and storage medium
CN106375351A (en) Abnormal domain name detection method and device
CN112000657A (en) Data management method, device, server and storage medium
CN112258184B (en) Method, apparatus, electronic device and readable storage medium for freezing blockchain network
CN113032787A (en) System vulnerability detection method and device
CN110321287A (en) A kind of detection method of server capability, device and electronic equipment
CN108763291B (en) Data management method and device and electronic equipment
CN110647769A (en) Indoor air detection data chaining method and equipment of Internet of things by combining block chains
CN112615791A (en) Method and device for scheduling traffic of content delivery network

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
CP03 Change of name, title or address

Address after: 361000 B1F-065, Zone A, Huaxun Building, Software Park, Xiamen Torch Hi-tech Zone, Huli District, Xiamen City, Fujian Province

Patentee after: Ke'an (Xiamen) Technology Co.,Ltd.

Address before: B1f-065, zone a, Huaxun building, software park, torch hi tech Zone, Xiamen City, Fujian Province, 361000

Patentee before: TAILIAN (XIAMEN) TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address