Clock synchronization method, equipment and computer storage medium

文档序号:1660249 发布日期:2019-12-27 浏览:15次 中文

阅读说明:本技术 一种时钟同步的方法、设备以及计算机存储介质 (Clock synchronization method, equipment and computer storage medium ) 是由 范志荣 于 2018-06-19 设计创作,主要内容包括:本发明实施例公开了一种时钟同步的方法、设备以及计算机存储介质。所述方法包括接收家电设备发送的家电设备所处位置的时区ID和家电设备的第一时间戳;按照预设的时间间隔,根据所述家电设备所处位置的时区ID和所述家电设备的第一时间戳更新时间同步周期;按照更新后的所述时间同步周期发送服务器的第二时间戳。根据本发明实施例可以动态调整时间同步周期,使得同步家电设备时间的频率处于中间较优频率,在保证了家电设备的时间精准度的基础上,不增加占据家电设备的资源。(The embodiment of the invention discloses a method and equipment for clock synchronization and a computer storage medium. The method comprises the steps of receiving a time zone ID of the position of the household appliance and a first timestamp of the household appliance, wherein the time zone ID is sent by the household appliance; updating a time synchronization period according to a preset time interval and a time zone ID of the position of the household appliance and a first timestamp of the household appliance; and sending the second time stamp of the server according to the updated time synchronization period. According to the embodiment of the invention, the time synchronization period can be dynamically adjusted, so that the frequency of the time for synchronizing the household appliances is in the middle optimal frequency, and the resources occupying the household appliances are not increased on the basis of ensuring the time accuracy of the household appliances.)

1. A method for clock synchronization, applied to a server, is characterized in that the method comprises:

receiving a time zone ID of the position of the household appliance and a first timestamp of the household appliance, which are sent by the household appliance;

updating a time synchronization period according to a preset time interval and a time zone ID of the position of the household appliance and a first timestamp of the household appliance;

and sending the second time stamp of the server according to the updated time synchronization period.

2. The method of claim 1, wherein updating the time synchronization period based on the time zone ID of the location of the home device and the first timestamp of the home device at the predetermined time interval comprises:

determining a third timestamp of the server according to the time zone ID of the position of the household appliance;

determining a time difference value according to the third timestamp of the server and the first timestamp of the household appliance;

and updating the time synchronization period according to the time difference.

3. The method of claim 2, further comprising:

and when the first timestamp of the household appliance is not equal to the third timestamp of the server, sending the third timestamp of the server.

4. The method of claim 2, further comprising:

adding the time difference value to a time difference value recording table corresponding to the time difference value being smaller than a preset deviation threshold value;

and determining that the position of the household appliance is obviously changed corresponding to the time difference value being larger than a preset deviation threshold value.

5. The method of claim 4, wherein updating the time synchronization period based on the time difference value comprises:

determining a minimum time difference value in a preset time interval in the time difference value recording table;

and updating the time synchronization period according to the minimum time difference value.

6. A clock synchronization method is applied to household appliances, and is characterized by comprising the following steps:

sending a time zone ID of the position of the household appliance and a first timestamp of the household appliance according to a preset first time period;

receiving a second timestamp of the server;

and updating the clock time of the household appliance from the first time stamp of the household appliance to the second time stamp of the server.

7. The method of claim 6, wherein before the sending the time zone ID of the location of the home device and the first timestamp of the home device according to the preset first time period, the method further comprises:

and receiving the time zone ID of the position of the household appliance sent by the control terminal equipment.

8. The method of claim 6, further comprising:

receiving a third timestamp of the server;

and updating the clock time of the household appliance from the first time stamp of the household appliance to the third time stamp of the server.

9. A clock synchronization method is applied to control terminal equipment, and is characterized by comprising the following steps:

determining the time zone ID of the position of the household appliance according to a preset mapping table of the time zone name and the time zone ID;

and sending the time zone ID of the position of the household appliance to the household appliance.

10. A server, comprising: a first network interface, a first memory, and a first processor;

the first network interface is configured to receive and transmit signals in the process of receiving and transmitting information with other external network elements;

the first memory configured to store a computer program operable on the processor;

the first processor, when executing the computer program, is configured to perform the steps of the method of any of claims 1 to 5.

11. An appliance device, comprising: a second network interface, a second memory, and a second processor;

the second network interface is configured to receive and transmit signals in the process of receiving and transmitting information with other external network elements;

the second memory configured to store a computer program operable on the processor;

the second processor, when executing the computer program, is configured to perform the steps of the method of any of claims 6 to 8.

12. A control terminal device comprising: a third network interface, a third memory, and a third processor;

the third network interface is configured to receive and transmit signals in the process of receiving and transmitting information with other external network elements;

the third memory configured to store a computer program operable on the processor;

the third processor, when executing the computer program, is configured to perform the steps of the method of claim 9.

13. A computer storage medium storing a clock synchronization program that when executed by at least one processor implements the steps of the method of any of claims 1 to 5, or any of claims 6 to 8, or claim 9.

Technical Field

The embodiment of the invention relates to the field of household appliances, in particular to a clock synchronization method, equipment and a computer storage medium.

Background

With the improvement of the modern quality of life, home appliances that can realize various functions have appeared. When a certain function of the home appliance is time-related, the home appliance is provided with a clock device. The accuracy of the clock device can directly affect the functions of the household appliance. In order to ensure the accuracy of the clock, the synchronization time is required. The existing synchronization time method is that a terminal device sends time synchronization to a home appliance at regular time or the home appliance acquires time synchronization from a server at regular time, and although the schemes can achieve the synchronization effect, two problems exist:

1. when the period of acquiring or sending the time synchronization is too low, although the problem of ensuring the time accuracy of the household appliance is solved, the household appliance occupies too many resources, and the resources for distributing the functions of the household appliance are relatively reduced;

2. when the period for acquiring or sending the time synchronization is too high, the problem of time accuracy of the household appliance cannot be guaranteed, and the time of the household appliance which can regularly appear for a period of time is inaccurate, so that the accuracy of time-related functions in the household appliance is influenced, a user is led to consider that the household appliance has a fault, and the user experience is influenced.

Disclosure of Invention

To solve the foregoing technical problems, embodiments of the present invention are directed to a method, an apparatus, and a computer storage medium for clock synchronization.

The technical scheme of the invention is realized as follows:

in a first aspect, an embodiment of the present invention provides a method for clock synchronization, which is applied to a server, and the method includes:

receiving a time zone ID of the position of the household appliance and a first timestamp of the household appliance, which are sent by the household appliance;

updating a time synchronization period according to a preset time interval and a time zone ID of the position of the household appliance and a first timestamp of the household appliance;

and sending the second time stamp of the server according to the updated time synchronization period.

In the foregoing solution, the updating the time synchronization cycle according to the time zone ID of the location of the home appliance and the first timestamp of the home appliance at a preset time interval includes:

determining a third timestamp of the server according to the time zone ID of the position of the household appliance;

determining a time difference value according to the third timestamp of the server and the first timestamp of the household appliance;

and updating the time synchronization period according to the time difference.

In the above aspect, the method further includes:

and when the first timestamp of the household appliance is not equal to the third timestamp of the server, sending the third timestamp of the server.

In the above aspect, the method further includes:

adding the time difference value to a time difference value recording table corresponding to the time difference value being smaller than a preset deviation threshold value;

and determining that the position of the household appliance is obviously changed corresponding to the time difference value being larger than a preset deviation threshold value.

In the foregoing solution, the updating the time synchronization period according to the time difference includes:

determining a minimum time difference value in a preset time interval in the time difference value recording table;

and updating the time synchronization period according to the minimum time difference value.

In a second aspect, an embodiment of the present invention provides a clock synchronization method, which is applied to a home appliance, and the method includes:

sending a time zone ID of the position of the household appliance and a first timestamp of the household appliance according to a preset first time period;

receiving a second timestamp of the server;

and updating the clock time of the household appliance from the first time stamp of the household appliance to the second time stamp of the server.

In the foregoing solution, before the sending the time zone ID of the location of the home appliance and the first timestamp of the home appliance according to the preset first time period, the method further includes:

and receiving the time zone ID of the position of the household appliance sent by the control terminal equipment.

In the above aspect, the method further includes:

receiving a third timestamp of the server;

and updating the clock time of the household appliance from the first time stamp of the household appliance to the third time stamp of the server.

In a third aspect, an embodiment of the present invention provides a method for clock synchronization, which is applied to control terminal equipment, and the method includes:

determining the time zone ID of the position of the household appliance according to a preset mapping table of the time zone name and the time zone ID;

and sending the time zone ID of the position of the household appliance to the household appliance.

In a fourth aspect, an embodiment of the present invention provides a server, including: a first network interface, a first memory, and a first processor;

the first network interface is configured to receive and transmit signals in the process of receiving and transmitting information with other external network elements;

the first memory configured to store a computer program operable on the processor;

the first processor is configured to, when running the computer program, perform the steps of the method of any of the first aspects.

In a fifth aspect, an embodiment of the present invention provides a home appliance, including: a second network interface, a second memory, and a second processor;

the second network interface is configured to receive and transmit signals in the process of receiving and transmitting information with other external network elements;

the second memory configured to store a computer program operable on the processor;

the second processor, when executing the computer program, is configured to perform the steps of the method of any of the second aspects.

In a sixth aspect, an embodiment of the present invention provides a control terminal device, including: a third network interface, a third memory, and a third processor;

the third network interface is configured to receive and transmit signals in the process of receiving and transmitting information with other external network elements;

the third memory configured to store a computer program operable on the processor;

the third processor, when executing the computer program, is configured to perform the steps of the method of the third aspect.

In a seventh aspect, an embodiment of the present invention provides a computer storage medium, where the computer storage medium stores a clock synchronization program, and the clock synchronization program, when executed by at least one processor, implements the steps of the method in any one of the first aspect, or any one of the second aspect, or the third aspect.

The embodiment of the invention provides a clock synchronization method, equipment and a computer storage medium; receiving a time zone ID of the position of the household appliance and a first timestamp of the household appliance, which are sent by the household appliance; updating a time synchronization period according to a preset time interval and a time zone ID of the position of the household appliance and a first timestamp of the household appliance; and sending the second timestamp of the server according to the updated time synchronization period, so that the time synchronization period can be dynamically adjusted, the frequency of the time of the synchronous household appliance is in a middle better frequency, and the resources occupying the household appliance are not increased on the basis of ensuring the time accuracy of the household appliance.

Drawings

Fig. 1 is a schematic flowchart of a clock synchronization method according to an embodiment of the present invention;

FIG. 2 is a flowchart illustrating another clock synchronization method according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating a clock synchronization method according to another embodiment of the present invention;

fig. 4 is a schematic flowchart of a clock synchronization method according to an embodiment of the present invention;

fig. 5 is a schematic structural diagram of a server device according to an embodiment of the present invention;

fig. 6 is a schematic structural diagram of another server device according to an embodiment of the present invention;

fig. 7 is a schematic structural diagram of another server device according to an embodiment of the present invention;

fig. 8 is a schematic structural diagram of another server device according to an embodiment of the present invention;

fig. 9 is a schematic hardware structure diagram of a server device according to an embodiment of the present invention;

fig. 10 is a schematic structural diagram of a home appliance according to an embodiment of the present invention;

fig. 11 is a schematic structural diagram of another household electrical appliance according to an embodiment of the present invention;

fig. 12 is a schematic structural diagram of another household electrical appliance according to an embodiment of the present invention;

fig. 13 is a schematic structural diagram of another household electrical appliance according to an embodiment of the present invention;

fig. 14 is a schematic diagram of a hardware structure of a home appliance according to an embodiment of the present invention;

fig. 15 is a schematic structural diagram of a control terminal device according to an embodiment of the present invention;

fig. 16 is a schematic diagram of a hardware structure of a control terminal device according to an embodiment of the present invention.

Detailed Description

The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:时间同步方法、装置、网络设备及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!