CN110491050B - Same-phase flashing method, device, server and storage medium - Google Patents

Same-phase flashing method, device, server and storage medium Download PDF

Info

Publication number
CN110491050B
CN110491050B CN201910911311.6A CN201910911311A CN110491050B CN 110491050 B CN110491050 B CN 110491050B CN 201910911311 A CN201910911311 A CN 201910911311A CN 110491050 B CN110491050 B CN 110491050B
Authority
CN
China
Prior art keywords
beat
time interval
beat number
terminal
current
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
CN201910911311.6A
Other languages
Chinese (zh)
Other versions
CN110491050A (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.)
Zhejiang Supcon Technology Co Ltd
Original Assignee
Zhejiang Supcon 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 Zhejiang Supcon Technology Co Ltd filed Critical Zhejiang Supcon Technology Co Ltd
Priority to CN201910911311.6A priority Critical patent/CN110491050B/en
Publication of CN110491050A publication Critical patent/CN110491050A/en
Application granted granted Critical
Publication of CN110491050B publication Critical patent/CN110491050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08BSIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
    • G08B5/00Visible signalling systems, e.g. personal calling systems, remote indication of seats occupied
    • G08B5/22Visible signalling systems, e.g. personal calling systems, remote indication of seats occupied using electric transmission; using electromagnetic transmission
    • G08B5/36Visible signalling systems, e.g. personal calling systems, remote indication of seats occupied using electric transmission; using electromagnetic transmission using visible light sources
    • G08B5/38Visible signalling systems, e.g. personal calling systems, remote indication of seats occupied using electric transmission; using electromagnetic transmission using visible light sources using flashing light

Landscapes

  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • General Physics & Mathematics (AREA)
  • Electric Clocks (AREA)
  • Alarm Systems (AREA)

Abstract

The invention provides a same-phase flashing method, a device, a server and a storage medium, wherein the method comprises the steps of responding to notification information sent by a timer of a receiving terminal at intervals of a preset first time interval to obtain the current system time of the terminal, and calculating a second time interval between the current system time and the preset starting time; and calculating the current beat number according to the second time interval and preset beat duration, wherein the beat duration is greater than the first time interval, and determining target light used for prompting alarm information by the current terminal based on the current beat number and a third time interval for flicker switching between various lights used for prompting alarm information in the terminal, wherein the third time interval is a positive integral multiple of the beat duration. According to the technical scheme provided by the invention, the alarm information flickers in the same phase, so that the problems that in the prior art, the flickering is disordered and monitoring personnel cannot conveniently identify the alarm information due to the fact that the alarm information flickers in different frequencies are solved.

Description

Same-phase flashing method, device, server and storage medium
Technical Field
The present invention relates to the field of distributed control technologies, and in particular, to a same-phase flashing method, device, server, and storage medium.
Background
With the rapid development of informatization and industrialization integration, a Distributed Control System (DCS) is more and more widely applied, monitoring software can run on different processes of different computers, and the monitoring software can uniformly transmit monitoring information to a terminal for display. The monitoring information includes operation state information, alarm information, and the like.
At present, a display interface of a terminal reminds monitoring personnel of alarm information in a flashing mode with different frequencies, namely, each alarm information has no association or independent flashing when flashing. However, the flashing mode is often disordered, and monitoring personnel cannot recognize alarm information conveniently.
Disclosure of Invention
In view of the above, an object of the present invention is to provide an in-phase flashing method, an in-phase flashing device, a server and a storage medium, so as to avoid the problem that in the prior art, flashing messy flashes caused by flashing lights for prompting alarm information at different frequencies is inconvenient for monitoring personnel to identify the alarm information
In order to achieve the above object, the following solutions are proposed:
the invention discloses a same-phase scintillation method in a first aspect, which comprises the following steps:
receiving notification information sent by a timer of the terminal at preset first time intervals;
responding the notification information to acquire the current system time of the terminal;
calculating a second time interval between the current system time and a preset starting time;
calculating the current beat number according to the second time interval and preset beat time length, wherein the beat time length is greater than the first time interval;
and determining the target light used for prompting the alarm information of the current terminal based on the current beat number and a third time interval for flicker switching between various lights used for prompting the alarm information in the terminal, wherein the third time interval is a positive integral multiple of the beat duration.
Optionally, when the at least one terminal includes a plurality of terminals, the method further includes:
and performing clock synchronization on each terminal in the at least one terminal.
Optionally, the calculating the current beat number according to the second time interval and a preset beat duration includes:
dividing the second time interval by the beat time length to obtain an original beat number;
and rounding the original beat number to obtain the current beat number.
Optionally, the rounding the original beat number to obtain the current beat number includes:
judging whether the original beat number is a decimal number or not;
if the original beat number is not a decimal, determining the original beat number as the current beat number;
if the original beat number is a decimal, determining a first integer which is adjacent to the original beat number and is larger than the original beat number and a second integer which is adjacent to the original beat number and is smaller than the original beat number;
and taking the target integer with the minimum difference from the original beat number in the first integer and the second integer as the current beat number.
Optionally, the determining, based on the current beat number and a third time interval of flicker switching between various lights for prompting the alarm information in the terminal, a target light for prompting the alarm information by the terminal at present includes:
calculating the number of times of flicker switching between various lights for prompting the alarm information in the terminal according to the current beat number and the third time interval;
performing modular operation on the type of the light for prompting the alarm information by using the times to obtain a second modular result;
and searching a preset corresponding relation between the numerical value and the light, and determining the target light corresponding to the second modulus result.
Optionally, the calculating, according to the current beat number and the third time interval, a number of times of flicker switching between various lights for prompting the warning information in the terminal includes:
dividing the third time interval by the beat duration to obtain a target beat number;
and dividing the current beat number by the target beat number to obtain the flicker switching times among various lights for prompting the alarm information in the terminal.
The invention discloses in a second aspect an in-phase scintillation device, comprising:
a receiving unit, configured to receive notification information sent by a timer of the terminal at preset first time intervals;
an obtaining unit, configured to obtain a current system time of the terminal in response to the notification information;
the first calculating unit is used for calculating a second time interval between the current system time and a preset starting time;
the second calculating unit is used for calculating the current beat number according to the second time interval and preset beat time length, and the beat time length is greater than the first time interval;
and the first determining unit is used for determining target light used for prompting the alarm information by the current terminal based on the current beat number and third time for flickering switching among various light used for prompting the alarm information in the terminal, wherein the third time interval is a positive integral multiple of the beat duration.
Optionally, the apparatus further comprises:
and the synchronization unit is used for carrying out clock synchronization on each terminal in at least one terminal.
A third aspect of the present invention discloses a server, comprising: at least one memory and at least one processor; the memory stores a program, and the processor calls the program stored in the memory, wherein the program is used for realizing the same-phase scintillation method disclosed in any one of the first aspect of the invention.
A fourth aspect of the present invention discloses a storage medium having stored therein computer-executable instructions for performing the in-phase blinking method as disclosed in any one of the first aspects of the present invention above.
The invention provides a same-phase flashing method, a same-phase flashing device, a same-phase flashing server and a same-phase flashing storage medium, which are applied to each terminal in at least one terminal, wherein the method comprises the steps of receiving notification information sent by a timer of the terminal at intervals of a preset first time interval, responding to the notification information to obtain the current system time of the terminal, and calculating a second time interval between the current system time and the preset starting time; and calculating the current beat number according to the second time interval and preset beat duration, wherein the beat duration is greater than the first time interval, and determining target light used for prompting the alarm information by the current terminal based on the current beat number and a third time interval for switching flicker between various lights used for prompting the alarm information in the terminal, wherein the third time interval is a positive integral multiple of the beat duration. According to the technical scheme provided by the invention, after the current system time of the terminal is obtained, the second time interval between the current system time and the preset initial time is calculated, the current beat number is calculated according to the second time interval and the preset beat duration, and the target lamp tube used for prompting the alarm information by the current terminal is determined based on the current beat number and the third time interval, so that the lights used for prompting the alarm information flicker in the same phase, and the problems that in the prior art, the lights used for prompting the alarm information flicker in different frequencies are disordered, and the alarm information is inconvenient to identify by monitoring personnel are solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of an in-phase flashing method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for calculating a current beat number according to a second time interval and a preset beat duration according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for rounding an original beat number to obtain a current beat number according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for determining a target light used by a current terminal for prompting alarm information based on a current beat number and a third time interval for blinking and switching among various lights used for prompting alarm information in the terminal according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for calculating the number of times of blinking switching between various lamps for prompting the warning information in the terminal according to the current beat number and the third time interval according to the embodiment of the present invention;
fig. 6 is an exemplary diagram illustrating that lights for prompting alarm information blink at flashing, mid-flashing and slow-flashing frequencies, respectively, according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an in-phase scintillation device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
It can be known from the above background art that the display interface of the current terminal reminds monitoring personnel of alarm information in a flashing mode with different frequencies, that is, each alarm information has no association or independent flashing when flashing. However, the flashing mode is often disordered, and monitoring personnel cannot recognize alarm information conveniently.
Therefore, the embodiment of the invention provides an in-phase flashing method, an in-phase flashing device, a server and a storage medium, which are applied to each terminal in at least one terminal, and the problem that monitoring personnel are inconvenient to identify alarm information because flashing of lamplight for prompting the alarm information in the prior art at different frequencies is disordered and is inconvenient to identify the alarm information is solved by flashing each lamplight for prompting the alarm information at the same phase.
Referring to fig. 1, an embodiment of the invention provides a flow chart of an in-phase blinking method. The in-phase blinking method is applied to each of at least one terminal, and when the at least one terminal only includes one terminal, the method specifically includes the following steps:
s101: and receiving the notification information sent by the timer of the terminal at preset first time intervals.
Note that, a first time interval is preset, and the first time interval may be set to 25 ms. The first time interval in the embodiment of the present invention may be set according to practical applications, and the embodiment of the present invention is not limited.
In the specific process of executing step S101, the terminal receives notification information sent by its corresponding timer at a first preset time interval.
S102: and responding the notification information to acquire the current system time of the terminal.
In the process of specifically executing step S102, after receiving the notification information sent by the corresponding timer, the terminal acquires the current system time of the terminal.
S103: a second time interval between the current system time and a preset start time is calculated.
It should be noted that the preset start time is Universal Time (UTC), for example, the preset start time may be 2019/8/2309: 45: 00.000. The present invention can be set according to practical applications, and the embodiments of the present invention are not limited.
In the specific execution of step S103, a difference between the current system time and the preset start time is calculated, and the calculated difference is used as the second time interval.
Based on the embodiment of the present invention, the calculation formula of the second time interval is as follows:
T=Tn'-Ts (1)
wherein, T is the second time interval, Tn' is the current system time of the terminal, and Ts is the preset starting time.
Such as: when the current system time is 2019/8/2309: 45:02.000 and the preset start time is 2019/8/2309: 45:00.000, the difference between the current system time and the preset start time is calculated to be 2000ms, and 2000ms is taken as the second time interval.
S104: and calculating the current beat number according to the second time interval and the preset beat time length.
The preset beat duration is greater than a preset first time interval.
In the embodiment of the present invention, the beat duration is preset, for example, when the first time interval is 25ms, the preset beat duration may be 250 ms. The first time interval should be much smaller than the beat duration, typically 1 order of magnitude smaller. The above is only a preferred way of providing the relationship between the first time interval and the beat time length in the embodiment of the present application, and the inventor may set the specific relationship between the first time interval and the beat time length according to practical applications, and the embodiment of the present invention is not limited thereto.
In the specific process of executing step S104, the original beat number is obtained by dividing the second time interval by the preset beat duration, and if the original beat number is not a decimal, that is, the original beat number is an integer, the original beat number is determined as the current beat number, and if the original beat number is a decimal, the original beat number needs to be rounded first to obtain a target integer, and the target integer is used as the current beat number. For example, when the second time interval is 2000ms, the preset beat duration is 250ms, the original beat number is obtained by dividing the second time interval of 2000ms by 250ms, and is 8, since 8 is an integer, the original beat number is determined as an integer, and the original beat number is determined as the current beat number.
As a preferred implementation of the embodiment of the present application, the rounding manner may be rounding up. The rounding-up means that, when the original beat number is a decimal, an integer adjacent to the original beat number and larger than the original beat number is taken.
As another preferred implementation manner of the embodiment of the present application, the rounding manner may be rounding down, where rounding down refers to taking an integer that is smaller than the original beat number and is adjacent to the original beat number when the original beat number is a decimal number.
For example, when the calculated second time interval is 10036ms, the preset beat duration is 250ms, the second time interval 10000ms is divided by 250ms to obtain an original beat number of 40.144, an upward rounding method is adopted to round the original beat number to obtain an integer 41 which is adjacent to the original beat number and is greater than the original beat number, and a downward rounding method is adopted to round the original beat number to obtain a second integer 40 which is adjacent to the original beat number and is less than a digital integer of the original beat number.
As another implementation manner of the embodiment of the present application, when the original beat number is a decimal, after rounding the original data, the target integer having the smallest difference from the original beat number is determined as the current beat number. For example, when the calculated original beat number is 40.144, rounding up the original beat number to obtain 41, which is an integer adjacent to the original beat number and greater than the original beat number, rounding up the original beat number to obtain 40, which is an integer adjacent to the original beat number and less than the original beat number, and determining 40 as the current beat number because 40 has the smallest difference from the original beat number (40.144) compared with 41.
S105: and determining the target light used for prompting the alarm information of the current terminal based on the current beat number and a third time interval for flicker switching between various lights used for prompting the alarm information in the terminal.
It should be noted that the third time interval is a positive integer multiple of the beat duration, for example, the third time interval is 1 time, 2 times, 3 times, and so on of the beat duration. For example, when the beat duration is 250ms, the third time interval may be determined to be 500 ms. The present invention can be set according to practical applications, and the embodiments of the present invention are not limited.
In the specific execution process of step S105, a target beat number is calculated by using a preset third time interval and beat duration, the number of times of flicker switching between various lights for prompting the alarm information in the terminal is calculated by using the calculated target beat number and the current beat number, the types of the various lights for prompting the alarm information in the terminal are modulo according to the number of times of flicker switching between the various lights for prompting the alarm information in the terminal, a modulo result is obtained, a corresponding relation between a preset value and the lights is searched, and a target light corresponding to the modulo result is determined.
It should be noted that the preset corresponding relationship between the numerical value matched with the alarm information and the light may be obtained, and the preset corresponding relationship between the numerical value and the light is searched to determine the target light currently used for prompting the alarm information. The corresponding relation is related to the type of the light of the alarm information, and when 2 types of light exist, the corresponding relation comprises the light type corresponding to the numerical value 0 and the light type corresponding to the numerical value 1; when there are 3 kinds of light, the corresponding relation includes the light kind that numerical value 0 corresponds, the light kind that numerical value 1 corresponds, and the light kind that numerical value 2 corresponds. It should be noted that the light type is a light color corresponding to the blinking of the light.
For example, when there are 3 kinds of light, and the light colors corresponding to the 3 kinds of light are red, orange, and cyan, the preset corresponding relationship between the numerical values and the light includes: the light color corresponding to the value 0 is red, the light color corresponding to the value 1 is orange, and the light color corresponding to the value 2 is cyan. In order to better understand the above, the following description is given by way of example.
For example, when the third time interval is set to 500ms, the beat duration is 250ms, and the current beat number is 8, the third time interval is divided by the beat duration to obtain a target beat number of 2, then the current beat number is divided by the target beat number to obtain a number of times of flicker switching between various lights for prompting alarm information in the terminal, which is 4, the number of times of flicker switching between various lights for prompting alarm information in the terminal is utilized to perform modulo operation on the kind of the light for prompting the alarm information to obtain a second modulo result of 0, if the preset correspondence between the numerical value and the light is that the light color corresponding to the numerical value 0 is red, the light color corresponding to the numerical value 1 is orange, the light color corresponding to the numerical value 2 is cyan, and the light color corresponding to the numerical value 3 is gray, the correspondence between the preset numerical value and the light is searched, and determining that the target light corresponding to the second modulus result (0) is red.
The invention provides a same phase flashing method, which comprises the steps of receiving notification information sent by a timer of a terminal at intervals of a preset first time interval, responding to the notification information to obtain the current system time of the terminal, and calculating a second time interval between the current system time and a preset starting time; and calculating the current beat number according to the second time interval and preset beat duration, wherein the beat duration is greater than the first time interval, and determining target light used for prompting alarm information by the current terminal based on the current beat number and a third time interval for flicker switching between various lights used for prompting alarm information in the terminal, wherein the third time interval is a positive integral multiple of the beat duration. According to the technical scheme provided by the invention, after the current system time of the terminal is obtained, the second time interval between the current system time and the preset initial time is calculated, the current beat number is calculated according to the second time interval and the preset beat duration, and the target lamp tube used for prompting the alarm information by the current terminal is determined based on the current beat number and the third time interval, so that the lights used for prompting the alarm information flicker in the same phase, and the problems that in the prior art, the lights used for prompting the alarm information flicker in different frequencies are disordered, and the alarm information is inconvenient to identify by monitoring personnel are solved.
Further, in the embodiment of the invention, at least one terminal may further include a plurality of terminals. When at least one terminal includes a plurality of terminals, clock synchronization should be performed on each of the at least one terminal, and after clock synchronization is performed on each of the at least one terminal, each of the at least one terminal respectively performs the same-phase blinking method disclosed in fig. 1 according to the embodiment of the present invention.
In the above embodiment of the present invention, step S104 disclosed in fig. 1 calculates the current beat number according to the second time interval and the preset beat duration, as shown in fig. 2, specifically includes the following steps:
s201: the original beat number is obtained by dividing the second time interval by the beat duration.
In the specific process of step S201, the original beat number is obtained by dividing the second time interval by the beat time length, for example, when the second time interval is 10000ms, the preset beat time length is 250ms, and the second time interval 10000ms is divided by 250ms, so as to obtain the original beat number of 40.
Based on the embodiment of the present invention, the original beat number can be further obtained from the above formula (1), and the calculation formula of the original beat number is as follows:
Tempo=T/Tp (2)
where, Tempo is the original beat number, T is the second time interval, and Tp is the preset beat duration.
S202: and rounding the original beat number to obtain the current beat number.
In the specific process of step S202, if the calculated original beat is not a decimal, that is, the original beat number is an integer, the original beat number may be determined as the current beat number, and if the calculated original beat number is a decimal, the original beat number needs to be rounded, and the rounded target integer is determined as the current beat number.
In the embodiment of the invention, after the second time interval between the current system time and the preset starting time is calculated, the original beat number is obtained by dividing the second time interval by the preset beat time, and the original beat number is rounded to obtain the current beat number. According to the third time interval which is used for prompting flicker switching between the alarm information and various lights in the terminal and is obtained according to the current beat number after rounding, the current terminal can be more accurately determined to be used for prompting the target light of the alarm information, so that each alarm information flickers in the same phase, and further the problems that in the prior art, the alarm information flickers in different frequencies, so that the flicker is disordered, and the monitoring personnel are inconvenient to recognize the alarm information are solved.
In the above embodiment of the present invention, step S202 disclosed in fig. 2 rounds the original number of beats to obtain the current number of beats, as shown in fig. 3, which specifically includes the following steps:
s301: and judging whether the original beat number is a decimal number or not.
If the original beat number is not a decimal number, step S302 is executed, and if the original beat number is a decimal number, step S303 is executed.
In the specific process of step S301, after the original beat number is obtained by dividing the second time interval by the beat duration, it is determined whether the obtained original beat number is a decimal number.
S302: the original number of beats is determined as the current number of beats.
In the specific process of performing step S302, if the original beat number is not a decimal number, the original beat number is determined as the current beat number. For example, when the second time interval is 10000ms, the preset beat duration is 250ms, and the second time interval 10000ms is divided by 250ms, the original beat number is obtained as 40, and since 40 is an integer, it is determined that the original beat number is not a decimal number, and the original beat number is determined as the current beat number.
S303: a first integer greater than the original number of beats and a second integer less than the original number of beats are determined adjacent to the original number of beats.
In the specific process of step S303, if the original beat number is a decimal, a first integer larger than the original beat number and a second integer smaller than the original beat number are determined. For example, when the second time interval is 10036ms, the preset beat duration is 250ms, and the second time interval 10000ms is divided by 250ms, so as to obtain an original beat number of 40.144, since 40.144 is a decimal, the original beat number is determined to be a decimal, a first integer larger than the original beat number adjacent to the original beat number is determined to be 41, and a second integer smaller than the original beat number adjacent to the original beat number is determined to be 40.
S304: and taking the target integer with the minimum difference from the original beat number in the first integer and the second integer as the current beat number.
In the specific execution of step S304, after determining a first integer adjacent to the original beat number and larger than the original beat number and a second integer smaller than the original beat number, a target integer that is the smallest difference from the original beat number among the first integer and the second integer is taken as the current beat number. For example, when the second time interval is 10036ms, the preset beat duration is 250ms, and the second time interval 10000ms is divided by 250ms, so that the original beat number is 40.144, since 40.144 is a decimal number, the original beat number is determined to be a decimal number, a first integer larger than the original beat number adjacent to the original beat number is determined to be 41, a second integer smaller than the original beat number adjacent to the original beat number is determined to be 40, and since 41 is smaller than 40, 40 is smaller than 40.144, and 40 is taken as the current beat number.
In the embodiment of the present invention, whether the original beat number can be determined as the current beat number is determined by determining whether the original beat number is a decimal number, if the original beat number is not a decimal number, the original beat number is determined as the current beat number, if the original beat number is a decimal number, after rounding the original beat number, a first integer larger than the original beat number and a second integer smaller than the original beat number adjacent to the original beat number are determined, an integer having a smallest difference from the original beat number is determined as a target integer, and the target integer is determined as the current beat number. After the current beat number is determined, the target lamp tube used for prompting the alarm information at the current terminal is determined based on the current beat number and the third time interval, and the alarm information flickers in the same phase, so that the problem that monitoring personnel are inconvenient to identify the alarm information due to the fact that the alarm information flickers in different frequencies in the prior art is solved.
In the foregoing embodiment of the present invention, step S105 disclosed in fig. 1 determines, based on the current beat number and a third time interval of flicker switching between various lights for prompting alarm information in the terminal, a target light used by the current terminal to prompt the alarm information, as shown in fig. 4, specifically includes the following steps:
s401: and calculating the times of flicker switching among various lamps for prompting the alarm information in the terminal according to the current beat number and the third time interval.
It should be noted that the third time interval is preset, and the third time interval may be set to 500ms, and may be set according to practical applications, and the embodiment of the present invention is not limited thereto.
Fig. 5 is a flowchart illustrating a method for calculating the number of times of blinking switching between various lamps for prompting the warning information in the terminal according to the current number of beats and the third time interval according to an embodiment of the present invention.
As shown in fig. 5, the method includes:
s501: and dividing the third time interval by the beat time length to obtain the target beat number.
In the specific execution of step S501, the preset third time interval is divided by the preset number of beats to obtain the target number of beats.
Based on the embodiment of the invention, the calculation formula of the target beat number is as follows:
Tempo”=Tc/Tp (3)
where Tempo "is the target beat number, Tc is the third time interval, and Tp is the beat duration.
For example, when the third time interval is set to 500ms and the beat duration is 250ms, the target number of beats is obtained by dividing the third time interval by the beat duration and is 2.
S502: and dividing the current beat number by the target beat number to obtain the number of times of flicker switching among various lights for prompting the alarm information in the terminal.
In the specific process of executing step S502, after the third time interval is divided by the target beat number of the beat duration, the current beat number is divided by the target beat number, so that the number of times of blinking switching between various lights for prompting the terminal alarm information can be obtained.
Based on the embodiment of the present invention, the number of times of flicker switching between various lights for prompting the terminal alarm information can be further obtained from the above formula (3), and the calculation formula of the number of times of flicker switching between various lights for prompting the terminal alarm information is as follows:
C=Tempo'/Tempo” (4)
wherein, C is the number of times of flicker switching among various lights for prompting the terminal alarm information, Tempo 'is the current beat number, and Tempo' is the target beat number.
For example, when the current beat number is 8 and the target beat number is 2, the number of times of blinking switching between various lights for prompting the warning information in the terminal is obtained by dividing the current beat number by the target beat number, which is 4.
S402: and performing modular operation on the type of the light for prompting the alarm information by using the times to obtain a second modular result.
In the process of specifically executing step S402, after the number of times of flicker switching between various lights for prompting the alarm information in the terminal is obtained through calculation, a second modulo result is obtained by performing modulo operation on the type of the light for prompting the alarm information in the terminal by using the number of times.
Based on the embodiment of the present invention, a second modulus result can be further obtained from the above equation (3) and equation (4), and the calculation formula of the second modulus result is as follows:
Ci=C%Cn (5)
wherein Ci is a second modulus result, C is the number of times of flicker switching among various lights for prompting the alarm information in the terminal, and Cn is the type of the lights for prompting the alarm information in the terminal.
For example, when the number of times of blinking switching between various lights for prompting the alarm information in the terminal is 4, the kinds of lights for prompting the alarm information in the terminal are four, and the light colors corresponding to the 4 kinds of lights are red, orange, cyan, and gray, respectively, the number of times is used to perform modulo operation on the kinds of lights for prompting the alarm information in the terminal, so as to obtain a second modulo result of 0.
S403: and searching a preset corresponding relation between the numerical value and the light, and determining the target light corresponding to the second modulus result.
In the specific execution process of step S403, a corresponding relationship between the numerical value and the light is preset, and after the second modulo result is determined, the target light corresponding to the second modulo result is determined by searching the preset corresponding relationship between the numerical value and the light.
The preset correspondence relationship between the numerical value and the light may be that the light color corresponding to the numerical value 0 is red, the light color corresponding to the numerical value 1 is orange, the light color corresponding to the numerical value 2 is cyan, and the light color corresponding to the numerical value 3 is gray. The present invention can be set according to practical applications, and the embodiments of the present invention are not limited.
For example, when it is determined that the second modulo result (0) is 0, if the preset correspondence between the numerical value and the light is 0, the light corresponding to 0 is red, the light corresponding to 1 is orange, the light corresponding to 2 is cyan, and the light corresponding to 3 is gray, the correspondence between the preset numerical value and the light is searched, and it is determined that the target light corresponding to the second modulo result (0) is red.
For better understanding of the above, the following description will be made by taking fast flicker, medium flicker, and slow flicker as examples, as shown in fig. 6: the light for prompting the alarm information in the terminal has three kinds of frequency flicker, namely fast flicker, medium flicker and slow flicker. The types of the light which flashes rapidly are 2, namely red and gray. There are 2 kinds of light flashing at medium speed, orange and gray respectively. The light types of slow flashing lights are 2, cyan and gray. When used to prompt a high level of alert information, the lights flash rapidly, i.e., alternately red and gray, switching colors 1 time per beat. When the alarm information is used for prompting the middle-grade alarm information, the light flickers at a middle speed, namely the light flickers alternately in orange and gray, and the color is switched for 1 time every 2 beats. When the alarm is used for prompting low-level alarm information, the light flickers at a slow speed, namely, cyan and gray flickers alternately, and the color is changed every 4 beats.
In the embodiment of the invention, after the current beat number is determined, the times of flicker switching among various lights for prompting the alarm information in the terminal are calculated according to the current beat number and the third time interval, the type of the light for prompting the alarm information is subjected to modular operation to obtain a second modular result, and then the target light corresponding to the second modular result is determined by searching the preset corresponding relation between the numerical value and the light.
Based on the same-phase scintillation method disclosed in the embodiment of the present invention, the embodiment of the present invention also correspondingly discloses an in-phase scintillation device, referring to fig. 7, the in-phase scintillation device 700 includes:
a receiving unit 701, configured to receive notification information sent by a timer of a terminal at a first preset time interval.
An obtaining unit 702, configured to obtain the current system time of the terminal in response to the notification information.
A first calculating unit 703, configured to calculate a second time interval between the current system time and a preset starting time.
A second calculating unit 704, configured to calculate the current beat number according to a second time interval and a preset beat duration, where the beat duration is greater than the first time interval.
The first determining unit 705 is configured to determine a target light used by the current terminal for prompting alarm information based on the current beat number and a third time for flashing and switching among various lights used for prompting the alarm information in the terminal, where the third time interval is a positive integer multiple of the beat duration.
The invention provides a same phase scintillation device, which receives notification information sent by a timer of a terminal at intervals of a preset first time interval through a receiving unit, acquires the current system time of the terminal by responding to the notification information through an acquisition unit, and calculates a second time interval between the current system time and a preset starting time through a first calculation unit; and the current beat number is calculated by the second calculating unit according to the second time interval and preset beat duration, the beat duration is greater than the first time interval, target light used for prompting alarm information of the current terminal is determined by the first determining unit on the basis of the current beat number and a third time interval for flickering switching between various lights used for prompting alarm information in the terminal, and the third time interval is a positive integral multiple of the beat duration. According to the technical scheme provided by the invention, after the current system time of the terminal is obtained, the second time interval between the current system time and the preset initial time is calculated, the current beat number is calculated according to the second time interval and the preset beat duration, and the target lamp tube used for prompting the alarm information by the current terminal is determined based on the current beat number and the third time interval, so that the lights used for prompting the alarm information flicker in the same phase, and the problems that in the prior art, the lights used for prompting the alarm information flicker in different frequencies are disordered, and the alarm information is inconvenient to identify by monitoring personnel are solved.
Preferably, the in-phase scintillation device 700 further includes:
and the synchronization unit is used for carrying out clock synchronization on each terminal in at least one terminal.
Preferably, the second computing unit 704 includes: an original beat number determining unit and a rounding unit.
And the original beat number determining unit is used for dividing the second time interval by the beat duration to obtain the original beat number.
And the rounding unit is used for rounding the original beat number to obtain the current beat number.
In the embodiment of the invention, after the second time interval between the current system time and the preset starting time is calculated, the original beat number is obtained by dividing the second time interval by the preset beat time, and the original beat number is rounded to obtain the current beat number. According to the third time interval which is used for prompting flicker switching between alarm information and various lights in the terminal and is obtained according to the current beat number after rounding, the current terminal can be more accurately determined to be used for prompting alarm information target light, and the lights which are used for prompting the alarm information flicker with the same phase, so that the problem that in the prior art, the lights which are used for prompting the alarm information flicker with different frequencies are disordered, and monitoring personnel are inconvenient to recognize the alarm information is solved.
Preferably, the rounding unit comprises: the device comprises a judging unit, a second determining unit, a third determining unit and a rounding subunit.
And the judging unit is used for judging whether the original beat number is a decimal number.
It should be noted that the second determination unit is executed if the original beat number is not a decimal, and the third determination unit is executed if the original beat number is a decimal.
A second determination unit for determining the original beat number as the current beat number.
A third determination unit configured to determine a first integer larger than the original beat number and a second integer smaller than the original beat number adjacent to the original beat number.
And the rounding subunit is used for taking the target integer with the minimum difference from the original beat number in the first integer and the second integer as the current beat number.
In the embodiment of the present invention, whether the original beat number can be determined as the current beat number is determined by determining whether the original beat number is a decimal number, if the original beat number is not a decimal number, the original beat number is determined as the current beat number, if the original beat number is a decimal number, after rounding the original beat number, a first integer larger than the original beat number and a second integer smaller than the original beat number adjacent to the original beat number are determined, an integer having a smallest difference from the original beat number is determined as a target integer, and the target integer is determined as the current beat number. After confirming current beat number, confirm the target fluorescent tube that current terminal is used for indicateing alarm information based on current beat number and third time interval, realize that each light that is used for indicateing alarm information flickers with the same phase place, and then avoid the light that is used for indicateing alarm information among the prior art to twinkle with the scintillation that different frequency twinkles and leads to in disorder, the problem of monitoring personnel's discernment alarm information of being not convenient for.
Preferably, the first determining unit 704 includes: the device comprises a third calculating unit, a modulus taking unit and a fourth determining unit.
And the third calculating unit is used for calculating the flicker switching times among various lights for prompting the alarm information in the terminal according to the current beat number and the third time interval.
And the module taking unit is used for carrying out module taking operation on the type of the light for prompting the alarm information by using the times to obtain a second module taking result.
And the fourth determining unit is used for searching the preset corresponding relation between the numerical value and the light and determining the target light corresponding to the second modulus result.
In the embodiment of the invention, after the current beat number is determined, the times of flicker switching among various lights for prompting the alarm information in the terminal are calculated according to the current beat number and the third time interval, the type of the light for prompting the alarm information is subjected to modular operation to obtain a second modular result, and then the target light corresponding to the second modular result is determined by searching the preset corresponding relation between the numerical value and the light.
Preferably, the third calculation unit includes: target beat number determination unit, fourth calculation unit
And the target beat number determining unit is used for dividing the third time interval by the beat duration to obtain the target beat number.
And the fourth calculating unit is used for dividing the current beat number by the target beat number to obtain the flicker switching times among various lights for prompting the alarm information in the terminal.
An embodiment of the present invention provides a server, referring to fig. 8, including a memory 801 and a processor 802, where:
the memory 801 stores programs; the processor 802 is configured to execute a program stored in a memory, and specifically, to execute the in-phase blinking method according to any of the embodiments of the present invention.
Embodiments of the present invention provide a storage medium, which stores computer-executable instructions for implementing the same phase flashing method according to any embodiment of the present invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
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.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (8)

1. An in-phase flashing method applied to at least one terminal, the method comprising:
receiving notification information sent by a timer of the terminal at preset first time intervals;
responding the notification information to acquire the current system time of the terminal;
calculating a second time interval between the current system time and a preset starting time;
calculating the current beat number according to the second time interval and preset beat time length, wherein the beat time length is greater than the first time interval;
determining a target light used for prompting the alarm information by the current terminal based on the current beat number and a third time interval for flicker switching between various lights used for prompting the alarm information in the terminal, wherein the third time interval comprises: calculating the number of times of flicker switching between various lights for prompting the alarm information in the terminal according to the current beat number and the third time interval; performing modular operation on the type of the light for prompting the alarm information by using the times to obtain a second modular result; searching a preset corresponding relation between a numerical value and lamplight, and determining target lamplight corresponding to the second modulus result;
the calculating the number of times of flicker switching between various lights for prompting the alarm information in the terminal according to the current beat number and the third time interval comprises: dividing the third time interval by the beat duration to obtain a target beat number; dividing the current beat number by the target beat number to obtain the number of times of flicker switching among various lights for prompting the alarm information in the terminal;
the third time interval is a positive integer multiple of the beat duration.
2. The method of claim 1, wherein when the at least one terminal comprises a plurality of terminals, the method further comprises:
and performing clock synchronization on each terminal in the at least one terminal.
3. The method of claim 1, wherein calculating the current beat number according to the second time interval and a preset beat duration comprises:
dividing the second time interval by the beat time length to obtain an original beat number;
and rounding the original beat number to obtain the current beat number.
4. The method of claim 3, wherein rounding the original number of beats to obtain a current number of beats comprises:
judging whether the original beat number is a decimal number or not;
if the original beat number is not a decimal, determining the original beat number as the current beat number;
if the original beat number is a decimal, determining a first integer which is adjacent to the original beat number and is larger than the original beat number and a second integer which is adjacent to the original beat number and is smaller than the original beat number;
and taking the target integer with the minimum difference from the original beat number in the first integer and the second integer as the current beat number.
5. An in-phase scintillation device, comprising:
the receiving unit is used for receiving notification information sent by a timer of the terminal at preset first time intervals;
an obtaining unit, configured to obtain a current system time of the terminal in response to the notification information;
the first calculating unit is used for calculating a second time interval between the current system time and a preset starting time;
the second calculating unit is used for calculating the current beat number according to the second time interval and preset beat time length, and the beat time length is greater than the first time interval;
a first determining unit, configured to determine, based on the current beat number and a third time of flicker switching between various lights for prompting alarm information in the terminal, a target light used by the terminal to prompt the alarm information, where the first determining unit includes: calculating the number of times of flicker switching between various lights for prompting the alarm information in the terminal according to the current beat number and the third time interval; performing modular operation on the type of the light for prompting the alarm information by using the times to obtain a second modular result; searching a preset corresponding relation between a numerical value and lamplight, and determining target lamplight corresponding to the second modulus result;
the calculating the number of times of flicker switching between various lights for prompting the alarm information in the terminal according to the current beat number and the third time interval comprises: dividing the third time interval by the beat duration to obtain a target beat number; dividing the current beat number by the target beat number to obtain the number of times of flicker switching among various lights for prompting the alarm information in the terminal;
the third time interval is a positive integer multiple of the beat duration.
6. The apparatus of claim 5, further comprising:
a synchronization unit for performing clock synchronization to at least one terminal.
7. A server, comprising: at least one memory and at least one processor; the memory stores a program that the processor calls, the program being for implementing the in-phase blinking method of any of claims 1-4.
8. A storage medium having stored thereon computer-executable instructions for performing the in-phase blinking method of any of claims 1-4.
CN201910911311.6A 2019-09-25 2019-09-25 Same-phase flashing method, device, server and storage medium Active CN110491050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910911311.6A CN110491050B (en) 2019-09-25 2019-09-25 Same-phase flashing method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910911311.6A CN110491050B (en) 2019-09-25 2019-09-25 Same-phase flashing method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN110491050A CN110491050A (en) 2019-11-22
CN110491050B true CN110491050B (en) 2021-05-18

Family

ID=68544329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910911311.6A Active CN110491050B (en) 2019-09-25 2019-09-25 Same-phase flashing method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN110491050B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371525B (en) * 2020-03-12 2022-03-22 浙江中控技术股份有限公司 Alarm synchronous sounding method and device, storage medium and operation station
CN115001615A (en) * 2022-05-25 2022-09-02 中国第一汽车股份有限公司 Synchronization control method, device, system and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741439A (en) * 2004-08-26 2006-03-01 华为技术有限公司 Signal synchronizing method and system thereof
JP2013223091A (en) * 2012-04-16 2013-10-28 Sony Computer Entertainment Inc Sync signal adjustment device, sync signal adjustment method, video display device, and sync signal generation device
CN103929859A (en) * 2014-04-29 2014-07-16 上海申贝科技发展有限公司 Beacon light wireless synchronous flashing method based on Big Dipper/GPS satellite
CN104156302A (en) * 2014-08-18 2014-11-19 中国航天科技集团公司第九研究院第七七一研究所 Maintenance and timing system and method for satellite-borne computer real-time clock
CN104641306A (en) * 2012-07-20 2015-05-20 皮尔茨公司 Method for synchronizing display elements
JP5899094B2 (en) * 2012-09-19 2016-04-06 能美防災株式会社 Alarm system and alarm device
CN108897210A (en) * 2018-07-11 2018-11-27 成都爱为贝思科技有限公司 A kind of seismic exploration data wireless collection and GPS time synchronous method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7912164B2 (en) * 2006-12-20 2011-03-22 Eaton Corporation Synchronization system and method for wireless communicating nodes

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741439A (en) * 2004-08-26 2006-03-01 华为技术有限公司 Signal synchronizing method and system thereof
JP2013223091A (en) * 2012-04-16 2013-10-28 Sony Computer Entertainment Inc Sync signal adjustment device, sync signal adjustment method, video display device, and sync signal generation device
CN104641306A (en) * 2012-07-20 2015-05-20 皮尔茨公司 Method for synchronizing display elements
JP5899094B2 (en) * 2012-09-19 2016-04-06 能美防災株式会社 Alarm system and alarm device
CN103929859A (en) * 2014-04-29 2014-07-16 上海申贝科技发展有限公司 Beacon light wireless synchronous flashing method based on Big Dipper/GPS satellite
CN104156302A (en) * 2014-08-18 2014-11-19 中国航天科技集团公司第九研究院第七七一研究所 Maintenance and timing system and method for satellite-borne computer real-time clock
CN108897210A (en) * 2018-07-11 2018-11-27 成都爱为贝思科技有限公司 A kind of seismic exploration data wireless collection and GPS time synchronous method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GPS授时技术在高速公路诱导灯全路段同步闪烁上的应用;刘皓蔚;《电子产品世界》;20171231(第12期);全文 *
无线传感器网络的协作时间同步机制研究;李敏;《中国优秀硕士学位论文全文数据库 信息科技辑》;20150215(第2期);全文 *

Also Published As

Publication number Publication date
CN110491050A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN110491050B (en) Same-phase flashing method, device, server and storage medium
EP2996366B1 (en) Application recommendation method, system and server
EP3010157A1 (en) Method for detecting electric quantity of device, device and system
CN105259974A (en) Method for displaying non-text-based battery status information and a computing device
CN103765377B (en) Terminal and its application management method
CN107103004A (en) Data processing method, apparatus and system in webpage
CN112019835B (en) Frame rate verification device and method for dynamic vision sensor module and storage medium
CN111142970A (en) Intelligent skin changing method and device for mobile APP
CN1078433C (en) Radio call selecting receiver
CN109561336A (en) Distribution display synchronous method, apparatus and system
CN109068395B (en) Method and device for indicating state of bridging pairing, terminal equipment and medium
US20070063676A1 (en) Multiple mode electronic device and method for indicating remaining battery capacity level
CN110602221A (en) Notification level processing method and device and readable storage medium
WO2018144278A1 (en) Intuitive display of time notifications in mobile devices
JP2016050892A (en) Communication system, electronic apparatus, clock and program
JP2002207691A (en) Data transfer controller
JP2010268394A (en) Multi wireless communication device, and communication timing notification method
CN114244733A (en) Method and system for indicating LED flicker of communication equipment
JP2012023893A (en) Power supply device, management device, and power management system
CN112135389A (en) Method, system and device for balancing flickering frequency of breathing lamp
CN113110810A (en) Anti-shake interval adjusting method and device, mobile terminal and storage medium
CN115589649A (en) Method and device for brightness adjustment, electronic equipment and storage medium
CN112996014B (en) Internet of things equipment detection method and first equipment
JP2017158130A (en) Communication system, communication terminal, and program
CN116723620A (en) Dimming control method and device, electronic equipment and storage medium

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
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20191122

Assignee: Zhejiang zhongkong Software Technology Co., Ltd

Assignor: Zhejiang zhongkong Technology Co., Ltd

Contract record no.: X2021330000695

Denomination of invention: The invention relates to an in-phase scintillation method, device, server and storage medium

Granted publication date: 20210518

License type: Common License

Record date: 20211104