CN109947843A - The determination method, apparatus and system of time in block chain - Google Patents

The determination method, apparatus and system of time in block chain Download PDF

Info

Publication number
CN109947843A
CN109947843A CN201711252210.XA CN201711252210A CN109947843A CN 109947843 A CN109947843 A CN 109947843A CN 201711252210 A CN201711252210 A CN 201711252210A CN 109947843 A CN109947843 A CN 109947843A
Authority
CN
China
Prior art keywords
time
block chain
current time
intelligent contract
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711252210.XA
Other languages
Chinese (zh)
Other versions
CN109947843B (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.)
Beijing European Chain Technology Co Ltd
Original Assignee
Beijing European Chain 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 Beijing European Chain Technology Co Ltd filed Critical Beijing European Chain Technology Co Ltd
Priority to CN201711252210.XA priority Critical patent/CN109947843B/en
Publication of CN109947843A publication Critical patent/CN109947843A/en
Application granted granted Critical
Publication of CN109947843B publication Critical patent/CN109947843B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Electric Clocks (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses the determination method, apparatus and system of time in a kind of block chain, the problem of being related to technical field of data processing, be able to solve the time irreversibility of each node in existing block chain.Method of the invention specifically includes that the intelligent contract receiving time acquisition request on block chain;Rule is determined according to preset time, determines the current time of the block chain;The current time is returned to the requesting party for sending the time acquisition request.The present invention is mainly suitable in the scene for determining the block chain time based on intelligent contract.

Description

The determination method, apparatus and system of time in block chain
Technical field
The present invention relates to technical field of data processing, more particularly to the determination method, apparatus of time in block chain a kind of And system.
Background technique
Block chain technology is a kind of decentralization and data storage, transmission and the method proved for residing in distributed frame, Dependence with data block instead of current internet to central server.It is by point pair in each node of block chain bottom What spot net was communicated, each node can safeguard the synchronization of data jointly.However, the local zone time of each node but may It is not synchronized, such as the local zone time of node 1 is 12:12:12 on November 1st, 2017, the local zone time of node 2 is 2017 On November 1,12:12:13 was unable to get satisfaction therefore when there is the demand of time synchronization in practical applications.For example, working as When a certain transaction needs associated with specific time, it just will appear different node processing results differences, so that the transaction is not because can It is led to the failure by verifying.It follows that it is urgently to be resolved for how providing a kind of unified Time Service mechanism.
Summary of the invention
In view of this, in block chain provided by the invention the time determination method, apparatus and system, its object is to solve In existing block chain the problem of the time irreversibility of each node.
To solve the above-mentioned problems, present invention generally provides following technical solutions:
In a first aspect, the present invention provides the determination methods of time in block chain a kind of, which comprises
Intelligent contract receiving time acquisition request on block chain;
Rule is determined according to preset time, determines the current time of the block chain;
The current time is returned to the requesting party for sending the time acquisition request.
Optionally, described that rule is determined according to preset time, determine that the current time of the block chain includes:
It obtains this and executes the current time that block chain goes out the node local of block;
By this described current time for executing block chain node local for going out block be determined as the block chain it is current when Between.
Optionally, the current time for obtaining the node local that this execution block chain goes out block includes:
When the intelligent contract, which is located at this described execution block chain, to be gone out on the node of block, reads described this and execute area Block chain goes out the current time of the node local of block;
When the intelligent contract, which is not located at this described execution block chain, to be gone out on the node of block, area is executed to described this Block chain goes out the node sending time acquisition request of block, receive it is described this execute block chain go out block node feeding back it is current when Between.
Optionally, described that rule is determined according to preset time, determine that the current time of the block chain includes:
To the time server sending time acquisition request independently of the block chain;
Receive the current time that the time server returns;
The current time that the time server returns is determined as to the current time of the block chain.
Second aspect, the present invention provides the determination methods of time in block chain a kind of, which comprises
When it needs to be determined that block chain current time when, to provide Time Service intelligent contract sending time acquisition ask It asks, so that the intelligent contract determines rule according to preset time, determines the current time of the block chain;
Receive the current time that the intelligent contract is sent.
Optionally, the method also includes:
According to the current time for the current time adjustment local that the intelligent contract is sent, so that time synchronization.
Optionally, before the intelligent contract sending time acquisition request to offer Time Service, the method also includes:
Judge that adjusting the duration passed through after local current time in the current time sent according to the intelligent contract is It is no to reach preset duration threshold value;
It is described to include: to the intelligent contract sending time acquisition request for providing Time Service
If the duration reaches the preset duration threshold value, the time acquisition request is sent to the intelligent contract.
Optionally, the method also includes:
If the duration is not up to the preset duration threshold value, local current time is determined as the block chain Current time.
The third aspect, the present invention provides the determining device of time in block chain a kind of, described device includes:
Receiving unit, the intelligent contract receiving time acquisition request on block chain;
Determination unit determines the current time of the block chain for determining rule according to preset time;
Return unit, for the current time to be returned to the requesting party for sending the time acquisition request.
Optionally, the determination unit includes:
Module is obtained, executes the current time that block chain goes out the node local of block for obtaining this;
First determining module, for this described current time for executing the node local that block chain goes out block to be determined as institute State the current time of block chain.
Optionally, the acquisition module, for being located at the section that this described execution block chain goes out block when the intelligent contract When on point, reads described this and execute the current time that block chain goes out the node local of block;When the intelligent contract is not located at institute It states this and executes block chain when going out on the node of block, execute block chain to described this and go out the node sending time acquisition of block and asks It asks, receives described this and execute the current time that block chain goes out the node feeding back of block.
Optionally, the determination unit includes:
Sending module, for the time server sending time acquisition request independently of the block chain;
Receiving module, the current time returned for receiving the time server;
Second determining module, the current time for returning to the time server are determined as the current of the block chain Time.
Fourth aspect, the present invention provides the determining device of time in block chain a kind of, described device includes:
Transmission unit, for when it needs to be determined that block chain current time when, to provide Time Service intelligent contract hair Time acquisition request is sent, so that the intelligent contract determines rule according to preset time, determines the current time of the block chain;
Receiving unit, the current time sent for receiving the intelligent contract.
Optionally, described device further include:
Adjustment unit, the current time of the current time adjustment local for being sent according to the intelligent contract, so that when Between it is synchronous.
Optionally, described device further include:
Judging unit, for judging in root before the intelligent contract sending time acquisition request to offer Time Service Adjust whether the duration passed through after local current time reaches preset duration threshold according to the current time that the intelligent contract is sent Value;
The transmission unit, for being sent to the intelligent contract when the duration reaches the preset duration threshold value The time acquisition request.
Optionally, described device further include:
Determination unit, for when the duration is not up to the preset duration threshold value, local current time to be determined For the current time of the block chain.
5th aspect, the present invention provides a kind of storage medium, the storage medium includes the program of storage, wherein Equipment executes the determination of time in block chain as described in relation to the first aspect described program controls the storage medium when running where Method.
6th aspect, the present invention provides a kind of storage medium, the storage medium includes the program of storage, wherein Equipment executes the determination of time in the block chain as described in second aspect described program controls the storage medium when running where Method.
7th aspect, the present invention provides the determining devices of time in block chain a kind of, and described device includes storage medium And processor;
The processor is adapted for carrying out each instruction;
The storage medium is suitable for storing a plurality of instruction;
Described instruction is suitable for being loaded by the processor and executing the determination of time in block chain as described in relation to the first aspect Method.
Eighth aspect, the present invention provides the determining devices of time in block chain a kind of, and described device includes storage medium And processor;
The processor is adapted for carrying out each instruction;
The storage medium is suitable for storing a plurality of instruction;
Described instruction is suitable for being loaded as the processor and executing the determination of time in the block chain as described in second aspect Method.
9th aspect, the present invention provides the determination system of time in block chain a kind of, the system comprises intelligent contract, The requesting party of acquisition time;Wherein, the intelligent contract includes the device as described in the third aspect, and the requesting party includes such as the Device described in four aspects.
By above-mentioned technical proposal, technical solution provided by the invention is at least had the advantage that
The determination method, apparatus and system of time in block chain provided by the invention, can be in each section in block chain When point needs to obtain current time, the current time of respective local is not directly acquired instead of, it is unified to work as to the acquisition of intelligent contract The preceding time, so that each node is synchronized in time.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the flow chart of the determination method of time in a kind of block chain provided in an embodiment of the present invention;
Fig. 2 shows the flow charts of the determination method of time in another block chain provided in an embodiment of the present invention;
Fig. 3 shows the composition block diagram of the determining device of time in a kind of block chain provided in an embodiment of the present invention;
Fig. 4 shows the composition block diagram of the determining device of time in another block chain provided in an embodiment of the present invention;
Fig. 5 shows the composition block diagram of the determining device of time in another block chain provided in an embodiment of the present invention;
Fig. 6 shows the composition block diagram of the determining device of time in another block chain provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
In order to provide a kind of unified Time Service mechanism to block chain, the embodiment of the invention provides in a kind of block chain The determination method of time, as shown in Figure 1, which comprises
101, the intelligent contract receiving time acquisition request on block chain.
Intelligent contract refers to that is defined in digital form is capable of the contract of automatic implementation of the provisions.In block chain technical field, Intelligent contract refers in particular to the computer program for triggering based on scheduled event, can not distorting, executing automatically.Intelligent contract once generates, Any one node can often call the intelligence contract in block chain, to realize a certain business or transaction.The present invention is real Applying the intelligent contract in example can be the contract of special offer Time Service, and being also possible to includes Time Service and other are serviced Contract.But when the intelligence contract is the special contract for providing Time Service, the opposite efficiency of operation time includes other The operation efficiency of the contract of service often wants high, therefore provides the contract of Time Service it is preferable to use special.
It, can be to providing the intelligent contract hair of Time Service when some node in block chain it needs to be determined that when current time Time acquisition request is sent, after receiving the time acquisition request so as to the intelligence contract, can be worked as to what the node feeding back determined The preceding time.
102, intelligent contract determines rule according to preset time, determines the current time of the block chain.
It is (i.e. default according to the processing logic of itself after intelligent contract receives the time acquisition request of requesting party's transmission Time determines rule), it determines the current time of block chain, and after determining time result, time result is fed back to ask immediately The side of asking.Wherein, preset time determines that rule may include a variety of, such as the local zone time of some node can be determined as required The time of some equipment outside block chain can also be determined as the required time by the time wanted.
103, the current time is returned to the requesting party for sending the time acquisition request by intelligent contract.
After intelligent contract determines the current time of block chain, which can be returned into requesting party, to request Root carries out subsequent logic processing according to the current time.
The determination method of time in block chain provided in an embodiment of the present invention can be needed in each node in block chain When obtaining current time, the current time of respective local is not directly acquired instead of, it is unified to obtain current time to intelligent contract, So that each node is synchronized in time.
Optionally, it is referred in above-mentioned steps 102, the method that intelligent contract determines current time has very much, below with following It is illustrated for two kinds of determining methods.
Method one: it obtains this and executes the current time that block chain goes out the node local of block;Described this is executed into block The current time that chain goes out the node local of block is determined as the current time of the block chain.
Wherein, there may be multiple block chains to go out block node (being commonly called as " mine machine ") in block chain, and each block chain goes out block section The block of point write-in is different, and synchronization only one block chain goes out block node and goes out block (i.e. generation block).In order to enable area This execution block chain is gone out node (the i.e. the last block out of block by the uniqueness of the current time of block chain, the embodiment of the present invention Block chain go out block node) current time of local current time as block chain.
In practical applications, intelligent contract be potentially stored in this execute block chain go out on the node of block, it is also possible to store On other nodes.Therefore obtaining the specific implementation of current time that this executes the node local that block chain goes out block can be with Are as follows: when the intelligent contract of the requestor requests of acquisition time, which is located at this execution block chain, to be gone out on the node of block, intelligent contract After receiving time acquisition request, local current time is directly read;When the intelligent contract is not located at this described execution When block chain is gone out on the node of block, after the intelligence contract receives time acquisition request, block can be executed to described this Chain goes out the node sending time acquisition request of block, then receive it is described this execute block chain go out block node feeding back it is current when Between.
You need to add is that in practical applications, in addition to the local zone time for executing the node that block chain goes out block with this is made It, can also be using the local zone time of other any nodes in block chain as the time of block chain outside time for block chain.
Method two: intelligent contract is first to the time server sending time acquisition request independently of the block chain, then The current time that the time server returns is received, is finally determined as the current time that the time server returns described The current time of block chain.
Due to being executed for block chain goes out the node local zone time of block relative to this, the time server meter of special timing The time of calculation is more accurate, so closing if a intelligence for being able to access that the time server independently of block chain can be created About, then current time preferentially is obtained using the intelligence contract.
Further, according to method described in intelligent contract side, another embodiment of the invention additionally provides a kind of area The determination method of time, this method can be applied to the node of any one request time on block chain in block chain, such as Fig. 2 institute Show, which comprises
201, when it needs to be determined that block chain current time when, to provide Time Service intelligent contract sending time obtain Request determines the current time of the block chain so that the intelligent contract determines rule according to preset time.
When certain node it needs to be determined that when the current time of block chain, can to the intelligent contract being locally stored or this hold Row block chain goes out the identical intelligent contract sending time acquisition request stored on the node of block, to receive when the intelligence contract To after the time acquisition request, rule can be determined according to the time of default setting, to determine current time.Wherein, of the invention Intelligent contract in embodiment can be the contract of special offer Time Service, be also possible to include Time Service and other services Contract.But when the intelligence contract is the special contract for providing Time Service, the opposite efficiency of operation time includes it The operation efficiency for the contract that he services often wants high, therefore provides the contract of Time Service it is preferable to use special.
202, the current time that the intelligent contract is sent is received.
After receiving the current time of intelligent contract feedback, subsequent logic processing can be carried out according to the current time, Realize the business with time correlation.
The determination method of time in block chain provided in an embodiment of the present invention can be needed in each node in block chain When obtaining current time, the current time of respective local is not directly acquired instead of, it is unified to obtain current time to intelligent contract, So that each node is synchronized in time.
Further, in practical applications, certain node may need frequently to determine current time in special time period, In this case, it if every time to intelligent contract acquisition time, operates comparatively laborious, it is lower to obtain efficiency.When in order to improve Between obtain efficiency, after obtaining current time from intelligent contract side, the current time tune that can be sent according to the intelligent contract Whole local current time, so that time synchronization.Thus subsequent can be directly from local acquisition time, without from intelligent contract Side acquisition time.
However, as time goes by, the local zone time of node is often slack-off, such as in life, common computer is Unite time (i.e. local zone time) with after network time synchronization, it is often slack-off after a period of time, lead to the system time of computer It is asynchronous again with network time.In order to avoid causing the time used in each node to occur again because above situation occurs It is asynchronous, it can first judge before the intelligent contract sending time acquisition request to offer Time Service according to the intelligence Can the current time that sends of contract adjust after local current time by duration whether reach preset duration threshold value;If when described Length reaches the preset duration threshold value, then sends the time acquisition request to the intelligent contract, to close from the intelligence About side obtains current time;If the duration is not up to the preset duration threshold value, directly local current time is determined For the current time of the block chain.Wherein, preset duration threshold value is determining based on practical experience node local zone time and intelligence There is most growing in short-term for difference in the time of energy contract institute operation.
Further, according to above method embodiment, another embodiment of the invention is additionally provided in a kind of block chain The determining device of time, as shown in figure 3, described device includes:
Receiving unit 31, the intelligent contract receiving time acquisition request on block chain;
Determination unit 32 determines the current time of the block chain for determining rule according to preset time;
Return unit 33, for the current time to be returned to the requesting party for sending the time acquisition request.
Optionally, as shown in figure 4, the determination unit 32 includes:
Module 321 is obtained, executes the current time that block chain goes out the node local of block for obtaining this;
First determining module 322, for determining this described current time for executing the node local that block chain goes out block For the current time of the block chain.
Optionally, the acquisition module 321, for going out block when the intelligent contract is located at this described execution block chain When on node, reads described this and execute the current time that block chain goes out the node local of block;When the intelligent contract is not located at When this described execution block chain is gone out on the node of block, the node sending time acquisition for going out block to this described execution block chain is asked It asks, receives described this and execute the current time that block chain goes out the node feeding back of block.
Optionally, as shown in figure 4, the determination unit 32 includes:
Sending module 323, for the time server sending time acquisition request independently of the block chain;
Receiving module 324, the current time returned for receiving the time server;
Second determining module 325, the current time for returning to the time server are determined as the block chain Current time.
The determining device of time includes pocessor and storage media in the block chain, above-mentioned receiving unit, determination unit, Return unit etc. is stored in a storage medium as program unit, executes the above-mentioned journey being stored in a storage medium by processor Sequence unit realizes corresponding function.
The determining device of time in block chain provided in an embodiment of the present invention can be needed in each node in block chain When obtaining current time, the current time of respective local is not directly acquired instead of, it is unified to obtain current time to intelligent contract, So that each node is synchronized in time.
Further, according to above method embodiment, another embodiment of the invention is additionally provided in a kind of block chain The determining device of time, as shown in figure 5, described device includes:
Transmission unit 41, for when it needs to be determined that block chain current time when, to provide Time Service intelligent contract Sending time acquisition request, so that the intelligent contract determines rule according to preset time, determine the block chain it is current when Between;
Receiving unit 42, the current time sent for receiving the intelligent contract.
Optionally, as shown in fig. 6, described device further include:
Adjustment unit 43, the current time of the current time adjustment local for being sent according to the intelligent contract, so that Time synchronization.
Optionally, as shown in fig. 6, described device further include:
Judging unit 44, for judging root before the intelligent contract sending time acquisition request to offer Time Service Whether reach preset duration threshold value according to the duration that the current time that the intelligent contract is sent adjusts local current time;
The transmission unit 41, for being sent out to the intelligent contract when the duration reaches the preset duration threshold value Send the time acquisition request.
Optionally, as shown in fig. 6, described device further include:
Determination unit 45, it is for when the duration is not up to the preset duration threshold value, local current time is true It is set to the current time of the block chain.
The determining device of time includes pocessor and storage media in the block chain, above-mentioned transmission unit, receiving unit, Adjustment unit, judging unit, determination unit etc. are stored in a storage medium as program unit, are stored in by processor execution Above procedure unit in storage medium realizes corresponding function.
The determining device of time in block chain provided in an embodiment of the present invention can be needed in each node in block chain When obtaining current time, the current time of respective local is not directly acquired instead of, it is unified to obtain current time to intelligent contract, So that each node is synchronized in time.
The embodiment of the invention provides a kind of storage medium, the storage medium includes the program of storage, wherein described Equipment program controls the storage medium when running where executes the determination side of time in the block chain as described in intelligent contract side Method.
The embodiment of the invention provides a kind of storage medium, the storage medium includes the program of storage, wherein described Equipment executes the determination method of time in the block chain as described in requesting party side program controls the storage medium when running where.
Storage medium may include the non-volatile memory in computer-readable medium, random access memory (RAM) And/or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one Storage chip.
The embodiment of the invention provides the determining devices of time in block chain a kind of, and described device includes storage medium and place Manage device;
The processor is adapted for carrying out each instruction;
The storage medium is suitable for storing a plurality of instruction;
Described instruction is suitable for as the processor loads and executes in the block chain as described in intelligent contract side the time really Determine method.
The embodiment of the invention provides the determining devices of time in block chain a kind of, and described device includes storage medium and place Manage device;
The processor is adapted for carrying out each instruction;
The storage medium is suitable for storing a plurality of instruction;
Described instruction is suitable for being loaded as the processor and executing the determination of time in the block chain as described in requesting party side Method.
Include kernel in processor, is gone in storage medium to transfer corresponding program unit by kernel.Kernel can be set one It is a or more, unify the time of each node in block chain by adjusting kernel parameter.
Further, another embodiment of the invention additionally provides the determination system of time in block chain a kind of, described System includes the requesting party of intelligent contract, acquisition time;Wherein, the intelligent contract includes device as shown in Figure 3 or Figure 4, The requesting party includes device as shown in Figure 5 or Figure 6.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just The program code of beginningization there are as below methods step:
Intelligent contract receiving time acquisition request on block chain;
Rule is determined according to preset time, determines the current time of the block chain;
The current time is returned to the requesting party for sending the time acquisition request.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just The program code of beginningization there are as below methods step:
When it needs to be determined that block chain current time when, to provide Time Service intelligent contract sending time acquisition ask It asks, so that the intelligent contract determines rule according to preset time, determines the current time of the block chain;
Receive the current time that the intelligent contract is sent.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory
(DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable Read memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), the more function of number Can CD (DVD) other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices or it is any its His non-transmission medium, can be used for storing and can be accessed by a computing device information.As defined in this article, computer-readable Jie Matter does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product. Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art, Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement, Improve etc., it should be included within the scope of the claims of this application.

Claims (15)

1. a kind of determination method of time in block chain, which is characterized in that the described method includes:
Intelligent contract receiving time acquisition request on block chain;
Rule is determined according to preset time, determines the current time of the block chain;
The current time is returned to the requesting party for sending the time acquisition request.
2. determining the area the method according to claim 1, wherein described determine rule according to preset time The current time of block chain includes:
It obtains this and executes the current time that block chain goes out the node local of block;
This described current time for executing the node local that block chain goes out block is determined as to the current time of the block chain.
3. according to the method described in claim 2, it is characterized in that, the node local for obtaining this execution block chain and going out block Current time include:
When the intelligent contract, which is located at this described execution block chain, to be gone out on the node of block, reads described this and execute block chain The current time of the node local of block out;
When the intelligent contract, which is not located at this described execution block chain, to be gone out on the node of block, block chain is executed to described this The node sending time acquisition request of block out receives described this and executes the current time that block chain goes out the node feeding back of block.
4. determining the area the method according to claim 1, wherein described determine rule according to preset time The current time of block chain includes:
To the time server sending time acquisition request independently of the block chain;
Receive the current time that the time server returns;
The current time that the time server returns is determined as to the current time of the block chain.
5. a kind of determination method of time in block chain, which is characterized in that the described method includes:
When it needs to be determined that block chain current time when, to provide Time Service intelligent contract sending time acquisition request, with Toilet states intelligent contract and determines rule according to preset time, determines the current time of the block chain;
Receive the current time that the intelligent contract is sent.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
According to the current time for the current time adjustment local that the intelligent contract is sent, so that time synchronization.
7. according to the method described in claim 6, it is characterized in that, being obtained to the intelligent contract sending time for providing Time Service Before taking request, the method also includes:
Judge to adjust whether the duration passed through after local current time reaches in the current time sent according to the intelligent contract To preset duration threshold value;
It is described to include: to the intelligent contract sending time acquisition request for providing Time Service
If the duration reaches the preset duration threshold value, the time acquisition request is sent to the intelligent contract.
8. the method according to the description of claim 7 is characterized in that the method also includes:
If the duration is not up to the preset duration threshold value, local current time is determined as the current of the block chain Time.
9. the determining device of time in a kind of block chain, which is characterized in that described device includes:
Receiving unit, the intelligent contract receiving time acquisition request on block chain;
Determination unit determines the current time of the block chain for determining rule according to preset time;
Return unit, for the current time to be returned to the requesting party for sending the time acquisition request.
10. the determining device of time in a kind of block chain, which is characterized in that described device includes:
Transmission unit, for when it needs to be determined that block chain current time when, to provide Time Service intelligent contract send when Between acquisition request so that the intelligent contract determines rule according to preset time determine the current time of the block chain;
Receiving unit, the current time sent for receiving the intelligent contract.
11. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program When control the storage medium where equipment perform claim require 1 into the block chain described in any one of claim 4 when Between determination method.
12. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program When control the storage medium where equipment perform claim require 5 to right want any one of 8 described in time in block chain Determination method.
13. the determining device of time in a kind of block chain, which is characterized in that described device includes storage medium and processor;
The processor is adapted for carrying out each instruction;
The storage medium is suitable for storing a plurality of instruction;
Described instruction is suitable for being loaded as the processor and being executed as described in any one of claim 1 to claim 4 The determination method of time in block chain.
14. the determining device of time in a kind of block chain, which is characterized in that described device includes storage medium and processor;
The processor is adapted for carrying out each instruction;
The storage medium is suitable for storing a plurality of instruction;
Described instruction is suitable for being loaded as the processor and being executed as described in any one of claim 5 to claim 8 The determination method of time in block chain.
15. the determination system of time in a kind of block chain, which is characterized in that the system comprises intelligent contracts, acquisition time Requesting party;Wherein, the intelligent contract includes device as claimed in claim 9, and the requesting party includes such as claim 10 The device.
CN201711252210.XA 2017-12-01 2017-12-01 Method, device and system for determining time in block chain Active CN109947843B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711252210.XA CN109947843B (en) 2017-12-01 2017-12-01 Method, device and system for determining time in block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711252210.XA CN109947843B (en) 2017-12-01 2017-12-01 Method, device and system for determining time in block chain

Publications (2)

Publication Number Publication Date
CN109947843A true CN109947843A (en) 2019-06-28
CN109947843B CN109947843B (en) 2021-06-01

Family

ID=67004042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711252210.XA Active CN109947843B (en) 2017-12-01 2017-12-01 Method, device and system for determining time in block chain

Country Status (1)

Country Link
CN (1) CN109947843B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110601849A (en) * 2019-08-21 2019-12-20 腾讯科技(深圳)有限公司 Trusted timestamp adding method and device and storage medium
CN111339187A (en) * 2020-02-20 2020-06-26 百度在线网络技术(北京)有限公司 Data processing method, device, equipment and storage medium based on intelligent contract

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106960165A (en) * 2017-03-13 2017-07-18 广东网金控股股份有限公司 It is a kind of that the method that electronic contract is conutersigned in many ways is realized based on the intelligent contract of block chain
CN106982203A (en) * 2017-01-06 2017-07-25 中国银联股份有限公司 The ATM network system and its information processing method of robust based on block chain technology
CN107317856A (en) * 2017-06-23 2017-11-03 李波 A kind of date storage method and device based on block chain
WO2017198291A1 (en) * 2016-05-18 2017-11-23 Rwe International Se Peer-to-peer network and node of a peer-to-peer network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017198291A1 (en) * 2016-05-18 2017-11-23 Rwe International Se Peer-to-peer network and node of a peer-to-peer network
CN106982203A (en) * 2017-01-06 2017-07-25 中国银联股份有限公司 The ATM network system and its information processing method of robust based on block chain technology
CN106960165A (en) * 2017-03-13 2017-07-18 广东网金控股股份有限公司 It is a kind of that the method that electronic contract is conutersigned in many ways is realized based on the intelligent contract of block chain
CN107317856A (en) * 2017-06-23 2017-11-03 李波 A kind of date storage method and device based on block chain

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110601849A (en) * 2019-08-21 2019-12-20 腾讯科技(深圳)有限公司 Trusted timestamp adding method and device and storage medium
CN111339187A (en) * 2020-02-20 2020-06-26 百度在线网络技术(北京)有限公司 Data processing method, device, equipment and storage medium based on intelligent contract
CN111339187B (en) * 2020-02-20 2023-05-09 百度在线网络技术(北京)有限公司 Data processing method, device, equipment and storage medium based on intelligent contract

Also Published As

Publication number Publication date
CN109947843B (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US11178233B2 (en) Service orchestration method and apparatus, and server
CN109298940B (en) Computing task allocation method and device, electronic equipment and computer storage medium
US20160239011A1 (en) Extending a Programmable Logic Controller with Apps
CN105432040A (en) Profile-based sla guarantees under workload migration in a distributed cloud
CN106130960B (en) Judgement system, load dispatching method and the device of steal-number behavior
CN109947843A (en) The determination method, apparatus and system of time in block chain
CN109729049A (en) The sharing method and device of information
CN111443894A (en) Random number generation method, device and medium based on block chain
CN114138468B (en) Self-adaptive distribution method and device for packaging task amount and storage medium
CN109614159A (en) Plan target distribution, introduction method and device
Raza et al. Configuration and Placement of Serverless Applications using Statistical Learning
CN109995787A (en) A kind of data processing method and relevant device
CN107678863A (en) The page assembly means of communication and device
US11120513B2 (en) Capital chain information traceability method, system, server and readable storage medium
CN108874375A (en) A kind of implementation method and device of timer
CN111832862B (en) Flow management method and system based on block chain
CN109981732A (en) Mass file transfer control method and device
CN116244062A (en) Data processing method and device, electronic equipment and storage medium
CN109542401A (en) A kind of Web development approach, device, storage medium and processor
CN110046034A (en) Task acquisition methods and device
CN109587069A (en) A kind of current-limiting method and system based on API gateway
CN109614386A (en) Data processing method, device, server and computer readable storage medium
CN110221989A (en) A kind of data cache method, device, storage medium and computer equipment
CN116993519A (en) Bill generation method and device
CN117348999B (en) Service execution system and service execution method

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