[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2024066390A1 - Network time synchronization method and system, and electronic device and storage medium - Google Patents

Network time synchronization method and system, and electronic device and storage medium Download PDF

Info

Publication number
WO2024066390A1
WO2024066390A1 PCT/CN2023/094583 CN2023094583W WO2024066390A1 WO 2024066390 A1 WO2024066390 A1 WO 2024066390A1 CN 2023094583 W CN2023094583 W CN 2023094583W WO 2024066390 A1 WO2024066390 A1 WO 2024066390A1
Authority
WO
WIPO (PCT)
Prior art keywords
chain
clock
time
accounting
node
Prior art date
Application number
PCT/CN2023/094583
Other languages
French (fr)
Chinese (zh)
Inventor
童羽
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2024066390A1 publication Critical patent/WO2024066390A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes

Definitions

  • the embodiments of the present invention relate to the field of communication technology, and in particular to a network timing method, system, electronic device and storage medium.
  • time synchronization is crucial and is a necessary condition for the collaborative work of communication equipment.
  • the IEEE organization developed a protocol for transmitting precise time through Ethernet. This is the 1588v2 that is currently widely used, which can provide a time synchronization accuracy of less than 100ns.
  • IEEE1588v2 is independent of the physical layer and can transmit synchronization information by adding time tags to messages.
  • time synchronization can also be achieved.
  • 1588v2 Since the 4G era, 1588v2 has been widely used in network communication systems. For example, it is used to provide accurate time information to base stations. In the 5G era, wireless base stations have higher requirements for time synchronization accuracy, requiring frequency synchronization accuracy to be less than 0.05ppm and phase synchronization accuracy to be less than 1.5us.
  • the current mainstream solution for applying 1588v2 in wireless base station networks to provide accurate time information to base stations is to centrally deploy 1588v2 servers in the core network room to provide time synchronization to all base stations in the wireless network.
  • 1588v2 can support high-precision phase synchronization and meet the synchronization requirements of 5G.
  • the packet transmission network requires all nodes to support the PTP (Precision Time Protocol) protocol to ensure that the base station obtains accurate time information.
  • the time information is transmitted through the transmission network. Due to the complex networking, network congestion, delay, jitter, packet loss and other factors will affect the time accuracy, making it difficult to meet the accuracy requirements of wireless base stations for timing. For the above problems existing in related technologies, no effective solution has been found so far.
  • the embodiments of the present invention provide a network timing method, system, electronic device, storage medium and storage medium to solve the technical problem that related technologies are difficult to meet the high-precision requirements of time synchronization of wireless base stations.
  • a network timing method is provided, which is applied to a blockchain network timing system, including: using a base station device in a target communication network as a block node to establish a chain domain of a time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock; the accounting node obtains standard time information from a standard time source system; the accounting node performs timing from the accounting clock to the on-chain clock according to the standard time information.
  • a network timing system which includes an accounting node and an on-chain node: the accounting node is configured to obtain standard time information from a standard time source system, and the accounting clock performs timing to the on-chain clock according to the standard time information; the on-chain node is configured to synchronize time information to the accounting clock.
  • a storage medium which includes a stored program, and the above steps are executed when the program is run.
  • an electronic device including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is configured to store a computer program; and the processor is configured to execute the steps in the above method by running the program stored in the memory.
  • the embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
  • FIG1 is a hardware structure block diagram of a computer according to an embodiment of the present invention.
  • FIG2 is a flow chart of a network timing method according to an embodiment of the present invention.
  • FIG3 is a schematic diagram of a flow chart of block time generation in an embodiment of the present invention.
  • FIG4 is a schematic diagram of a block time usage process in an embodiment of the present invention.
  • FIG5 is a schematic diagram of a query process of block time in an embodiment of the present invention.
  • FIG6 is a schematic diagram of a server-client structure according to an embodiment of the present invention.
  • FIG7 is a structural block diagram of a blockchain network timing system according to an embodiment of the present invention.
  • FIG8 is a schematic diagram of a blockchain data structure according to an embodiment of the present invention.
  • FIG9 is a schematic diagram of a model of a chain clock in an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a model of an accounting clock in an embodiment of the present invention.
  • FIG1 is a hardware structure block diagram of a computer of an embodiment of the present invention.
  • the computer may include one or more (only one is shown in FIG1 ) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data.
  • the above-mentioned computer may also include a transmission device 106 and an input-output device 108 for communication functions.
  • FIG1 is for illustration only and does not apply to the above-mentioned computer.
  • the computer may include more or fewer components than those shown in FIG. 1 , or may have a configuration different from that shown in FIG. 1 .
  • the memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a video motion-stillness rate recognition method in an embodiment of the present invention.
  • the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method.
  • the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the transmission device 106 is used to receive or send data via a network.
  • the specific example of the above network may include a wireless network provided by a communication provider of the computer.
  • the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
  • RF Radio Frequency
  • FIG. 2 is a flow chart of a network timing method according to an embodiment of the present invention applied to a primary base station. As shown in FIG. 2 , the flow includes the following steps:
  • Step S10 using the base station device in the target communication network as a block node to establish a chain domain of the time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock;
  • Step S20 the accounting node obtains standard time information from the standard time source system
  • Step S30 the accounting node synchronizes time with the on-chain clock through the accounting clock according to the standard time information.
  • All base station devices in the target communication network are used as block nodes to establish the chain domain of the time blockchain, where the target communication network can be a telecommunications-grade communication network.
  • the chain domain includes accounting nodes and on-chain nodes.
  • the nodes in the blockchain network can be divided into accounting nodes and non-accounting nodes (i.e., on-chain nodes in this embodiment).
  • Accounting nodes ensure the consistency of blockchain distributed system data and complete the generation and maintenance of blockchain data; non-accounting nodes can obtain corresponding
  • the time information provided by the accounting node disperses the timing pressure of the blockchain system.
  • the dynamic addition and deletion of blockchain nodes dynamically expands or downgrades resources according to specific business.
  • the accounting node corresponds to the accounting clock
  • the on-chain node corresponds to the on-chain clock. All nodes in the chain domain are divided into accounting clocks and on-chain clocks.
  • the accounting node obtains accurate standard time information from the standard time source system.
  • the standard time information includes timestamp, time type information, time source information, etc. Among them, the time source information includes atomic clock self-keeping system, GNSS system, and UTC system.
  • the accounting clock synchronizes the on-chain clock based on the obtained standard time information.
  • the blockchain time information is synchronized to the on-chain clock through the blockchain, and the blockchain technology is applied to the time synchronization of the base station equipment.
  • the base station in the blockchain provides storage space and computing power support for the entire blockchain system, realizes decentralization, and reduces dependence on the transmission network, that is, reduces the impact on networking performance and improves the accuracy of time synchronization of the base station.
  • the blockchain network timing system obtains standard time information from the standard time source system, and the blockchain network timing system uploads the key information of the block time to the chain, including the unique identifier of the block time, the node information of the generated block, the timestamp information, the time source type information (such as atomic clock self-timekeeping, GNSS timing system, UTC time source, etc.), the block time status and other information.
  • the device to be synchronized or the third-party time information service provider applies to the blockchain network timing system for block time.
  • the relevant processes such as block time generation and block time authorization are saved on the chain to facilitate subsequent verification and traceability through the blockchain network timing system.
  • the services supported by the blockchain network timing system include the generation of block time, the use of block time, the query of block time and the timing process.
  • the construction of the blockchain network timing system includes but is not limited to network deployment (deployment of nodes constituting the blockchain, including consensus nodes and business nodes), realization of block chain generation and storage, reaching consensus, realization of business acceptance and business processing, etc., and then the blockchain network timing system is serviced and operated, and the full life cycle of timing services is managed, such as user management, business allocation, business query and authority management.
  • the third-party device can be an individual, legal person, enterprise, government agency, etc. who uses the blockchain network timing system.
  • the third-party device can directly use the timing service of the blockchain network timing system, or use the blockchain network timing service through a third-party network timing provider, such as local application system network timing, hardware device time synchronization, etc.
  • the blockchain network timing system includes system management, timing protocol management, blockchain time protocol (BTP), open platform, blockchain time underlying engine and blockchain base.
  • System management is used to manage the blockchain network timing system, including user management, system parameter configuration, etc.
  • Timing protocol management is used to manage the timing protocols used by the system, which can include NTP, PTP and BTP.
  • Blockchain Time Protocol (BTP) is used to define the standards for blockchain timing, including protocol implementation, messages, etc.
  • the open platform provides open capabilities related to time information for various network business systems and third-party network timing service providers.
  • the open platform provides basic capabilities related to timing and connects to the underlying blockchain time engine.
  • the underlying blockchain time engine realizes the generation and maintenance of blockchain time information, and cooperates with the blockchain base to complete consensus.
  • the blockchain base provides trusted time evidence for the entire life cycle, with node management, consensus, accounting nodes, security and external application chain interoperability.
  • the blockchain network timing system synchronizes time information with the standard time source system to obtain high-precision and reliable time.
  • the blockchain network timing system can communicate with other application chains across chains, such as connecting to the time network application chain to form a time information closed loop of the network timing application.
  • timing protocol management To use the blockchain network timing system, you must first choose which synchronization protocol to use.
  • the blockchain network timing system uses this protocol for network timing.
  • the timing protocol management functions include: managing synchronization protocols, such as BTP, PTP, NTP, etc.; configuring or negotiating synchronization protocol parameters; querying the server information of the timing, such as the number of servers, blockchain time status, etc.
  • the time status includes generating, consensus, and waiting for consensus, among which the "consensus" status is the normal use status; querying the client information of the timing, such as the number of clients, client status, etc.
  • the client status includes normal, abnormal, offline, etc.
  • System management provides management of all modules of the blockchain timing system for the operation departments of service providers and service users: it has an administrator management function module for creating, modifying and disabling administrators; it has a role management function module for creating, modifying and deleting roles; it has a system audit function module for auditing operation records within the system; system overall function module management, configuration module parameters, etc.; fault management, alarm management, system usage information management, etc.; it has a node management function for managing and querying the status and information of timing nodes; it has a data visualization module for analyzing and displaying blockchain operation signs, block time statistics, etc.; account management: real-name authenticated account registration, user identity identification, user account freezing and thawing, user logout, etc. It should have a user privacy protection mechanism.
  • identity authentication user identity authentication ensures correct identification and authentication
  • Identify the user's identity information and authorization information Use secure algorithms and protocols that comply with national password management regulations for identity authentication; ensure the storage security of user passwords and other identity authentication-related credential information; use two-factor authentication for operations on important data, business or systems.
  • Blockchain time underlying engine is the basic capability driving engine of the blockchain network timing system. It provides system components, supports upper-layer blockchain time applications and management, implements node timing according to the selected synchronization protocol, and connects to the blockchain base to provide reliable and traceable on-chain time services for network timing applications: It has a standard time source synchronization component, provides high-precision timestamps for the blockchain base, generates block time, and completes the generation and chaining of block time.
  • the standard time source selection needs to be a high-precision atomic clock self-timekeeping system, a satellite timing system (GNSS) or other world standard time, and has strict requirements on its error range; it has an online verification component to provide unified verification services for block time users, service providers, and application systems; it has a block time on-chain service component to support services such as block time chaining and recording chain information; according to the synchronization protocol selection module protocol, the interface provided by the blockchain base is called to provide a network timing engine for blockchain time.
  • GNSS satellite timing system
  • Blockchain base provides a peer-to-peer network environment, through transparent and trusted rules, to build a block chain time data structure that is unforgeable, tamper-proof and traceable: based on the consensus mechanism, it achieves consistency of time data on distributed accounting nodes; through smart contract programming and virtual machine execution engine, it completes Turing-complete time transaction processing; based on cryptography and chain structure, it ensures that data cannot be tampered with or forged; it can effectively verify the data stored on the blockchain, and at the same time, there are corresponding technologies to ensure that privacy information is not leaked.
  • Smart contracts support the storage and operation of smart contract codes to ensure that the execution results of all nodes remain consistent after the smart contract is executed; support Turing-complete smart contracts; support the adjustment of smart contract code logic and the update of data structure; smart contracts have the ability of forward data compatibility.
  • the version is iterated, the old version of the contract is deactivated in time and the data is archived.
  • the new version of the contract can call historical data.
  • Consensus algorithm has the Byzantine fault tolerance capability of consensus nodes; maintains the consistency of each node's write operation to update the ledger status; ensures the consistency of the final status of each node's ledger; can reach a new consensus on the entire network after switching the consensus mechanism when the node is online, and the system operates normally.
  • Cross-chain requirements Support the establishment of a trusted bridging mechanism between the blockchain and the outside world, so that external data can enter the blockchain safely and reliably; support multi-mode cross-chain interconnection solutions, support application layer cross-chain, homogeneous cross-chain, heterogeneous cross-chain and other cross-chain modes, and choose to adopt according to specific business scenarios.
  • the Blockchain Time Protocol specifies a time synchronization protocol. This protocol is applicable to distributed systems consisting of one or more nodes, communicating over a network. A node is defined as containing real-time time, which can be used by applications within the node for various purposes. The protocol provides a mechanism for synchronizing the time of participating nodes to a high degree of accuracy. This protocol specifies: The Blockchain Time Protocol (BTP); The node, system, and communication properties necessary to support BTP.
  • the BTP system uses the standard data types and formats of general computer system programming languages.
  • the blockchain data structure uses a one-way linked list, and each block consists of two parts, the block header and the block body.
  • the block body is mainly used to store time data; the content stored in the block header can be divided into four parts, namely the root hash of the previous block (the hash value stored in the Merkle tree root node of the previous block), the Merkle tree root hash (the hash value stored in the Merkle tree root node of the current block), the timestamp, and others.
  • the block body stores the blockchain timestamp data.
  • Timing messages are divided into timing messages and control messages. Timing messages generate accurate timestamps when sent and received. Timing messages include: synchronization requests and timing responses; control messages include notification messages, management messages, and event messages, among which notification messages are used for fault and alarm notifications; management messages are used to query and update the BTP data set maintained by the clock. These messages are also used to customize the BTP system as well as for initialization and consensus. Management messages are used for accounting nodes; event messages are used for communication between clocks and for all other purposes. For example, event messages can be used to negotiate the communication type, message rate, etc. between the server and its clients. All messages can be extended through the standard type, length, value (TLV) extension mechanism.
  • TLV standard type, length, value
  • the BTP system is a distributed network system composed of a mixture of BTP devices and non-BTP devices.
  • BTP devices include accounting clocks, on-chain clocks, etc.
  • Non-BTP devices include bridges, routers and other infrastructure devices, and possibly computers, printers and other application devices.
  • the BTP protocol is a distributed protocol that specifies how real-time times in the system are synchronized with each other. These times are organized into a server-client hierarchy, where the standard time source is at the top of the hierarchy and determines the reference time of the entire system. Timing is achieved by exchanging BTP messages, where the client uses the time information provided by the server to adjust its time to the time of the most accurate server.
  • Devices in the BTP system communicate with each other through a communication network.
  • the network can include devices that implement different network communication protocols.
  • the protocol is executed within a logical scope called a chain domain. Unless otherwise specified, all BTP messages, data sets, state machines, and all other BTP entities are always associated with a specific chain domain.
  • a given physical network and a single device connected to the network A device can be associated with multiple domains.
  • the time established by the protocol in one domain is independent of the time in other chain domains.
  • the model of the on-chain clock is shown in Figure 9.
  • the on-chain clock communicates with the network through a logical interface based on a single physical port.
  • the message interface is set to send and receive timing messages and control messages. These timing messages are timestamped by timestamps that generate values based on local time.
  • the on-chain clock in the chain domain supports a single copy protocol and has a BTP state.
  • the on-chain clock is the clock client in the system.
  • the on-chain clock maintains two types of data sets, called blockchain clock data sets and BTP port data sets.
  • the BTP protocol engine completes the following functions: sending and receiving BTP messages; maintaining data sets; executing port-associated state machines.
  • the on-chain clock port is always in the slave state (synchronized to the server), and it will calculate the server-side time based on the received BTP timing message and the generated timestamp.
  • the control loop in the local clock adjusts the local time to be consistent with the server.
  • the model of the accounting clock is shown in Figure 10.
  • the accounting clock usually has multiple physical interfaces, each of which communicates with the network through a logical interface: timing message and control message interface.
  • Each port of the accounting clock has the following characteristics: a) The blockchain time data set is common to all ports of the accounting clock. b) The local clock is common to all ports of the accounting clock. c) Each protocol engine has the additional function of parsing the status of all ports to determine which port provides the time signal for synchronizing the local clock.
  • the accounting clock obtains time information from an external standard time source and generates blockchain time information through an internal algorithm. Messages related to synchronization and establishing a server-client hierarchy terminate in the protocol engine of the accounting clock and will not be forwarded.
  • Management messages are forwarded by other ports on the accounting clock according to restrictions to limit the propagation of these messages in the system.
  • the accounting clock model of Figure 10 is only applicable to BTP messages.
  • the accounting clock acts as a normal network component, such as a base station, bridge, repeater, or router.
  • the accounting clock is only used as an accounting node.
  • the network timing method also includes:
  • Step A generating a block time data chain block according to the standard time information, wherein the block data of the block time data chain block is the block time;
  • Step B adding the block time data chain block to the blockchain, and using the block time to synchronize time with other devices outside the chain domain.
  • the blockchain network timing system obtains standard time information, generates a block time data chain block based on the obtained standard time information, directly or indirectly applies for a digital certificate from a digital certificate certification authority and encrypts the block time data chain block.
  • the generated block time data chain block is recorded in the platform system and added to the blockchain.
  • the generated block time can be synchronized to other devices through a third-party network timing service provider or directly.
  • the accounting node provides time to the on-chain clock from the accounting clock according to the standard time information, including:
  • Step S301 the accounting node receives a block time synchronization request sent by the on-chain clock
  • Step S302 the accounting node performs node authentication on the on-chain clock
  • Step S303 after the node authentication is passed, the accounting node uses a synchronization protocol to synchronize time from the accounting clock to the on-chain clock according to the standard time information.
  • the accounting node receives the block time synchronization request sent by the on-chain clock, and the accounting node performs node authentication on the on-chain clock. After the node authentication is passed, the accounting node uses the synchronization protocol to synchronize the time from the accounting clock to the on-chain clock according to the standard time information.
  • the blockchain network timing system manages the time blockchain, including generating, updating, and maintaining the blockchain. After the block time user completes its own configuration, it sends the block time application to the blockchain network timing system through the on-chain clock. The blockchain network timing system performs node authentication on the applicant. After the blockchain network timing system authenticates the node, it sends the synchronization protocol to the application node according to the synchronization protocol configured by the system to negotiate the timing protocol.
  • the blockchain network timing system records the user information in the platform management system and uses the successfully negotiated synchronization protocol to synchronize the applicant. As shown in Figure 4, the blockchain network timing system uploads the block time usage process and key information to the chain, including block unique identification, block time related information, negotiation file summary information, synchronization protocol information, user information, etc. The complete block time application process and user information content are uploaded to the chain for reliable tracking or tracing. In order to enhance the credible evidence of block content, the user's content can be stored in credible government departments, such as administrative blockchains, through cross-chain technology.
  • the network timing method also includes:
  • Step C receiving a block time query request sent by a third-party device
  • Step D authenticating the third-party device based on the block information, block time status and deployed services in the query request, and returning the timing time of the chain domain to the third-party device after the authentication is passed.
  • the third-party device receives the block time query request sent by the third-party device, which is a service user with relevant permissions.
  • the third-party device can directly or through the third-party network timing service provider to initiate a query of the block time and its application to the blockchain network timing system.
  • the third-party device is authenticated based on the block information, block time status and deployed business in the query request, and the timing time of the chain domain is returned to the third-party device after the identity authentication is passed.
  • the block time information on the blockchain can be queried, including the unique identifier of the block time, user information, time type information, block time status, etc.; the usage of different states can be tracked, such as the usage of the status to be uploaded to the chain, uploaded to the chain, and in use; the signed business, such as documents and contracts, is verified, and the verification content includes but is not limited to the integrity of the block time, the validity of the block time, the validity of the digital certificate, etc.
  • the blockchain network timing system returns the query results to the service user who initiated the query. As shown in Figure 5, the blockchain network timing system uploads the query process and key information of the block time to the chain.
  • the network timing method also includes:
  • Step E Use the accounting clock in the chain domain and the on-chain clock to establish a server and client structure, where each server is connected to multiple clients, and each client is connected to multiple servers;
  • Step F based on the server and client structure, the accounting clock synchronizes time with the on-chain clock according to the standard time information, wherein the port of the accounting clock is the server clock to the on-chain clock, and the port of the on-chain clock is the client port of the accounting clock.
  • the accounting clock in the chain domain and the on-chain clock are used to establish a server and client structure.
  • the accounting clock is the server and the on-chain clock is the client.
  • Each server can connect to multiple clients, and each client can connect to multiple servers, where the number of clients for which each server provides timing services does not exceed 100; the number of servers synchronized by each client is not less than 2.
  • the accounting clock provides timing to the on-chain clock according to the standard time information, where the port of the accounting clock is the server clock to the on-chain clock, and the port of the on-chain clock is the client port of the accounting clock. It should be noted that in this embodiment, only the establishment of server-client two-layer services is allowed, and the client is not allowed to provide timing to other devices or clients.
  • the process of establishing a server-client structure between the accounting clock in the chain domain and the on-chain clock is shown in Figure 6.
  • the accounting clock is in a parallel relationship with the accounting clock, located at the root of the hierarchy, called the "clock server".
  • the port of the accounting clock is the server clock to the on-chain clock (as shown by S). All S ports on the accounting clock are server ports of the on-chain clock connected to them.
  • the port of the on-chain clock is the client port of the accounting clock.
  • the network timing method also includes:
  • Step G the on-chain clock of the on-chain node sends a synchronization message to the accounting clock
  • Step H the on-chain clock of the on-chain node receives the timing message message returned by the accounting clock, and the timing message message carries the first timestamp of sending the timing message message;
  • Step I the on-chain clock of the on-chain node calculates the synchronization time according to the first timestamp and the second timestamp, where the second timestamp is the timestamp of the on-chain clock receiving the timing message.
  • the on-chain clock of the on-chain node sends a synchronization message to the accounting clock.
  • the on-chain clock of the on-chain node receives the timing message returned by the accounting clock.
  • the timing message carries the first timestamp of sending the timing message.
  • the on-chain clock of the on-chain node calculates the synchronization time based on the first timestamp and the second timestamp.
  • the second timestamp is the timestamp of the on-chain clock receiving the timing message.
  • the timing process between the accounting clock and the on-chain clock in the chain domain is as follows: the on-chain clock sends a synchronization message Sync_Req message to the accounting clock; after receiving the request, the accounting clock sends a timing message Timing_Resp message to the on-chain clock, which carries the timestamp when it leaves the accounting clock.
  • the on-chain clock adds its own timestamp and hands the message over to the application for processing; the blockchain time underlying engine extracts the time information in the block and calculates the current accurate time. In this way, the on-chain clock can set its own time based on this information to synchronize it with the time of the accounting clock.
  • the network timing method further includes:
  • Step J Convert the standard time information obtained from the standard time source system into local time to generate a time blockchain data structure
  • Step K using blockchain technology to organize time information
  • Step L transmitting the time information in the blockchain through the time blockchain data structure.
  • the standard time information obtained from the external standard time source system is converted into local time, and a time blockchain data structure is generated.
  • the time information is organized using blockchain technology, and the time information is transmitted in the blockchain through the time blockchain data structure.
  • the time information is organized using blockchain technology, and accurate time information is transmitted through the time blockchain data structure.
  • the timing process and protocol can choose existing synchronization protocols such as PTP or NTP, and the blockchain timing protocol BTP defined by this system is preferred.
  • the network timing method also includes:
  • Step M generating a block time data chain block according to the standard time information, wherein the block data of the block time data chain block is the block time;
  • Step N adding the block time data chain block to the blockchain, and using the block time to synchronize time with other devices outside the chain domain.
  • a block time data chain block is generated according to the standard time information, wherein the block data of the block time data chain block is the block time, the block time data chain block is added to the blockchain, and the block time is used to synchronize time to other devices outside the chain domain.
  • Blockchain A model for implementing and managing transaction processing by building an unforgeable, tamper-proof and traceable block chain data structure through transparent and trusted rules in a peer-to-peer network environment.
  • Chain Domain The collection of all devices using the Blockchain Time Protocol (BTP).
  • BTP Blockchain Time Protocol
  • BTP Blockchain Time Protocol
  • Time server A device that uses the blockchain time protocol to synchronize time in a chain domain. It is the time source in the selected chain domain. There can be multiple time servers in a chain domain. In this system, it is referred to as a server.
  • Time client A device that uses the Blockchain Time Protocol (BTP) to receive time information from a time server within the chain domain and synchronize its own time.
  • BTP Blockchain Time Protocol
  • a time client can select multiple servers. In this system, it is referred to as a client.
  • Node A device that can send or receive Blockchain Time Protocol (BTP) communications on the network.
  • BTP Blockchain Time Protocol
  • BTP port A physical interface running the Blockchain Time Protocol (BTP), a logical access point for the clock, used for BTP communication with the communication network.
  • BTP Blockchain Time Protocol
  • Port Number An index that identifies a specific Blockchain Time Protocol (BTP) port on a BTP node.
  • BTP Blockchain Time Protocol
  • Accuracy The average value of the time or frequency error between the measured clock and the reference clock.
  • the accounting node of a blockchain in a chain domain has one or more Blockchain Time Protocol (BTP) ports and maintains the clock used in the chain domain. It can be used as a time source in the chain domain, that is, a time server.
  • BTP Blockchain Time Protocol
  • On-chain clock A non-accounting node of a blockchain in a chain domain, which has a Blockchain Time Protocol (BTP) port and uses the time in the chain domain to synchronize its own clock. That is, the client.
  • BTP Blockchain Time Protocol
  • BTP Blockchain Time Protocol
  • BTP Blockchain Time Protocol
  • Blockchain Time Protocol (BTP) communication path The portion of the signaling path of a specific network that enables direct communication between the on-chain clock and the accounting clock.
  • BTP Blockchain Time Protocol
  • a recognized standard time source is an external source to the Blockchain Time Protocol (BTP) that provides time and/or frequency as needed, traceable to international standards laboratories that maintain clocks that form the basis of the International Atomic Energy Agency Time (TAI) and Universal Coordinated Time (UTC) timekeepers. Examples include the Global Positioning System (GPS, BeiDou), and the U.S. National Institute of Standards and Technology (NIST) time servers.
  • BTP Blockchain Time Protocol
  • TAI International Atomic Energy Agency Time
  • UTC Universal Coordinated Time
  • GPS Global Positioning System
  • BeiDou Global Positioning System
  • NIST National Institute of Standards and Technology
  • Network time synchronization The process of using the network to transmit standard time information and achieve computer system time synchronization by providing a clock correction reference benchmark.
  • Clock source A recognized standard time source that provides appropriate time and/or frequency traceable to an international standard laboratory, such as the time server of the National Time Service Center of the Chinese Academy of Sciences, the BeiDou satellite system, the Global Positioning System (GPS), etc.
  • the clocks maintained by these international standard laboratories serve as the basis for the International Atomic Time (TAI) and Coordinated Universal Time (UTC) time scales.
  • TAI International Atomic Time
  • UTC Coordinated Universal Time
  • Network time synchronization protocol A collection of rules, standards or agreements established to transmit unified and standard time on the network. Commonly used network time synchronization protocols include: Network Time Protocol (NTP), Simple Network Time Protocol (SNTP), Precision Time Protocol (PTP), Blockchain Time Protocol (BTP).
  • NTP Network Time Protocol
  • SNTP Simple Network Time Protocol
  • PTP Precision Time Protocol
  • BTP Blockchain Time Protocol
  • Timestamp A credential automatically generated by an application that identifies and records the time when an event occurred.
  • Associative entity A data entity in a many-to-many relationship between two data entities.
  • Turing complete refers to a universal physical machine or programming language with unlimited storage capacity. Turing complete means that the language used can do everything that a Turing machine can do and can solve all computable problems.
  • the technical solution of the embodiment of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
  • a storage medium such as ROM/RAM, magnetic disk, optical disk
  • a terminal device which can be a mobile phone, computer, server, or network device, etc.
  • a network timing system is also provided to realize the above-mentioned embodiment and the preferred implementation mode, and the description thereof will not be repeated.
  • the term "module" can realize the combination of software and/or hardware of the predetermined function.
  • the device described in the following embodiments is preferably realized with software, the realization of hardware, or the combination of software and hardware is also possible and conceived.
  • the network timing system includes accounting nodes and on-chain nodes:
  • the accounting node is configured to obtain standard time information from a standard time source system, and the accounting clock synchronizes time with the on-chain clock according to the standard time information;
  • the on-chain node is configured to synchronize time information with the accounting clock.
  • An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
  • the storage medium may be configured to store a computer program configured to perform the following steps:
  • the base station device in the target communication network uses the base station device in the target communication network as a block node to establish a chain domain of the time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock;
  • the accounting node obtains standard time information from the standard time source system
  • the accounting node synchronizes time from the accounting clock to the on-chain clock according to the standard time information.
  • the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
  • a USB flash drive a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
  • An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
  • the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
  • the processor may be configured to perform the following steps through a computer program:
  • the base station device in the target communication network uses the base station device in the target communication network as a block node to establish a chain domain of the time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock;
  • the accounting node obtains standard time information from the standard time source system
  • the accounting node synchronizes time from the accounting clock to the on-chain clock according to the standard time information.
  • the disclosed technical content can be implemented in other ways.
  • the device embodiments described above are only exemplary.
  • the division of the units is only a logical function division. There may be other divisions in actual implementation.
  • multiple units or components can be combined or integrated into another system, or some features can be ignored or not performed.
  • the coupling or direct coupling or communication connection between each other shown or discussed can be an indirect coupling or communication connection through some interface, unit or module, which can be electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiments of the present invention belong to the technical field of communications. Disclosed are a network time synchronization method and system, and an electronic device and a storage medium. The method comprises: taking a base station device in a target communication network as a block node to establish a chain domain of a time blockchain, wherein the chain domain comprises an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock; the accounting node acquiring standard time information from a standard time source system; and the accounting node carrying out time synchronization on the on-chain clock via the accounting clock according to the standard time information.

