CN111539818B - Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network - Google Patents

Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network Download PDF

Info

Publication number
CN111539818B
CN111539818B CN202010155223.0A CN202010155223A CN111539818B CN 111539818 B CN111539818 B CN 111539818B CN 202010155223 A CN202010155223 A CN 202010155223A CN 111539818 B CN111539818 B CN 111539818B
Authority
CN
China
Prior art keywords
sampling window
sampling
executing
value
block chain
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
CN202010155223.0A
Other languages
Chinese (zh)
Other versions
CN111539818A (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202010155223.0A priority Critical patent/CN111539818B/en
Publication of CN111539818A publication Critical patent/CN111539818A/en
Application granted granted Critical
Publication of CN111539818B publication Critical patent/CN111539818B/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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a method for adaptively adjusting a sampling window in a block chain, which comprises the following steps: s1, judging whether sampling window adjustment is needed or not based on the height of the whole network and the maximum value of the sampling window, if so, executing a step S2, otherwise, executing a step S4; s2, calculating a sampling interval based on the whole network height, the maximum value of the sampling window and the deviation, judging again that the sampling window needs to be adjusted, if so, executing the step S3, otherwise, executing the step S4; s3, calculating a sampling window adjusting value based on the whole network height, the maximum value of the sampling window, the deviation calculation sampling interval, the abnormal increase threshold value and the abnormal decrease threshold value; and S4, taking the maximum value of the sampling window as a sampling window adjustment value. The invention also relates to a computer readable storage medium and a blockchain network. The invention can effectively avoid the violent jitter of the block outlet speed of the whole network caused by the sudden increase or sudden decrease of the difficulty of the whole network, thereby ensuring the robustness and stability of the whole block chain network.

Description

Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network
Technical Field
The present invention relates to the field of block chain technology, and more particularly, to a method, a computer-readable storage medium, and a block chain network for adaptively adjusting a sampling window in a block chain.
Background
In a block chain network, voting is often required to be performed on multiple pieces of data to ensure data consistency, and a sponsor of a witch attack can forge multiple identities and obtain the write right to final data by obtaining a plurality of votes. In order to prevent the witch attack, in many cases, nodes with different identities in a centralized system need to submit workload proofs while submitting data. Many well-known public chains, such as: the bitcoin and the Ethengfang all adopt a workload proving mode to prevent Sybil attack and ensure the safety of the system.
The workload proving algorithm for bitcoin is to adjust the block-out interval and the expected time interval of 2016 blocks generated in the past and adjust the current block-out difficulty each time the system generates 2016 blocks. The specific formula is as follows: linear difficulty calculation method
Expected unit block out time (one week): t is t =14*24*60*60;
Block out time (10 min) T of one block is expected s =10*60
Adjusting the number of blocks to be subjected to the one-time block output difficulty (2016):
Figure BDA0002402779870000011
time of 1 st block of every 2016 blocks: t is f
Time of last block of every 2016 blocks: t is l
Block outlet interval: t is as =T l -T f
In extreme case, if the block interval of 2016 is greater than 4 weeks, the block interval is calculated according to 4 weeks, and if the block interval of 2016 is less than 1/4 week, the block interval is calculated according to 1/4 week
Figure BDA0002402779870000012
Therefore, the old difficulty value: d o
New difficulty value = old difficulty value (2016 block actual out block time/2016 block expected out block time):
Figure BDA0002402779870000021
therefore, the existing difficulty calculation mode of the bit coins can well ensure the block discharging speed when the calculation force is stable. However, the method has the obvious defect that the fluctuation of the difficulty of the whole network is severe, for example, under the condition of sudden increase or sudden decrease, the block outlet speed of the whole network is severely jittered, so that the stability of the block outlet speed is difficult to ensure;
disclosure of Invention
The technical problem to be solved by the present invention is to provide a method for adaptively adjusting a sampling window in a block chain, a computer-readable storage medium, and a block chain network, aiming at the above-mentioned defects in the prior art, and the method enhances the adaptability of the block chain network by adaptively adjusting the sampling window, so that severe jitter of the block output speed of the whole network caused by sudden increase or sudden decrease of the difficulty of the whole network can be effectively avoided, and further, the robustness and stability of the whole block chain network can be ensured.
One technical solution adopted by the present invention to solve the technical problem is to construct a method for adaptively adjusting a sampling window in a block chain, including:
s1, based on the total network height H and the maximum value N of a sampling window max Judging whether the sampling window is needed to be adjusted, if so, executing the step S2, otherwise, executing the stepStep S4;
s2, based on the whole network height H and the maximum value N of the sampling window max Calculating a sampling interval A by deviation, judging that the sampling window needs to be adjusted again, if so, executing a step S3, otherwise, executing a step S4;
s3, based on the total network height H and the maximum value N of the sampling window max Calculating a sampling interval A by deviation, taking an abnormal increase threshold value as B, and calculating a sampling window adjustment value N by an abnormal reduction threshold value C;
s4, setting the maximum value N of the sampling window max As the sampling window adjustment value N.
In the method for adaptively adjusting a sampling window in a block chain according to the present invention, the step S2 further includes:
s21, based on the whole network height H and the maximum value N of the sampling window max Index i = H-N max
S22, judging whether the index i and the deviation calculation sampling interval A meet i-1-0 | | | i-2-straw cover 0| | | i-A <0| | i-A-1-straw cover 0| | | | i-A-2-straw cover 0, if yes, continuing to step S4, otherwise, executing step S3.
In the method for adaptively adjusting a sampling window in a block chain according to the present invention, the step S3 further includes:
s31, obtaining an index i = H-N max
S32, calculating a first median m based on the index, the time stamp list TS in the deviation calculation sampling interval A and the deviation calculation sampling interval A 1 =med(TS[i],TS[i-1],TS[i-2]) And a second median m 2 =med(TS[i-A],TS[i-A-1],TS[i-A-2]);
S33, based on the first median m 1 Second median m 2 Whether the deviation calculation sampling interval A, the abnormal increase threshold B and the abnormal decrease threshold C meet the following conditions is judged: m is a unit of 1 -m 2 >B||m 1 -m 2 <C, if yes, executing step S34, otherwise executing step S4;
s34, taking the abnormal fluctuation value as U = i-H +1+ N min In which N is min The minimum value of the sampling window is obtained, an index i + + is executed, whether the index i is larger than the full-network height H or not is judged, if yes, the step S35 is executed, and if not, the step S32 is returned to;
s35, based on the abnormal fluctuation value U and the maximum value N of the sampling window max And calculating the sampling window adjustment value N.
In the method for adaptively adjusting a sampling window in a block chain according to the present invention, in the step S35, the sampling window adjustment value N = min (N = min) is selected max ,U)。
In the method for adaptively adjusting a sampling window in a block chain according to the present invention, the method further comprises:
s5, selecting N sampling blocks based on the sampling window adjusting value N, obtaining the time stamps and the difficulty of the sampling blocks, and calculating the difficulty required by the blocks at the current height based on the time stamps and the difficulty.
In the method for adaptively adjusting a sampling window in a block chain according to the present invention, the step S4 further includes:
s51, selecting N sampling blocks based on the sampling window adjusting value N, and acquiring time stamps and difficulty D of the sampling blocks;
s52, carrying out descending order according to the sequence of the timestamps to obtain a timestamp list TS, taking the index i =0 0 Is the average difficulty of the sampling block;
s53, calculating difficulty
Figure BDA0002402779870000041
And executes i + +;
s54, judging whether the index meets i = N, and if so, judging that D is equal to N N+1 Otherwise, the process returns to step S53 as the difficulty required for the block of the current height.
Another technical solution to solve the technical problem of the present invention is to configure a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for adaptively adjusting a sampling window in a block chain.
Another technical solution adopted by the present invention to solve the technical problem is to construct a block chain network, which includes a plurality of block chain nodes, where the block chain nodes store a computer program, and the program, when executed by a processor, implements the method for adaptively adjusting a sampling window in a block chain.
By implementing the method for adaptively adjusting the sampling window in the block chain, the computer readable storage medium and the block chain network, the adaptability of the block chain network is enhanced by adaptively adjusting the sampling window, so that severe jitter of the block outlet speed of the whole network caused by sudden increase or sudden decrease of the difficulty of the whole network can be effectively avoided, and the robustness and the stability of the whole block chain network are further ensured. Furthermore, the difficulty required by the block with the current height can be calculated according to the exponential moving average based on the obtained sampling window, so that obvious deviation can be prevented, and the robustness and the stability of the whole block chain network can be further ensured.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a flowchart illustrating a first preferred embodiment of a method for adaptively adjusting a sampling window in a block chain according to the present invention;
fig. 2 is a flowchart illustrating a first preferred embodiment of the method for adaptively adjusting a sampling window in a block chain according to the present invention.
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.
The invention relates to a method for adaptively adjusting a sampling window in a block chain, which comprises the following steps: s1, based on the total network height H and the maximum value N of a sampling window max Judging whether the sampling window needs to be adjusted, if so, executing the step S2, otherwise, executing the step S4; s2, based on the total network height H and the maximum value N of the sampling window max Deviation, deviation ofCalculating a sampling interval A, judging again that the sampling window needs to be adjusted, if so, executing a step S3, otherwise, executing a step S4; s3, based on the whole network height H and the maximum value N of the sampling window max Calculating a sampling window adjustment value N by using a deviation calculation sampling interval A, an abnormal increase threshold value B and an abnormal reduction threshold value C; s4, the maximum value N of the sampling window max As the sampling window adjustment value N. The invention enhances the adaptability of the block chain network by adaptively adjusting the sampling window, can effectively avoid the severe jitter of the block outlet speed of the whole network caused by the sudden increase or sudden decrease of the difficulty of the whole network, and further ensures the robustness and stability of the whole block chain network. Furthermore, the difficulty required by the block with the current height can be calculated based on the obtained sampling window, so that obvious deviation can be prevented, and the robustness and the stability of the whole block chain network are further ensured.
The invention relates to an algorithm for sampling data and making adjustments in a blockchain system, which adjusts the difficulty of a current network-wide blockchain by dynamically sampling the interval of block outages in the latest period of time. The adaptability of the block chain network is enhanced through self-adaptive window adjustment, and severe jitter of the block exiting speed of the whole network caused by sudden increase or sudden decrease of the difficulty of the whole network can be effectively avoided. The main purpose is to stabilize the performance of the blockchain network and improve the adaptability of the blockchain network.
The terms of the present invention are first defined as follows:
the total network height is H, and a specific value thereof may be defined according to actual situations, for example, 1024 may be selected;
it is expected that the block time is a constant T, and a specific value thereof may be defined according to actual situations, for example, T =120s may be selected;
maximum value of sampling window is N max Specific numerical values thereof may be defined according to actual situations, for example, T =120s may be selected;
minimum value of sampling window is N min The specific value can be defined according to the actual situation, for example, N can be selected max =240;
Taking the function of the median as med ();
taking the minimum function as min ()
The deviation calculation sampling interval is a, and a specific numerical value thereof may be defined according to actual conditions, for example, a =20 may be selected
The abnormal increase threshold is B, and a specific value thereof may be defined according to actual conditions, for example, B =2.5 may be selected
The abnormal reduction threshold is C, and a specific value thereof may be defined according to actual conditions, for example, C =0.5 may be selected
The list of time stamps in the offset calculation sampling interval is TS
Abnormal deviation value of U
It is known to those skilled in the art that other values can be selected from the above value range according to actual needs, and the present invention is not limited by the specific value range.
In step S1, based on the total network height H and the maximum value N of the sampling window max And judging whether the sampling window needs to be adjusted or not, if so, executing the step S2, otherwise, executing the step S4. Preferably, when the total network height H and the maximum value N of the sampling window max Satisfy H>N max If not, directly knowing the step S4, the maximum value N of the sampling window is adjusted max As the sampling window adjustment value N.
In step S2, based on the total network height H and the maximum value N of the sampling window max And calculating a sampling interval A by deviation, judging that the sampling window needs to be adjusted again, if so, executing a step S3, otherwise, executing a step S4. Preferably, the maximum value N of the sampling window is firstly based on the total network height H max Index i = H-N max (ii) a Then judging whether the index i and the deviation calculation sampling interval A meet i-1<0||i-2<0||i-A<0||i-A-1<0||i-A-2<0, if yes, going to step S4, otherwise, executing step S3.
Adopting the steps S1-S2 can preliminarily judge whether abnormal fluctuation occurs, and if the abnormal fluctuation does not occur, directly using the maximum value N of the sampling window max As a miningThe sampling window adjustment value N does not need to be adaptively adjusted, and only when abnormal fluctuation occurs, for example, when the calculation power of the whole network is suddenly increased by 3 times or the calculation power is suddenly reduced by 1/3, the value is switched to be smaller. The selection of the adaptive window is adjusted according to the fluctuation of the block-out time stamp in the past period of time, and if an emergency occurs, the adaptive adjustment of the sampling window is performed according to the emergency.
In step S3, based on the total network height H and the maximum value N of the sampling window max Calculating a sampling interval A by deviation, taking the abnormal increase threshold value as b, and calculating a sampling window adjustment value N by the abnormal reduction threshold value C. In this step, it is preferable to perform
1. First, the index i = H-N is obtained max
2. Calculating a first median m based on the index, the timestamp list TS in the deviation calculation sampling interval A, and the deviation calculation sampling interval A 1 =med(TS[i],TS[i-1],TS[i-2]) And a second median m 2 =med(TS[i-A],TS[i-A-1],TS[i-A-2]);
3. Based on the first median m 1 Second median m 2 Whether the deviation calculation sampling interval A, the abnormal increase threshold B and the abnormal decrease threshold C meet the following conditions is judged: m is 1 -m 2 >B||m 1 -m 2 <C, if yes, the abnormal fluctuation is shown, self-adaptive adjustment is needed, if not, the abnormal fluctuation is not shown, and the maximum value N of the sampling window is used max As the sampling window adjustment value N.
4. After the abnormal fluctuation is determined, the abnormal fluctuation value is taken as U = i-H +1+ N min In which N is min Is the minimum value of a sampling window, executes an index i + +, judges whether the index i is greater than the full-network height H, and if so, based on the abnormal fluctuation value U and the maximum value N of the sampling window max Calculating the sampling window adjustment value N, i.e. the sampling window adjustment value N = min (N) max U). If i is found<H, then returning to step 2, and re-executing step 2-4 until the obtained index i is largeIn the height H of the whole network, then corresponding abnormal fluctuation value U and the maximum value N of the sampling window max Taking the minimum value to obtain the sampling window adjustment value N, i.e. the sampling window adjustment value N = min (N) max ,U)。
By implementing the method for adaptively adjusting the sampling window in the block chain, the adaptability of the block chain network is enhanced by adaptively adjusting the sampling window, so that the severe jitter of the block outlet speed of the whole network caused by sudden increase or sudden decrease of the difficulty of the whole network can be effectively avoided, and the robustness and the stability of the whole block chain network are further ensured.
Fig. 2 is a flowchart illustrating a first preferred embodiment of the method for adaptively adjusting a sampling window in a block chain according to the present invention. In the embodiment shown in fig. 2, the steps S1 to S4 of obtaining the sampling window adjustment value N may refer to the embodiment shown in fig. 1, and will not be described in detail herein.
In step S5, N sampling blocks are selected based on the sampling window adjustment value N, and the time stamps and the difficulty of the sampling blocks are obtained, and the difficulty required for the block of the current height is calculated based on the time stamps and the difficulty. In step S5, the difficulty required for the current block may be calculated by using the exponential moving average, so as to adjust the difficulty of the whole network.
In the preferred embodiment of the invention, the specific steps are as follows:
1. selecting N sampling blocks based on the sampling window adjustment value N, and acquiring time stamps TS of the sampling blocks 1 ,TS 12 ,…,Ts 1N And difficulty D 1 ,D 2 ,…D N Sampling is carried out to obtain a timestamp set and a difficulty set [ TS ] 1 ,TS 2 ,…,TS N ]And [ D 1 ,D 2 ,…D N ]。
2. According to the sequence of the time stamps, performing descending arrangement to obtain a time stamp list TS [ TS ] 1 ,TS 2 ,…,TS N ]Based on the difficulty D 1 ,D 2 ,…D N Obtaining an average difficulty D of a sample block 0 . The average difficulty may be calculated using any known averaging or weighting algorithmD 0
3. Start index i =0;
4. difficulty of calculation
Figure BDA0002402779870000081
And executes i + +;
5. judging whether the index satisfies i = N, if so, judging D N+1 Otherwise, repeating step 4 until i = N as the difficulty required for the block of the current height.
By implementing the method for adaptively adjusting the sampling window in the block chain, the adaptability of the block chain network is enhanced by adaptively adjusting the sampling window, so that the severe jitter of the block outlet speed of the whole network caused by sudden increase or sudden decrease of the difficulty of the whole network can be effectively avoided, and the robustness and the stability of the whole block chain network are further ensured. Furthermore, the difficulty required by the block with the current height can be calculated according to the exponential moving average based on the obtained sampling window, so that obvious deviation can be prevented, and the robustness and the stability of the whole block chain network can be further ensured.
Another technical solution to solve the technical problem of the present invention is to configure a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for adaptively adjusting a sampling window in a block chain.
Another technical solution adopted by the present invention to solve the technical problem is to construct a block chain network, which includes a plurality of block chain nodes, where the block chain nodes store a computer program, and the program, when executed by a processor, implements the method for adaptively adjusting a sampling window in a block chain.
By implementing the computer readable storage medium and the block chain network, the adaptability of the block chain network is enhanced by adaptively adjusting the sampling window, so that the severe jitter of the block outlet speed of the whole network caused by sudden increase or sudden decrease of the difficulty of the whole network can be effectively avoided, and the robustness and the stability of the whole block chain network are further ensured. Furthermore, the difficulty required by the block with the current height can be calculated according to the exponential moving average based on the obtained sampling window, so that obvious deviation can be prevented, and the robustness and the stability of the whole block chain network can be further ensured.
Accordingly, the present invention can be realized in hardware, software, or a combination of hardware and software. The present invention can be realized in a centralized fashion in at least one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system or other apparatus adapted for carrying out the methods of the present invention is suited. A typical combination of hardware and software could be a general purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.
The present invention may also be implemented by a computer program product, comprising all the features enabling the implementation of the methods of the invention, when loaded in a computer system. The computer program in this document refers to: any expression, in any programming language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: a) Conversion to other languages, codes or symbols; b) Reproduced in a different format.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the scope of the invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the invention without departing from its scope. Therefore, it is intended that the invention not be limited to the particular embodiment disclosed, but that the invention will include all embodiments falling within the scope of the appended claims.
The above description is intended to be illustrative of the preferred embodiment of the present invention and should not be taken as limiting the invention, but rather, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.

Claims (8)

1. A method for adaptively adjusting a sampling window in a block chain, comprising:
s1, based on the total network height H and the maximum value N of a sampling window max Judging whether the sampling window is required to be adjusted, if so, executing a step S2, otherwise, executing a step S4;
s2, based on the total network height H and the maximum value N of the sampling window max Calculating a sampling interval A by deviation, judging whether the sampling window needs to be adjusted again, if so, executing a step S3, otherwise, executing a step S4;
s3, based on the total network height H and the maximum value N of the sampling window max Calculating a sampling window adjustment value N by using a deviation calculation sampling interval A, an abnormal increase threshold B and an abnormal decrease threshold C;
s4, setting the maximum value N of the sampling window max As the sampling window adjustment value N.
2. The method of claim 1, wherein the step S2 further comprises:
s21, based on the total network height H and the maximum value N of the sampling window max Index i = H-N max
S22, judging whether the index i and the deviation calculation sampling interval A meet i-1-0 | | | i-2-plus-0 | | | i-A <0| | i-A-1-plus-0 | | | | i-A-2-plus-0, if yes, executing the step S4, otherwise executing the step S3.
3. The method for adaptively adjusting sampling windows in a block chain according to claim 1 or 2, wherein the step S3 further comprises:
s31, obtaining an index i = H-N max
S32, calculating a first median m based on the index, the time stamp list TS in the deviation calculation sampling interval A and the deviation calculation sampling interval A 1 =med(TS[i],TS[i-1],TS[i-2]) And a second median m 2 =med(TS[i-A],TS[i-A-1],TS[i-A-2]);
S33, based on the first median m 1 The second median m 2 Whether the deviation calculation sampling interval A, the abnormal increase threshold value B and the abnormal decrease threshold value C meet the following conditions: m is 1 -m 2 >||m 1 -m 2 <C, if yes, executing step S34, otherwise, executing step S4;
s34, taking the abnormal fluctuation value as U = i-H +1+ N min In which N is mim The minimum value of the sampling window is obtained, an index i + + is executed, whether the index i is larger than the full-network height H or not is judged, if yes, the step S35 is executed, and if not, the step S32 is returned to;
s35, based on the abnormal fluctuation value U and the maximum value N of the sampling window max And calculating the sampling window adjustment value N.
4. The method of claim 3, wherein in step S35, the sampling window adjustment value N = min (N) is selected max ,U)。
5. The method of claim 1 or 2, further comprising:
s5, selecting N sampling blocks based on the sampling window adjustment value N determined in the step S3 or the step S4, obtaining the time stamps and the difficulty of the sampling blocks, and calculating the difficulty required by the block with the current height based on the time stamps and the difficulty.
6. The method of claim 5, wherein the step S5 further comprises:
s51, selecting N sampling blocks based on the sampling window adjustment value N, and acquiring time stamps and difficulty D of the sampling blocks;
s52, carrying out descending order arrangement according to the sequence of the time stamps to obtain a time stamp list TS, taking an index i =0 0 Is the average difficulty of the sampling block;
s53, calculating difficulty
Figure QLYQS_1
And executing i + +, where T is a constant, representing an expected block time;
s54, judging whether the index meets i = N, and if so, judging that D is equal to N N+1 Otherwise, the process returns to step S53 as the difficulty required for the block of the current height.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method of adaptively adjusting a sampling window in a block chain according to any one of claims 1 to 6.
8. A blockchain network comprising a plurality of blockchain nodes having stored thereon a computer program, characterized in that the program, when being executed by a processor, implements a method of adaptively adjusting a sampling window in a blockchain according to any of the claims 1-6.
CN202010155223.0A 2020-03-06 2020-03-06 Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network Active CN111539818B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010155223.0A CN111539818B (en) 2020-03-06 2020-03-06 Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010155223.0A CN111539818B (en) 2020-03-06 2020-03-06 Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network

