CN112311495B - Operation duration obtaining method and device, communication unit, electric control board and storage medium - Google Patents
Operation duration obtaining method and device, communication unit, electric control board and storage medium Download PDFInfo
- Publication number
- CN112311495B CN112311495B CN201910675563.3A CN201910675563A CN112311495B CN 112311495 B CN112311495 B CN 112311495B CN 201910675563 A CN201910675563 A CN 201910675563A CN 112311495 B CN112311495 B CN 112311495B
- Authority
- CN
- China
- Prior art keywords
- information
- timing
- timing information
- running
- communication unit
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0006—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/1607—Details of the supervisory signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/003—Arrangements for allocating sub-channels of the transmission path
- H04L5/0053—Allocation of signaling, i.e. of overhead other than pilot signals
- H04L5/0055—Physical resource allocation for ACK/NACK
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Quality & Reliability (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Telephonic Communication Services (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a method and a device for acquiring running time, a communication unit, an electric control board and a storage medium, and belongs to the technical field of data processing. The timing instruction is sent to the electric control board of the electric equipment, so that the electric control board reports the timing information according to the preset period after receiving the timing instruction, then the running long information is updated according to the received timing information when the timing information reported by the electric control board is received, then the connection state with the server is detected, finally the running long information is sent to the server when the connection state is normal, the timing information is reported according to the preset period by the main control board, under the normal condition, the timing information is reported every other preset period, the timing information is not uploaded after complete timing is not completed, the time length reported by timing can be shortened, the influence of abnormal states such as restart of the electric control board or a communication unit is reduced, and the accuracy of determining the running time of the electric equipment is improved.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for obtaining a running duration, a communication unit, an electronic control board, and a storage medium.
Background
For electrical devices, statistically accurate operating times are required in many cases, for example: rented electrical equipment (such as equipment for sharing air conditioners and the like) needs to be charged according to the running time; or, the electrical equipment needs to be maintained after operating for a certain period of time.
In the prior art, these electrical devices usually set a timer on an electrical control board, start timing when the electrical devices are switched from an off state to an on state, then stop timing when the electrical devices are switched from the on state to the off state, and upload timing information collected by the timer through a communication unit, where the timing mode is to upload timing information after completing a complete timing by the timer, but in the working process of the timer, the electrical control board may have abnormal states such as restart, and due to problems of chip resources, the timing result of the timer may not be stored so that the operating time of the electrical devices cannot be accurately determined.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a running time obtaining method, a running time obtaining device, a communication unit, an electric control board and a storage medium, and aims to solve the technical problem that the running time of electrical equipment cannot be accurately determined in the prior art.
In order to achieve the above object, the present invention provides an operation duration obtaining method, including the steps of:
sending a timing instruction to an electric control board of the electrical equipment, so that the electric control board reports timing information according to a preset period after receiving the timing instruction;
when the timing information reported by the electric control board is received, updating the running long information according to the received timing information;
detecting a connection state with a server;
and when the connection state is normal, sending the long running information to a server.
Preferably, when receiving the timing information reported by the electronic control board, the updating the runtime long information according to the received timing information includes:
when the timing information reported by the electric control board is received, the running long information is updated according to the received timing information, and a confirmation character is fed back to the electric control board, so that the electric control board clears the timing information after receiving the fed-back confirmation character.
Preferably, when the connection state is normal, the run-time long information is sent to a server, including;
when the connection state is normal, judging whether the running time long information exceeds a preset time threshold;
when the running time long information does not exceed a preset time threshold, sending the running time long information to a server;
when the running time length information exceeds a preset time length threshold, dividing the running time length information by the preset time length threshold to obtain a remainder and a modulus value, and sending the remainder and the modulus value to a server.
Preferably, after detecting the connection state with the server, the method for obtaining the running duration further includes:
and when the connection state is abnormal, returning to the step of updating the running long information according to the received timing information when the timing information reported by the electric control board is received.
In addition, to achieve the above object, the present invention further provides an operation duration obtaining device, where the operation duration obtaining device includes:
the command sending module is used for sending a timing command to an electric control board of the electric equipment so that the electric control board reports timing information according to a preset period after receiving the timing command;
the information updating module is used for updating the running long information according to the received timing information when the timing information reported by the electric control board is received;
the state detection module is used for detecting the connection state with the server;
and the information sending module is used for sending the running-time long information to a server when the connection state is normal.
Further, to achieve the above object, the present invention provides a communication unit including: the system comprises a memory, a processor and a running time length acquiring program which is stored on the memory and can run on the processor, wherein the running time length acquiring program is configured to realize the steps of the running time length acquiring method.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium having a running time length acquisition program stored thereon, the running time length acquisition program, when executed by a processor, implementing the steps of the running time length acquisition method as described above.
In addition, in order to achieve the above object, the present invention further provides an operation duration obtaining method, where the operation duration obtaining method includes the following steps:
when a timing instruction sent by a communication unit is received, starting timing of the running state to update timing information;
judging whether the timing information reaches a preset period or not;
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the long-term running information according to the received timing information, and sending the long-term running information to the server when the connection state of the communication unit and the server is normal.
Preferably, when the timing information reaches a preset period, reporting the timing information to the communication unit, so that the communication unit updates the runtime long information according to the received timing information, and sends the runtime long information to the server when the connection state with the server is normal, including:
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the long running information according to the received timing information, feeds back a confirmation character, and sends the long running information to the server when the connection state of the communication unit and the server is normal;
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the running time long information according to the received timing information, and after the running time long information is sent to the server when the connection state with the server is normal, the running time length obtaining method further comprises the following steps:
judging whether the confirmation characters fed back by the communication unit are received within a preset time range;
and when receiving the confirmation characters fed back by the communication unit within a preset time range, clearing the timing information, and continuously timing the running state to update the timing information.
Preferably, before the determining whether the timing information reaches the preset period, the method for obtaining the running duration further includes:
judging whether a restart instruction is received or not;
when a restart instruction is received, reporting the timing information to the communication unit;
and when a restart instruction is not received, executing the step of judging whether the timing information reaches a preset period.
In addition, to achieve the above object, the present invention further provides an operation duration obtaining device, where the operation duration obtaining device includes:
the timing starting module is used for starting the timing of the running state to update the timing information when receiving the timing instruction sent by the communication unit;
the information judgment module is used for judging whether the timing information reaches a preset period or not;
and the information reporting module is used for reporting the timing information to the communication unit when the timing information reaches a preset period so as to enable the communication unit to update the long information during operation according to the received timing information, and sending the long information during operation to the server when the connection state between the communication unit and the server is normal.
In addition, to achieve the above object, the present invention also provides an electric control board, comprising: the method comprises the steps of storing a running time length, storing the running time length in a memory, storing the running time length in the memory, and executing the running time length in the processor.
In addition, in order to achieve the above object, the present invention also provides an electrical apparatus including the electrical control board as described above.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium having a running time length acquisition program stored thereon, the running time length acquisition program, when executed by a processor, implementing the steps of the running time length acquisition method as described above.
The timing instruction is sent to the electric control board of the electric equipment, so that the electric control board reports the timing information according to the preset period after receiving the timing instruction, then when the timing information reported by the electric control board is received, the running long information is updated according to the received timing information, then the connection state with the server is detected, finally when the connection state is normal, the running long information is sent to the server, the timing is carried out by adopting a mode that the main control board reports the timing information according to the preset period, under the normal condition, the timing information is reported every preset period, the timing information is not uploaded after complete timing, the time length reported by timing can be shortened, the influence of abnormal states such as restart of the electric control board or a communication unit is reduced, and the accuracy of determining the running time of the electric equipment is improved.
Drawings
FIG. 1 is a schematic diagram of a communication unit structure of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a first embodiment of the operation duration obtaining method according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of the method for obtaining an operation duration according to the present invention;
FIG. 4 is a flowchart illustrating a method for obtaining an operation duration according to a third embodiment of the present invention;
fig. 5 is a block diagram of the configuration of the first embodiment of the operation duration acquiring apparatus according to the present invention;
FIG. 6 is a schematic diagram of a main control board structure of a hardware operating environment according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating a method for obtaining an operation duration according to a fourth embodiment of the present invention;
fig. 8 is a flowchart illustrating a fifth embodiment of the operation duration obtaining method according to the present invention;
fig. 9 is a flowchart illustrating a method for obtaining an operation duration according to a sixth embodiment of the present invention;
fig. 10 is a block diagram of the second embodiment of the operation time length acquisition apparatus according to the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a communication unit structure of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the communication unit may include: a processor 1001, such as a CPU, a network interface 1002, and a memory 1003. The network interface 1002 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1003 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1003 may optionally be a storage communication unit separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the communication unit, and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1003 as a storage medium may include an operating system, a network communication module, and a running time acquiring program.
The communication unit calls the running time length acquisition program stored in the memory 1003 by the processor 1001, and performs the following operations:
sending a timing instruction to an electric control board of the electrical equipment, so that the electric control board reports timing information according to a preset period after receiving the timing instruction;
when the timing information reported by the electric control board is received, updating the running time long information according to the received timing information;
detecting a connection state with a server;
and when the connection state is normal, sending the running long information to a server.
Further, the processor 1001 may call the running time length obtaining program stored in the memory 1003, and further perform the following operations:
when the timing information reported by the electric control board is received, the running long information is updated according to the received timing information, and a confirmation character is fed back to the electric control board, so that the electric control board clears the timing information after receiving the fed-back confirmation character.
Further, the processor 1001 may call the running time length obtaining program stored in the memory 1003, and further perform the following operations:
when the connection state is normal, judging whether the running time length information exceeds a preset time length threshold value;
when the running time long information does not exceed a preset time threshold, sending the running time long information to a server;
when the running time length information exceeds a preset time length threshold, dividing the running time length information by the preset time length threshold to obtain a remainder and a modulus value, and sending the remainder and the modulus value to a server.
Further, the processor 1001 may call the running time length obtaining program stored in the memory 1003, and further perform the following operations:
and when the connection state is abnormal, returning to the step of updating the running long information according to the received timing information when the timing information reported by the electric control board is received.
In this embodiment, a timing instruction is sent to an electric control board of an electrical device, so that the electric control board reports timing information according to a preset period after receiving the timing instruction, then updates run-time long information according to the received timing information when receiving the timing information reported by the electric control board, detects a connection state with a server, and finally sends the run-time long information to the server when the connection state is normal, the main control board reports the timing information according to the preset period for timing, and under a normal condition, the timing information is reported every preset period, and the run-time long information is uploaded after complete timing is not completed, so that the time length for reporting the timing can be shortened, thereby reducing the influence of abnormal states such as restart of the electric control board or a communication unit, and improving the accuracy of determining the run time of the electrical device.
Based on the hardware structure, the embodiment of the running time length obtaining method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for obtaining an operation duration according to a first embodiment of the present invention.
In a first embodiment, the method for obtaining the operation duration includes the following steps:
s10: and sending a timing instruction to an electric control board of the electrical equipment, so that the electric control board reports timing information according to a preset period after receiving the timing instruction.
It should be noted that the electrical device may be a household electrical device, for example: the household air conditioner, the hot water kettle, the water heater or the coffee maker and the like can also be used in other occasions, such as: the present embodiment is not limited to a large-scale central air conditioner used in a market.
It can be understood that the electrical equipment is usually provided with an electrical control board, and the functions of the electrical equipment are usually realized by the electrical control board, so in this embodiment, the communication unit may send a timing instruction to the electrical control board of the electrical equipment, so that the electrical control board reports timing information according to a preset period after receiving the timing instruction.
In a specific implementation, the preset period is usually preset in the communication unit and the electronic control board, that is, assuming that the preset period is 5 minutes, at this time, the preset period T =5min is stored in both the communication unit and the electronic control board, and thus, after the electronic control board receives the timing instruction, the timing information may be reported according to the preset period of 5 minutes.
S20: and when the timing information reported by the electric control board is received, updating the running long information according to the received timing information.
It should be noted that although the electronic control board reports the timing information according to the preset period, there may be some special situations that cause the timing information to be different from the preset period, and therefore, the timing information reflects the actual timing time length, and when the timing information reported by the electronic control board is received, the running time length information needs to be updated according to the received timing information.
S30: a connection status with the server is detected.
In a specific implementation, it is assumed that the connection state with the server is in a connection abnormality, for example: by means of heartbeat detection, namely, a detection message is sent to a server at intervals, and when a response message corresponding to the detection message can be received within a period of time, the connection state with the server can be determined as normal; when the response message corresponding to the detection message is not received within a period of time, the connection state with the server is considered to be abnormal; of course, the connection state with the server may also be detected by other ways, which is not limited in this embodiment.
S40: and when the connection state is normal, sending the long running information to a server.
It can be understood that, when the connection state is the normal connection, it can be stated that the normal communication between the communication unit and the server can be performed, and at this time, the runtime long information can be sent to the server.
In a specific implementation, since there may be a case of abnormal connection between the communication unit and the server, and the runtime long information cannot be sent to the server at this time, in this embodiment, the step S20 may be returned to.
In this embodiment, a timing instruction is sent to an electric control board of an electrical device, so that the electric control board reports timing information according to a preset period after receiving the timing instruction, then updates running long information according to the received timing information when receiving the timing information reported by the electric control board, detects a connection state with a server, and finally sends the running long information to the server when the connection state is normal, and timing is performed by using a main control board in a manner of reporting the timing information according to the preset period.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for obtaining an operation duration according to a second embodiment of the present invention, and the method for obtaining an operation duration according to the second embodiment of the present invention is provided based on the embodiment illustrated in fig. 2.
In the second embodiment, step S20 includes:
s21: when the timing information reported by the electric control board is received, the running time length information is updated according to the received timing information, and a confirmation character is fed back to the electric control board, so that the electric control board clears the timing information after receiving the fed-back confirmation character.
It should be noted that, for the communication unit, an abnormal state such as restart may occur, at this time, a situation that the communication unit cannot receive the timing information occurs, it is assumed that the electronic control board directly clears the timing information after reporting the timing information, but the communication unit is in the abnormal state at this time, and the timing information is not included in the run-time long information, so that accuracy of the run-time long information is affected.
That is to say, when the electronic control board does not receive the feedback confirmation character, the timing information is not cleared, but the timing information is continuously updated, and the next preset period is waited, so that the accuracy of the long information in operation is ensured.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for obtaining an operation duration according to a third embodiment of the present invention, and the method for obtaining an operation duration according to the third embodiment of the present invention is provided based on the embodiment shown in fig. 2.
In the third embodiment, step S40 includes:
s41: and when the connection state is normal, judging whether the running long information exceeds a preset long threshold value.
In order to avoid that the running-time long information needing to be transmitted is too large, thereby causing data overflow and further influencing correct statistics of the running-time long information by the server, in this embodiment, a preset time threshold may be preset, and in specific implementation, the preset time threshold may be set to be a preset threshold, for example: the preset time threshold may be set to 4000 (unit may be set to second), and of course, the preset time threshold may also be set to the maximum value of the transmission between the communication unit and the server, assuming that the transmission is performed by the 12-bit length between the communication unit and the server, and correspondingly, the preset time threshold may be set to 2 12 =4096 (units can be set to seconds).
Therefore, when the connection state is normal, the communication unit needs to determine whether the runtime long information exceeds a preset time threshold.
S42: and when the running time long information does not exceed a preset time threshold, sending the running time long information to a server.
It can be understood that, when the run-time long information does not exceed the preset time threshold, it indicates that the run-time long information does not have data overflow, and the run-time long information can be directly sent to the server.
S43: when the running time long information exceeds a preset time threshold, dividing the running time long information by the preset time threshold to obtain a remainder and a modulus value, and sending the remainder and the modulus value to a server.
In specific implementation, when the run-time long information exceeds a preset long threshold, the situation that the run-time long information overflows data is described, in order to avoid sending the run-time long information for multiple times and affecting transmission efficiency, in this embodiment, the run-time long information is divided by the preset long threshold to obtain a remainder and a modulus value, and the remainder and the modulus value are sent to a server.
Certainly, in order to facilitate the server to restore the runtime long information according to the remainder and the module value, the server and the communication unit both store the preset time threshold, assuming that the preset time threshold is 4000 seconds, at this time, the runtime long information is 13500 seconds, at this time, the runtime long information is divided by the preset time threshold, so that a remainder is 3, and a module value is 1500 seconds, at this time, the remainder 3 and the module value 1500 may be sent to the server according to a preset format.
Assuming that the preset time length threshold is T max The runtime long information is T Could For the server, after receiving the remainder n and the module value T _ all, the locally stored preset duration threshold T may be read max According to the formula T Could =n·T max + T _ all to compute runtime long information T Could 。
In addition, an embodiment of the present invention further provides an operation duration obtaining device, and referring to fig. 5, the operation duration obtaining device includes:
the instruction sending module 510 is configured to send a timing instruction to an electric control board of an electrical device, so that the electric control board reports timing information according to a preset period after receiving the timing instruction;
the information updating module 520 is configured to update the running time length information according to the received timing information when the timing information reported by the electronic control board is received;
a state detection module 530 for detecting a connection state with the server;
and the information sending module 540 is configured to send the runtime long information to a server when the connection state is normal.
In this embodiment, a timing instruction is sent to an electric control board of an electrical device, so that the electric control board reports timing information according to a preset period after receiving the timing instruction, then updates run-time long information according to the received timing information when receiving the timing information reported by the electric control board, detects a connection state with a server, and finally sends the run-time long information to the server when the connection state is normal, the main control board reports the timing information according to the preset period for timing, and under a normal condition, the timing information is reported every preset period, and the run-time long information is uploaded after complete timing is not completed, so that the time length for reporting the timing can be shortened, thereby reducing the influence of abnormal states such as restart of the electric control board or a communication unit, and improving the accuracy of determining the run time of the electrical device.
Each module in the apparatus may be configured to implement each step in the method, and is not described herein again.
In addition, an embodiment of the present invention further provides a storage medium, where an operation duration obtaining program is stored on the storage medium, and when executed by a processor, the operation duration obtaining program implements the following operations:
sending a timing instruction to an electric control board of the electrical equipment, so that the electric control board reports timing information according to a preset period after receiving the timing instruction;
when the timing information reported by the electric control board is received, updating the running time long information according to the received timing information;
detecting a connection state with a server;
and when the connection state is normal, sending the running long information to a server.
The running duration acquiring program in the storage medium is used for implementing each step in the method when being executed by the processor, and is not described herein again.
Referring to fig. 6, fig. 6 is a schematic diagram of an electric control board structure of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 6, the electric control board may include: a processor 2001, e.g., a CPU, a communication bus 2002, a user interface 2003, a network interface 2004, a memory 2005. The communication bus 2002 is used to implement connection communication between these components. The user interface 2003 may include a Display screen (Display), and the optional user interface 2003 may also include a standard wired interface, a wireless interface. The network interface 2004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). Memory 2005 can be a high-speed RAM memory, or can be a non-volatile memory such as a disk memory. The memory 2005 may alternatively be a storage server independent of the processor 2001 described previously.
It will be appreciated by those skilled in the art that the configuration shown in figure 6 is not intended to be limiting and may include more or fewer components than shown, or some combination of components, or a different arrangement of components.
As shown in fig. 6, the memory 2003, which is a storage medium, may include therein an operating system, a network communication module, and a running time acquiring program.
The electronic control board calls the running time length acquisition program stored in the memory 2003 through the processor 2001, and performs the following operations:
when a timing instruction sent by a communication unit is received, starting timing of the running state to update timing information;
judging whether the timing information reaches a preset period or not;
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the running long information according to the received timing information and sends the running long information to the server when the connection state of the communication unit and the server is normal.
Further, the processor 2001 may call the run-time length acquisition program stored in the memory 2003, and also perform the following operations:
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the long running information according to the received timing information, feeds back a confirmation character, and sends the long running information to the server when the connection state of the communication unit and the server is normal;
judging whether the confirmation characters fed back by the communication unit are received within a preset time range;
and when receiving the confirmation characters fed back by the communication unit within a preset time range, clearing the timing information, and continuously timing the running state to update the timing information.
Further, the processor 2001 may call the run-time length obtaining program stored in the memory 2003, and also perform the following operations:
judging whether a restart instruction is received or not;
when a restart instruction is received, reporting the timing information to the communication unit;
and when a restart instruction is not received, executing the step of judging whether the timing information reaches a preset period.
In the embodiment, when a timing instruction sent by a communication unit is received, timing of a running state is started to update timing information, whether the timing information reaches a preset period is judged, and finally, when the timing information reaches the preset period, the timing information is reported to the communication unit, so that the communication unit updates the running long information according to the received timing information, and sends the running long information to a server when the connection state with the server is normal, and under normal conditions, the timing information is reported every preset period, and is not uploaded after complete timing is not completed, so that the time length of timing report can be shortened, the influence of abnormal states such as restart of an electric control board or the communication unit is reduced, and the accuracy of determining the running time of the electric equipment is improved.
Based on the hardware structure, the embodiment of the method for acquiring the running time length is provided.
Referring to fig. 7, fig. 7 is a flowchart illustrating a method for obtaining an operation duration according to a fourth embodiment of the present invention.
In a fourth embodiment, the method for acquiring the operation duration includes the steps of:
s100: and when a timing instruction sent by the communication unit is received, starting timing of the running state to update the timing information.
It should be noted that, when a timing instruction sent by the communication unit is received, the timing of the operating state starts, and meanwhile, the timing information is updated according to the real-time timing result.
It can be understood that, for the electrical apparatus, it may be in an operating state, or may be in a standby state or other states, and the timing in this embodiment is to start timing that the electrical apparatus is in the operating state, that is, only when the electrical apparatus is in the operating state, the timing information is updated at the same time when accounting is performed, and when the electrical apparatus is in the standby state or other states, the timing is not started.
S200: and judging whether the timing information reaches a preset period.
In a specific implementation, whether the timing information reaches a preset period is determined, that is, whether the timing information belongs to an integral multiple of the preset period is determined, that is, assuming that the preset period is 5 minutes, at this time, assuming that the timing information is 5 minutes, it may be determined that the preset period is reached, and similarly, assuming that the timing information is 10 minutes, at this time, the preset period is also reached, and similarly, assuming that the timing information is 15 minutes, 20 minutes, 25 minutes, or 30 minutes, it may be determined that the preset period is reached.
S300: when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the long-term running information according to the received timing information, and sending the long-term running information to the server when the connection state of the communication unit and the server is normal.
It should be noted that, when the timing information reaches a preset period, the timing information may be reported to the communication unit, and the communication unit updates the running long information according to the received timing information, for example: the operation time length information in the communication unit is 10 minutes, and at this time, the received timing information is 15 minutes, and at this time, the operation time length information may be updated to 25 minutes.
It can be understood that, in order to ensure normal transmission of data, in this embodiment, when the connection state between the communication unit and the server is normal, the run-time long information is sent to the server.
In the embodiment, when a timing instruction sent by the communication unit is received, the timing of the running state is started to update the timing information, whether the timing information reaches the preset period is judged, and finally, when the timing information reaches the preset period, the timing information is reported to the communication unit, so that the communication unit updates the running long information according to the received timing information, and sends the running long information to the server when the connection state with the server is normal, the timing information is reported every other preset period under normal conditions, and the timing information is not uploaded after complete timing is not completed, so that the time length of timing reporting can be shortened, the influence of abnormal states such as restarting of an electric control board or the communication unit is reduced, and the accuracy of determining the running time of the electric equipment is improved.
Referring to fig. 8, fig. 8 is a flowchart illustrating a fifth embodiment of the operation duration obtaining method according to the present invention, and the fifth embodiment of the operation duration obtaining method according to the present invention is proposed based on the embodiment illustrated in fig. 7.
In the fifth embodiment, step S300 includes:
s310: when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the long running information according to the received timing information, feeds back confirmation characters, and sends the long running information to the server when the connection state of the communication unit and the server is normal.
Correspondingly, after step S300, the method for obtaining the operation duration further includes:
s401: and judging whether the confirmation characters fed back by the communication unit are received within a preset time range.
S402: and when receiving the confirmation characters fed back by the communication unit within a preset time range, clearing the timing information, and continuously timing the running state to update the timing information.
It should be noted that, for the communication unit, an abnormal state such as restart may occur, at this time, a situation that the communication unit cannot receive the timing information occurs, and it is assumed that the electronic control board directly clears the timing information after reporting the timing information, but the communication unit is in the abnormal state at this time, and the timing information is not counted in the running long information, so that accuracy of the running long information is affected.
In a specific implementation, the preset time range is usually determined according to a time when the electronic control board sends out timing information, for example: the timing when the electronic control board sends out the timing information is 12.
That is to say, when the electronic control board does not receive the feedback confirmation character, the timing information is not cleared, but the timing information is continuously updated, and the next preset period is waited, so that the accuracy of the long information in operation is ensured.
Referring to fig. 9, fig. 9 is a flowchart illustrating a sixth embodiment of the operation duration obtaining method according to the present invention, and the sixth embodiment of the operation duration obtaining method according to the present invention is proposed based on the embodiment shown in fig. 7.
In the sixth embodiment, before step S200, the method for obtaining the operation duration further includes:
s111: and judging whether a restart instruction is received or not.
S112: and when a restart instruction is received, reporting the timing information to the communication unit.
S113: and when a restart instruction is not received, executing the step of judging whether the timing information reaches a preset period.
In a specific implementation, except that the communication unit may be restarted, the main control board may also be restarted, and the restarting time of the main control board is generally random, so that the restarting time of the main control board does not generally coincide with a preset period, and therefore, when the main control board needs to be restarted, the timing information carries time information, in order to avoid that the timing information of the main control board is lost when the main control board is restarted, in this embodiment, before step S200, it may be determined whether a restart instruction is received, when the restart instruction is received, the timing information is reported to the communication unit, and when the restart instruction is not received, step S200 is executed.
In addition, an embodiment of the present invention further provides an operation duration obtaining device, and referring to fig. 10, the operation duration obtaining device includes:
a timing starting module 1010, configured to start timing of an operating state to update timing information when a timing instruction sent by the communication unit is received;
an information determining module 1020, configured to determine whether the timing information reaches a preset period;
an information reporting module 1030, configured to report the timing information to the communication unit when the timing information reaches a preset period, so that the communication unit updates the running time length information according to the received timing information, and sends the running time length information to the server when a connection state with the server is normal.
In the embodiment, when a timing instruction sent by the communication unit is received, the timing of the running state is started to update the timing information, whether the timing information reaches the preset period is judged, and finally, when the timing information reaches the preset period, the timing information is reported to the communication unit, so that the communication unit updates the running long information according to the received timing information, and sends the running long information to the server when the connection state with the server is normal, the timing information is reported every other preset period under normal conditions, and the timing information is not uploaded after complete timing is not completed, so that the time length of timing reporting can be shortened, the influence of abnormal states such as restarting of an electric control board or the communication unit is reduced, and the accuracy of determining the running time of the electric equipment is improved.
Each module in the apparatus may be configured to implement each step in the method, and is not described herein again.
In addition, the embodiment of the invention also provides electrical equipment which comprises the electric control board.
It should be noted that the electrical device may be a household electrical device, for example: the household air conditioner, the hot water kettle, the water heater or the coffee maker and other devices can be used in other occasions, such as: the present embodiment is not limited to a large-scale central air conditioner used in a market. .
In addition, an embodiment of the present invention further provides a storage medium, where an operation duration obtaining program is stored on the storage medium, and when executed by a processor, the operation duration obtaining program implements the following operations:
when a timing instruction sent by a communication unit is received, starting timing of the running state to update timing information;
judging whether the timing information reaches a preset period or not;
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the running long information according to the received timing information and sends the running long information to the server when the connection state of the communication unit and the server is normal.
The running duration acquiring program in the storage medium is used for implementing each step in the method when being executed by the processor, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (13)
1. An operation duration acquisition method, characterized by comprising the steps of:
sending a timing instruction to an electric control board of the electrical equipment, so that the electric control board reports timing information according to a preset period after receiving the timing instruction;
when the timing information reported by the electric control board is received, updating the running long information according to the received timing information;
detecting a connection state with a server;
when the connection state is normal, judging whether the running time length information exceeds a preset time length threshold value;
when the running time long information does not exceed a preset time threshold, sending the running time long information to a server;
when the running time length information exceeds a preset time length threshold, dividing the running time length information by the preset time length threshold to obtain a remainder and a module value, and sending the remainder and the module value to a server, wherein the data length required by the remainder and the module value is smaller than the data length required by the running time length information.
2. The method for obtaining running time length according to claim 1, wherein when the timing information reported by the electronic control board is received, updating the running time length information according to the received timing information includes:
when the timing information reported by the electric control board is received, the running long information is updated according to the received timing information, and a confirmation character is fed back to the electric control board, so that the electric control board clears the timing information after receiving the fed-back confirmation character.
3. The operation duration acquisition method according to claim 1 or 2, wherein after the detection of the connection state with the server, the operation duration acquisition method further comprises:
and when the connection state is abnormal, returning to the step of updating the running long information according to the received timing information when the timing information reported by the electric control board is received.
4. An operation duration acquisition device, characterized in that the operation duration acquisition device includes:
the command sending module is used for sending a timing command to an electric control board of the electric equipment so that the electric control board reports timing information according to a preset period after receiving the timing command;
the information updating module is used for updating the running long information according to the received timing information when the timing information reported by the electric control board is received;
the state detection module is used for detecting the connection state with the server;
the information sending module is used for judging whether the running long information exceeds a preset long threshold value or not when the connection state is normal; when the running time long information does not exceed a preset time threshold, sending the running time long information to a server; when the running time length information exceeds a preset time length threshold, dividing the running time length information by the preset time length threshold to obtain a remainder and a module value, and sending the remainder and the module value to a server, wherein the data length required by the remainder and the module value is smaller than the data length required by the running time length information.
5. A communication unit, characterized in that the communication unit comprises: a memory, a processor and a run-time length acquisition program stored on the memory and executable on the processor, the run-time length acquisition program being configured to implement the steps of the run-time length acquisition method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that a running time length acquisition program is stored thereon, which when executed by a processor implements the steps of the running time length acquisition method according to any one of claims 1 to 3.
7. An operation duration acquisition method, characterized by comprising the steps of:
when a timing instruction sent by a communication unit is received, starting timing of the running state to update timing information;
judging whether the timing information reaches a preset period or not;
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the running long information according to the received timing information, and judging whether the running long information exceeds a preset long threshold when the connection state of the communication unit and the server is normal; when the running time long information does not exceed a preset time threshold, sending the running time long information to a server; when the running time long information exceeds a preset time threshold, dividing the running time long information by the preset time threshold to obtain a remainder and a modulus value, and sending the remainder and the modulus value to a server, wherein the data length required by the remainder and the modulus value is smaller than the data length required by the running time long information.
8. The method for acquiring running duration according to claim 7, wherein when the timing information reaches a preset period, reporting the timing information to the communication unit, so that the communication unit updates the running duration information according to the received timing information, and when a connection state with a server is normal, sending the running duration information to the server, includes:
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the long running information according to the received timing information, feeds back a confirmation character, and sends the long running information to the server when the connection state of the communication unit and the server is normal;
when the timing information reaches a preset period, reporting the timing information to the communication unit so that the communication unit updates the running time long information according to the received timing information, and after the running time long information is sent to the server when the connection state with the server is normal, the running time length obtaining method further comprises the following steps:
judging whether the confirmation characters fed back by the communication unit are received within a preset time range;
and when receiving the confirmation characters fed back by the communication unit within a preset time range, clearing the timing information, and continuously timing the running state to update the timing information.
9. The method for acquiring running length according to claim 7, wherein before determining whether the timing information reaches a preset period, the method further comprises:
judging whether a restart instruction is received or not;
when a restart instruction is received, reporting the timing information to the communication unit;
and when a restart instruction is not received, executing the step of judging whether the timing information reaches a preset period.
10. An operation duration acquisition device, characterized by comprising:
the timing starting module is used for starting the timing of the running state to update the timing information when receiving the timing instruction sent by the communication unit;
the information judgment module is used for judging whether the timing information reaches a preset period or not;
the information reporting module is used for reporting the timing information to the communication unit when the timing information reaches a preset period so that the communication unit updates the long information during operation according to the received timing information, and judging whether the long information during operation exceeds a preset time threshold value when the connection state with the server is normal; when the running time long information does not exceed a preset time threshold, sending the running time long information to a server; when the running time length information exceeds a preset time length threshold, dividing the running time length information by the preset time length threshold to obtain a remainder and a module value, and sending the remainder and the module value to a server, wherein the data length required by the remainder and the module value is smaller than the data length required by the running time length information.
11. An electronic control board, comprising: a memory, a processor and a run-time length acquisition program stored on the memory and executable on the processor, the run-time length acquisition program being configured to implement the steps of the run-time length acquisition method according to any one of claims 7 to 9.
12. An electrical apparatus, characterized in that it comprises an electrical control board according to claim 11.
13. A computer-readable storage medium, characterized in that a running time length acquisition program is stored thereon, which when executed by a processor implements the steps of the running time length acquisition method according to any one of claims 7 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910675563.3A CN112311495B (en) | 2019-07-24 | 2019-07-24 | Operation duration obtaining method and device, communication unit, electric control board and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910675563.3A CN112311495B (en) | 2019-07-24 | 2019-07-24 | Operation duration obtaining method and device, communication unit, electric control board and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112311495A CN112311495A (en) | 2021-02-02 |
CN112311495B true CN112311495B (en) | 2023-03-10 |
Family
ID=74329256
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910675563.3A Active CN112311495B (en) | 2019-07-24 | 2019-07-24 | Operation duration obtaining method and device, communication unit, electric control board and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112311495B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113341959B (en) * | 2021-05-25 | 2022-02-11 | 吉利汽车集团有限公司 | Robot data statistical method and system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070088969A1 (en) * | 2005-10-13 | 2007-04-19 | Weekley Michael D | Method and system for monitoring an accumulated runtime in a device |
CN102369491B (en) * | 2009-04-10 | 2014-08-13 | 欧姆龙株式会社 | Operation information output device, method for controlling operation information output device, monitoring device, method for controlling monitoring device, and control program |
US20110173354A1 (en) * | 2010-01-08 | 2011-07-14 | Hall Kenwood H | Hardware Based Connection State Machine With Built In Timers |
CN108494087A (en) * | 2018-03-13 | 2018-09-04 | 广州华润热电有限公司 | A kind of reminding method and relevant device of unit check |
-
2019
- 2019-07-24 CN CN201910675563.3A patent/CN112311495B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112311495A (en) | 2021-02-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4805281B2 (en) | System and method for device management scheduling | |
JP5727194B2 (en) | Wireless communication system and wireless communication method | |
CN104166577B (en) | A kind of method and apparatus of mobile terminal system upgrading | |
CN105072175A (en) | Air conditioner repair requesting method, air conditioner and server | |
CN104898438A (en) | Household electrical appliance control method and apparatus, and terminal | |
CN112311495B (en) | Operation duration obtaining method and device, communication unit, electric control board and storage medium | |
CN113542256B (en) | Method, device, equipment and storage medium for updating login credentials in client | |
CN110262920B (en) | Linux system external watchdog indirect feeding method, watchdog feeding agent driving module and watchdog system | |
CN106919489B (en) | Method and device for monitoring abnormal exit of application interface of application program | |
CN108197958B (en) | Method and device for counting off-line cattle and storage medium | |
CN113396561A (en) | Operation device maintenance method and apparatus, storage medium, and program product | |
CN112583617B (en) | Fault determination method, server, control terminal and storage medium | |
KR20180026756A (en) | Information processing apparatus, device, information processing system, information processing method, and information processing program | |
CN107783825B (en) | Multi-background process starting method and device for mobile terminal and mobile terminal | |
WO2015021827A1 (en) | Method,device and system for offline reconnection of a web application | |
CN114826981B (en) | System and method for realizing application resident in cloud mobile phone | |
WO2017206620A1 (en) | Method and apparatus for setting state of application program | |
CN110650259B (en) | Call request response method, device, server, terminal and storage medium | |
CN111042932B (en) | Method and device for obtaining downtime and electronic control unit | |
JP2006302081A (en) | Service restart device and service restart program | |
CN111400094A (en) | Method, device, equipment and medium for restoring factory settings of server system | |
CN107147805B (en) | Mobile terminal offline processing method and device | |
CN112559063A (en) | CPU switching method and device, intelligent terminal and storage medium | |
CN108365923B (en) | Data transmission method and wireless terminal equipment | |
CN116800821B (en) | System upgrading method and device, storage medium and electronic equipment |
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 |