Description

网络授时方法、系统、电子设备及存储介质Network timing method, system, electronic device and storage medium 技术领域Technical Field
本发明实施例涉及通信技术领域,具体而言,涉及一种网络授时方法、系统、电子设备及存储介质。The embodiments of the present invention relate to the field of communication technology, and in particular to a network timing method, system, electronic device and storage medium.
背景技术Background technique
对于网络通信来说,时间同步至关重要,是通信设备协同工作的必要条件。2008年初,IEEE组织制定了通过以太网传递精确时间的协议,这个就是目前正在广泛使用的1588v2,可以提供小于100ns的时间同步精度。IEEE1588v2独立于物理层,可通过在报文中加入时间标签来传递同步信息,除了频率同步之外还可以实现时间同步。从4G时代开始,1588v2被广泛应用于网络通信系统中。例如,用于给基站提供精确时间信息。5G时代无线基站对时间同步精度的要求更高,要求满足频率同步精度小于0.05ppm,相位同步精度小于1.5us。For network communication, time synchronization is crucial and is a necessary condition for the collaborative work of communication equipment. In early 2008, the IEEE organization developed a protocol for transmitting precise time through Ethernet. This is the 1588v2 that is currently widely used, which can provide a time synchronization accuracy of less than 100ns. IEEE1588v2 is independent of the physical layer and can transmit synchronization information by adding time tags to messages. In addition to frequency synchronization, time synchronization can also be achieved. Since the 4G era, 1588v2 has been widely used in network communication systems. For example, it is used to provide accurate time information to base stations. In the 5G era, wireless base stations have higher requirements for time synchronization accuracy, requiring frequency synchronization accuracy to be less than 0.05ppm and phase synchronization accuracy to be less than 1.5us.
相关技术中,1588v2应用在无线基站网络中给基站提供精确时间信息的当前主流方案是将1588v2的服务器采用集中式部署在核心网机房中,给无线网络中的所有基站授时。理论上来说,1588v2可支持高精度的相位同步,能够满足5G的同步需求。但实际上,分组传输网络需要所有节点都支持PTP(Pricise Time Protocol,精准时间协议)协议才能保证基站得到准确的时间信息。通过传输网传递时间信息,由于组网较为复杂,网络的拥塞,时延,抖动,丢包等因素都会影响时间精度,难以满足无线基站对授时的精度要求。针对相关技术中存在的上述问题,目前尚未发现有效的解决方案。In the related technologies, the current mainstream solution for applying 1588v2 in wireless base station networks to provide accurate time information to base stations is to centrally deploy 1588v2 servers in the core network room to provide time synchronization to all base stations in the wireless network. Theoretically, 1588v2 can support high-precision phase synchronization and meet the synchronization requirements of 5G. But in fact, the packet transmission network requires all nodes to support the PTP (Precision Time Protocol) protocol to ensure that the base station obtains accurate time information. The time information is transmitted through the transmission network. Due to the complex networking, network congestion, delay, jitter, packet loss and other factors will affect the time accuracy, making it difficult to meet the accuracy requirements of wireless base stations for timing. For the above problems existing in related technologies, no effective solution has been found so far.
发明内容Summary of the invention
本发明实施例提供了一种网络授时方法、系统、电子设备及存储介质及存储介质,以解决相关技术难以满足无线基站的时间同步的高精度要求的技术问题。 The embodiments of the present invention provide a network timing method, system, electronic device, storage medium and storage medium to solve the technical problem that related technologies are difficult to meet the high-precision requirements of time synchronization of wireless base stations.
根据本申请实施例的一个方面,提供了一种网络授时方法,应用于区块链网络授时系统,包括:将目标通信网络中的基站设备作为区块节点建立时间区块链的链域,其中,所述链域包括记账节点和链上节点,所述记账节点对应记账时钟,所述链上节点对应链上时钟;所述记账节点从标准时间源系统获取标准时间信息;所述记账节点根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时。According to one aspect of an embodiment of the present application, a network timing method is provided, which is applied to a blockchain network timing system, including: using a base station device in a target communication network as a block node to establish a chain domain of a time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock; the accounting node obtains standard time information from a standard time source system; the accounting node performs timing from the accounting clock to the on-chain clock according to the standard time information.
根据本申请实施例的另一个方面,还提供了一种网络授时系统,所述网络授时系统包括记账节点和链上节点:所述记账节点,设置为从标准时间源系统获取标准时间信息,根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时;所述链上节点,设置为向所述记账时钟同步时间信息。According to another aspect of an embodiment of the present application, a network timing system is also provided, which includes an accounting node and an on-chain node: the accounting node is configured to obtain standard time information from a standard time source system, and the accounting clock performs timing to the on-chain clock according to the standard time information; the on-chain node is configured to synchronize time information to the accounting clock.
根据本申请实施例的另一方面,还提供了一种存储介质,该存储介质包括存储的程序,程序运行时执行上述的步骤。According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
根据本申请实施例的另一方面,还提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;其中:存储器,设置为存放计算机程序;处理器,设置为通过运行存储器上所存放的程序来执行上述方法中的步骤。According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is configured to store a computer program; and the processor is configured to execute the steps in the above method by running the program stored in the memory.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述方法中的步骤。The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
图1是本发明实施例的一种计算机的硬件结构框图;FIG1 is a hardware structure block diagram of a computer according to an embodiment of the present invention;
图2是根据本发明实施例的一种网络授时方法的流程图;FIG2 is a flow chart of a network timing method according to an embodiment of the present invention;
图3是本发明实施例中的区块时间生成的流程示意图;FIG3 is a schematic diagram of a flow chart of block time generation in an embodiment of the present invention;
图4是本发明实施例中的区块时间使用流程示意图;FIG4 is a schematic diagram of a block time usage process in an embodiment of the present invention;
图5是本发明实施例中的区块时间的查询流程示意图; FIG5 is a schematic diagram of a query process of block time in an embodiment of the present invention;
图6是本发明实施例中服务器-客户端结构示意图;FIG6 is a schematic diagram of a server-client structure according to an embodiment of the present invention;
图7是本发明实施例中区块链网络授时系统的结构框图;FIG7 is a structural block diagram of a blockchain network timing system according to an embodiment of the present invention;
图8是本发明实施例中区块链数据结构示意图;FIG8 is a schematic diagram of a blockchain data structure according to an embodiment of the present invention;
图9是本发明实施例中链上时钟的模型示意图;FIG9 is a schematic diagram of a model of a chain clock in an embodiment of the present invention;
图10是本发明实施例中记账时钟的模型示意图。FIG. 10 is a schematic diagram of a model of an accounting clock in an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“主时间”、“从时间”等是用于区别类似的对象。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "master time", "slave time", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
实施例1Example 1
本申请实施例一所提供的方法实施例可以在手机、计算机、平板或者类似的运算装置中执行。以运行在计算机上为例,图1是本发明实施例的一种计算机的硬件结构框图。如图1所示,计算机可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,可选地,上述计算机还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述计 算机的结构造成限定。例如,计算机还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in the first embodiment of the present application can be executed in a mobile phone, a computer, a tablet or a similar computing device. Taking running on a computer as an example, FIG1 is a hardware structure block diagram of a computer of an embodiment of the present invention. As shown in FIG1 , the computer may include one or more (only one is shown in FIG1 ) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above-mentioned computer may also include a transmission device 106 and an input-output device 108 for communication functions. It can be understood by those skilled in the art that the structure shown in FIG1 is for illustration only and does not apply to the above-mentioned computer. For example, the computer may include more or fewer components than those shown in FIG. 1 , or may have a configuration different from that shown in FIG. 1 .
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的一种视频动静率识别方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a video motion-stillness rate recognition method in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
传输设备106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机的通信供应商提供的无线网络。在一个实例中,传输设备106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
在本实施例中提供了一种网络授时方法,图2是根据本发明实施例的一种网络授时方法应用于主基站的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a network timing method is provided. FIG. 2 is a flow chart of a network timing method according to an embodiment of the present invention applied to a primary base station. As shown in FIG. 2 , the flow includes the following steps:
步骤S10,将目标通信网络中的基站设备作为区块节点建立时间区块链的链域,其中,所述链域包括记账节点和链上节点,所述记账节点对应记账时钟,所述链上节点对应链上时钟;Step S10, using the base station device in the target communication network as a block node to establish a chain domain of the time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock;
步骤S20,所述记账节点从标准时间源系统获取标准时间信息;Step S20, the accounting node obtains standard time information from the standard time source system;
步骤S30,所述记账节点根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时。Step S30: the accounting node synchronizes time with the on-chain clock through the accounting clock according to the standard time information.
将目标通信网络中的所有基站设备作为区块节点,建立时间区块链的链域,其中,目标通信网络具体可以为电信级通信网络,链域包括记账节点和链上节点,按照节点的主要功能,区块链组网中节点可分为记账节点和非记账节点(即本实施例中的链上节点)。记账节点保证区块链分布式系统数据的一致性,完成区块链数据的生成和维护;非记账节点可以根据位置获取相应 记账节点提供的时间信息,分散区块链系统的授时压力等。区块链节点的动态增加和删除根据具体业务对资源的动态扩容或降配。当节点出现异常情况后,如断电或重启,应能在一定时间内,完成与其它正常节点的数据同步。记账节点对应记账时钟,链上节点对应链上时钟,将链域中的所有节点区分为记账时钟和链上时钟,记账节点从标准时间源系统获取精准的标准时间信息,该标准时间信息包括时间戳、时间类型信息、时间源信息等信息,其中,时间源信息包括原子钟自守时系统、GNSS系统、UTC系统。依据获取到的标准时间信息由记账时钟向链上时钟进行授时。All base station devices in the target communication network are used as block nodes to establish the chain domain of the time blockchain, where the target communication network can be a telecommunications-grade communication network. The chain domain includes accounting nodes and on-chain nodes. According to the main functions of the nodes, the nodes in the blockchain network can be divided into accounting nodes and non-accounting nodes (i.e., on-chain nodes in this embodiment). Accounting nodes ensure the consistency of blockchain distributed system data and complete the generation and maintenance of blockchain data; non-accounting nodes can obtain corresponding The time information provided by the accounting node disperses the timing pressure of the blockchain system. The dynamic addition and deletion of blockchain nodes dynamically expands or downgrades resources according to specific business. When an abnormal situation occurs in the node, such as power failure or restart, it should be able to complete data synchronization with other normal nodes within a certain period of time. The accounting node corresponds to the accounting clock, and the on-chain node corresponds to the on-chain clock. All nodes in the chain domain are divided into accounting clocks and on-chain clocks. The accounting node obtains accurate standard time information from the standard time source system. The standard time information includes timestamp, time type information, time source information, etc. Among them, the time source information includes atomic clock self-keeping system, GNSS system, and UTC system. The accounting clock synchronizes the on-chain clock based on the obtained standard time information.
通过本发明上述步骤,通过区块链向链上时钟同步区块链时间信息,将区块链技术应用于基站设备的时间同步中,区块链中的基站为整个区块链系统提供了存储空间和算力支持,实现了去中心化,减少了对传输网的依赖,即降低了组网性能的影响,提高了基站的时间同步的精度。Through the above steps of the present invention, the blockchain time information is synchronized to the on-chain clock through the blockchain, and the blockchain technology is applied to the time synchronization of the base station equipment. The base station in the blockchain provides storage space and computing power support for the entire blockchain system, realizes decentralization, and reduces dependence on the transmission network, that is, reduces the impact on networking performance and improves the accuracy of time synchronization of the base station.
如图3所示,区块链网络授时系统从标准时间源系统中获取标准时间信息,区块链网络授时系统将区块时间的关键信息上链,关键信息包括区块时间唯一标识、生成区块的节点信息、时间戳信息、时间源类型信息(如原子钟自守时、GNSS授时系统、UTC时间源等)、区块时间状态等信息。待同步设备或者第三方时间信息服务商向区块链网络授时系统申请区块时间。在区块时间生成、区块时间授权等相关流程上链保存,便于后续通过区块链网络授时系统进行验证和追溯。As shown in Figure 3, the blockchain network timing system obtains standard time information from the standard time source system, and the blockchain network timing system uploads the key information of the block time to the chain, including the unique identifier of the block time, the node information of the generated block, the timestamp information, the time source type information (such as atomic clock self-timekeeping, GNSS timing system, UTC time source, etc.), the block time status and other information. The device to be synchronized or the third-party time information service provider applies to the blockchain network timing system for block time. The relevant processes such as block time generation and block time authorization are saved on the chain to facilitate subsequent verification and traceability through the blockchain network timing system.
区块链网络授时系统支持的业务包括区块时间的生成、区块时间的使用、区块时间的查询和授时流程等业务。建设区块链网络授时系统包括但不限于网络部署(部署构成区块链的节点,包括共识节点和业务节点)、实现块链生成与存储、达成共识、实现业务受理和业务处理等,进而对区块链网络授时系统进行服务运营,管理授时类业务全生命周期,如用户管理、业务分配、业务查询和权限管理等。本实施例中,第三方设备可以是使用区块链网络授时系统的个人、法人、企业、政府机构等,第三方设备可以直接使用区块链网络授时系统的授时服务,也可以通过第三方网络授时提供商使用区块链网络授时服务,例如本地应用系统网络对时,硬件设备时间同步等。The services supported by the blockchain network timing system include the generation of block time, the use of block time, the query of block time and the timing process. The construction of the blockchain network timing system includes but is not limited to network deployment (deployment of nodes constituting the blockchain, including consensus nodes and business nodes), realization of block chain generation and storage, reaching consensus, realization of business acceptance and business processing, etc., and then the blockchain network timing system is serviced and operated, and the full life cycle of timing services is managed, such as user management, business allocation, business query and authority management. In this embodiment, the third-party device can be an individual, legal person, enterprise, government agency, etc. who uses the blockchain network timing system. The third-party device can directly use the timing service of the blockchain network timing system, or use the blockchain network timing service through a third-party network timing provider, such as local application system network timing, hardware device time synchronization, etc.
参考图7,区块链网络授时系统(BTS)包含系统管理、授时协议管理、区块链时间协议(BTP)、开放平台、区块链时间底层引擎和区块链基座。系 统管理用于管理区块链网络授时系统,包括用户管理,系统参数配置等。授时协议管理用于对系统采用的授时协议进行管理,授时协议可以包括NTP,PTP及BTP等。区块链时间协议(BTP)用于定义采用区块链授时的标准,包括协议实现、消息等。开放平台面向各类网络业务系统以及第三方网络授时服务商提供时间信息相关的开放能力。开放平台对上提供授时相关的基础能力,对下连接区块链时间底层引擎。区块链时间底层引擎实现区块链时间信息的生成、维护、配合区块链基座完成共识等。区块链基座提供全生命周期的时间可信存证,具有节点管理、共识、记账节点、安全及外部应用链互通等。Referring to Figure 7, the blockchain network timing system (BTS) includes system management, timing protocol management, blockchain time protocol (BTP), open platform, blockchain time underlying engine and blockchain base. System management is used to manage the blockchain network timing system, including user management, system parameter configuration, etc. Timing protocol management is used to manage the timing protocols used by the system, which can include NTP, PTP and BTP. Blockchain Time Protocol (BTP) is used to define the standards for blockchain timing, including protocol implementation, messages, etc. The open platform provides open capabilities related to time information for various network business systems and third-party network timing service providers. The open platform provides basic capabilities related to timing and connects to the underlying blockchain time engine. The underlying blockchain time engine realizes the generation and maintenance of blockchain time information, and cooperates with the blockchain base to complete consensus. The blockchain base provides trusted time evidence for the entire life cycle, with node management, consensus, accounting nodes, security and external application chain interoperability.
区块链网络授时系统与标准时间源系统进行时间信息同步,获得高精度的可靠的时间。另一方面,区块链网络授时系统可与其它应用链跨链互通,如连接时间网应用链,形成网络授时应用的时间信息闭环。The blockchain network timing system synchronizes time information with the standard time source system to obtain high-precision and reliable time. On the other hand, the blockchain network timing system can communicate with other application chains across chains, such as connecting to the time network application chain to form a time information closed loop of the network timing application.
具体地,授时协议管理:要使用区块链网络授时系统,首先要选择使用何种同步协议,区块链网络授时系统通过该协议进行网络授时,授时协议管理功能包括:管理同步协议,如BTP,PTP,NTP等;配置或者协商同步协议参数;查询所授时的服务器信息,如服务器数量,区块链时间状态等。时间状态包含生成中、已共识、待共识等,其中“已共识”状态为正常使用状态;查询被授时的客户端信息,如客户端数量,客户端状态等。客户端状态包含正常、异常、离线等。Specifically, timing protocol management: To use the blockchain network timing system, you must first choose which synchronization protocol to use. The blockchain network timing system uses this protocol for network timing. The timing protocol management functions include: managing synchronization protocols, such as BTP, PTP, NTP, etc.; configuring or negotiating synchronization protocol parameters; querying the server information of the timing, such as the number of servers, blockchain time status, etc. The time status includes generating, consensus, and waiting for consensus, among which the "consensus" status is the normal use status; querying the client information of the timing, such as the number of clients, client status, etc. The client status includes normal, abnormal, offline, etc.
系统管理:系统管理为服务提供方和服务使用方的运营部门提供区块链授时系统所有模块的管理:具有管理员管理功能模块,用于管理员的创建、修改与禁用;具有角色管理功能模块,用于角色的创建、修改与删除;具有系统审计功能模块,用于系统内的操作记录审计;系统总体功能模块管理,配置模块参数等;故障管理,告警管理,系统的使用信息管理等;具有节点管理功能,用于管理和查询授时节点的状态和信息;具有数据可视化模块,用于分析和展示区块链运行体征,区块时间统计信息等;账号管理:实名认证的账户注册、用户身份识别、用户账户冻结和解冻、用户注销等。应具有用户隐私保护机制。应支持不同级别账户的不同权限;定期对用户账号的使用情况进行安全性分析,对登录时间、登录位置、访问时长、等行为进行综合分析,并评估账号安全风险;身份认证:用户身份认证确保正确标识和鉴 别用户主体身份信息和授权信息:使用安全并符合国家密码管理规定的算法和协议进行身份认证;确保用户口令等身份认证相关凭证信息的存储安全性;对重要数据、业务或系统的操作,应采用双因素身份认证。System management: System management provides management of all modules of the blockchain timing system for the operation departments of service providers and service users: it has an administrator management function module for creating, modifying and disabling administrators; it has a role management function module for creating, modifying and deleting roles; it has a system audit function module for auditing operation records within the system; system overall function module management, configuration module parameters, etc.; fault management, alarm management, system usage information management, etc.; it has a node management function for managing and querying the status and information of timing nodes; it has a data visualization module for analyzing and displaying blockchain operation signs, block time statistics, etc.; account management: real-name authenticated account registration, user identity identification, user account freezing and thawing, user logout, etc. It should have a user privacy protection mechanism. It should support different permissions for accounts of different levels; regularly conduct security analysis of user account usage, conduct comprehensive analysis of login time, login location, access duration, and other behaviors, and evaluate account security risks; identity authentication: user identity authentication ensures correct identification and authentication Identify the user's identity information and authorization information: Use secure algorithms and protocols that comply with national password management regulations for identity authentication; ensure the storage security of user passwords and other identity authentication-related credential information; use two-factor authentication for operations on important data, business or systems.
区块链时间底层引擎:区块链时间底层引擎是区块链网络授时系统的基础能力驱动引擎,提供系统组件,支持上层区块链时间应用和管理,根据选择的同步协议实现对节点授时,连接区块链基座为网络授时应用提供可信可追溯的链上时间服务:具有标准时间源同步组件,为区块链基座提供高精度时间戳,生成区块时间,完成区块时间的生成及上链。标准时间源的选择需要是高精度的原子钟自守时系统、卫星授时系统(GNSS)或者其他世界标准时间,并对其误差范围有严格要求;具有在线验真组件,为区块时间使用者、服务商、应用系统提供统一验真服务;具有区块时间链上服务组件,支撑区块时间上链、记录上链信息等服务;根据同步协议选择模块的协议,调用区块链基座提供的接口,提供区块链时间的网络授时引擎。Blockchain time underlying engine: The blockchain time underlying engine is the basic capability driving engine of the blockchain network timing system. It provides system components, supports upper-layer blockchain time applications and management, implements node timing according to the selected synchronization protocol, and connects to the blockchain base to provide reliable and traceable on-chain time services for network timing applications: It has a standard time source synchronization component, provides high-precision timestamps for the blockchain base, generates block time, and completes the generation and chaining of block time. The standard time source selection needs to be a high-precision atomic clock self-timekeeping system, a satellite timing system (GNSS) or other world standard time, and has strict requirements on its error range; it has an online verification component to provide unified verification services for block time users, service providers, and application systems; it has a block time on-chain service component to support services such as block time chaining and recording chain information; according to the synchronization protocol selection module protocol, the interface provided by the blockchain base is called to provide a network timing engine for blockchain time.
区块链基座:区块链基座提供了对等网络环境下,通过透明和可信规则,构建不可伪造、不可篡改和可追溯的块链式时间数据结构:基于共识机制达成分布式记账节点上的时间数据一致性;通过智能合约编程与虚拟机执行引擎完成图灵完备的时间事务处理;基于密码学与链式结构,确保数据不可篡改和不可伪造;可以对区块链上存储的数据进行有效验证,同时有相应技术确保隐私信息不泄露。Blockchain base: The blockchain base provides a peer-to-peer network environment, through transparent and trusted rules, to build a block chain time data structure that is unforgeable, tamper-proof and traceable: based on the consensus mechanism, it achieves consistency of time data on distributed accounting nodes; through smart contract programming and virtual machine execution engine, it completes Turing-complete time transaction processing; based on cryptography and chain structure, it ensures that data cannot be tampered with or forged; it can effectively verify the data stored on the blockchain, and at the same time, there are corresponding technologies to ensure that privacy information is not leaked.
智能合约:支持智能合约代码的存储和运行,确保智能合约执行之后所有节点执行结果都保持一致;支持图灵完备的智能合约;支持智能合约代码逻辑的调整和数据结构更新;智能合约具备数据前向兼容的能力,版本迭代时,旧版本的合约及时停用,并存档数据,新版本合约能调用历史数据。Smart contracts: support the storage and operation of smart contract codes to ensure that the execution results of all nodes remain consistent after the smart contract is executed; support Turing-complete smart contracts; support the adjustment of smart contract code logic and the update of data structure; smart contracts have the ability of forward data compatibility. When the version is iterated, the old version of the contract is deactivated in time and the data is archived. The new version of the contract can call historical data.
共识算法:具备共识节点的拜占庭容错能力;保持每个节点更新账本状态写操作的一致性;保证每个节点账本的最终状态一致性;能在节点在线情况下,切换共识机制后达成全网新的共识,系统运行正常。Consensus algorithm: has the Byzantine fault tolerance capability of consensus nodes; maintains the consistency of each node's write operation to update the ledger status; ensures the consistency of the final status of each node's ledger; can reach a new consensus on the entire network after switching the consensus mechanism when the node is online, and the system operates normally.
跨链要求:支持区块链与外部世界间建立一种可信任的桥接机制,使得外部数据可以安全可靠地进入区块链;支持多模式的跨链互联方案,支持应用层跨链、同构跨链、异构跨链多种跨链模式,依据具体业务场景选择采用。 Cross-chain requirements: Support the establishment of a trusted bridging mechanism between the blockchain and the outside world, so that external data can enter the blockchain safely and reliably; support multi-mode cross-chain interconnection solutions, support application layer cross-chain, homogeneous cross-chain, heterogeneous cross-chain and other cross-chain modes, and choose to adopt according to specific business scenarios.
区块链时间协议(BTP)规定了一种时间同步协议。本协议适用于由一个或多个节点组成的分布式系统,通过网络进行通信。节点被定义为包含实时时间,可由节点内的应用用于各种目的。协议提供了一种用于将参与节点的时间同步到高精确度的机制。本协议规定了:区块链时间协议(BTP);支持BTP所必需的节点、系统和通信属性。The Blockchain Time Protocol (BTP) specifies a time synchronization protocol. This protocol is applicable to distributed systems consisting of one or more nodes, communicating over a network. A node is defined as containing real-time time, which can be used by applications within the node for various purposes. The protocol provides a mechanism for synchronizing the time of participating nodes to a high degree of accuracy. This protocol specifies: The Blockchain Time Protocol (BTP); The node, system, and communication properties necessary to support BTP.
参照图8,BTP系统中的数据类型和格式:除了区块链时间数据类型外,BTP系统采用通用计算机系统程序语言的标准数据类型和格式。区块链数据结构采用单向链表,每个区块包括2部分,区块头和区块主体。区块主体主要用于存储时间数据;区块头存储的内容可以分为4个部分,分别是前一区块的根散列(前一区块Merkle树根节点存储的hash值)、Merkle树根散列(当前区块Merkle树根节点存储的hash值)、时间戳、其他。区块主体存储区块链时间戳数据。Refer to Figure 8, data types and formats in the BTP system: In addition to the blockchain time data type, the BTP system uses the standard data types and formats of general computer system programming languages. The blockchain data structure uses a one-way linked list, and each block consists of two parts, the block header and the block body. The block body is mainly used to store time data; the content stored in the block header can be divided into four parts, namely the root hash of the previous block (the hash value stored in the Merkle tree root node of the previous block), the Merkle tree root hash (the hash value stored in the Merkle tree root node of the current block), the timestamp, and others. The block body stores the blockchain timestamp data.
BTP消息分为授时消息和控制消息。授时消息在发送和接收时生成准确的时间戳。授时消息包括:同步请求和授时应答;控制消息包括通知消息、管理消息和事件消息,其中通知消息用于故障和告警通告;管理消息用于查询和更新时钟维护的BTP数据集。这些消息还用于定制BTP系统以及初始化和共识。管理消息用于记账节点;事件消息用于时钟之间的通信,用于所有其他目的。例如,事件消息可用于协商服务器与其客户端之间的通讯类型、消息速率等。所有消息都可以通过标准的类型、长度、值(TLV)扩展机制来扩展。BTP messages are divided into timing messages and control messages. Timing messages generate accurate timestamps when sent and received. Timing messages include: synchronization requests and timing responses; control messages include notification messages, management messages, and event messages, among which notification messages are used for fault and alarm notifications; management messages are used to query and update the BTP data set maintained by the clock. These messages are also used to customize the BTP system as well as for initialization and consensus. Management messages are used for accounting nodes; event messages are used for communication between clocks and for all other purposes. For example, event messages can be used to negotiate the communication type, message rate, etc. between the server and its clients. All messages can be extended through the standard type, length, value (TLV) extension mechanism.
BTP系统是由BTP设备和非BTP设备的混合构成的分布式网络系统。BTP设备包括记账时钟、链上时钟等。非BTP设备包括网桥、路由器和其他基础设施设备,可能还有计算机、打印机和其他应用设备。BTP协议是一种分布式协议,规定系统中的实时时间如何彼此同步。这些时间被组织为服务器-客户端层次结构,其中标准时间源位于层级的顶部,决定整个系统的参考时间。授时是通过交换BTP消息来实现的,其中客户端使用服务器提供的时间信息将其时间调整到最精确服务器的时间。BTP系统中的设备通过通信网络相互通信。网络可以包括实现不同网络通信协议的设备。该协议在称为链域的逻辑范围内执行。除非另有规定,所有BTP消息、数据集、状态机和所有其他BTP实体始终与特定链域相关联。给定的物理网络和连接到网络的单 个设备可以与多个域相关联。在本协议中,协议在一个域内建立的时间与其他链域内的时间无关。BTP设备有两种基本类型:记账时钟和链上时钟。The BTP system is a distributed network system composed of a mixture of BTP devices and non-BTP devices. BTP devices include accounting clocks, on-chain clocks, etc. Non-BTP devices include bridges, routers and other infrastructure devices, and possibly computers, printers and other application devices. The BTP protocol is a distributed protocol that specifies how real-time times in the system are synchronized with each other. These times are organized into a server-client hierarchy, where the standard time source is at the top of the hierarchy and determines the reference time of the entire system. Timing is achieved by exchanging BTP messages, where the client uses the time information provided by the server to adjust its time to the time of the most accurate server. Devices in the BTP system communicate with each other through a communication network. The network can include devices that implement different network communication protocols. The protocol is executed within a logical scope called a chain domain. Unless otherwise specified, all BTP messages, data sets, state machines, and all other BTP entities are always associated with a specific chain domain. A given physical network and a single device connected to the network A device can be associated with multiple domains. In this protocol, the time established by the protocol in one domain is independent of the time in other chain domains. There are two basic types of BTP devices: accounting clocks and on-chain clocks.
链上时钟的模型如图9所示,链上时钟通过基于单个物理端口的逻辑接口与网络通信。消息接口设置为发送和接收授时消息和控制消息,这些授时消息由时间戳生成基于本地时间的值来标记时间戳。链域中的链上时钟支持单副本协议,且具有一个BTP状态。链上时钟是系统中的时钟客户端。链上时钟维护两种类型的数据集合,分别称为区块链时钟数据集和BTP端口数据集。BTP协议引擎完成如下功能:发送和接收BTP消息;维护数据集;执行端口关联的状态机。链上时钟端口始终处于从状态(同步到服务器),它将根据收到的BTP授时消息和生成的时间戳计算服务器端的时间。本地时钟中的控制环路会调整本地时间以与服务器一致。The model of the on-chain clock is shown in Figure 9. The on-chain clock communicates with the network through a logical interface based on a single physical port. The message interface is set to send and receive timing messages and control messages. These timing messages are timestamped by timestamps that generate values based on local time. The on-chain clock in the chain domain supports a single copy protocol and has a BTP state. The on-chain clock is the clock client in the system. The on-chain clock maintains two types of data sets, called blockchain clock data sets and BTP port data sets. The BTP protocol engine completes the following functions: sending and receiving BTP messages; maintaining data sets; executing port-associated state machines. The on-chain clock port is always in the slave state (synchronized to the server), and it will calculate the server-side time based on the received BTP timing message and the generated timestamp. The control loop in the local clock adjusts the local time to be consistent with the server.
记账时钟的模型如图10所示,记账时钟通常具有多个物理接口,每个物理接口通过逻辑接口与网络通信:授时消息和控制消息接口。记账时钟的每个端口具有以下特点:a)区块链时间数据集对记账时钟的所有端口都是公用的。b)本地时钟对记账时钟的所有端口都是共用的。c)每个协议引擎具有解析所有端口的状态以确定哪个端口提供用于同步本地时钟的时间信号的附加功能。记账时钟从外部标准时间源获取时间信息,通过内部算法生成区块链时间信息。同步、建立服务器-客户端层次结构相关的消息终止于记账时钟的协议引擎中,不会被转发。管理消息由记账时钟上的其他端口根据限制进行转发,以限制这些消息在系统中的传播。图10的记账时钟模型仅适用于BTP消息。对于所有非BTP消息,记账时钟充当正常网络组件,例如基站、网桥、中继器或路由器。记账时钟仅用作记账节点。The model of the accounting clock is shown in Figure 10. The accounting clock usually has multiple physical interfaces, each of which communicates with the network through a logical interface: timing message and control message interface. Each port of the accounting clock has the following characteristics: a) The blockchain time data set is common to all ports of the accounting clock. b) The local clock is common to all ports of the accounting clock. c) Each protocol engine has the additional function of parsing the status of all ports to determine which port provides the time signal for synchronizing the local clock. The accounting clock obtains time information from an external standard time source and generates blockchain time information through an internal algorithm. Messages related to synchronization and establishing a server-client hierarchy terminate in the protocol engine of the accounting clock and will not be forwarded. Management messages are forwarded by other ports on the accounting clock according to restrictions to limit the propagation of these messages in the system. The accounting clock model of Figure 10 is only applicable to BTP messages. For all non-BTP messages, the accounting clock acts as a normal network component, such as a base station, bridge, repeater, or router. The accounting clock is only used as an accounting node.
所述网络授时方法还包括:The network timing method also includes:
步骤A,根据所述标准时间信息生成区块时间数据链块,其中,所述区块时间数据链块的区块数据为区块时间;Step A, generating a block time data chain block according to the standard time information, wherein the block data of the block time data chain block is the block time;
步骤B,将所述区块时间数据链块加入区块链中,并采用所述区块时间向所述链域之外的其他设备授时。Step B, adding the block time data chain block to the blockchain, and using the block time to synchronize time with other devices outside the chain domain.
根据标准时间信息生成区块时间数据链块,其中,区块时间数据链块的区块数据为区块时间,将区块时间数据链块加入区块链中,并采用区块时间 向链域之外的其他设备授时。本实施例中区块链网络授时系统获取标准时间信息,依据获取的标准时间信息生成区块时间数据链块,直接或间接向数字证书认证机构申请数字证书并对区块时间数据链块进行加密,生成的区块时间数据链块在平台系统进行记录并加入到区块链中。生成的区块时间可通过第三方网络授时服务商或直接给其他设备授时。Generate a block time data chain block based on the standard time information, where the block data of the block time data chain block is the block time, add the block time data chain block to the blockchain, and use the block time Time synchronization to other devices outside the chain domain. In this embodiment, the blockchain network timing system obtains standard time information, generates a block time data chain block based on the obtained standard time information, directly or indirectly applies for a digital certificate from a digital certificate certification authority and encrypts the block time data chain block. The generated block time data chain block is recorded in the platform system and added to the blockchain. The generated block time can be synchronized to other devices through a third-party network timing service provider or directly.
所述记账节点根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时包括:The accounting node provides time to the on-chain clock from the accounting clock according to the standard time information, including:
步骤S301,所述记账节点接收所述链上时钟发送的区块时间同步请求;Step S301, the accounting node receives a block time synchronization request sent by the on-chain clock;
步骤S302,所述记账节点对所述链上时钟进行节点认证;Step S302, the accounting node performs node authentication on the on-chain clock;
步骤S303,在节点认证通过后,所述记账节点采用同步协议根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时。Step S303, after the node authentication is passed, the accounting node uses a synchronization protocol to synchronize time from the accounting clock to the on-chain clock according to the standard time information.
记账节点接收链上时钟发送的区块时间同步请求,记账节点对链上时钟进行节点认证,在节点认证通过后,记账节点采用同步协议根据标准时间信息由记账时钟向链上时钟进行授时。示例性地,区块链网络授时系统管理时间区块链,包括生成、更新、维护区块链。区块时间使用者完成自身配置后,通过链上时钟发送区块时间申请至区块链网络授时系统,区块链网络授时系统对申请者进行节点认证,区块链网络授时系统认证节点通过后,根据系统配置的同步协议,发送同步协议给申请节点,进行授时协议协商,区块链网络授时系统将使用者信息记录在平台管理系统,用协商成功的同步协议给申请者授时。如图4所示,区块链网络授时系统将区块时间的使用过程和使用关键信息上链,包括区块唯一标识,区块时间相关信息,协商文件摘要信息,同步协议信息,使用者信息等。将完整的区块时间申请流程和使用者信息的内容上链,便于可信追踪或溯源。为了增强区块内容的可信存证,可以将使用者的内容通过跨链技术,存储在具有公信力的政府部门,如行政区块链。The accounting node receives the block time synchronization request sent by the on-chain clock, and the accounting node performs node authentication on the on-chain clock. After the node authentication is passed, the accounting node uses the synchronization protocol to synchronize the time from the accounting clock to the on-chain clock according to the standard time information. Exemplarily, the blockchain network timing system manages the time blockchain, including generating, updating, and maintaining the blockchain. After the block time user completes its own configuration, it sends the block time application to the blockchain network timing system through the on-chain clock. The blockchain network timing system performs node authentication on the applicant. After the blockchain network timing system authenticates the node, it sends the synchronization protocol to the application node according to the synchronization protocol configured by the system to negotiate the timing protocol. The blockchain network timing system records the user information in the platform management system and uses the successfully negotiated synchronization protocol to synchronize the applicant. As shown in Figure 4, the blockchain network timing system uploads the block time usage process and key information to the chain, including block unique identification, block time related information, negotiation file summary information, synchronization protocol information, user information, etc. The complete block time application process and user information content are uploaded to the chain for reliable tracking or tracing. In order to enhance the credible evidence of block content, the user's content can be stored in credible government departments, such as administrative blockchains, through cross-chain technology.
所述网络授时方法还包括:The network timing method also includes:
步骤C,接收第三方设备发送的区块时间查询请求;Step C, receiving a block time query request sent by a third-party device;
步骤D,基于所述查询请求中的区块信息、区块时间状态和已部署的业务对所述第三方设备进行身份认证,并在身份认证通过后向所述第三方设备返回所述链域的授时时间。 Step D: authenticating the third-party device based on the block information, block time status and deployed services in the query request, and returning the timing time of the chain domain to the third-party device after the authentication is passed.
接收第三方设备发送的区块时间查询请求,第三方设备为拥有相关权限的服务使用方,第三方设备完成身份认证后,可以直接或通过第三方网络授时服务商向区块链网络授时系统发起区块时间及其应用的查询,基于查询请求中的区块信息、区块时间状态和已部署的业务对第三方设备进行身份认证,并在身份认证通过后向第三方设备返回链域的授时时间。可查询区块链上的区块时间信息,包括区块时间的唯一标识、使用者信息、时间类型信息、区块时间状态等;对不同状态的使用情况进行跟踪,如待上链、已上链、使用中等状态的使用情况进行跟踪;对已签署的业务,如文件,合同进行验真,验证内容包括但不限于区块时间的完整性、区块时间的有效性、数字证书有效性等内容。区块链网络授时系统将查询的结果返回给发起查询的服务使用方。如图5所示,区块链网络授时系统将区块时间的查询过程及关键信息上链。Receive the block time query request sent by the third-party device, which is a service user with relevant permissions. After completing the identity authentication, the third-party device can directly or through the third-party network timing service provider to initiate a query of the block time and its application to the blockchain network timing system. The third-party device is authenticated based on the block information, block time status and deployed business in the query request, and the timing time of the chain domain is returned to the third-party device after the identity authentication is passed. The block time information on the blockchain can be queried, including the unique identifier of the block time, user information, time type information, block time status, etc.; the usage of different states can be tracked, such as the usage of the status to be uploaded to the chain, uploaded to the chain, and in use; the signed business, such as documents and contracts, is verified, and the verification content includes but is not limited to the integrity of the block time, the validity of the block time, the validity of the digital certificate, etc. The blockchain network timing system returns the query results to the service user who initiated the query. As shown in Figure 5, the blockchain network timing system uploads the query process and key information of the block time to the chain.
所述网络授时方法还包括:The network timing method also includes:
步骤E,采用所述链域中的记账时钟和链上时钟建立服务器与客户端结构,每台服务器连接多台客户端,每台客户端连接多台服务器;Step E: Use the accounting clock in the chain domain and the on-chain clock to establish a server and client structure, where each server is connected to multiple clients, and each client is connected to multiple servers;
步骤F,基于所述服务器与客户端结构根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时,其中,记账时钟的端口是到链上时钟的服务器时钟,链上时钟的端口是记账时钟的客户端端口。Step F, based on the server and client structure, the accounting clock synchronizes time with the on-chain clock according to the standard time information, wherein the port of the accounting clock is the server clock to the on-chain clock, and the port of the on-chain clock is the client port of the accounting clock.
采用链域中的记账时钟和链上时钟建立服务器与客户端结构,记账时钟为服务器,链上时钟为客户端,每台服务器可以连接多台客户端,每台客户端可以连接多台服务器,其中每台服务器提供授时服务的客户端的数量不超过100台;每台客户端同步的服务器的数量不少于2台。基于服务器与客户端结构根据所标准时间信息由记账时钟向所述链上时钟进行授时,其中,记账时钟的端口是到链上时钟的服务器时钟,链上时钟的端口是记账时钟的客户端端口。需要说明的是,本实施例中只允许建立服务器-客户端两层服务,不允许客户端再给其他设备或者客户端授时。The accounting clock in the chain domain and the on-chain clock are used to establish a server and client structure. The accounting clock is the server and the on-chain clock is the client. Each server can connect to multiple clients, and each client can connect to multiple servers, where the number of clients for which each server provides timing services does not exceed 100; the number of servers synchronized by each client is not less than 2. Based on the server and client structure, the accounting clock provides timing to the on-chain clock according to the standard time information, where the port of the accounting clock is the server clock to the on-chain clock, and the port of the on-chain clock is the client port of the accounting clock. It should be noted that in this embodiment, only the establishment of server-client two-layer services is allowed, and the client is not allowed to provide timing to other devices or clients.
在链域中的记账时钟和链上时钟之间建立服务器-客户端结构的过程如图6所示。在本示例中,记账时钟与记账时钟之间是一种平行的关系,位于层次结构的根,称为“时钟服务器”。记账时钟的端口是到链上时钟的服务器时钟(如S所示)。记账时钟上的所有S端口都是连接到它们的链上时钟的服务器端口。 链上时钟的端口是记账时钟的客户端端口。The process of establishing a server-client structure between the accounting clock in the chain domain and the on-chain clock is shown in Figure 6. In this example, the accounting clock is in a parallel relationship with the accounting clock, located at the root of the hierarchy, called the "clock server". The port of the accounting clock is the server clock to the on-chain clock (as shown by S). All S ports on the accounting clock are server ports of the on-chain clock connected to them. The port of the on-chain clock is the client port of the accounting clock.
所述网络授时方法还包括:The network timing method also includes:
步骤G,所述链上节点的链上时钟向记账时钟发送同步消息报文;Step G, the on-chain clock of the on-chain node sends a synchronization message to the accounting clock;
步骤H,所述链上节点的链上时钟接收记账时钟返回的授时消息报文,所述授时消息报文携带发送授时消息报文的第一时间戳;Step H, the on-chain clock of the on-chain node receives the timing message message returned by the accounting clock, and the timing message message carries the first timestamp of sending the timing message message;
步骤I,所述链上节点的链上时钟根据第一时间戳和第二时间戳计算同步时间,所述第二时间戳为链上时钟接收所述授时消息报文的时间戳。Step I: the on-chain clock of the on-chain node calculates the synchronization time according to the first timestamp and the second timestamp, where the second timestamp is the timestamp of the on-chain clock receiving the timing message.
链上节点的链上时钟向记账时钟发送同步消息报文,链上节点的链上时钟接收记账时钟返回的授时消息报文,授时消息报文携带发送授时消息报文的第一时间戳,链上节点的链上时钟根据第一时间戳和第二时间戳计算同步时间,第二时间戳为链上时钟接收授时消息报文的时间戳。在链域中的记账时钟和链上时钟之间的授时过程如下:链上时钟发送一个同步消息Sync_Req报文给记账时钟;记账时钟收到请求后,发送一个授时消息Timing_Resp报文给链上时钟,该报文带有它离开记账时钟时的时间戳。当此BTP报文到达链上时钟时,链上时钟加上自己的时间戳,并把报文交给应用程序处理;区块链时间底层引擎提出区块中的时间信息,计算出当前准确时间。这样,链上时钟就能够根据这些信息来设定自己的时间,使之与记账时钟的时间同步。The on-chain clock of the on-chain node sends a synchronization message to the accounting clock. The on-chain clock of the on-chain node receives the timing message returned by the accounting clock. The timing message carries the first timestamp of sending the timing message. The on-chain clock of the on-chain node calculates the synchronization time based on the first timestamp and the second timestamp. The second timestamp is the timestamp of the on-chain clock receiving the timing message. The timing process between the accounting clock and the on-chain clock in the chain domain is as follows: the on-chain clock sends a synchronization message Sync_Req message to the accounting clock; after receiving the request, the accounting clock sends a timing message Timing_Resp message to the on-chain clock, which carries the timestamp when it leaves the accounting clock. When this BTP message arrives at the on-chain clock, the on-chain clock adds its own timestamp and hands the message over to the application for processing; the blockchain time underlying engine extracts the time information in the block and calculates the current accurate time. In this way, the on-chain clock can set its own time based on this information to synchronize it with the time of the accounting clock.
在本发明的一实施方式中,所述网络授时方法还包括:In one embodiment of the present invention, the network timing method further includes:
步骤J,将从标准时间源系统获取的标准时间信息转化为本地时间,生成时间区块链数据结构;Step J: Convert the standard time information obtained from the standard time source system into local time to generate a time blockchain data structure;
步骤K,采用区块链技术组织时间信息;Step K, using blockchain technology to organize time information;
步骤L,通过所述时间区块链数据结构在所述区块链中传递所述时间信息。Step L, transmitting the time information in the blockchain through the time blockchain data structure.
将从外接的标准时间源系统获取的标准时间信息转化为本地时间,生成时间区块链数据结构,采用区块链技术组织时间信息,通过时间区块链数据结构在区块链中传递时间信息。采用区块链技术组织时间信息,通过时间区块链数据结构传递准确的时间信息,授时的过程和协议可以选择已有的同步协议如PTP或者NTP等,优选本系统定义的区块链授时协议BTP。The standard time information obtained from the external standard time source system is converted into local time, and a time blockchain data structure is generated. The time information is organized using blockchain technology, and the time information is transmitted in the blockchain through the time blockchain data structure. The time information is organized using blockchain technology, and accurate time information is transmitted through the time blockchain data structure. The timing process and protocol can choose existing synchronization protocols such as PTP or NTP, and the blockchain timing protocol BTP defined by this system is preferred.
所述网络授时方法还包括: The network timing method also includes:
步骤M,根据所述标准时间信息生成区块时间数据链块,其中,所述区块时间数据链块的区块数据为区块时间;Step M, generating a block time data chain block according to the standard time information, wherein the block data of the block time data chain block is the block time;
步骤N,将所述区块时间数据链块加入区块链中,并采用所述区块时间向所述链域之外的其他设备授时。Step N, adding the block time data chain block to the blockchain, and using the block time to synchronize time with other devices outside the chain domain.
根据标准时间信息生成区块时间数据链块,其中,区块时间数据链块的区块数据为区块时间,将区块时间数据链块加入区块链中,并采用区块时间向所述链域之外的其他设备授时。A block time data chain block is generated according to the standard time information, wherein the block data of the block time data chain block is the block time, the block time data chain block is added to the blockchain, and the block time is used to synchronize time to other devices outside the chain domain.
以下为适用于本实施例的术语与定义:The following are the terms and definitions applicable to this embodiment:
区块链(block chain):一种在对等网络环境下,通过透明和可信规则,构建不可伪造、不可篡改和可追溯的块链式数据结构,实现和管理事务处理的模式。Blockchain: A model for implementing and managing transaction processing by building an unforgeable, tamper-proof and traceable block chain data structure through transparent and trusted rules in a peer-to-peer network environment.
链域:使用区块链时间协议(BTP)的所有设备的集合。Chain Domain: The collection of all devices using the Blockchain Time Protocol (BTP).
链路:两个支持区块链时间协议(BTP)端口之间的网络路径。Link: A network path between two ports supporting the Blockchain Time Protocol (BTP).
时间服务器:在链域内,使用区块链时间协议进行时间授时的设备,是选定链域内的时间源,在一个链域内可以有多台时间服务器。在本系统中简称服务器。Time server: A device that uses the blockchain time protocol to synchronize time in a chain domain. It is the time source in the selected chain domain. There can be multiple time servers in a chain domain. In this system, it is referred to as a server.
时间客户端:在链域内,使用区块链时间协议(BTP)接收时间服务器的时间信息,实现自身时间同步的设备,一台时间客户端可以选择多台服务器。在本系统中简称客户端。Time client: A device that uses the Blockchain Time Protocol (BTP) to receive time information from a time server within the chain domain and synchronize its own time. A time client can select multiple servers. In this system, it is referred to as a client.
节点:可在网络上发出或接收区块链时间协议(BTP)通信的设备。Node: A device that can send or receive Blockchain Time Protocol (BTP) communications on the network.
区块链时间协议(BTP)端口:运行区块链时间协议(BTP)的物理接口,时钟的逻辑接入点,用于与通信网络进行BTP通信。Blockchain Time Protocol (BTP) port: A physical interface running the Blockchain Time Protocol (BTP), a logical access point for the clock, used for BTP communication with the communication network.
端口号:标识BTP节点上的特定区块链时间协议(BTP)端口的索引。Port Number: An index that identifies a specific Blockchain Time Protocol (BTP) port on a BTP node.
精确度:被测时钟和参考时钟之间的时间或频率误差的平均值。Accuracy: The average value of the time or frequency error between the measured clock and the reference clock.
记账时钟:在一个链域中的区块链的记账节点,具有一个或者多个区块链时间协议(BTP)端口并维护链域中使用的时间的时钟。它可以作为链域中的时间源,即时间服务器。 Accounting clock: The accounting node of a blockchain in a chain domain has one or more Blockchain Time Protocol (BTP) ports and maintains the clock used in the chain domain. It can be used as a time source in the chain domain, that is, a time server.
链上时钟:在一个链域中的区块链的非记账节点,具有一个区块链时间协议(BTP)端口并使用链域中时间来同步自身时间的时钟。即客户端。On-chain clock: A non-accounting node of a blockchain in a chain domain, which has a Blockchain Time Protocol (BTP) port and uses the time in the chain domain to synchronize its own clock. That is, the client.
直接通信:区块链时间协议(BTP)的时间信息在链上时钟和记账时钟之间通信。Direct communication: The time information of the Blockchain Time Protocol (BTP) is communicated between the on-chain clock and the accounting clock.
区块链时间协议(BTP)通信:协议运行中使用的信息,在PTP通信路径上的PTP消息中传输。Blockchain Time Protocol (BTP) communication: Information used in the operation of the protocol, transmitted in PTP messages on the PTP communication path.
区块链时间协议(BTP)通信路径:特定网络的信令路径部分,可实现链上时钟和记账时钟之间的直接通信。Blockchain Time Protocol (BTP) communication path: The portion of the signaling path of a specific network that enables direct communication between the on-chain clock and the accounting clock.
区块链时间协议(BTP)节点:BTP记账时钟、链上时钟或生成或解析BTP消息的设备。Blockchain Time Protocol (BTP) node: A BTP accounting clock, an on-chain clock, or a device that generates or parses BTP messages.
认可的标准时间源:认可的标准时间源是区块链时间协议(BTP)的外部来源,它根据需要提供时间和/或频率,可向维护时钟的国际标准实验室追踪,这些时钟构成国际原子能机构时间(TAI)和世界协调时间(UTC)计时器的基础。例如全球定位系统(GPS、北斗)、和美国国家标准与技术研究院(NIST)时间服务器。Recognized Standard Time Source: A recognized standard time source is an external source to the Blockchain Time Protocol (BTP) that provides time and/or frequency as needed, traceable to international standards laboratories that maintain clocks that form the basis of the International Atomic Energy Agency Time (TAI) and Universal Coordinated Time (UTC) timekeepers. Examples include the Global Positioning System (GPS, BeiDou), and the U.S. National Institute of Standards and Technology (NIST) time servers.
网络时钟授时(network time synchronization):利用网络传送标准时间信息,通过提供时钟校正参考基准实现计算机系统时间同步的过程。Network time synchronization: The process of using the network to transmit standard time information and achieve computer system time synchronization by providing a clock correction reference benchmark.
时钟源(clock source):被认可的标准时间源,提供可供追溯到国际标准实验室的合适的时间和/或频率,如中国科学院国家授时中心时间服务器、北斗卫星系统、全球定位系统(GPS)等。这些国际标准实验室维护的时钟作为国际原子时(TAI)和协调世界时(UTC)时标的基础。Clock source: A recognized standard time source that provides appropriate time and/or frequency traceable to an international standard laboratory, such as the time server of the National Time Service Center of the Chinese Academy of Sciences, the BeiDou satellite system, the Global Positioning System (GPS), etc. The clocks maintained by these international standard laboratories serve as the basis for the International Atomic Time (TAI) and Coordinated Universal Time (UTC) time scales.
网络授时协议(network time synchronization protocol):在网络上传递统一、标准的时间而建立的规则、标准或约定的合集。常用的网络授时协议有:网络时间协议(NTP)、简单网络时间协议(SNTP)、精确时间协议(PTP)、区块链时间协议(BTP,Block Time Protocol)。Network time synchronization protocol: A collection of rules, standards or agreements established to transmit unified and standard time on the network. Commonly used network time synchronization protocols include: Network Time Protocol (NTP), Simple Network Time Protocol (SNTP), Precision Time Protocol (PTP), Blockchain Time Protocol (BTP).
时间戳(timestamp):一个应用程序自动形成的凭证,能标识并记录事件发生的时刻。Timestamp: A credential automatically generated by an application that identifies and records the time when an event occurred.
关联实体:两个数据实体间多对多关系的数据实体。 Associative entity: A data entity in a many-to-many relationship between two data entities.
图灵完备:指的是有无限存储能力的通用物理机器或编程语言。图灵完备就代表着使用的语言能做到用图灵机能做到的所有事情,能够解决所有的可计算问题。Turing complete: refers to a universal physical machine or programming language with unlimited storage capacity. Turing complete means that the language used can do everything that a Turing machine can do and can solve all computable problems.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the embodiment of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
实施例2Example 2
在本实施例中还提供了一种网络授时系统,用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In the present embodiment, a network timing system is also provided to realize the above-mentioned embodiment and the preferred implementation mode, and the description thereof will not be repeated. As used below, the term "module" can realize the combination of software and/or hardware of the predetermined function. Although the device described in the following embodiments is preferably realized with software, the realization of hardware, or the combination of software and hardware is also possible and conceived.
所述网络授时系统包括记账节点和链上节点:The network timing system includes accounting nodes and on-chain nodes:
所述记账节点,设置为从标准时间源系统获取标准时间信息,根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时;The accounting node is configured to obtain standard time information from a standard time source system, and the accounting clock synchronizes time with the on-chain clock according to the standard time information;
所述链上节点,设置为向所述记账时钟同步时间信息。The on-chain node is configured to synchronize time information with the accounting clock.
实施例3Example 3
本发明的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
可选地,在本实施例中,上述存储介质可以被设置为存储设置为执行以下步骤的计算机程序:Optionally, in this embodiment, the storage medium may be configured to store a computer program configured to perform the following steps:
S1,将目标通信网络中的基站设备作为区块节点建立时间区块链的链域,其中,所述链域包括记账节点和链上节点,所述记账节点对应记账时钟,所述链上节点对应链上时钟; S1, using the base station device in the target communication network as a block node to establish a chain domain of the time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock;
S2,所述记账节点从标准时间源系统获取标准时间信息;S2, the accounting node obtains standard time information from the standard time source system;
S3,所述记账节点根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时。S3, the accounting node synchronizes time from the accounting clock to the on-chain clock according to the standard time information.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
本发明的实施例还提供了一种电子设备,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
可选地,上述电子设备还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。Optionally, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
S1,将目标通信网络中的基站设备作为区块节点建立时间区块链的链域,其中,所述链域包括记账节点和链上节点,所述记账节点对应记账时钟,所述链上节点对应链上时钟;S1, using the base station device in the target communication network as a block node to establish a chain domain of the time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock;
S2,所述记账节点从标准时间源系统获取标准时间信息;S2, the accounting node obtains standard time information from the standard time source system;
S3,所述记账节点根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时。S3, the accounting node synchronizes time from the accounting clock to the on-chain clock according to the standard time information.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划 分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units is only a logical function division. There may be other divisions in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not performed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be an indirect coupling or communication connection through some interface, unit or module, which can be electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。 The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims (10)

  1. 一种网络授时方法,所述方法包括:A network timing method, the method comprising:
    将目标通信网络中的基站设备作为区块节点建立时间区块链的链域,其中,所述链域包括记账节点和链上节点,所述记账节点对应记账时钟,所述链上节点对应链上时钟;The base station device in the target communication network is used as a block node to establish a chain domain of the time blockchain, wherein the chain domain includes an accounting node and an on-chain node, the accounting node corresponds to an accounting clock, and the on-chain node corresponds to an on-chain clock;
    所述记账节点从标准时间源系统获取标准时间信息;The accounting node obtains standard time information from the standard time source system;
    所述记账节点根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时。The accounting node synchronizes time with the on-chain clock through the accounting clock according to the standard time information.
  2. 根据权利要求1所述的方法,其中,所述记账节点根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时包括:The method according to claim 1, wherein the accounting node provides time to the on-chain clock from the accounting clock according to the standard time information, comprising:
    所述记账节点接收所述链上时钟发送的区块时间同步请求;The accounting node receives a block time synchronization request sent by the on-chain clock;
    所述记账节点对所述链上时钟进行节点认证;The accounting node performs node authentication on the on-chain clock;
    在节点认证通过后,所述记账节点采用同步协议根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时。After the node authentication is passed, the accounting node uses a synchronization protocol to synchronize time from the accounting clock to the on-chain clock according to the standard time information.
  3. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    接收第三方设备发送的区块时间查询请求;Receive block time query requests sent by third-party devices;
    基于所述查询请求中的区块信息、区块时间状态和已部署的业务对所述第三方设备进行身份认证,并在身份认证通过后向所述第三方设备返回所述链域的授时时间。The third-party device is authenticated based on the block information, block time status and deployed services in the query request, and the timing time of the chain domain is returned to the third-party device after the authentication is passed.
  4. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    采用所述链域中的记账时钟和链上时钟建立服务器与客户端结构,每台服务器连接多台客户端,每台客户端连接多台服务器; The accounting clock in the chain domain and the on-chain clock are used to establish a server and client structure, each server is connected to multiple clients, and each client is connected to multiple servers;
    基于所述服务器与客户端结构根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时,其中,记账时钟的端口是到链上时钟的服务器时钟,链上时钟的端口是记账时钟的客户端端口。Based on the server and client structure, the accounting clock synchronizes time with the on-chain clock according to the standard time information, wherein the port of the accounting clock is the server clock to the on-chain clock, and the port of the on-chain clock is the client port of the accounting clock.
  5. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    所述链上节点的链上时钟向记账时钟发送同步消息报文;The on-chain clock of the on-chain node sends a synchronization message to the accounting clock;
    所述链上节点的链上时钟接收记账时钟返回的授时消息报文,所述授时消息报文携带发送授时消息报文的第一时间戳;The on-chain clock of the on-chain node receives the timing message message returned by the accounting clock, and the timing message message carries the first timestamp of sending the timing message message;
    所述链上节点的链上时钟根据第一时间戳和第二时间戳计算同步时间,所述第二时间戳为链上时钟接收所述授时消息报文的时间戳。The on-chain clock of the on-chain node calculates the synchronization time according to the first timestamp and the second timestamp, where the second timestamp is the timestamp of the on-chain clock receiving the timing message.
  6. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    将从标准时间源系统获取的标准时间信息转化为本地时间,生成时间区块链数据结构;Convert the standard time information obtained from the standard time source system into local time and generate the time blockchain data structure;
    采用区块链技术组织时间信息;Use blockchain technology to organize time information;
    通过所述时间区块链数据结构在所述区块链中传递所述时间信息。The time information is communicated in the blockchain via the time blockchain data structure.
  7. 根据权利要求1所述的方法,所述方法还包括:The method according to claim 1, further comprising:
    根据所述标准时间信息生成区块时间数据链块,其中,所述区块时间数据链块的区块数据为区块时间;Generate a block time data chain block according to the standard time information, wherein the block data of the block time data chain block is the block time;
    将所述区块时间数据链块加入区块链中,并采用所述区块时间向所述链域之外的其他设备授时。The block time data chain block is added to the blockchain, and the block time is used to synchronize time with other devices outside the chain domain.
  8. 一种网络授时系统,所述网络授时系统包括记账节点和链上节点:A network timing system, comprising an accounting node and an on-chain node:
    所述记账节点,设置为从标准时间源系统获取标准时间信息,根据所述标准时间信息由所述记账时钟向所述链上时钟进行授时; The accounting node is configured to obtain standard time information from a standard time source system, and the accounting clock synchronizes time with the on-chain clock according to the standard time information;
    所述链上节点,设置为向所述记账时钟同步时间信息。The on-chain node is configured to synchronize time information with the accounting clock.
  9. 一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;其中:An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein:
    存储器,设置为存放计算机程序;a memory arranged to store a computer program;
    处理器,设置为通过运行存储器上所存放的程序来执行权利要求1至7中任一项所述的方法步骤。A processor, configured to execute the method steps of any one of claims 1 to 7 by running a program stored in a memory.
  10. 一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行上述权利要求1至7中任一项所述的方法步骤。 A storage medium comprising a stored program, wherein the program, when executed, executes the method steps described in any one of claims 1 to 7.
PCT/CN2023/094583 2022-09-27 2023-05-16 Network time synchronization method and system, and electronic device and storage medium WO2024066390A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211185897.0A CN117834069A (en) 2022-09-27 2022-09-27 Network time service method, system, electronic equipment and storage medium
CN202211185897.0 2022-09-27

Publications (1)

Publication Number Publication Date
WO2024066390A1 true WO2024066390A1 (en) 2024-04-04

Family

ID=90475835

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/094583 WO2024066390A1 (en) 2022-09-27 2023-05-16 Network time synchronization method and system, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN117834069A (en)
WO (1) WO2024066390A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190199700A1 (en) * 2017-11-20 2019-06-27 Marc Lauren Abramowitz System and method for block chain encrypted communication and identification
CN110505065A (en) * 2019-08-21 2019-11-26 腾讯科技(深圳)有限公司 A kind of trusted timestamp adding method, device and storage medium
CN111323758A (en) * 2019-12-30 2020-06-23 扬州船用电子仪器研究所(中国船舶重工集团公司第七二三研究所) Radar and confrontation dual-mode duplex multifunctional frequency conversion assembly
CN111447068A (en) * 2020-03-20 2020-07-24 腾讯科技(深圳)有限公司 Time service evidence storing method based on block chain
CN112019345A (en) * 2020-08-10 2020-12-01 杭州锘崴信息科技有限公司 System and method for high-precision time block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190199700A1 (en) * 2017-11-20 2019-06-27 Marc Lauren Abramowitz System and method for block chain encrypted communication and identification
CN110505065A (en) * 2019-08-21 2019-11-26 腾讯科技(深圳)有限公司 A kind of trusted timestamp adding method, device and storage medium
CN111323758A (en) * 2019-12-30 2020-06-23 扬州船用电子仪器研究所(中国船舶重工集团公司第七二三研究所) Radar and confrontation dual-mode duplex multifunctional frequency conversion assembly
CN111447068A (en) * 2020-03-20 2020-07-24 腾讯科技(深圳)有限公司 Time service evidence storing method based on block chain
CN112019345A (en) * 2020-08-10 2020-12-01 杭州锘崴信息科技有限公司 System and method for high-precision time block chain

Also Published As

Publication number Publication date
CN117834069A (en) 2024-04-05

Similar Documents

Publication Publication Date Title
US11770296B2 (en) Decentralized data storage and processing for IoT devices
US11849052B2 (en) Certificate in blockchain network, storage medium, and computer device
US20080123852A1 (en) Method and system for managing a wireless network
CN112291376B (en) Data processing method and related equipment in block chain system
KR102121140B1 (en) Method and device for comparing data versions between time zone crossing stations
CN113347065A (en) Flow scheduling test device and method in time-sensitive network
US11743099B2 (en) Systems, methods and devices for networked media distribution
CN112231741B (en) Data processing method, device, medium and electronic equipment based on block chain system
CN113656101B (en) Authorization management method, system, server and user side
US7778166B2 (en) Synchronizing sequence numbers among peers in a network
CN112532753B (en) Data synchronization method, device, medium and electronic equipment of block chain system
US20230045486A1 (en) Apparatus and Methods for Encrypted Communication
CN112152981B (en) Communication method, node and communication system
WO2024066390A1 (en) Network time synchronization method and system, and electronic device and storage medium
CN111464251A (en) Synchronization method, device and system
CN111031012B (en) Method for realizing security authentication of DDS domain participant
Chowdhury Packet timing: network time protocol
CN115549983A (en) Safety authentication device and method of IPv6 network transmission equipment based on time synchronization
Chowdhury Packet Timing: Precision Time Protocol
CN112512022A (en) TSN industrial application server, client, system, service method and storage medium
Castaño Cid Design and proof of concept of a centralized controller for time-sensitive networks
Kerö et al. Can ST 2059-2 Benefit From PTP Version 2.1?
Mkacher Optimization of Time Synchronization Techniques on Computer Networks
WO2024208065A1 (en) Communication method and communication system
WO2022206123A1 (en) Blockchain chaining method and apparatus, and electronic device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23869645

Country of ref document: EP

Kind code of ref document: A1