CN116669170B - Intelligent fire hydrant network time synchronization method and related device - Google Patents

Intelligent fire hydrant network time synchronization method and related device Download PDF

Info

Publication number
CN116669170B
CN116669170B CN202310864220.8A CN202310864220A CN116669170B CN 116669170 B CN116669170 B CN 116669170B CN 202310864220 A CN202310864220 A CN 202310864220A CN 116669170 B CN116669170 B CN 116669170B
Authority
CN
China
Prior art keywords
time
time synchronization
network time
ntp
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310864220.8A
Other languages
Chinese (zh)
Other versions
CN116669170A (en
Inventor
谭依民
阳静静
高琢玉
周富彬
欧阳伊蓉
黄强
欧阳洪轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Moore Zhilian Technology Co ltd
Original Assignee
Shenzhen Moore Zhilian Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Moore Zhilian Technology Co ltd filed Critical Shenzhen Moore Zhilian Technology Co ltd
Priority to CN202310864220.8A priority Critical patent/CN116669170B/en
Publication of CN116669170A publication Critical patent/CN116669170A/en
Application granted granted Critical
Publication of CN116669170B publication Critical patent/CN116669170B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • 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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Small-Scale Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses an intelligent hydrant network time synchronization method and a related device, wherein the method comprises the following steps: step S1, aiming at any intelligent fire hydrant, starting an Internet of things module according to preset synchronous time, and acquiring network time by fusing various network time synchronous methods; step S2, synchronizing the time of the intelligent fire hydrant according to the acquired network time; and step S3, closing the Internet of things module of the intelligent hydrant, entering a sleep mode, and waiting for the next preset synchronization time to execute the step S1. In the intelligent fire hydrant network time synchronization flow, a plurality of network time synchronization methods are fused, the reliability of the intelligent fire hydrant network time synchronization is improved, and the speed of the synchronization network time is ensured.

Description

Intelligent fire hydrant network time synchronization method and related device
Technical Field
The invention relates to the field of Internet of things and intelligent fire control, in particular to an intelligent hydrant network time synchronization method and device, computing equipment and a computer storage medium.
Background
The intelligent fire hydrant needs to upload state data information of the fire hydrant to a cloud server, such as flow, water pressure, temperature and the like, and meanwhile, the time stamp generated by the data needs to be uploaded, so that the cloud server can conveniently analyze and sort the data. Therefore, the time stamp must be accurate, that is, the intelligent fire hydrant needs to have a network time synchronization function.
One common network time synchronization method is a NITZ time synchronization method (called network identifier and time zone), which provides a mechanism for providing local date, time zone, summer offset and network provider identity information to a mobile device through a wireless network, and is used for automatically updating system time by a mobile phone. The NITZ technology has become one of the selectable parts of the official standards starting from the GSM phase 2Release96 version. Another common network time synchronization method is NTP time synchronization (NetworkTime Protocol, called network time protocol), which is an application layer protocol in the TCP/IP protocol family, used to synchronize clocks between a client and a server, providing high-precision time correction. The NTP server receives the precise coordinated universal time UTC from a rights clock source (e.g., atomic clock, GPS), and the client requests and receives the time from the server. The NTP transmits based on UDP messages using a UDP port number of 123.
Neither the NITZ time synchronization nor the NTP time synchronization has an unavailable network environment, resulting in an inability to synchronize time. Wherein for the NITZ time synchronization approach not all base stations support NITZ, base stations of different providers and operators may have different sets of functions depending on the hardware and software functions of the base stations. For the NTP time synchronization method, the NTP server is not guaranteed to be available all the time, and the time spent by the NTP protocol flow is long.
Disclosure of Invention
In view of the foregoing, the present invention has been made in order to provide a method and apparatus for synchronizing network time of an intelligent hydrant, a computing device and a computer storage medium for synchronizing network time with high reliability.
According to one aspect of the present invention, there is provided an intelligent hydrant network time synchronization method comprising:
step S1, aiming at any intelligent fire hydrant, starting an Internet of things module according to preset synchronous time, and acquiring network time by fusing various network time synchronous methods;
step S2, synchronizing the time of the intelligent fire hydrant according to the acquired network time;
and step S3, closing the Internet of things module of the intelligent hydrant, entering a sleep mode, and waiting for the next preset synchronization time to execute the step S1.
In an optional manner, the acquiring the network time by fusing the multiple network time synchronization methods further includes:
and according to the function set of the base station, the network time is acquired by fusing the NITZ time synchronization mode and the NTP time synchronization mode.
In an optional manner, the fusing the NITZ time synchronization manner and the NTP time synchronization manner to obtain the network time according to the function set of the base station further includes:
acquiring network time by using an NITZ time synchronization mode preferentially, and returning to a function set of the base station;
judging whether the function set of the base station supports the NITZ time synchronization mode, and if not, selecting the NTP time synchronization mode to acquire network time.
In an optional manner, the number of the first NTP time server and the second NTP time server is a plurality, and the NTP time synchronization manner of obtaining the network time through the second NTP time server further includes:
for any intelligent fire hydrant, sequentially and circularly requesting the second NTP time server and the alternative cname domain name in the NTP time synchronization mode, and recording the retry request times;
judging whether the number of retries of the request reaches a preset maximum number of retries, if the number of retries does not reach the preset maximum number of retries, when the network time is successfully acquired, exiting the circulation request, and synchronizing the network time of the intelligent hydrant;
if the preset maximum retry times are reached, executing step S3, closing the Internet of things module of the intelligent fire hydrant, entering a sleep mode, and waiting for the next preset synchronization time of the intelligent fire hydrant.
In an alternative, the method further comprises;
judging whether the function set of the base station supports an NITZ time synchronization mode, if so, switching to an NTP time synchronization mode to acquire network time when the number of retries requested by the intelligent hydrant reaches a preset maximum number of retries.
In an alternative, the method further comprises:
judging whether the function set of the base station supports the NITZ time synchronization mode, if not, adding the base station into a NITZ blacklist;
for any intelligent fire hydrant, after the next net injection is successful, judging whether the requested base station is in the NITZ blacklist, and if so, not trying the NITZ time synchronization mode.
According to another aspect of the present invention, there is provided an intelligent fire hydrant network time synchronization apparatus, comprising:
the time acquisition module is used for starting the internet of things module of any intelligent fire hydrant according to preset synchronous time and acquiring network time by fusing various network time synchronous methods;
the time synchronization module is used for synchronizing the time of the intelligent fire hydrant according to the acquired network time;
and the synchronous waiting module is used for closing the Internet of things module of the intelligent fire hydrant and entering a sleep mode to wait for the next preset synchronous time execution time acquisition module.
According to yet another aspect of the present invention, there is provided a computing device comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the intelligent fire hydrant network time synchronization method.
According to yet another aspect of the present invention, there is provided a computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the intelligent fire hydrant network time synchronization method described above.
According to the scheme provided by the invention, aiming at any intelligent fire hydrant, an internet of things module is started according to preset synchronous time, and network time is obtained by fusing various network time synchronous methods; synchronizing the time of the intelligent fire hydrant according to the acquired network time; and closing the Internet of things module of the intelligent hydrant, entering a sleep mode, and waiting for the execution of the next preset synchronization time until the network time is acquired. In the intelligent fire hydrant network time synchronization flow, a plurality of network time synchronization methods are fused, the reliability of the intelligent fire hydrant network time synchronization is improved, and the speed of the synchronization network time is ensured.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
fig. 1 shows a flow diagram of an intelligent hydrant network time synchronization method according to an embodiment of the present invention;
FIG. 2 shows a prior art diagram of synchronizing network time;
fig. 3 shows a flow diagram of a method for intelligent hydrant network time synchronization according to another embodiment of the present invention;
fig. 4 shows a schematic structural diagram of an intelligent hydrant network time synchronization device according to an embodiment of the present invention;
FIG. 5 illustrates a schematic diagram of a computing device in accordance with an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 shows a flow diagram of an intelligent hydrant network time synchronization method according to an embodiment of the present invention. The method integrates a plurality of network time synchronization methods in the intelligent hydrant network time synchronization flow.
To more clearly describe the network time synchronization method in the method, a method for intelligent hydrant network time synchronization in the prior art is first described.
The existing intelligent hydrant technical scheme uses NITZ or NTP for network time synchronization, as shown in fig. 2, the flow is approximately as follows:
step one, the intelligent hydrant is powered on and started. After the intelligent fire hydrant is powered on and started, the internet of things module is opened every day at regular time to acquire network time, and in general, the network time can be set to be early morning, and other time can be configured. The period of acquiring the network time can be configured, for example, one day or two days, depending on the RTC time precision of the intelligent hydrant chip and the requirement of the time precision, if the time precision is high, for example, the error of every 24 hours is within 1 second, the period of acquiring the network time can be properly improved.
And step two, connecting a network. After the internet of things module is started, firstly, network connection actions can be performed, which may include a plurality of steps such as network searching, network injection, dialing, server connection and the like, if the network injection is successful or the dialing is successful, if the network injection is in a NITZ time synchronization mode, the network connection process is required to be correctly dialed and the network connection process can be realized by connecting the NTP server.
And step three, judging whether the network is successfully connected, if the network is failed to be connected, automatically removing retry, and setting the maximum retry times. The maximum retry number is configurable, and is too large depending on specific project requirements, and in an extreme network situation, the internet of things module can be opened for a long time, so that the power consumption of the intelligent hydrant can be increased. In general, the maximum number of times is set to 3. If the network is successfully connected, time synchronization is started.
And step four, performing time synchronization by using an NITZ or NTP time synchronization transmission mode. For the NITZ time synchronization mode, only interaction with the base station is required. For the NTP time synchronization mode, the data packet needs to be sent according to the NTP protocol. If the synchronization fails, the retry is also removed, and a maximum number of retries is set, typically, this value is set to 3.
And fifthly, judging whether the time synchronization is successful. If the time synchronization is successful, the local time is updated, then the Internet of things module is closed and enters a sleep mode, and the next time synchronization flow is waited. If the time synchronization connection fails and reaches the maximum retry number, or if the time synchronization fails and reaches the maximum retry number, the internet of things module is closed and enters a sleep mode, and the next time synchronization flow is waited.
The two network time synchronization modes have different technical problems, specifically:
for the NITZ time synchronization mode, there is a problem in that not all base stations support the NITZ time synchronization mode, depending on hardware and software functions of the base stations. Base stations of different providers and operators may have different sets of functions. Some newer base station devices may support the NITZ time synchronization mode, while some older devices may not. Furthermore, operators in a particular region may choose not to use NITZ time synchronization, but to synchronize the time of the mobile device in other ways. Thus, whether a base station supports NITZ time synchronization may vary from region to region and from operator to operator.
For the NTP time synchronization approach, a reliable NTP server needs to be selected, and the reliable server needs to satisfy two conditions: (1) the time precision is required to meet the requirement; (2) The service is stable and reliable, and accidents such as downtime, service stopping and the like can not occur. Open NTP servers, such as pool.ntp.org, which is a large virtual cluster time server, may be used, maintained by open source volunteers. Also, NTP servers provided by large-scale science and technology companies or national institutions may be used. However, whichever NTP server is used, the following problems exist: (1) The server can not be ensured to be available all the time by using an open source server, for example, the server is down or the server cannot be processed due to overlarge concurrency number; (2) In some network environments, the selected NTP server may not be accessible; (3) The NTP protocol flow takes longer than the NITZ time synchronization approach.
Therefore, the above-mentioned NITZ and NTP time synchronization method or technical scheme mainly has the following problems: (1) reliability is not high. Whether in NITZ or NTP time synchronization mode, there is an unavailable network environment, which results in the failure to synchronize time; (2) the speed of using NTP synchronized time scheme is slow.
Next, a method for synchronizing the network time of the intelligent fire hydrant according to an embodiment of the present invention, such as a flowchart of the method for synchronizing the network time of the intelligent fire hydrant shown in fig. 1, includes the following steps:
step S101, aiming at any intelligent fire hydrant, starting an Internet of things module according to preset synchronous time, and acquiring network time by fusing various network time synchronous methods.
In order to improve the reliability of network time synchronization of the intelligent fire hydrant and ensure the speed of network time synchronization on the basis of the reliability, in the embodiment, based on the characteristics of network environment, stability, synchronization speed, base station equipment and the like of the traditional various network time synchronization modes, various network time synchronization methods are integrated to acquire network time. Specifically, for any intelligent fire hydrant, the internet of things module is started according to preset synchronization time (such as 1 am every day), and network time is obtained by fusing various network time synchronization methods.
In an optional manner, the acquiring the network time by fusing the multiple network time synchronization methods further includes:
and according to the function set of the base station, the network time is acquired by fusing the NITZ time synchronization mode and the NTP time synchronization mode.
In an optional manner, the fusing the NITZ time synchronization manner and the NTP time synchronization manner to obtain the network time according to the function set of the base station further includes:
acquiring network time by using an NITZ time synchronization mode preferentially, and returning to a function set of the base station;
judging whether the function set of the base station supports the NITZ time synchronization mode, and if not, selecting the NTP time synchronization mode to acquire network time.
Since the speed of the NITZ synchronization time is superior to that of the NTP synchronization time, and only the base stations in a partial area do not support the NITZ time synchronization mode, the network time is synchronized by preferentially using the NITZ time synchronization mode. If NITZ synchronization time is used, the base station returns no support, and the NTP mode is selected to synchronize time.
In an optional manner, the NTP time synchronization manner to obtain the network time further includes:
presetting an alternative cname domain name for resolving an available first NTP time server;
and the NTP time synchronization mode acquires network time through a second NTP time server, and acquires network time through the alternative cname domain name when the second NTP time server is inaccessible.
In an optional manner, the number of the first NTP time server and the second NTP time server is a plurality, and the NTP time synchronization manner of obtaining the network time through the second NTP time server further includes:
for any intelligent fire hydrant, sequentially and circularly requesting the second NTP time server and the alternative cname domain name in the NTP time synchronization mode, and recording the retry request times;
judging whether the number of retries of the request reaches a preset maximum number of retries, if the number of retries does not reach the preset maximum number of retries, when the network time is successfully acquired, exiting the circulation request, and synchronizing the network time of the intelligent hydrant;
if the preset maximum retry times are reached, executing step S3, closing the Internet of things module of the intelligent fire hydrant, entering a sleep mode, and waiting for the next preset synchronization time of the intelligent fire hydrant.
In this embodiment, in order to improve the reliability of the intelligent hydrant network time synchronization, when the NTP time synchronization mode is used, for example, three large NTP time servers (called second NTP time servers) are selected, and meanwhile, more than one alternative cname domain name is preset, and the domain name can be resolved into any other available NTP time server (called first NTP time server) at will, and the first NTP time server can be operated by operation staff of the intelligent hydrant. That is, the intelligent fire hydrant is a universal NTP time server, and any specific NTP server is down or inaccessible, so that the time synchronization function of the intelligent fire hydrant is not affected, and the reliability of the time synchronization function is greatly improved.
Step S102, synchronizing the time of the intelligent fire hydrant according to the acquired network time.
And updating the local time of the intelligent fire hydrant according to the acquired network time.
And step S103, closing the Internet of things module of the intelligent fire hydrant, entering a sleep mode, and waiting for the execution of the next preset synchronization time until the network time is acquired.
And closing the internet of things module of the intelligent fire hydrant, entering a sleep mode, waiting for the next time synchronization flow, and executing the step S101 until the network time is acquired.
According to the scheme provided by the embodiment of the invention, in the network time synchronization process of the intelligent hydrant, the NITZ time synchronization mode and the NTP time synchronization mode are fused, and the cname technology is added. Compared with the traditional intelligent hydrant network time synchronization method, the network time synchronization method greatly improves the reliability of network time synchronization and ensures the speed of network time synchronization on the basis.
Fig. 3 shows a flow diagram of a method for intelligent hydrant network time synchronization according to another embodiment of the present invention. The method adds NITZ blacklist mechanism, and adds a base station into the NITZ blacklist when confirming that the base station does not support NITZ function. And cycling through the attempts of the plurality of NTP servers and the cname server by setting a maximum number of retries. Specifically, as shown in fig. 3, the method comprises the following steps:
step S301, determining whether the network connection is successful.
The intelligent fire hydrant is powered on and started, for example, the internet of things module is automatically started every morning, and the internet of things module is connected with a network after being started. Judging whether the network connection is successful, if so, executing step S302, namely judging whether the connected base station is in the NITZ blacklist; if the network connection is unsuccessful, further judging whether the maximum retry times are reached, if the maximum retry times are reached, executing step S311, namely closing the Internet of things module, and entering a sleep mode; if the maximum retry number is not reached, the network connection is continued.
In step S302, it is determined whether the connected base station is in the NITZ blacklist.
In an optional mode, judging whether a function set of the base station supports a NITZ time synchronization mode, and if not, adding the base station into a NITZ blacklist;
for any intelligent fire hydrant, after the next net injection is successful, judging whether the requested base station is in the NITZ blacklist, and if so, not trying the NITZ time synchronization mode.
In this embodiment, a NITZ blacklist mechanism is added, and when a certain base station is confirmed not to support the NITZ function, the base station is added to the NITZ blacklist. However, after the next successful network injection, if a device in the blacklist is connected, it is not necessary to try the NITZ time synchronization mode any more, because the base station does not support the NITZ time synchronization mode, and it is ineffective to try again many times. If the connected base station is not in the NITZ blacklist, step S308 is performed, i.e. time synchronization is performed using the NTP server.
In step S303, time synchronization is performed using NITZ.
Time synchronization is performed using NITZ, if synchronization is successful, the local time is updated, and if synchronization is unsuccessful, step S306 is performed, i.e. it is determined whether the base station supports NITZ.
Step S304, judging whether the synchronization is successful.
Step S305, determining whether the maximum retry number is reached.
If the retry is performed several times and the maximum retry number is reached, and the synchronization time is not successful, step S308 is performed, i.e. the NTP server is used for time synchronization.
In step S306, it is determined whether the base station supports NITZ.
In an optional mode, judging whether the function set of the base station supports an NITZ time synchronization mode, if so, switching to the NTP time synchronization mode to acquire network time when the number of retries requested by the intelligent fire hydrant reaches a preset maximum number of retries.
In an optional mode, judging whether a function set of the base station supports a NITZ time synchronization mode, and if not, adding the base station into a NITZ blacklist;
for any intelligent fire hydrant, after the next net injection is successful, judging whether the requested base station is in the NITZ blacklist, and if so, not trying the NITZ time synchronization mode.
Specifically, it is determined whether the base station supports NITZ, if the base station supports the NITZ synchronization mode, step S305 is executed, and it is determined whether the maximum retry number is reached; if the base station does not support the NITZ synchronization mode, step S307 is performed, i.e., the base station is added to the NITZ blacklist.
In step S307, the base station is added to the NITZ blacklist.
For example, the base station ID is added to the NITZ blacklist.
In step S308, time synchronization is performed using the NTP server.
After switching to the NTP time synchronization mode, the maximum retry number is also set. Every time the 1 st NTP server, the 2 nd NTP server, the 3 rd NTP server and the cname server are tried gradually, any server can exit the cycle in advance after the synchronization time is successful, then the local time is updated, the Internet of things module is closed, and the sleep mode is entered. The network time synchronization reliability is greatly improved by cycling the requests in an NTP time synchronization mode.
Step S309, a cname server is set.
For example, it is the responsibility of the operator of the intelligent hydrant to set any other available NTP time server and set the cname domain name.
Step S3010, determine whether synchronization is successful.
Step S3011, the Internet of things module is closed, and a sleep mode is entered.
And closing the internet of things module of the intelligent fire hydrant, entering a sleep mode, and waiting for the next preset synchronization time of the intelligent fire hydrant.
The proposal provided by the embodiment of the invention increases the NITZ blacklist mechanism, avoids invalid attempts and further improves the speed of network time synchronization. And cycling through the attempts of the plurality of NTP servers and the cname server by setting a maximum number of retries. The invention can ensure the successful synchronization to the maximum extent under the extreme condition that the base station which does not support NITZ or the NITZ fails to synchronize even NTP time synchronization fails, further improves the reliability of network time synchronization and takes account of the reliability of network time synchronization and the speed of synchronization time.
Fig. 4 shows a schematic structural diagram of an intelligent hydrant network time synchronization device according to an embodiment of the present invention. The intelligent fire hydrant network time synchronization device comprises: a time acquisition module 410, a time synchronization module 420, and a synchronization waiting module 430.
The time acquisition module 410 is configured to start the internet of things module of any intelligent fire hydrant according to a preset synchronization time, and acquire network time by fusing multiple network time synchronization methods;
the time synchronization module 420 is configured to synchronize time of the intelligent fire hydrant according to the acquired network time;
the synchronization waiting module 430 is configured to close the internet of things module of the intelligent hydrant and enter a sleep mode to wait for the next preset synchronization time execution time acquisition module.
In an alternative manner, the time acquisition module 410 is further configured to:
and according to the function set of the base station, the network time is acquired by fusing the NITZ time synchronization mode and the NTP time synchronization mode.
In an alternative manner, the time acquisition module 410 is further configured to:
acquiring network time by using an NITZ time synchronization mode preferentially, and returning to a function set of the base station;
judging whether the function set of the base station supports the NITZ time synchronization mode, and if not, selecting the NTP time synchronization mode to acquire network time.
In an alternative manner, the time acquisition module 410 is further configured to:
presetting an alternative cname domain name for resolving an available first NTP time server;
and the NTP time synchronization mode acquires network time through a second NTP time server, and acquires network time through the alternative cname domain name when the second NTP time server is inaccessible.
In an alternative manner, the number of the first NTP time server and the second NTP time server is plural, and the time acquisition module 410 is further configured to:
for any intelligent fire hydrant, sequentially and circularly requesting the second NTP time server and the alternative cname domain name in the NTP time synchronization mode, and recording the retry request times;
judging whether the number of retries of the request reaches a preset maximum number of retries, if the number of retries does not reach the preset maximum number of retries, when the network time is successfully acquired, exiting the circulation request, and synchronizing the network time of the intelligent hydrant;
if the preset maximum retry number is reached, the synchronization waiting module 430 is executed to close the internet of things module of the intelligent hydrant and enter a sleep mode to wait for the next preset synchronization time of the intelligent hydrant.
In an alternative manner, the method further includes a NITZ determination module, where the NITZ determination module is further configured to:
judging whether the function set of the base station supports an NITZ time synchronization mode, if so, switching to an NTP time synchronization mode to acquire network time when the number of retries requested by the intelligent hydrant reaches a preset maximum number of retries.
In an alternative manner, the system further includes a NITZ blacklist setting module, where the NITZ blacklist setting module is further configured to:
judging whether the function set of the base station supports the NITZ time synchronization mode, if not, adding the base station into a NITZ blacklist;
for any intelligent fire hydrant, after the next net injection is successful, judging whether the requested base station is in the NITZ blacklist, and if so, not trying the NITZ time synchronization mode.
According to the scheme provided by the embodiment of the invention, in the network time synchronization process of the intelligent hydrant, the NITZ time synchronization mode and the NTP time synchronization mode are fused, and the cname technology is added. Compared with the traditional intelligent hydrant network time synchronization method, the network time synchronization method greatly improves the reliability of network time synchronization and ensures the speed of network time synchronization on the basis.
FIG. 5 illustrates a schematic diagram of an embodiment of a computing device of the present invention, and the embodiments of the present invention are not limited to a particular implementation of the computing device.
As shown in fig. 5, the computing device may include: a processor (processor) 502, a communication interface (communication interface) 504, a memory (memory) 506, and a communication bus 508.
Wherein: processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508. A communication interface 504 for communicating with network elements of other devices, such as clients or other servers. The processor 502 is configured to execute the program 510, and may specifically perform the relevant steps in the above-described embodiment of the intelligent hydrant network time synchronization method.
In particular, program 510 may include program code including computer-operating instructions.
The processor 502 may be a central processing unit CPU, or a specific integrated circuit ASIC (ApplicationSpecificIntegratedCircuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included by the computing device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 506 for storing a program 510. Memory 506 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The embodiment of the invention provides a non-volatile computer storage medium, which stores at least one executable instruction, and the computer executable instruction can execute the intelligent fire hydrant network time synchronization method in any method embodiment.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the above description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components according to embodiments of the present invention may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present invention can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specifically stated.

Claims (7)

1. An intelligent fire hydrant network time synchronization method, which is characterized by comprising the following steps:
step S1, aiming at any intelligent fire hydrant, starting an Internet of things module according to preset synchronous time, and acquiring network time by fusing various network time synchronous methods; the method specifically comprises the following steps: according to the function set of the base station, the network time is acquired by fusing the NITZ time synchronization mode and the NTP time synchronization mode: acquiring network time by using an NITZ time synchronization mode preferentially, and returning to a function set of the base station; judging whether the function set of the base station supports an NITZ time synchronization mode, and if not, selecting an NTP time synchronization mode to acquire network time; wherein, the network time acquisition by the NTP time synchronization method includes: presetting an alternative cname domain name for resolving an available first NTP time server; the NTP time synchronization mode obtains network time through a second NTP time server, and when the second NTP time server is inaccessible, the network time is obtained through the alternative cname domain name;
step S2, synchronizing the time of the intelligent fire hydrant according to the acquired network time;
and step S3, closing the Internet of things module of the intelligent hydrant, entering a sleep mode, and waiting for the next preset synchronization time to execute the step S1.
2. The intelligent fire hydrant network time synchronization method according to claim 1, wherein the number of the first NTP time server and the second NTP time server is plural, and the NTP time synchronization method for acquiring network time through the second NTP time server further includes:
for any intelligent fire hydrant, sequentially and circularly requesting the second NTP time server and the alternative cname domain name in the NTP time synchronization mode, and recording the retry request times;
judging whether the number of retries of the request reaches a preset maximum number of retries, if the number of retries does not reach the preset maximum number of retries, when the network time is successfully acquired, exiting the circulation request, and synchronizing the network time of the intelligent hydrant;
if the preset maximum retry times are reached, executing step S3, closing the Internet of things module of the intelligent fire hydrant, entering a sleep mode, and waiting for the next preset synchronization time of the intelligent fire hydrant.
3. The intelligent fire hydrant network time synchronization method according to claim 2, further comprising;
judging whether the function set of the base station supports an NITZ time synchronization mode, if so, switching to an NTP time synchronization mode to acquire network time when the number of retries requested by the intelligent hydrant reaches a preset maximum number of retries.
4. A method of intelligent fire hydrant network time synchronization according to any one of claims 1 to 3 in which the method further comprises:
judging whether the function set of the base station supports the NITZ time synchronization mode, if not, adding the base station into a NITZ blacklist;
for any intelligent fire hydrant, after the next net injection is successful, judging whether the requested base station is in the NITZ blacklist, and if so, not trying the NITZ time synchronization mode.
5. An intelligent fire hydrant network time synchronization device, comprising:
the time acquisition module is used for starting the internet of things module of any intelligent fire hydrant according to preset synchronous time and acquiring network time by fusing various network time synchronous methods; the method specifically comprises the following steps: according to the function set of the base station, the network time is acquired by fusing the NITZ time synchronization mode and the NTP time synchronization mode: acquiring network time by using an NITZ time synchronization mode preferentially, and returning to a function set of the base station; judging whether the function set of the base station supports an NITZ time synchronization mode, and if not, selecting an NTP time synchronization mode to acquire network time; wherein, the network time acquisition by the NTP time synchronization method includes: presetting an alternative cname domain name for resolving an available first NTP time server; the NTP time synchronization mode obtains network time through a second NTP time server, and when the second NTP time server is inaccessible, the network time is obtained through the alternative cname domain name;
the time synchronization module is used for synchronizing the time of the intelligent fire hydrant according to the acquired network time;
and the synchronous waiting module is used for closing the Internet of things module of the intelligent fire hydrant and entering a sleep mode to wait for the next preset synchronous time execution time acquisition module.
6. A computing device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the intelligent hydrant network time synchronization method according to any one of claims 1-4.
7. A computer storage medium having stored therein at least one executable instruction that causes a processor to perform operations corresponding to the intelligent fire hydrant network time synchronization method of any one of claims 1-4.
CN202310864220.8A 2023-07-14 2023-07-14 Intelligent fire hydrant network time synchronization method and related device Active CN116669170B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310864220.8A CN116669170B (en) 2023-07-14 2023-07-14 Intelligent fire hydrant network time synchronization method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310864220.8A CN116669170B (en) 2023-07-14 2023-07-14 Intelligent fire hydrant network time synchronization method and related device

Publications (2)

Publication Number Publication Date
CN116669170A CN116669170A (en) 2023-08-29
CN116669170B true CN116669170B (en) 2024-03-15

Family

ID=87722589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310864220.8A Active CN116669170B (en) 2023-07-14 2023-07-14 Intelligent fire hydrant network time synchronization method and related device

Country Status (1)

Country Link
CN (1) CN116669170B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657622A (en) * 2016-12-02 2017-05-10 惠州Tcl移动通信有限公司 Setting method and system of mobile terminal display time
WO2018098934A1 (en) * 2016-12-01 2018-06-07 华为技术有限公司 Method for obtaining time and time zone and terminal
CN109039518A (en) * 2018-08-21 2018-12-18 四川长虹电器股份有限公司 The ntp server address intelligent management of Android television system
CN110061797A (en) * 2019-05-29 2019-07-26 海尔优家智能科技(北京)有限公司 Method for synchronizing time, device, storage medium and computer equipment
KR102066977B1 (en) * 2018-12-26 2020-01-15 우송대학교산학협력단 IoT SYSTEM USING NB-IoT NETWORK AND ITS TIME SYNCHRONIZATION METHOD
CN112788100A (en) * 2020-12-07 2021-05-11 青岛海尔科技有限公司 Time synchronization method and device, storage medium and electronic device
CN113271169A (en) * 2021-04-27 2021-08-17 东风汽车集团股份有限公司 Vehicle time service method and system based on wireless communication terminal
CN113872718A (en) * 2021-09-26 2021-12-31 上海市共进通信技术有限公司 System, method, apparatus, processor and computer readable storage medium for implementing time synchronization function
KR20220074342A (en) * 2020-11-27 2022-06-03 주식회사 엘지유플러스 System for water quality management capable of time synchronization and method using the same
CN114826463A (en) * 2021-01-28 2022-07-29 华为技术有限公司 Time synchronization method and vehicle-mounted equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3997815A1 (en) * 2019-07-08 2022-05-18 ABB Schweiz AG Industrial device supporting multiple time synchronization protocols

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018098934A1 (en) * 2016-12-01 2018-06-07 华为技术有限公司 Method for obtaining time and time zone and terminal
CN106657622A (en) * 2016-12-02 2017-05-10 惠州Tcl移动通信有限公司 Setting method and system of mobile terminal display time
CN109039518A (en) * 2018-08-21 2018-12-18 四川长虹电器股份有限公司 The ntp server address intelligent management of Android television system
KR102066977B1 (en) * 2018-12-26 2020-01-15 우송대학교산학협력단 IoT SYSTEM USING NB-IoT NETWORK AND ITS TIME SYNCHRONIZATION METHOD
CN110061797A (en) * 2019-05-29 2019-07-26 海尔优家智能科技(北京)有限公司 Method for synchronizing time, device, storage medium and computer equipment
KR20220074342A (en) * 2020-11-27 2022-06-03 주식회사 엘지유플러스 System for water quality management capable of time synchronization and method using the same
CN112788100A (en) * 2020-12-07 2021-05-11 青岛海尔科技有限公司 Time synchronization method and device, storage medium and electronic device
CN114826463A (en) * 2021-01-28 2022-07-29 华为技术有限公司 Time synchronization method and vehicle-mounted equipment
CN113271169A (en) * 2021-04-27 2021-08-17 东风汽车集团股份有限公司 Vehicle time service method and system based on wireless communication terminal
CN113872718A (en) * 2021-09-26 2021-12-31 上海市共进通信技术有限公司 System, method, apparatus, processor and computer readable storage medium for implementing time synchronization function

Also Published As

Publication number Publication date
CN116669170A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
US20130311613A1 (en) Updating Web Resources
CN113448837B (en) Development and test environment deployment method, system, electronic equipment and medium
WO2021107988A1 (en) Distributed processing of transactions in a network using timestamps
WO2012111112A1 (en) Information processing device, time setting method, and time setting program
CN110673941A (en) Migration method of micro-services in multiple computer rooms, electronic equipment and storage medium
CN108833584B (en) Message pushing method, terminal, server and computer storage medium
US10721335B2 (en) Remote procedure call using quorum state store
WO2022179353A1 (en) Domain name resolution method and apparatus, and computer device
CN109120432B (en) Fault server positioning method and device
CN111193622B (en) Asymmetric configuration management method, device and equipment and readable storage medium
CN110535776A (en) Gateway current-limiting method, device, gateway, system and storage medium
CN107025257B (en) Transaction processing method and device
CN111338829A (en) Method and device for calling remote procedure call service
CN116669170B (en) Intelligent fire hydrant network time synchronization method and related device
CN113468143A (en) Data migration method, system, computing device and storage medium
US10289744B2 (en) Method and apparatus for managing content in a processing device
CN111913870A (en) Multi-environment management method, device, system, equipment and medium
EP4050850A1 (en) Service upgrading method, device and system
CN112035418A (en) Multi-computer room synchronization method, computing device and computer storage medium
WO2011143851A1 (en) Database server operation control system, method and equipment
CN111162936A (en) Data acquisition method and device
US9652258B2 (en) Dynamic time zone definition update manager
CN110324425B (en) Hybrid cloud transaction route processing method and device
CN113839991A (en) Method and device for confirming equipment information, storage medium and electronic device
CN102870117A (en) Acquisition method and apparatus for service information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant