CN116488765A - Time setting method, device, electronic equipment and computer readable storage medium - Google Patents

Time setting method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116488765A
CN116488765A CN202310453671.2A CN202310453671A CN116488765A CN 116488765 A CN116488765 A CN 116488765A CN 202310453671 A CN202310453671 A CN 202310453671A CN 116488765 A CN116488765 A CN 116488765A
Authority
CN
China
Prior art keywords
switch
time
current working
state
time setting
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.)
Pending
Application number
CN202310453671.2A
Other languages
Chinese (zh)
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.)
Zhejiang Windey Co Ltd
Original Assignee
Zhejiang Windey 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 Zhejiang Windey Co Ltd filed Critical Zhejiang Windey Co Ltd
Priority to CN202310453671.2A priority Critical patent/CN116488765A/en
Publication of CN116488765A publication Critical patent/CN116488765A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • 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
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E10/00Energy generation through renewable energy sources
    • Y02E10/70Wind energy
    • Y02E10/72Wind turbines with rotation axis in wind direction

Abstract

The application discloses a time setting method, a time setting device, electronic equipment and a computer readable storage medium, and relates to the field of time calibration. In the scheme, the same time setting service address is configured for each switch in advance; acquiring the working state of a current working switch to determine whether the current working switch is abnormal; if the switch is abnormal, the current working switch is set to be in a silent state, and any switch with normal working state is set to be in an active state, so that the switch in the active state is used for providing time setting service for the fan terminal. Therefore, the time setting service addresses of all the switches are the same, so that when the time setting service of the currently working switch fails, the switch can be automatically switched to other normally working switches, the time setting service of the fan system is not influenced, and the normal use of the time setting service is ensured.

Description

Time setting method, device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of time calibration, and in particular, to a time synchronization method, apparatus, electronic device, and computer readable storage medium.
Background
The fan monitoring network in the wind power plant generally communicates with each fan terminal through the main/standby switch, so that the time setting work is completed. Specifically, an IRIG-B code decoding unit of an internal EIA RS422/485 interface of the main/standby switch receives an IRIG-B code sent by the time service device, decodes time information and time synchronization pulse according to the IRIG-B code, and sends the time information to a central processing unit of the switch to start network time synchronization service, and at the moment, the central processing unit completes time synchronization communication with a fan terminal in a fan monitoring network through NTP (Network Time Protocol ).
However, since the main/standby switch configures different time-setting service IP addresses, each fan terminal can only configure one time-setting service IP address at the same time. In the process of executing the time setting task, if the time setting service of one switch fails, a worker is required to manually change the configuration file in each fan terminal so as to modify the time setting service IP address corresponding to each fan terminal, and then the switch can be switched to the other switch, so that the time setting task can be recovered. The mode in the prior art causes inaccurate time of the fan terminal equipment, and further data recording of the fan terminal can be affected.
Disclosure of Invention
The purpose of the application is to provide a time setting method, a device, electronic equipment and a computer readable storage medium, wherein the time setting service addresses of all the switches are the same, so that when the time setting service of the switch which works currently fails, the switch can be automatically switched to other switches which work normally, the time setting service of a fan system is not influenced, and the normal use of the time setting service is ensured.
In order to solve the technical problem, the present application provides a time synchronization method, which is applied to a fan system, the fan system includes a plurality of fan terminals and at least two switches, each switch is connected with the fan terminal, and the time synchronization method includes:
the same time setting service address is configured for each switch in advance;
acquiring the working state of a current working switch to determine whether the current working switch is abnormal;
if the current working switch is abnormal, the current working switch is set to be in a silent state, any switch with normal working state is set to be in an active state, and the active state switch is used for providing time setting service for the fan terminal.
Preferably, acquiring the working state of the currently working switch to determine whether the currently working switch is abnormal, including:
monitoring time setting information transmitted between a time service device and a currently working switch to determine whether the time setting information is abnormal or not, wherein the time service device is a device for acquiring standard time;
if the time setting information is abnormal, judging that the switch working currently is abnormal; otherwise, judging that the current working exchanger is normal.
Preferably, acquiring the working state of the currently working switch to determine whether the currently working switch is abnormal, including:
judging whether the switches except the switch which works currently receive message information broadcast by the switch which works currently in preset time or not;
if not, judging that the current working switch is abnormal, otherwise, judging that the current working switch is normal.
Preferably, each switch is preconfigured with priority parameters corresponding to the switches one by one; the method for determining whether the current working switch is abnormal comprises the following steps:
and comparing priority parameters corresponding to the switches, and setting the switch with the maximum priority parameter as the switch which works currently.
Preferably, comparing priority parameters corresponding to the switches, and setting the switch with the largest priority parameter as the currently working switch, including:
each exchanger broadcasts message information to exchangers except the exchanger and the fan terminal, wherein the message information at least comprises priority parameters corresponding to the exchanger;
each exchanger compares the priority parameter corresponding to each message information received with the priority parameter corresponding to the exchanger;
if the received priority parameters have priority parameters larger than the priority parameters of the self, the self is set to be in a silent state, otherwise, the self is set to be in an active state to serve as a switch which works currently.
Preferably, the current working switch is set to a silent state, and any switch with normal working state is set to an active state, so that the switch in the active state is used for providing time setting service for the fan terminal, including:
updating the priority parameters of the current working switch from a first initial parameter to a first updated parameter or updating a second initial parameter corresponding to at least one switch except the current working switch to a second updated parameter, wherein the second updated parameter is larger than the first initial parameter and larger than the second initial parameter;
and determining the switch with the maximum priority parameter as a standby switch according to the updated priority parameter corresponding to each switch, setting the standby switch into an active state, and setting the currently working switch into a silent state so as to provide time setting service for the fan terminal by using the standby switch.
Preferably, after the standby switch is used for providing the time setting service for the fan terminal, the method further comprises:
when the current working switch is recovered to be normal, recovering the priority parameter of the current working switch from the first updating parameter to the first initial parameter, or recovering the second updating parameter corresponding to at least one switch except the current working switch to the second initial parameter;
and setting the current working switch to be in an active state and setting the standby switch to be in a silent state according to the updated priority parameters corresponding to the switches so as to provide time setting service for the fan terminal by using the current working switch.
For solving above-mentioned technical problem, this application still provides a time setting device, is applied to fan system, fan system includes a plurality of fan terminal and two at least switches, each the switch with fan terminal is connected, time setting device includes:
an address configuration unit, configured to configure the same time synchronization service address for each switch in advance;
the state determining unit is used for obtaining the working state of the current working switch so as to determine whether the current working switch is abnormal or not;
and the switching unit is used for setting the current working switch to be in a silent state and setting any switch with normal working state to be in an active state when the current working switch is abnormal, so that the switch in the active state is used for providing time setting service for the fan terminal.
In order to solve the above technical problem, the present application further provides an electronic device, including:
a memory for storing a computer program;
a processor for implementing the steps of the time-setting method as described above when storing a computer program.
To solve the above technical problem, the present application further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the time synchronization method as described above.
The application provides a time setting method, a time setting device, electronic equipment and a computer readable storage medium, and relates to the field of time calibration. In the scheme, the same time setting service address is configured for each switch in advance; acquiring the working state of a current working switch to determine whether the current working switch is abnormal; if the switch is abnormal, the current working switch is set to be in a silent state, and any switch with normal working state is set to be in an active state, so that the switch in the active state is used for providing time setting service for the fan terminal. Therefore, the time setting service addresses of all the switches are the same, so that when the time setting service of the currently working switch fails, the switch can be automatically switched to other normally working switches, the time setting service of the fan system is not influenced, and the normal use of the time setting service is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings needed in the prior art and embodiments, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a time synchronization method provided in the present application;
FIG. 2 is a block diagram of a fan system provided herein;
fig. 3 is a block diagram of a time setting device provided in the present application;
fig. 4 is a block diagram of an electronic device provided in the present application.
Detailed Description
The core of the application is to provide a time setting method, a device, electronic equipment and a computer readable storage medium, wherein the time setting service addresses of all the switches are the same, so that when the time setting service of the currently working switch fails, the switch can be automatically switched to other normally working switches, the time setting service of a fan system is not influenced, and the normal use of the time setting service is ensured.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flow chart of a time synchronization method provided in the present application, and fig. 2 is a block diagram of a fan system provided in the present application. The method is applied to a fan system, the fan system comprises a plurality of fan terminals and at least two switches, each switch is connected with the fan terminal, and the time synchronization method comprises the following steps:
s11: the same time setting service address is configured for each exchanger in advance;
specifically, when considering that the time setting service addresses configured by each switch in the prior art are different, if the switch needs to be switched, the time setting service addresses also need to be switched or configured, the using steps are complex, the time setting service efficiency is low, and the problem of inaccurate time setting may be caused.
In order to solve the technical problem, when at least two switches are arranged in the fan system, the same time setting service address is configured for each switch, and when any switch is a fan system broadcast message, the same time setting service address is used. Even when the working switch is required to be switched subsequently, the time setting service address of the switch after the switching is the same as the time setting service address before the switching, so that the time setting service address does not need to be reconfigured, the flow of the switch is optimized, the time required by the switch is saved, and the problem of inaccurate time setting is avoided as much as possible.
The number of the switches depends on the actual situation, and in a specific embodiment, two switches, that is, a core switch and a standby switch, are provided, and in the following embodiment, the core switch and the standby switch are mainly described, but the present invention is not limited to this implementation manner.
S12: acquiring the working state of a current working switch to determine whether the current working switch is abnormal;
specifically, the step aims to provide a method for determining whether to switch the switching condition of the switch, taking the working state of the switch currently working as a judging basis, and judging that the switch currently working can normally provide time setting service when the working state of the switch currently working is normal, wherein the switch does not need to be switched at the moment; if the working state of the current working switch is abnormal, the risk that the current working switch can not normally provide time setting service is judged, and at the moment, the switch is judged to be needed to be switched.
When the fan system includes a plurality of switches, any one of the switches may be designated as a switch that normally operates after the fan system is started, or a preset switch may be used as a switch that normally operates after the fan system is started. For example, in one embodiment, after the fan system is started, the core switch is used as the switch that works currently by default, and at this time, the working state of the core switch may be obtained in real time, and whether the core switch is abnormal or not may be determined according to the working state of the core switch. If yes, triggering to enter a related step of switching to the standby switch, otherwise, not triggering to enter a step of switching to the standby switch.
S13: if the switch is abnormal, the current working switch is set to be in a silent state, and any switch with normal working state is set to be in an active state, so that the switch in the active state is used for providing time setting service for the fan terminal.
The present step aims to provide a specific way of switching the switches, specifically, when it is determined that the switch currently operating is abnormal, the switch currently operating is set to a silent state, and any switch in a normal state is set to an active state. The silence state may be a sleep mode or a shutdown mode, which refers to a state that the switch set in the silence state no longer provides a time setting service for the fan terminal, and the active state may refer to a start-up state or a working state, which refers to a state that the switch set in the active state provides a time setting service for the fan terminal.
If the number of switches is more than two, and when it is determined that the current working switch is abnormal, including at least two switches with normal working states, a specific manner of setting which switch with normal working state to be an active state may be: and setting the switch with the forefront sequence number and normal working state as an active state according to the sequence number of the switch, or setting the switch with the highest priority and normal working state as an active state according to the priority of the switch.
In summary, in the time setting method in the application, the time setting service addresses of all the switches are the same, so that when the time setting service of the currently working switch fails, the switch can be automatically switched to other normally working switches, the time setting service of the fan system is not affected, and the normal use of the time setting service is ensured.
Based on the above embodiments: as a preferred embodiment, acquiring an operation state of a currently operated switch to determine whether the currently operated switch is abnormal, includes:
monitoring time setting information transmitted between a time service device and a currently working switch to determine whether the time setting information is abnormal or not, wherein the time service device is a device for acquiring standard time;
if the time setting information is abnormal, judging that the switch working currently is abnormal; otherwise, judging that the current working exchanger is normal.
The embodiment aims to provide a specific implementation manner for determining whether the currently operating switch is abnormal, specifically, but not limited to, monitoring time synchronization information transmitted between a time service device and the currently operating switch, if the transmitted time synchronization information is the same as standard time synchronization information, determining that the operating state of the currently operating switch is normal, otherwise, determining that the currently operating switch is abnormal.
Further, when the transmitted time setting information is judged to be normal, the first identification information is output, and when the transmitted time setting information is judged to be abnormal, the second identification information is output. The first identification information and the second identification information can be characters, character strings, high-low levels and the like.
In the specific implementation process, the time setting information is a square wave signal or a level signal which accords with a preset standard, and the abnormal condition of the time setting information can include fluctuation or level abnormality of the square wave signal.
The time service device can acquire the standard time through a GPS or Beidou and the like, so as to realize the time synchronization of the whole fan system as the reference time.
Therefore, the judgment of the working state of the currently working switch can be realized by judging the state of the time synchronization information transmitted between the time service device and the switch, and the realization mode is simple and reliable.
As a preferred embodiment, acquiring an operation state of a currently operated switch to determine whether the currently operated switch is abnormal, includes:
judging whether the switches except the switch which works currently receive message information broadcast by the switch which works currently within preset time;
if not, judging that the current working switch is abnormal, otherwise, judging that the current working switch is normal.
The present embodiment aims to provide another specific implementation manner for determining whether a currently operating switch is abnormal, specifically, when in a normal operating state, the switch in the current operating state provides a time synchronization service for each fan terminal in a fan system, the switch generally broadcasts message information to other switches and each fan terminal except itself.
Therefore, the time of the received message information can also be used as a judging basis, specifically, when the current working switch normally broadcasts the message information to other switches except the current working switch and each fan terminal, the current working switch is judged to be normal, otherwise, the current working switch is judged to be abnormal.
It should be noted that in a specific embodiment of the present application, it is not determined whether each fan terminal receives the message information broadcast by the currently operating switch, but only whether the switches except the currently operating switch receive the message information broadcast by the currently operating switch within the preset time is determined as follows: the method can be applied to all the switches, so that only the switches have programs for judging whether the message information broadcast by the currently working switch is received. Of course, in another embodiment, a program for judging whether the fan terminal itself receives the message information broadcast by the switch that works currently may also be provided in the fan terminal, and after the fan terminal obtains the judgment result, the program is fed back to the processor, so that the processor determines whether to switch the switch according to the judgment result.
Therefore, in the method, whether the message information broadcast by the current working switch is received or not is judged by other switches, the judgment of the working state of the current working switch can be realized, program development is only needed for each switch in the fan system, the realization mode is simple and reliable, and the development cost is saved.
As a preferred embodiment, each switch is preconfigured with priority parameters corresponding to itself one by one; the method for determining whether the current working switch is abnormal comprises the following steps:
and comparing priority parameters corresponding to the switches, and setting the switch with the largest priority parameter as the switch which works currently.
Further, the present application aims to provide a specific way of determining the current working switch, in which the switch is preconfigured with a priority parameter corresponding to the switch, and when determining the working switch, the switch with the largest priority parameter is determined to be the current working switch according to the priority parameters configured by each switch, that is, the switch with the highest priority level is determined to be the current working switch.
For example, there are two switches, and when one is a core switch and the other is a standby switch, if the priority parameter of the core switch is 110 and the priority parameter of the standby switch is 100, the core switch is taken as the currently operating switch.
Therefore, by configuring the priority parameter in this embodiment, the selection of the switch that works currently can be implemented by using simple and easy-to-implement logic, and the implementation manner is simple and reliable.
As a preferred embodiment, comparing priority parameters corresponding to the switches, and setting the switch with the largest priority parameter as the currently operating switch, including:
each exchanger broadcasts message information to the exchangers and the fan terminals except the exchanger, wherein the message information at least comprises priority parameters corresponding to the exchanger;
each exchanger compares the priority parameter corresponding to each message information received with the priority parameter corresponding to each exchanger;
if the received priority parameters have priority parameters larger than the priority parameters of the self, the self is set to be in a silent state, otherwise, the self is set to be in an active state to serve as a switch which works currently.
The embodiment aims to provide a specific mode of setting the switch with the largest priority parameter as the currently working switch, specifically, when the execution main body in the application is a processor in the switch, when a fan system is started, each switch is controlled to broadcast message information to the switches except the switch and the fan terminal, and the message information at least comprises the priority parameter corresponding to the switch; at this time, each switch receives N-1 message information (assuming that N switches are provided, N is an integer greater than 2), and each switch compares N-1 priority parameters included in the N-1 message information with the priority parameters configured by itself, and if there is a priority parameter greater than the priority parameter of itself, determines that itself is not the switch with the largest priority parameter, and at this time, it will not become the switch that is currently operating, so it is only necessary to directly set itself to a mute state. If the received priority parameter does not have the priority parameter larger than the priority parameter of the self, judging the self to be the switch with the highest priority, and setting the working state of the self to be an active state so as to become the priority parameter of the current work, thereby providing time setting service for the fan system.
In the mode in this embodiment, each switch determines whether itself meets the requirement of becoming the current working switch, and sets its working state according to the determination result, without using other control devices to set its working state, so as to reduce transmission of control signals, avoid control failure, and improve reliability of fan system in time setting.
As a preferred embodiment, the current working switch is set to a silent state, and any switch with normal working state is set to an active state, so as to provide a time setting service for a fan terminal by using the switch with active state, including:
updating the priority parameter of the currently working switch from the first initial parameter to the first updated parameter, or updating the second initial parameter corresponding to at least one switch except the currently working switch to the second updated parameter, wherein the second updated parameter is larger than the first initial parameter and larger than the second initial parameter;
and determining the switch with the maximum priority parameter as a standby switch according to the updated priority parameter corresponding to each switch, setting the standby switch as an active state, and setting the currently working switch as a silent state so as to provide time setting service for a fan terminal by using the standby switch.
The present embodiment aims to provide a specific implementation manner of a switch, specifically, when each switch is configured with a priority parameter corresponding to itself, in the present embodiment, when it is determined that the switch needs to be switched, a standby switch is determined by adjusting the priority parameter. The above embodiment is based on setting the switch with the largest priority parameter as the currently operating switch: when the current working switch is judged to be abnormal, the priority parameter corresponding to the current working switch is updated from the first initial parameter to the first updated parameter, at the moment, the priority parameter corresponding to the abnormal current working switch is judged to be the first updated parameter, the priority parameters corresponding to the other switches are the second initial parameter, and the second initial parameter is larger than the first updated parameter, at the moment, when the priority parameter is judged again, the current working switch which is judged to be abnormal is set to be in a silent state, one of the switches with the priority parameter being the second initial parameter is selected as a standby switch, and the standby switch is set to be in an active state, so that the standby switch is used for providing time setting service for a fan terminal. Or, the priority parameter corresponding to the switch which works at present is unchanged and still is the first initial parameter, the priority parameter corresponding to at least one switch in the other switches is updated from the second initial parameter to the second updated parameter, wherein the second updated parameter is larger than the first initial parameter, at the moment, when judging the priority parameter again, the switch which works at present and judges to be abnormal is set to be in a silence state, the switch with the priority parameter being the second updated parameter is used as a standby switch and is set to be in an active state, and the standby switch is used for providing time synchronization service for a fan terminal.
For example, when there are two switches, one of which is a core switch and the other is a standby switch, if the priority parameter of the core switch is 110 and the priority parameter of the standby switch is 100, the core switch is regarded as the currently operating switch in the initial state. When it is determined that the core switch is abnormal, the priority parameter of the core switch may be reduced by 20 (to 90), or the priority parameter of the standby switch may be increased by 20 (to 120), and the function of switching the core switch to the standby switch may be realized.
Therefore, the switch can be switched by adjusting the priority parameter in the mode of this embodiment, and the judgment logic is simple and easy to implement.
As a preferred embodiment, after the standby switch is used to provide the time setting service for the fan terminal, the method further includes:
when the current working switch is recovered to be normal, recovering the priority parameter of the current working switch from the first updating parameter to the first initial parameter, or recovering the second updating parameter corresponding to at least one switch except the current working switch to the second initial parameter;
and setting the current working switch to be in an active state and setting the standby switch to be in a silent state according to the updated priority parameters corresponding to the switches so as to provide time setting service for the fan terminal by using the current working switch.
The present embodiments are directed to a specific implementation after the current operating switch has been restored, in one specific embodiment, by switching the switch back to the restored switch. In another embodiment, the switch may be switched back to the normal switch only when the standby switch (switch after switching) is abnormal. For example, the core switch is used in the initial state, and if the core switch is abnormal, the core switch is switched to the standby switch. If the core switch is abnormal in the working process of the standby switch, the core switch can be switched back to the core switch, or the standby switch is still used until the standby switch is abnormal.
Specifically, in the first embodiment of directly switching back to the normal switch, the switching manner is: and adjusting priority parameters of all the switches to restore the initial parameters, specifically restoring the currently working switch from the first updated parameters to the first initial parameters or restoring the switch updated to the second updated parameters to the second initial parameters so as to set the currently working switch to an active state and set the standby switch to a silent state, thereby providing time setting service for the fan system by using the currently working switch.
For example, after the primary switching, the priority parameter of the core switch is 90, and the priority parameter of the standby switch is 100, the priority parameter of the core switch may be restored to 110. Alternatively, if the priority parameter of the core switch is 110 and the priority parameter of the standby switch is 120, the priority parameter of the core switch may be restored to 100. The above two modes can realize the function of switching the standby switch to the standby switch which is recovered to be normal.
For ease of understanding, this application provides one specific example herein:
and setting a fan monitoring network time setting service address IP in the central processing unit of the main and standby exchanges, and carrying the network time setting server address and the NTP priority field by using a gratuitous ARP message to carry out whole network broadcasting. By comparing the NTP priorities, the primary NTP and the backup NTP are calculated. Meanwhile, an IRIG-B (DC) code level signal monitoring unit is added between an IRIG-B (DC) code decoding unit of the main and standby core switches and the central processing unit, level signals of the switches and the time service device are monitored by the monitoring unit, when the level signals are in a low level or a high level, the state is judged to be abnormal, and when the level signals accord with the IRIG-B (DC) code level signal rule, namely, within 10ms, continuous high and low levels are provided, the state is judged to be normal. Judging whether the upper time service device is normal or not, inputting the result to the central processing unit of the switch by using a 0 or 1 code, and modifying the original NTP priority by the central processing unit according to the input of 0 or 1, so as to change the main and alternative election result of the NTP and ensure the availability of the NTP service.
A method for monitoring network redundancy heat standby time by a fan comprises the following steps:
the fan system comprises two switches, the two switches are configured with the same NTP pair time service address, each switch is configured with an NTP priority field (namely the priority parameter), wherein the NTP priority field of one switch is 110, and the NTP priority field of the other switch is 100. The two switches consider that the two switches provide NTP time-setting service for the whole network for the first time by taking the two switches as a core switch, broadcast the whole network (including the switches except the two switches and all fan terminals) by using the free ARP, the two sides can receive the free ARP message information of the other side, compare the NTP priority fields carried by the free ARP message information, the priority is high, the whole network notification is still carried out, the priority is low, the two switches are converted into a silence state, the free ARP message information is not sent any more, only the free ARP message of the opposite end is monitored, the opposite end NTP priority fields are recorded, so that the election work of NTP is completed, and the high-priority switch is used as the core switch to provide NTP time-setting service downwards.
And secondly, monitoring the working level of an IRIG-B (DC) code decoding unit of the switch (namely, detecting the time synchronization information transmitted between the time service device and the switch). When the working level is in a normal state, an identifier 1 is output, the upper end of the identifier is in a normal state, and when the identifier 1 is received at the moment, the NTP priority fields of all the switches are not modified. When the working level is in an abnormal state, outputting an identifier 0, identifying the upper-end time synchronization abnormality, and when the identifier 0 is received, modifying the NTP priority field of one of the switches, for example, subtracting 20 the NTP priority field of the currently working switch from the original base, or adding 20 the NTP priority field corresponding to the working switch from the original base.
The core exchanger broadcasts the free ARP in the whole network, and the priority field carried by the ARP message information is updated NTP priority field. When the spare exchanger receives the free ARP message information of the core exchanger, comparing the priority of the own NTP with the priority of the core NTP, when the priority is smaller than the opposite end, still keeping the silence state, if the priority is larger than the opposite end, starting the whole network broadcasting free ARP, carrying the own NTP priority field, and when the core exchanger receives the free ARP message of the spare exchanger, finding that the priority is smaller than the opposite end, and actively entering the silence state. Thereby completing the master-slave NTP switching.
When the spare exchanger does not receive the free ARP message information of the core exchanger within a period of time, the spare exchanger judges that the core exchanger is faulty, the self state is switched from the silence state to the active state, the free ARP message is actively broadcast to the whole network, the NTP switching is completed, and NTP pair time service is provided for the whole network.
For solving above-mentioned technical problem, this application still provides a time setting device, please refer to fig. 3, fig. 3 is the structure block diagram of a time setting device that this application provided, and the device is applied to fan system, and fan system includes a plurality of fan terminal and two at least switches, and each switch is connected with fan terminal, and time setting device includes:
an address configuration unit 31, configured to configure the same time synchronization service address for each switch in advance;
a state determining unit 32, configured to obtain an operation state of the currently operated switch, so as to determine whether the currently operated switch is abnormal;
and the switching unit 33 is configured to set the currently operating switch to a silent state and set any switch with a normal operating state to an active state when the currently operating switch is abnormal, so as to provide a time synchronization service for the fan terminal by using the switch with the active state. For the description of the time setting device, refer to the above embodiments, and the description is omitted herein.
In order to solve the above technical problem, the present application further provides an electronic device, please refer to fig. 4, fig. 4 is a block diagram of an electronic device provided in the present application, the device includes:
a memory 41 for storing a computer program;
a processor 42 for implementing the steps of the time-setting method as described above when storing the computer program. For the description of the electronic device, refer to the above embodiments, and the description is omitted herein.
To solve the above technical problem, the present application further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the time synchronization method described above. For the description of the computer-readable storage medium, refer to the above embodiments, and the description is omitted herein.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A time synchronization method, characterized in that it is applied to a fan system, the fan system includes a plurality of fan terminals and at least two switches, each of the switches is connected with the fan terminals, the time synchronization method includes:
the same time setting service address is configured for each switch in advance;
acquiring the working state of a current working switch to determine whether the current working switch is abnormal;
if the current working switch is abnormal, the current working switch is set to be in a silent state, any switch with normal working state is set to be in an active state, and the active state switch is used for providing time setting service for the fan terminal.
2. The time tick method of claim 1 in which obtaining the operational status of the currently active switch to determine if the currently active switch is abnormal comprises:
monitoring time setting information transmitted between a time service device and a currently working switch to determine whether the time setting information is abnormal or not, wherein the time service device is a device for acquiring standard time;
if the time setting information is abnormal, judging that the switch working currently is abnormal; otherwise, judging that the current working exchanger is normal.
3. The time tick method of claim 1 in which obtaining the operational status of the currently active switch to determine if the currently active switch is abnormal comprises:
judging whether the switches except the switch which works currently receive message information broadcast by the switch which works currently in preset time or not;
if not, judging that the current working switch is abnormal, otherwise, judging that the current working switch is normal.
4. The time synchronization method of claim 1, wherein each of the switches is preconfigured with a priority parameter corresponding to itself one to one; the method for determining whether the current working switch is abnormal comprises the following steps:
and comparing priority parameters corresponding to the switches, and setting the switch with the maximum priority parameter as the switch which works currently.
5. The time synchronization method of claim 4, wherein comparing the priority parameters corresponding to the switches and setting the switch with the largest priority parameter as the currently operating switch comprises:
each exchanger broadcasts message information to exchangers except the exchanger and the fan terminal, wherein the message information at least comprises priority parameters corresponding to the exchanger;
each exchanger compares the priority parameter corresponding to each message information received with the priority parameter corresponding to the exchanger;
if the received priority parameters have priority parameters larger than the priority parameters of the self, the self is set to be in a silent state, otherwise, the self is set to be in an active state to serve as a switch which works currently.
6. The time setting method as claimed in claim 5, wherein setting the currently operating switch to a silent state and setting any one of the switches in a normal operation state to an active state to provide the time setting service for the blower terminal using the switch in the active state, comprises:
updating the priority parameters of the current working switch from a first initial parameter to a first updated parameter or updating a second initial parameter corresponding to at least one switch except the current working switch to a second updated parameter, wherein the second updated parameter is larger than the first initial parameter and larger than the second initial parameter;
and determining the switch with the maximum priority parameter as a standby switch according to the updated priority parameter corresponding to each switch, setting the standby switch into an active state, and setting the currently working switch into a silent state so as to provide time setting service for the fan terminal by using the standby switch.
7. The time tick method of claim 6, further comprising, after providing a time tick service to the fan terminal using the standby switch:
when the current working switch is recovered to be normal, recovering the priority parameter of the current working switch from the first updating parameter to the first initial parameter, or recovering the second updating parameter corresponding to at least one switch except the current working switch to the second initial parameter;
and setting the current working switch to be in an active state and setting the standby switch to be in a silent state according to the updated priority parameters corresponding to the switches so as to provide time setting service for the fan terminal by using the current working switch.
8. A time setting device, characterized in that is applied to fan system, fan system includes a plurality of fan terminal and at least two switch, each the switch with fan terminal is connected, time setting device includes:
an address configuration unit, configured to configure the same time synchronization service address for each switch in advance;
the state determining unit is used for obtaining the working state of the current working switch so as to determine whether the current working switch is abnormal or not;
and the switching unit is used for setting the current working switch to be in a silent state and setting any switch with normal working state to be in an active state when the current working switch is abnormal, so that the switch in the active state is used for providing time setting service for the fan terminal.
9. An electronic device, comprising:
a memory for storing a computer program;
processor for implementing the steps of the time synchronization method according to any of the claims 1-7 when storing a computer program.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the time synchronization method according to any of claims 1-7.
CN202310453671.2A 2023-04-25 2023-04-25 Time setting method, device, electronic equipment and computer readable storage medium Pending CN116488765A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310453671.2A CN116488765A (en) 2023-04-25 2023-04-25 Time setting method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310453671.2A CN116488765A (en) 2023-04-25 2023-04-25 Time setting method, device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116488765A true CN116488765A (en) 2023-07-25

Family

ID=87215215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310453671.2A Pending CN116488765A (en) 2023-04-25 2023-04-25 Time setting method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116488765A (en)

Similar Documents

Publication Publication Date Title
CN108088045B (en) Air conditioner communication mode switching method, air conditioner and readable storage medium
US8174962B2 (en) Global broadcast communication system
CN114866365B (en) Arbitration machine election method, device, intelligent equipment and computer readable storage medium
US10037253B2 (en) Fault handling methods in a home service system, and associated household appliances and servers
CN111245677A (en) Communication abnormity reporting method and device, electronic equipment and storage medium
CN107702274B (en) Terminal control method, device and computer readable storage medium
CN108151228B (en) Air conditioner communication mode switching method, air conditioner and readable storage medium
CN113396561A (en) Operation device maintenance method and apparatus, storage medium, and program product
CN113454605A (en) Operation device maintenance method and apparatus, storage medium, and program product
CN116488765A (en) Time setting method, device, electronic equipment and computer readable storage medium
KR20150104435A (en) Method of performing transition of operation mode for a routing processor
CN115622871A (en) Bus load determination method and device, household electrical appliance and storage medium
JP2019214353A (en) Communication device and control method
CN111866094B (en) Timing task processing method, node and computer readable storage medium
US8458705B2 (en) Method and apparatus for preventing the omission and repeated execution of schedule information due to a time change
JP2000148454A (en) Communication terminal device and center device
CN113424159A (en) Operation device maintenance method and apparatus, storage medium, and program product
JP2021145298A (en) Operating device and program
US10063386B2 (en) Control method, controller, and recording medium
CN112995571B (en) Communication management method and communication management device for wireless conference system
US8271828B2 (en) Restarting networks
CN115086219B (en) Virtual router determining method, device and computer readable storage medium
CN115963756A (en) Electronic system start control method and device and monitoring system
CN113362196B (en) Low-delay addressing method for pre-dispatching service of power grid monitoring system
JP2023136334A (en) Abnormality detection server, abnormality detection system, and abnormality detection method

Legal Events

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