CN108830712A - Method, apparatus, equipment and the medium that block generates - Google Patents
Method, apparatus, equipment and the medium that block generates Download PDFInfo
- Publication number
- CN108830712A CN108830712A CN201810476031.2A CN201810476031A CN108830712A CN 108830712 A CN108830712 A CN 108830712A CN 201810476031 A CN201810476031 A CN 201810476031A CN 108830712 A CN108830712 A CN 108830712A
- Authority
- CN
- China
- Prior art keywords
- new block
- transaction information
- target value
- stored
- difficulty target
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention discloses method, apparatus, equipment and media that a kind of block generates.This method includes:According to the new block that current difficulty target value generates, the general transaction information and general transaction information currently to be stored stored in new block is detected, general transaction information new block will be stored with and be added in block chain;According to testing result, current difficulty target value is updated.Scheme through the invention, determine whether new block stores full Transaction Information, if stored full, then need to adjust the rate for generating next new block, that is the difficulty target value of the next new block of adjustment generation, make it possible to generate next new block in time, so that not stored general transaction information is stored in next new block, improves EU rate.
Description
Technical field
The invention belongs to method, apparatus, equipment and computers that block chain technical field more particularly to a kind of block generate
Readable storage medium storing program for executing.
Background technique
In bit coin block chain, block generating rate is determined according to the difficulty target and adjusting of difficulty of its setting.
Current difficulty target is dynamically to be set, therefore no matter dig mine how power changes at long last, and new block generates rate and all keeps
One was generated at 10 minutes, and only just be will do it after 2,016 block of generation and adjusted next time.Such as:It is every to generate 2,016
Adjusting of difficulty next time is carried out after block.The formula of adjusting of difficulty is by the cost duration and 20,160 of newest 2,016 blocks
Minute, which compares, to obtain.
It just will do it since the rate that current block generates is fixed, and only after 2,016 block of generation next
Secondary adjustment, so resulting in when Transaction Information amount is big, the block of generation can not in time store a large amount of Transaction Informations completely
Cochain, to cause to block.
Summary of the invention
The embodiment of the invention provides method, apparatus, equipment and media that a kind of block generates, can be in Transaction Information amount
When big, the rate for the block that adjustment generates in time makes it possible to generate new block in time, so that not stored general transaction be believed
Breath is completely stored in time in next new block, to accelerate the cochain speed of Transaction Information.
In a first aspect, a kind of method that block generates is provided, the method includes:
New block is generated according to current difficulty target value;
Detect the general transaction information stored in the new block and general transaction information currently to be stored;
According to testing result, the new block for being stored with the general transaction information is added in block chain, it is described
General transaction information refers to first Transaction Information of non-block in the new block being stored in node trading pit;
And according to testing result, the current difficulty target value is updated, the testing result includes the new block
The general transaction information of middle storage and the general transaction information currently to be stored;
When updated difficulty target value is less than the current difficulty target value, then according to the current difficulty mesh
Scale value generates next new block;
And/or
When updated difficulty target value is greater than the current difficulty target value, then according to updated difficulty target
Value generates next new block.
Second aspect, provides a kind of device that block generates, and described device includes:
Generation module, for the new block according to current difficulty target value generation;
Detection module, for detecting the general transaction information and general transaction currently to be stored that store in the new block
Information;
Update module, for according to testing result, the new block for being stored with the general transaction information to be added to
In block chain, the general transaction information refers to the transaction letter of the non-bit coin in the new block being stored in node trading pit
Breath;
And according to testing result, the current difficulty target value is updated, the testing result includes the new block
The general transaction information of middle storage and the general transaction information currently to be stored;
The generation module is also used to when updated difficulty target value is less than the current difficulty target value, then
Next new block is generated according to the current difficulty target value;
And/or
It is also used to when updated difficulty target value is greater than the current difficulty target value, then according to updated difficulty
It spends target value and generates next new block.
The third aspect provides a kind of terminal device, including:
Memory, processor, communication interface and bus;
The memory, the processor are connected by the bus with the communication interface and complete mutual lead to
Letter;
The memory is for storing program code;
The processor is run by reading the executable program code stored in the memory can be performed with described
The corresponding program of program code, for executing the method such as first aspect.
Fourth aspect provides a kind of computer storage medium, including instruction, when described instruction is run on computers
When, make the method for the computer execution as described in relation to the first aspect.
Compared with prior art, method, apparatus, equipment and medium that a kind of block provided by the embodiments of the present application generates,
According to the Transaction Information that Transaction Information to be stored and new block store, determine whether new block can store commonly in time
Transaction Information, if Transaction Information to be stored is very big, and new block can not store general transaction information in time, then need to adjust
The difficulty target value that the generating rate of whole next new block, i.e. adjustment generate next new block, makes it possible to generate in time
Next new block accelerates Transaction Information so that not stored general transaction information is stored in next new block
Cochain speed.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, will make below to required in the embodiment of the present invention
Attached drawing is briefly described, it should be apparent that, drawings described below is only some embodiments of the present invention, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Fig. 1 is the schematic diagram for showing block data structures;
Fig. 2 shows the flow charts for the method that block of the embodiment of the present invention generates;
Fig. 3 is the schematic diagram for showing adjustment difficulty target value according to testing result of the embodiment of the present invention;
Fig. 4 is the device schematic block diagram for showing the generation of block of the embodiment of the present invention;
Fig. 5 is to show to can be realized the example hardware frame with the calculating equipment of device according to the method for the embodiment of the present invention
The structure chart of structure.
Specific embodiment
The feature and exemplary embodiment of various aspects of the invention is described more fully below, in order to make mesh of the invention
, technical solution and advantage be more clearly understood, with reference to the accompanying drawings and embodiments, the present invention is further retouched in detail
It states.It should be understood that specific embodiment described herein is only configured to explain the present invention, it is not configured as limiting the present invention.
To those skilled in the art, the present invention can be real in the case where not needing some details in these details
It applies.Below the description of embodiment is used for the purpose of better understanding the present invention to provide by showing example of the invention.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence " including ... ", it is not excluded that including
There is also other identical elements in the process, method, article or equipment of the element.
Fig. 1 is the schematic diagram for showing block data structures.
As shown in Figure 1, block generally comprises:Block size, block head and block body.
Block size, for the block size after the field with byte representation.
Block head includes:(1) version number, (2) father's block Hash (HASH) value, (3) Merkel tree (Merkle tree,
MT) root, (4) timestamp, (5) random number, (6) difficulty target value.
(1) version number:For recording the version number of block.
(2) father's block cryptographic Hash:For quoting the cryptographic Hash of father's block in block chain.
(3) MT root:For recording the HASH value of All Activity MT root in current block, any one Transaction Information changes,
The value will be caused also to change.
(4) timestamp:For recording the time proximity of block generation, chronomere is accurate to the second.
(5) difficulty target value:For the difficulty target of proof of work algorithm, wherein proof of work algorithm is SHA256
Algorithm is the hash algorithm that output valve is 256, and SHA is secure hash algorithm, and SHA256 algorithm is exactly secure hash algorithm
One in family.
(6) random number N once:Use when for calculating target value, when calculated result is unsatisfactory for target value, random number by
It is secondary to increase by 1, and calculated again, the HASH value of target value is met until calculating.
Block body includes:Transaction counter and store transaction ontology.
Transaction counter:For recording the quantity of transaction.
Store transaction ontology:Transaction Information for being recorded in block, each transaction are a record, All Activity
Constitute a list.
It is the difficulty target value by adjusting block in embodiments of the present invention, makes it possible to generate next new district in time
Block accelerates the cochain speed of Transaction Information so that not stored general transaction information is stored in next new block.
In order to better understand the present invention, below in conjunction with attached drawing, it is raw that block according to an embodiment of the present invention is described in detail
At method, apparatus, equipment and medium, it should be noted that these embodiments are not for limiting the scope of the present disclosure.
Fig. 2 shows the flow charts for the method that block of the embodiment of the present invention generates.
As shown in Fig. 2, the processing method 200 includes the following steps:
S210, the new block generated according to current difficulty target value.
S220 detects the general transaction information and general transaction information currently to be stored stored in new block.
In this step, usual in addition to needing to carry out new block before the new block of generation is added in block chain
Detection outside, it is also necessary to detected to " general transaction information " whether is stored in the store transaction ontology of new block.In addition, removing
Have stored in the general transaction information of the store transaction ontology of new block, it is also necessary to which detection is current remaining to be stored general
Logical Transaction Information.
The new block for being stored with general transaction information is added in block chain, general transaction by S230 according to testing result
Information refers to that first Transaction Information of the non-block in the new block being stored in node trading pit, that is, non-coinbase are handed over
Easy information, coinbase Transaction Information can be all stored in new block when generating each new block;
And according to testing result, update current difficulty target value, testing result include stored in new block it is common
Transaction Information and general transaction information currently to be stored.
S240, when updated difficulty target value is less than current difficulty target value, then according to current difficulty target
Value generates next new block;
And/or
It is when updated difficulty target value is greater than current difficulty target value, then raw according to updated difficulty target value
At next new block.
In this step, as an example, when desired a length of 1 minute when, the difficulty target value formula of update is:
Wherein, it is expected that duration can need to be adjusted according to the experience of user.
When updated difficulty target value is less than current difficulty target value, then generated according to current difficulty target value
Next new block.Such as:Generating the practical duration that current new block is spent is 30 seconds, then obtained according to formula (1)
The difficulty target value of update is less than current difficulty target value.Therefore it needs to generate according to current difficulty target value next
New block.
It is when updated difficulty target value is greater than current difficulty target value, then raw according to updated difficulty target value
At next new block.Such as:Generate practical duration that current new block is spent be 1 point 30 seconds, then according to formula (1)
To the difficulty target value of update be greater than current difficulty target value, then needing to generate according to updated difficulty target value
Next new block.
Method through the embodiment of the present invention is believed according to the transaction that general transaction information to be stored and new block store
Breath, determines whether new block can store general transaction information in time, if general transaction information to be stored is very big, and it is new
Block can not store general transaction information in time, then need to adjust the rate for generating next new block, i.e., under adjustment generates
The difficulty target value of one new block makes it possible to generate next new block in time, so that not stored general transaction be believed
Breath is stored in next new block, accelerates the cochain speed of Transaction Information.
In one embodiment, the initial value of current difficulty target value is pre-set parameter.
In order to timely adjustment difficulty target value in the embodiment of the present invention, so that the time longest of Transaction Information cochain exists
1 minute or so.
Fig. 3 is the schematic diagram for showing adjustment difficulty target value according to testing result of the embodiment of the present invention.
As shown in figure 3, step S310, detects whether the general transaction information stored in new block arrives default storage threshold value,
When detecting that the general transaction information stored in new block reaches default storage threshold value, step S320 is executed, it is new when detecting
When the general transaction information stored in block not up to presets storage threshold value, step S330 is executed.
Step S320 increases current difficulty target value.
Step S330 judges whether the general transaction information stored in new block is 0, when the common friendship stored in new block
When easy information is not 0, step S340 is executed;When the general transaction information stored in new block be 0 when, execute step S350.
Step S340 updates current difficulty target value according to the practical duration for generating new block and default expectation duration.
Step S350 abandons new block, according to the practical duration for generating new block and default expectation duration, updates current
Difficulty target value.
Step S360 generates next new block according to updated difficulty target value.
Above-mentioned steps S320, which is specifically as follows to work as, detects that the general transaction information stored in new block reaches default storage
Threshold value, and currently the general transaction information wait store be more than or equal to 0 when, increase current difficulty target value.
If detecting in embodiments of the present invention, the store transaction ontology in new block is filled with " general transaction information ", and
Transaction Information be there remains when storing, in order to store in block residue general transaction information to be stored in time, therefore needed
Increase current difficulty target value.After difficulty target value increases, since difficulty target value increases, node generates the speed of block
Rate is faster.So block chain node can be more easier to generate next new block, to will not deposit after increasing difficulty target value
The general transaction information of storage is stored in next new block, accelerates the cochain speed of Transaction Information.
Step S340 is specifically as follows the not up to default storage threshold of the general transaction information for working as and detecting and storing in new block
Value, and the general transaction information stored in new block is not 0 and when currently the general transaction information wait store is equal to 0, according to life
At the practical duration and default expectation duration of new block, current difficulty target value is updated.
In embodiments of the present invention, if detecting, the store transaction ontology in new block is not filled up " Transaction Information ", and
When currently the general transaction information wait store is equal to 0, illustrate that the store transaction ontology in current new block is that enough storages are handed over
Easy information, then there is no need to be quickly generated next new block again.So according to the practical duration for generating new block and in advance
If generating next new block according to updated target difficulty value it is expected that duration, updates current difficulty target value.
Step S350 is specifically as follows when detecting the general transaction information stored in new block is 0, abandons new block,
According to the practical duration for generating current new block and default expectation duration, current difficulty target value is updated.
In embodiments of the present invention, if the store transaction ontology for detecting in new block does not have " general transaction information ",
I.e. currently without stored " general transaction information ", then showing not high to the demand of new block at present, that is, do not need
It is quickly generated next new block again, therefore, current difficulty target value is updated according to current rate calculations formula (1).
Method through the embodiment of the present invention, the transaction that can be stored by store transaction information and new block as needed
Information, judges whether current new block can store general transaction information in time, if current Transaction Information is very big, and
New block can not store general transaction information in time, then need to adjust the rate for generating next new block, i.e. adjustment generates
The difficulty target value of next new block makes it possible to generate next new block in time, thus by not stored general transaction
Information is stored in next new block, accelerates the cochain speed of Transaction Information, if currently without Transaction Information or working as
Store transaction ontology in preceding new block can store general transaction information, then current difficulty mesh is updated according to formula (1)
Scale value.It needs to consider that network rate can also change in embodiments of the present invention, may become faster, it is also possible to slack-off therefore above-mentioned
Calculation formula (1) is also to need to consider that current network rate goes to calculate.
Above in conjunction with Fig. 1 to Fig. 3, the method that block according to embodiments of the present invention generates is described in detail, it below will knot
Fig. 4 is closed, device according to an embodiment of the present invention is described in detail.
Fig. 4 is the device schematic block diagram for showing the generation of block of the embodiment of the present invention.
As shown in figure 4, the device 400 that block of the embodiment of the present invention generates, the device 400 include:
Generation module 410, for the new block according to current target difficulty value generation.
Detection module 420, for detecting the general transaction information and general transaction currently to be stored that store in new block
Information.
Update module 430, for according to testing result, the new block for being stored with general transaction information being added to block chain
In, general transaction information refers to first Transaction Information of the non-block in the new block being stored in node trading pit;
And according to testing result, update current difficulty target value, testing result include stored in new block it is common
Transaction Information and general transaction information currently to be stored.
Generation module 410 is also used to then press when updated target difficulty value is less than the current target difficulty value
Next new block is generated according to current target difficulty value.
And/or
Generation module 410 is also used to when updated target difficulty value is greater than current target difficulty value, then according to more
Target difficulty value after new generates next new block.
Device through the embodiment of the present invention is believed according to the transaction that general transaction information to be stored and new block store
Breath, determines whether new block can store general transaction information in time, if general transaction information to be stored is very big, and it is new
Block can not store general transaction information in time, then need to adjust the rate for generating next new block, i.e., under adjustment generates
The difficulty target value of one new block makes it possible to generate next new block in time, so that not stored general transaction be believed
Breath is stored in next new block, accelerates the cochain speed of Transaction Information.
In one embodiment, the initial value of current target difficulty value is pre-set parameter.
Update module 430 is described in terms of three below.
In a first aspect, update module 430, detects that the general transaction information stored in new block reaches pre- specifically for working as
If store threshold value, and currently the general transaction information wait store be more than or equal to 0 when, increase current target difficulty value.
If detecting in embodiments of the present invention, the store transaction ontology in new block is filled with " general transaction information ", and
Transaction Information be there remains when storing, in order to store in block residue general transaction information to be stored in time, it is therefore desirable to
Increase current difficulty target value.After difficulty target value increases, since difficulty target value increases, node generates the rate of block
It is faster.So block chain node can be more easier to generate next new block, thus by not stored after increasing difficulty target value
General transaction information be stored in next new block, accelerate the cochain speed of Transaction Information.
Second aspect, update module 430 detect that the general transaction information stored in new block is not up to specifically for working as
Default storage threshold value, and the general transaction information stored in new block is not that 0 and general transaction information currently to be stored are equal to 0
When, according to the practical duration for generating new block and default expectation duration, update current difficulty target value.
The third aspect, update module 430 detect that the general transaction information stored in the new block is specifically for working as
When 0, new block is abandoned, according to the practical duration for generating new block and default expectation duration, updates current difficulty target value.
Device through the embodiment of the present invention, the transaction that can be stored by store transaction information and new block as needed
Information, judges whether current new block can store general transaction information in time, if current Transaction Information is very big, and
New block can not store general transaction information, then need to adjust the rate for generating next new block, i.e. adjustment generates next
The difficulty target value of a new block makes it possible to accelerate to generate next new block, thus by not stored general transaction information
It is stored in next new block, accelerates the cochain speed of Transaction Information, if currently without Transaction Information or currently new
Store transaction ontology in block can store transaction information enough, then according to the practical duration for generating new block and default expectation
Duration updates current difficulty target value, generates next new block according to updated difficulty target value.Implement in the present invention
It needs to consider that network is calculated power and can also be changed in example, may become faster, it is also possible to it is slack-off, therefore above-mentioned calculation formula (1) is also to need
Consider that current network rate goes calculating.
It is real according to the present invention that the other details of device according to an embodiment of the present invention combine Fig. 1 to Fig. 3 to describe with more than
The method for applying example is similar, and details are not described herein.
It can be realized according to the method for the embodiment of the present invention by calculating equipment with device in conjunction with what Fig. 1 to Fig. 4 described.Fig. 5
It is to show to can be realized the structure chart with the exemplary hardware architecture of the calculating equipment of device according to the method for the embodiment of the present invention.
As shown in figure 5, calculating equipment 500 includes input equipment 501, input interface 502, central processing unit 503, memory
504, output interface 505 and output equipment 506.Wherein, input interface 502, central processing unit 503, memory 504 and
Output interface 505 is connected with each other by bus 510, and input equipment 501 and output equipment 506 pass through 502 He of input interface respectively
Output interface 505 is connect with bus 510, and then is connect with the other assemblies for calculating equipment 500.Specifically, input equipment 501 connects
It receives from external input information, and central processing unit 503 is transmitted to for information is inputted by input interface 502;Central processing
Device 503 is handled to generate output information input information based on the computer executable instructions stored in memory 504, will
Output information is temporarily or permanently stored in memory 504, is then transmitted to output information by output interface 505 defeated
Equipment 506 out;Output information is output to the outside of calculating equipment 500 for users to use by output equipment 506.
That is, calculating equipment shown in fig. 5 also may be implemented as include:It is stored with computer executable instructions
Memory;And processor, the processor may be implemented when executing computer executable instructions that Fig. 1 to Fig. 5 to be combined to describe
Method and apparatus.
It should be clear that the invention is not limited to specific configuration described above and shown in figure and processing.
For brevity, it is omitted here the detailed description to known method.In the above-described embodiments, several tools have been described and illustrated
The step of body, is as example.But method process of the invention is not limited to described and illustrated specific steps, this field
Technical staff can be variously modified, modification and addition after understanding spirit of the invention, or suitable between changing the step
Sequence.
Functional block shown in structures described above block diagram can be implemented as hardware, software, firmware or their group
It closes.When realizing in hardware, it may, for example, be electronic circuit, specific integrated circuit (ASIC), firmware appropriate, insert
Part, function card etc..When being realized with software mode, element of the invention is used to execute program or the generation of required task
Code section.Perhaps code segment can store in machine readable media program or the data-signal by carrying in carrier wave is passing
Defeated medium or communication links are sent." machine readable media " may include any medium for capableing of storage or transmission information.
The example of machine readable media includes electronic circuit, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), soft
Disk, CD-ROM, CD, hard disk, fiber medium, radio frequency (RF) link, etc..Code segment can be via such as internet, inline
The computer network of net etc. is downloaded.
It should also be noted that, the exemplary embodiment referred in the present invention, is retouched based on a series of step or device
State certain methods or system.But the present invention is not limited to the sequence of above-mentioned steps, that is to say, that can be according in embodiment
The sequence referred to executes step, may also be distinct from that the sequence in embodiment or several steps are performed simultaneously.
The above description is merely a specific embodiment, it is apparent to those skilled in the art that,
For convenience of description and succinctly, the system, module of foregoing description and the specific work process of unit can refer to preceding method
Corresponding process in embodiment, details are not described herein.It should be understood that scope of protection of the present invention is not limited thereto, it is any to be familiar with
Those skilled in the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or substitutions,
These modifications or substitutions should be covered by the protection scope of the present invention.
Claims (12)
1. a kind of method that block generates, which is characterized in that the method includes:
New block is generated according to current difficulty target value;
Detect the general transaction information stored in the new block and general transaction information currently to be stored;
According to testing result, the new block for being stored with the general transaction information is added in block chain, it is described common
Transaction Information refers to first Transaction Information of non-block in the new block being stored in node trading pit;
And according to testing result, the current difficulty target value is updated, the testing result includes depositing in the new block
The general transaction information of storage and the general transaction information currently to be stored;
When updated difficulty target value is less than the current difficulty target value, then according to the current difficulty target value
Generate next new block;
And/or
It is when updated difficulty target value is greater than the current difficulty target value, then raw according to updated difficulty target value
At next new block.
2. the method according to claim 1, wherein the initial value of the current difficulty target value is to set in advance
The parameter set.
3. method according to claim 1 or 2, which is characterized in that it is described according to testing result, update the current difficulty
Target value is spent, including:
Storage threshold value is preset when detecting that the general transaction information stored in the new block reaches, and described currently to be stored
When general transaction information is more than or equal to 0, increase the current difficulty target value.
4. method according to claim 1 or 2, which is characterized in that it is described according to testing result, update the current difficulty
Target value is spent, including:
Threshold value is stored when detecting that the general transaction information stored in the new block is not up to default, and is deposited in the new block
The general transaction information of storage be not 0 and the currently general transaction information wait store be equal to 0 when, according to current network rate,
The practical duration and default expectation duration for generating the new block, update the current difficulty target value.
5. method according to claim 1 or 2, which is characterized in that it is described according to testing result, update the current difficulty
Target value is spent, including:
When detecting that the general transaction information that stores in the new block is 0, and the general transaction information currently to be stored
When equal to 0, the new block is abandoned;
According to the practical duration for generating the new block and default expectation duration, the current difficulty target value is updated.
6. the device that a kind of block generates, which is characterized in that described device includes:
Generation module, for the new block according to current difficulty target value generation;
Detection module, for detecting the general transaction information stored in the new block and general transaction letter currently to be stored
Breath;
Update module, for according to testing result, the new block for being stored with the general transaction information being added to block
In chain, the general transaction information refers to first transaction letter of the non-block in the new block being stored in node trading pit
Breath;
And according to testing result, the current difficulty target value is updated, the testing result includes depositing in the new block
The general transaction information of storage and the general transaction information currently to be stored;
The generation module is also used to when updated difficulty target value is less than the current difficulty target value, then according to
The current difficulty target value generates next new block;
And/or
It is also used to when updated difficulty target value is greater than the current difficulty target value, then according to updated difficulty mesh
Scale value generates next new block.
7. device according to claim 6, which is characterized in that the initial value of the current difficulty target value is to set in advance
The parameter set.
8. device according to claim 6 or 7, which is characterized in that the update module, specifically for described when detecting
The general transaction information stored in new block reaches default storage threshold value, and the general transaction information currently to be stored is greater than
Or when being equal to 0, increase the current difficulty target value.
9. device according to claim 6 or 7, which is characterized in that the update module, specifically for described when detecting
The not up to default storage threshold value of the general transaction information stored in new block, and the general transaction information stored in the new block
For 0 and the currently general transaction information wait store be equal to 0 when, according to the practical duration for generating the new block and default
It is expected that duration, updates the current difficulty target value.
10. device according to claim 6 or 7, which is characterized in that the update module detects institute specifically for working as
When to state the general transaction information that stores in new block be 0, the new block is abandoned, according to the practical duration for generating the new block
With default expectation duration, the current difficulty target value is updated.
11. a kind of terminal device, which is characterized in that including:
Memory, processor, communication interface and bus;
The memory, the processor are connected by the bus with the communication interface and complete mutual communication;
The memory is for storing program code;
The processor is run and the executable program by reading the executable program code stored in the memory
The corresponding program of code, for executing the method such as any one of claim 1-5.
12. a kind of computer storage medium, which is characterized in that including instruction, when described instruction is run on computers, make institute
It states computer and executes such as method described in any one of claim 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810476031.2A CN108830712A (en) | 2018-05-17 | 2018-05-17 | Method, apparatus, equipment and the medium that block generates |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810476031.2A CN108830712A (en) | 2018-05-17 | 2018-05-17 | Method, apparatus, equipment and the medium that block generates |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108830712A true CN108830712A (en) | 2018-11-16 |
Family
ID=64148095
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810476031.2A Pending CN108830712A (en) | 2018-05-17 | 2018-05-17 | Method, apparatus, equipment and the medium that block generates |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108830712A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110852882A (en) * | 2019-11-11 | 2020-02-28 | 北京众享比特科技有限公司 | Packet consensus method, apparatus, device, and medium for blockchain networks |
CN111064776A (en) * | 2019-12-05 | 2020-04-24 | 全链通有限公司 | Method and device for generating blocks in block chain and storage medium |
CN111339086A (en) * | 2020-02-18 | 2020-06-26 | 腾讯科技(深圳)有限公司 | Block processing method, and data query method and device based on block chain |
CN111881468A (en) * | 2020-06-30 | 2020-11-03 | 新浪网技术(中国)有限公司 | Asset information flow recording method, device and electronic equipment |
CN117692463A (en) * | 2024-02-01 | 2024-03-12 | 中国信息通信研究院 | Block generation method and device, equipment and media based on blockchain network |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150207632A1 (en) * | 2008-10-27 | 2015-07-23 | Microsoft Technology Licensing, Llc | Random Number Generation Failure Detection and Entropy Estimation |
CN106296191A (en) * | 2016-08-13 | 2017-01-04 | 深圳市樊溪电子有限公司 | A kind of PoW common recognition mechanism of block chain power-aware |
CN106651332A (en) * | 2016-12-29 | 2017-05-10 | 先锋支付有限公司 | Block chain and method for generating new block in block chain |
CN106878528A (en) * | 2017-01-23 | 2017-06-20 | 北京思特奇信息技术股份有限公司 | A kind of disturbance incoming call SMS interception method and system based on block chain technology |
CN107067242A (en) * | 2017-03-24 | 2017-08-18 | 钱德君 | Difficulty value creation method in a kind of block chain generating process |
CN107181797A (en) * | 2017-05-11 | 2017-09-19 | 中国农业银行股份有限公司 | The block compression method and system of a kind of block chain |
CN107657438A (en) * | 2017-09-18 | 2018-02-02 | 联动优势科技有限公司 | A kind of block chain generation method, data verification method, node and system |
CN107704269A (en) * | 2017-10-16 | 2018-02-16 | 中国银行股份有限公司 | A kind of method and system based on block chain generation block |
CN107733651A (en) * | 2017-09-11 | 2018-02-23 | 联动优势科技有限公司 | A kind of block chain generation method, node and system |
CN107807951A (en) * | 2017-09-18 | 2018-03-16 | 联动优势科技有限公司 | A kind of block chain generation method, data verification method, node and system |
-
2018
- 2018-05-17 CN CN201810476031.2A patent/CN108830712A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150207632A1 (en) * | 2008-10-27 | 2015-07-23 | Microsoft Technology Licensing, Llc | Random Number Generation Failure Detection and Entropy Estimation |
CN106296191A (en) * | 2016-08-13 | 2017-01-04 | 深圳市樊溪电子有限公司 | A kind of PoW common recognition mechanism of block chain power-aware |
CN106651332A (en) * | 2016-12-29 | 2017-05-10 | 先锋支付有限公司 | Block chain and method for generating new block in block chain |
CN106878528A (en) * | 2017-01-23 | 2017-06-20 | 北京思特奇信息技术股份有限公司 | A kind of disturbance incoming call SMS interception method and system based on block chain technology |
CN107067242A (en) * | 2017-03-24 | 2017-08-18 | 钱德君 | Difficulty value creation method in a kind of block chain generating process |
CN107181797A (en) * | 2017-05-11 | 2017-09-19 | 中国农业银行股份有限公司 | The block compression method and system of a kind of block chain |
CN107733651A (en) * | 2017-09-11 | 2018-02-23 | 联动优势科技有限公司 | A kind of block chain generation method, node and system |
CN107657438A (en) * | 2017-09-18 | 2018-02-02 | 联动优势科技有限公司 | A kind of block chain generation method, data verification method, node and system |
CN107807951A (en) * | 2017-09-18 | 2018-03-16 | 联动优势科技有限公司 | A kind of block chain generation method, data verification method, node and system |
CN107704269A (en) * | 2017-10-16 | 2018-02-16 | 中国银行股份有限公司 | A kind of method and system based on block chain generation block |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110852882A (en) * | 2019-11-11 | 2020-02-28 | 北京众享比特科技有限公司 | Packet consensus method, apparatus, device, and medium for blockchain networks |
CN111064776A (en) * | 2019-12-05 | 2020-04-24 | 全链通有限公司 | Method and device for generating blocks in block chain and storage medium |
CN111339086A (en) * | 2020-02-18 | 2020-06-26 | 腾讯科技(深圳)有限公司 | Block processing method, and data query method and device based on block chain |
CN111339086B (en) * | 2020-02-18 | 2021-04-20 | 腾讯科技(深圳)有限公司 | Block processing method, block chain-based data query method and device |
CN111881468A (en) * | 2020-06-30 | 2020-11-03 | 新浪网技术(中国)有限公司 | Asset information flow recording method, device and electronic equipment |
CN111881468B (en) * | 2020-06-30 | 2025-01-10 | 新浪技术(中国)有限公司 | Asset information transfer recording method, device and electronic equipment |
CN117692463A (en) * | 2024-02-01 | 2024-03-12 | 中国信息通信研究院 | Block generation method and device, equipment and media based on blockchain network |
CN117692463B (en) * | 2024-02-01 | 2024-05-24 | 中国信息通信研究院 | Block generation method, device, equipment and medium based on blockchain network |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108830712A (en) | Method, apparatus, equipment and the medium that block generates | |
CA2984833A1 (en) | Device, method and program for securely reducing an amount of records in a database | |
CN106575251B (en) | Speculative data processing of streaming data | |
CN110851535B (en) | Data processing method and device based on block chain, storage medium and terminal | |
CN109377383A (en) | Product data synchronization method, device, computer equipment and storage medium | |
US11288230B2 (en) | Method, device and computer program product for managing data replication | |
CN111858146B (en) | Method, apparatus and computer program product for recovering data | |
WO2022120995A1 (en) | Device computing power evaluation method and system based on pow consensus mechanism | |
EP3779701A1 (en) | Data monitoring method and device, electronic device, and computer readable storage medium | |
CN110569038B (en) | Random verification parameter design method, device, computer equipment and storage medium | |
CN112988455A (en) | Method, apparatus and computer program product for data backup | |
CN114003174A (en) | Erasure code storage method and system and electronic equipment | |
CN114429220A (en) | Model online updating method, device, equipment, storage medium and computer product | |
CN107977310B (en) | Traversal test command generation method and device | |
CN111078418B (en) | Operation synchronization method, device, electronic equipment and computer readable storage medium | |
US11521049B2 (en) | Optimization device and control method of optimization device | |
CN117827148A (en) | A random number generation method, device and electronic device | |
CN116405274B (en) | Abnormal flow detection and analysis method | |
CN110990256A (en) | Open source code detection method, device and computer readable storage medium | |
US11734155B2 (en) | Fully traceable and intermediately deterministic rule configuration and assessment framework | |
CN109359093A (en) | A method and system for updating a rule file | |
US11762754B1 (en) | Techniques for data log processing, retention, and storage | |
CN114442904B (en) | Method, apparatus and computer program product for managing a storage system | |
CN111083221B (en) | Transaction verification method and device | |
CN108427608A (en) | Event alarm method and event alarm device |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20181116 |