Publications (2)

Publication Number Publication Date
CN111539818A CN111539818A (en) 2020-08-14
CN111539818B true CN111539818B (en) 2023-04-07

Family

ID=71974796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010155223.0A Active CN111539818B (en) 2020-03-06 2020-03-06 Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network

Country Status (1)

Country Link
CN (1) CN111539818B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106932686B (en) * 2017-03-21 2019-07-09 国网上海市电力公司 Power grid exception rapid detection method based on minimax method of characteristic
EP3665858B1 (en) * 2017-08-09 2022-05-25 Visa International Service Association Verification of interactions system and method
CN109783542A (en) * 2019-01-11 2019-05-21 阳光电源股份有限公司 The data analysing method and device of distributed energy resource system
CN110120936B (en) * 2019-02-23 2021-09-14 西安电子科技大学 Block chain-based distributed network attack detection and safety measurement system and method
CN110049030B (en) * 2019-04-08 2020-03-10 山东公链信息科技有限公司 Block chain consensus system based on random continuous dispersion

Also Published As

Publication number Publication date
CN111539818A (en) 2020-08-14

Similar Documents

Publication Publication Date Title
Mamduhi et al. Event-triggered scheduling for stochastic multi-loop networked control systems with packet dropouts
CN101636945B (en) Method of transmitting data in a communication system
EP2140637B1 (en) Method of transmitting data in a communication system
CN102823206B (en) For reducing method and the packet transaction line card of the energy ezpenditure in packet transaction line card
CN113098646B (en) Time synchronization method and device, electronic equipment and storage medium
US20210073186A1 (en) Permissionless blockchain consensus method with adjusting block weight, system and p2p network
CN112738812A (en) Wireless network automatic adjustment method and device, terminal equipment and storage medium
CN111539818B (en) Method for adaptively adjusting sampling window in block chain, computer readable storage medium and block chain network
CN112583715A (en) Equipment node connection adjustment method and device
CN115022205A (en) Cross-network data transmission method applied to high-concurrency scene of massive terminals
CN113438315A (en) Internet of things information freshness optimization method based on dual-network deep reinforcement learning
CN116566696B (en) Security assessment system and method based on cloud computing
CN111708832B (en) Method for adjusting block difficulty in block chain network, computer medium and block chain network
CN112543145A (en) Method and device for selecting communication path of equipment node for sending data
CN109672227B (en) Economic operation scheduling method for power system
CN116016288A (en) Flow monitoring method, device, equipment and storage medium of industrial equipment
CN111539817B (en) Linear difficulty calculation method for preventing timestamp hijacking among blockchains, computer-readable storage medium and blockchain network
CN114326398B (en) Control method and control system of linear switching system with unstable mode
CN114710455A (en) Large-scale network control system event triggering method based on software definition
CN111709049B (en) Method for preventing timestamp attack in blockchain system, computer readable storage medium and blockchain system
KR100990863B1 (en) Method and apparatus for setting bandwidth by using moving average of data transfer rate
CN115208773A (en) Network hidden fault monitoring method and device
CN114005256A (en) Alarm delay device design method and system based on alarm duration probability function
CN112600753A (en) Equipment node communication path selection method and device according to equipment access amount
Nghiem et al. Learning-based adaptive quantization for communication-efficient distributed optimization with admm

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40028326

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant