Disclosure of Invention
The embodiment of the invention provides a time synchronization method and device of an air conditioning unit, which are used for ensuring the normal operation of the air conditioning unit when the network connection is disconnected.
The embodiment of the invention provides the following specific technical scheme:
a time synchronizer of air conditioning unit at least comprises a communication module and a time reference module, wherein,
the communication module is used for sending a corresponding notification message to the selected time reference module and sending a time query instruction to the time reference module when the disconnection between the air conditioning unit and the network is determined;
and the time reference module is used for sending the current reference time maintained locally to each functional module in the air conditioning unit when the time query instruction is received, and enabling each functional module to carry out time synchronization according to the reference time.
Optionally, the communication module is further configured to:
according to a set period, detecting the connection condition of the air conditioning unit and the network, sending a time query instruction to the time reference module once when the air conditioning unit is still disconnected with the network every time the connection condition is determined, and triggering the time reference module to send the current reference time to each functional module in the air conditioning unit again.
Optionally, the communication module is further configured to:
when the connection between the air conditioning unit and the network is determined to be recovered, standard network time is obtained and sent to each functional module in the air conditioning unit, and each functional module is enabled to carry out time synchronization according to the standard network time.
Optionally, each functional module is further configured to:
and executing an operation instruction related to time according to the reference time notified by the time reference template.
Optionally, the time reference module is a motherboard, and the reference time is a motherboard time.
A time synchronization method of an air conditioning unit comprises the following steps:
when the communication module in the air conditioning unit determines that the air conditioning unit is disconnected from the network, sending a corresponding notification message to the selected time reference module and sending a time query instruction to the time reference module;
and when receiving the time query instruction, the time reference module sends the current reference time of local maintenance to each functional module in the air conditioning unit, and each functional module is enabled to carry out time synchronization according to the reference time.
Optionally, further comprising:
the communication module detects the connection condition of the air conditioning unit and the network according to a set period, and sends a time query instruction to the time reference module once when the air conditioning unit is still disconnected with the network every time the connection condition is determined, and triggers the time reference module to send the current reference time to each functional module in the air conditioning unit again.
Optionally, further comprising:
the communication module acquires standard network time when determining that the air conditioning unit is connected with the network again, and sends the standard network time to each functional module in the air conditioning unit, so that each functional module carries out time synchronization according to the standard network time.
Optionally, further comprising:
and each functional module executes an operation instruction related to time according to the reference time notified by the time reference template.
Optionally, the time reference module is a motherboard, and the reference time is a motherboard time.
A storage medium storing a program for implementing a time synchronization method of an air conditioning unit, the program, when executed by a processor, performing the steps of:
when the communication module in the air conditioning unit determines that the air conditioning unit is disconnected from the network, sending a corresponding notification message to the selected time reference module and sending a time query instruction to the time reference module;
and when receiving the time query instruction, the time reference module sends the current reference time of local maintenance to each functional module in the air conditioning unit, and each functional module is enabled to carry out time synchronization according to the reference time.
A communications apparatus comprising one or more processors; and one or more computer-readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the method of any of the above.
In the embodiment of the invention, when the communication module determines that the air conditioning unit is disconnected from the network, the communication module sends a time query instruction to the time reference module, and the time reference module sends the current reference time of local maintenance to each functional module in the air conditioning unit, so that each functional module carries out time synchronization according to the reference time. Therefore, after the air conditioning unit is disconnected from the network, the time among the functional modules is ensured to be free from deviation, so that the time-related instruction can be smoothly executed, the normal operation of the air conditioning unit is ensured, and the service quality is ensured.
Detailed Description
In order to ensure the normal operation of the air conditioning unit when the network connection is disconnected, in the embodiment of the invention, after the air conditioning unit is disconnected from the network, the clock time of the communication module and the mainboard is timed and synchronized, and the time synchronization is ensured, so that the air conditioning unit can normally execute the control instruction related to the time with the clock maintained by the mainboard as the standard.
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, in the embodiment of the present invention, the air conditioning unit at least includes acommunication module 10 and atime reference module 11.
Thecommunication module 10 is used for sending a corresponding notification message to the selected time reference module and sending a time query instruction to the mainboard when the disconnection between the air conditioning unit and the network is determined;
and thetime reference module 11 is configured to, when receiving the time query instruction, send the current reference time maintained locally to each functional module (which may include the communication module 11) in the air conditioning unit, and enable each functional module to perform time synchronization according to the reference time.
Thecommunication module 11 detects the connection condition of the air conditioning unit and the network according to a set period, and sends a time query instruction to thetime reference module 11 every time the connection condition of the air conditioning unit and the network is determined, and triggers thetime reference module 11 to send the current reference time to each functional module in the air conditioning unit again.
Further, when determining that the air conditioning unit is connected to the network again, thecommunication module 11 acquires a standard network time, and sends the standard network time to each functional module in the air conditioning unit, so that each functional module performs time synchronization according to the standard network time.
Further, each functional module in the air conditioning unit is configured to execute an operation instruction related to time according to the reference time notified by thetime reference template 11. Thecommunication module 11 can also be regarded as one of the functional modules.
In practical application, the selection of thetime reference module 11 may be determined according to specific situations, and due to different hardware designs, the clock chip accuracy degrees of the functional modules are different, so that, optionally, the functional module with the highest clock chip accuracy degree needs to be selected as thetime reference module 11.
In the embodiment of the present invention, it is preferable that the motherboard is used as thetime reference module 11, and accordingly, the motherboard time maintained on the motherboard can be used as the reference time.
Referring to fig. 2, for convenience of description, in the following embodiments, thetime reference module 11 is a motherboard, and the functional modules are a communication module and a line controller.
As shown in fig. 2, when the air conditioning unit normally works, the communication module may request the standard network time from the internet at regular time, and synchronize the standard network time to the main board and the line controller, so that the time of the whole system is kept uniform, i.e., the time synchronization is kept among the user terminal (e.g., a mobile phone, a notebook computer, etc.), the communication module, the main board and the line controller, so that the air conditioning unit can execute the time-related operation instruction indicated by the user terminal according to the standard network time.
When the air conditioning unit is disconnected, the time synchronization in a small range needs to be realized in the content of the air conditioning unit, namely, the time synchronization among the communication module, the mainboard and the line controller is realized.
In general, time synchronization is realized based on the functional module with the smallest clock error, and optionally, time maintained on the motherboard may be selected as reference time to realize time synchronization within the above-mentioned small range. Then, after the air conditioning unit is disconnected from the network, the communication module can notify the host board of the network disconnection state at regular time and send a time query instruction to the host board, and after receiving the time query instruction, the host board can send the current host board time maintained locally to the communication module and the line controller for synchronization.
Based on the above framework, referring to fig. 3, in the embodiment of the present invention, a specific process for implementing time synchronization of an air conditioning unit is as follows:
step 300: and the communication module detects that the air conditioning unit is disconnected with the network.
Step 310: the communication module informs the mainboard that the network is disconnected currently, and sends a time query instruction to the mainboard.
Step 320: the mainboard receives the time query instruction and sends the current mainboard time of local maintenance to the communication module and the line controller.
Step 330: the communication module and the line controller synchronize the current mainboard time sent by the mainboard.
At the moment, time synchronization in a small range is realized among the communication module, the line controller and the mainboard. Then, the communication module and the line controller can execute the operation instruction related to the time according to the current mainboard time. E.g., on and off, etc.
Step 340: is the communication module determining whether the air conditioning unit is still disconnected from the network? If yes, go back to step 310; otherwise,step 350 is performed.
If the connection between the air conditioning unit and the network is disconnected all the time, the communication template will execute steps 310-330 repeatedly according to the set period until the network connection is recovered at a certain moment, and the communication module will acquire the standard network time from the network again and synchronize to the main board and the line controller.
Step 350: the communication module acquires the current standard network time from the network and sends the current standard network time to the mainboard and the wire controller.
Step 360: the mainboard and the line controller synchronize the current standard network time sent by the communication template.
At this time, the air conditioning unit completely recovers the connection with the network, and can keep synchronization with reference to the standard network time, and the communication module and the line controller can continue to execute the operation instruction related to the time with reference to the standard network time.
In the embodiment of the invention, in the process of disconnecting the air conditioning unit from the internet, the user terminal can also detect the network disconnection state of the air conditioning unit through the APP, for example, the user terminal sends a heartbeat communication packet to a communication module in the air conditioning unit through the APP, and when the user terminal does not reply on time, the APP can judge that the air conditioning unit is in the network disconnection state, so that the user is prompted that the air conditioning unit is disconnected, and the user is prompted to check whether the network is normal.
After the network is recovered to normal, the communication module periodically detects the connection state of the network, so that after the network is recovered to normal, the communication module re-establishes connection with the internet and sends the standard network time to each functional module (including a mainboard, a line controller and the like), and at the moment, the communication module, the mainboard, the line controller and the like synchronize according to the standard network time again, and continuously execute the operation instruction related to the time in the subsequent flow based on the standard network time.
Based on the same inventive concept, an embodiment of the present invention provides a storage medium storing a program for implementing a time synchronization method of an air conditioning unit, where the program, when executed by a processor, performs the following steps:
when the communication module in the air conditioning unit determines that the air conditioning unit is disconnected from the network, sending a corresponding notification message to the selected time reference module and sending a time query instruction to the time reference module;
and when receiving the time query instruction, the time reference module sends the current reference time of local maintenance to each functional module in the air conditioning unit, and each functional module is enabled to carry out time synchronization according to the reference time.
Based on the same inventive concept, in an embodiment of the present invention, a communication apparatus is provided, which includes one or more processors; and one or more computer-readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the method of any of the above.
In summary, in the embodiment of the present invention, when it is determined that the air conditioning unit is disconnected from the network, the communication module sends a time query instruction to the time reference module, and the time reference module sends the current reference time maintained locally to each functional module in the air conditioning unit, so that each functional module performs time synchronization according to the reference time. Therefore, after the air conditioning unit is disconnected from the network, the time among the functional modules is ensured to be free from deviation, so that the time-related instruction can be smoothly executed, the normal operation of the air conditioning unit is ensured, and the service quality is ensured.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.