A timing method for a centralized controller

By employing a combination of forward and reverse timing modes in the centralized controller, the problem of timed task disorder caused by network anomalies was solved, the reliability and stability of the timing function were achieved, and the user experience was improved.

CN115604375BActive Publication Date: 2025-10-31QINGDAO HISENSE BOSCH AIR CONDITIONING SYSTEM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211208660.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-10-31
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

The timing function of existing centralized controllers is prone to malfunction when the network is powered off or interrupted, causing scheduled tasks to fail and affecting user experience.

Method used

It employs a combination of forward and reverse timing modes to create and execute timed tasks based on network conditions, ensuring the reliability and stability of the timing function under different network conditions.

Benefits of technology

In the event of network anomalies, the reliable execution of scheduled tasks is ensured, improving the stability of the centralized controller and the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115604375B_ABST
    Figure CN115604375B_ABST
Patent Text Reader

Abstract

This invention discloses a timing method for a centralized controller, comprising: creating a scheduled task and simultaneously enabling a forward timing mode and a reverse timing mode; when creating a scheduled task while connected to the network and then disconnecting from the network, executing the forward timing mode first, and then executing the reverse timing mode after disconnecting from the network; when creating a scheduled task while offline and then connecting to the network, executing the reverse timing mode first, and then executing the forward timing mode after connecting to the network; executing either the forward timing mode or the reverse timing mode while the scheduled task is continuously connected to the network or continuously offline; after the scheduled task is completed, clearing the parameters in the forward timing mode and the reverse timing mode respectively; the parameters in the forward timing mode include a creation identifier and a target time for triggering the scheduled task, and the parameters in the reverse timing mode include the timing duration, and the creation identifier is related to the network status of the centralized controller. This invention can ensure the reliable and stable execution of the timing function of the centralized controller in different scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of centralized control technology, and in particular to a timing method for a centralized controller. Background Technology

[0002] Existing centralized control systems include a centralized controller, a communication module (such as a gateway device) for information exchange, a cloud platform for sending, receiving and managing data, and a mobile terminal for controlling and viewing the status of air conditioning units. The system can collect the status parameters of the air conditioning units and send them to the centralized controller, and the air conditioning units can receive control commands issued by the centralized controller.

[0003] The convenient operation offered by the centralized controller of a central air conditioning unit can be mainly divided into two categories: local and remote. Remote controllers primarily connect to the network via wired connections (LAN, etc.) or wireless connections (e.g., 4G, NB-IoT, WiFi, etc.), relying on the internet and being completely unrestricted by geographical location, allowing control anytime, anywhere. Local controllers, on the other hand, do not require network access and are controlled locally via buttons, touchscreens, etc., unaffected by network signal strength.

[0004] Whether local or remote, the timer function has become an essential feature for managing central air conditioning units. Users can set the operating status for different time periods each day, and perform functions such as turning the unit on and off or adjusting the temperature, all according to the user's wishes.

[0005] Existing centralized controller system design such as Figure 1 As shown, it includes a main control unit (MCU), an air conditioning communication circuit, a wireless communication unit (e.g., a WiFi module), a touch / display module, and a power supply circuit.

[0006] The air conditioning communication circuit is responsible for communicating with the air conditioning unit; the wireless communication unit is responsible for connecting to the router, accessing the cloud platform, and then communicating with the user terminal through the cloud platform to achieve remote management; the touch / display module displays and controls the local status of the air conditioner; and the power circuit provides power to the centralized control system.

[0007] Remote centralized controllers must be connected to the network. Scheduled tasks are typically created and set up through user terminals (e.g., mobile apps or PC web pages). This information is usually stored on a cloud platform, making them highly dependent on the network. When the centralized controller experiences a power outage or restart or a network interruption, the scheduling function may malfunction, causing the scheduling to fail and affecting the execution of scheduled tasks and user experience. Summary of the Invention

[0008] This invention provides a timing method for a centralized controller, which can ensure the reliable and stable execution of the centralized controller's timing function under different network states when creating timed tasks and under the current network state, thus avoiding affecting the timed tasks.

[0009] This application provides a timing method for a centralized controller, including:

[0010] Create a scheduled task and enable both forward and reverse scheduling modes simultaneously;

[0011] When a scheduled task is created while connected to the internet and then disconnected, the forward scheduling mode is executed first, and the reverse scheduling mode is executed after the internet connection is disconnected.

[0012] When a scheduled task is created offline and then connected to the internet, the reverse scheduling mode is executed first, and the forward scheduling mode is executed after the internet connection is established. In the forward scheduling mode, the target time is obtained based on the scheduling duration.

[0013] If the system is connected to the internet or disconnected from the internet during the scheduled task, execute either the forward scheduling mode or the reverse scheduling mode.

[0014] After the scheduled task is completed, the parameters in the forward timing mode and the reverse timing mode are cleared respectively.

[0015] The parameters in the forward timing mode include a creation identifier and a target time for triggering the timing task, while the parameters in the reverse timing mode include the timing duration. The creation identifier is related to the network status of the centralized controller.

[0016] In the timing method of the centralized controller provided in this application, by taking into account the network status when creating the timing task and the current network status, a dual timing mode of forward timing mode and reverse timing mode is designed to be used in combination to ensure that the centralized controller can achieve reliable timing under different network outage conditions, with little impact from abnormal network outage conditions and high stability; making the centralized controller flexibly applicable to a variety of scenarios and improving the user experience.

[0017] In some embodiments of this application, when the central controller is connected to the network, the central controller acquires UTC time and performs local clock calibration to calibrate the system time of the central controller.

[0018] After the centralized controller is connected to the network, it automatically synchronizes the time, improving the accuracy of system time usage and ensuring the accurate execution of scheduled tasks.

[0019] In some embodiments of this application, the system time of the centralized controller is timed with second-level precision;

[0020] In the reverse timing mode, the timing duration is also calculated with second-level precision.

[0021] In some embodiments of this application, the remaining timing duration is stored in real time in the reverse timing mode.

[0022] In reverse timing mode, the timing duration is updated and stored in real time, ensuring that the timing task can be restored and the timing duration can be restored after the network is disconnected. This avoids the execution of user timing tasks being affected by network outages and improves the ability of the centralized controller to cope with abnormal situations.

[0023] In some embodiments of this application, the creation of the scheduled task specifically refers to:

[0024] A scheduled task is created remotely, and the scheduled task is remotely synchronized to the central controller; or

[0025] Create a scheduled task locally.

[0026] In some embodiments of this application, the parameters in the forward timing mode further include a forward running status identifier, used to identify whether the forward timing mode is running;

[0027] The parameters in the reverse timing mode also include a reverse running status identifier, which is used to identify whether the reverse timing mode is running.

[0028] In the centralized controller, the forward timing mode and the reverse timing mode run synchronously. The forward running status identifier and the reverse running status identifier are set. The main purpose is to determine that the timed task has been completed by clearing the forward running status identifier and the reverse running status identifier after the timed task is completed.

[0029] In some embodiments of this application, when a scheduled task is created offline and then connected to the internet, the target time in the forward scheduling mode is obtained based on the scheduling duration, specifically:

[0030] After connecting to the network, obtain the timing duration in the reverse timing mode;

[0031] Calibrate the system time and obtain the current system time after calibration;

[0032] The target time is the sum of the current system time and the timer duration.

[0033] In some embodiments of this application, there is also a situation where the centralized controller restarts after a power outage. In order to reliably and stably execute the timed task in this case, the timing is performed separately according to the long stop and the momentary stop of the centralized controller.

[0034] The timing method further includes:

[0035] S1: After the centralized controller is powered off and restarted, read the timed task;

[0036] S2: Determine whether the centralized controller is in a long-term stop or a momentary stop. If it is a momentary stop, proceed to S3; if it is a long-term stop, proceed to S5.

[0037] S3: Execute the reverse timing mode and determine in real time whether the centralized controller is connected to the network. If it is connected to the network, proceed to S4; otherwise, return to S3.

[0038] S4: Determine the creation flag of the forward timing mode before the power outage. If the creation flag indicates that the network status is connected, then execute the forward timing mode and update and store the timing duration in the reverse timing mode. If the creation flag indicates that the network status is not connected, then update and store the target time in the forward timing mode.

[0039] S5: All scheduled tasks are paused, and it is determined in real time whether the central controller is connected to the network. If it is connected to the network, proceed to S6; otherwise, return to S5.

[0040] S6: Restore all scheduled tasks;

[0041] S7: Determine the creation flag of the forward timing mode before the power outage. If the creation flag indicates that the network status is connected, then execute the forward timing mode and update and store the timing duration in the reverse timing mode. If the creation flag indicates that the network status is not connected, return to S5.

[0042] In some embodiments of this application, updating and storing the timing duration in the reverse timing mode in step S4 specifically involves:

[0043] Get the duration of the positive timer mode to be completed;

[0044] Update the timing duration in the reverse timing mode using the duration to be completed;

[0045] Store the updated timer duration.

[0046] In some embodiments of this application, updating and storing the target time in the positive timing mode in step S4 specifically involves:

[0047] Get the duration to be completed in reverse timer mode;

[0048] Calibrate the system time and obtain the current system time after calibration;

[0049] The target time is the sum of the current system time and the duration to be completed;

[0050] Store the target time. Attached Figure Description

[0051] Figure 1 The system architecture of the centralized controller is shown. Figure 1 ;

[0052] Figure 2 A parameter setting table is shown for the forward timing mode and the reverse timing mode involved in the timing method of the centralized controller according to some embodiments;

[0053] Figure 3 A flowchart is shown when a positive timing mode is executed in a timing method of a centralized controller according to some embodiments;

[0054] Figure 4 A flowchart is shown when the reverse timing mode is executed in the timing method of a centralized controller according to some embodiments;

[0055] Figure 5 The operation of timing tasks in forward and reverse timing modes involved in the timing method of a centralized controller according to some embodiments is shown;

[0056] Figure 6 A flowchart illustrating the creation of a timed task in a networked state in a timing method for a centralized controller according to some embodiments is shown;

[0057] Figure 7 A flowchart illustrating the creation of a timed task without network connectivity in a timing method for a centralized controller according to some embodiments is shown.

[0058] Figure 8 The system architecture of the centralized controller is shown. Figure 2 ;

[0059] Figure 9 A circuit diagram is shown involving an instantaneous stop detection circuit of a centralized controller in a timing method of a centralized controller according to some embodiments;

[0060] Figure 10 A flowchart is shown in a timing method for a centralized controller according to some embodiments, involving the execution of a timed task after a power outage and restart of the centralized controller. Detailed Implementation

[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0062] In the description of this invention, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0063] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0064] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0065] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0066] The following disclosure provides many different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. In addition, examples of various specific processes and materials are provided in this invention, but those skilled in the art will recognize the application of other processes and / or the use of other materials.

[0067] The centralized controller is used for local / remote centralized control of central air conditioners. Users can create scheduled tasks directly on the local end (e.g., turn off the air conditioner after a certain number of hours), or remotely create scheduled tasks on the remote end (e.g., on a mobile app or PC webpage), and then remotely synchronize them to the local end for execution.

[0068] Whether creating a scheduled task locally or remotely, the local end takes precedence.

[0069] The basic principle of an air conditioner is described below.

[0070] Air conditioners execute a refrigeration cycle using a compressor, condenser, expansion valve, and evaporator. The refrigeration cycle involves a series of processes including compression, condensation, expansion, and evaporation, supplying refrigerant to the conditioned and heat-exchanged air.

[0071] The compressor compresses refrigerant gas under high temperature and pressure and discharges the compressed refrigerant gas. The discharged refrigerant gas flows into the condenser. The condenser condenses the compressed refrigerant into a liquid phase, and the heat is released to the surrounding environment through the condensation process.

[0072] The expansion valve expands the high-temperature, high-pressure liquid refrigerant condensed in the condenser into a low-pressure liquid refrigerant. The evaporator evaporates the expanded refrigerant in the expansion valve, returning the low-temperature, low-pressure refrigerant gas to the compressor. The evaporator achieves its cooling effect by utilizing the latent heat of refrigerant evaporation to exchange heat with the material being cooled. Throughout the cycle, the air conditioning unit regulates the temperature of the indoor space.

[0073] An air conditioner outdoor unit refers to the part that includes the compressor of the refrigeration cycle and the outdoor heat exchanger. An air conditioner indoor unit includes the indoor heat exchanger, and an expansion valve can be provided in either the indoor or outdoor unit.

[0074] The indoor and outdoor heat exchangers function as either condensers or evaporators. When the indoor heat exchanger is used as a condenser, the air conditioner functions as a heater in heating mode; when the indoor heat exchanger is used as an evaporator, the air conditioner functions as a cooler in cooling mode.

[0075] In order to ensure reliable and stable execution of scheduled tasks, this application involves enabling two scheduling modes: forward scheduling mode and reverse scheduling mode.

[0076] Forward and reverse timing modes are used together during the triggering of scheduled tasks to meet the timing needs of various application scenarios and ensure the stable and accurate execution of scheduled tasks.

[0077] [Forward Timer Mode]

[0078] See Figure 2 In positive timing mode, the parameters include a creation flag and a target time value.

[0079] The creation of the flag is related to the network status, and the target time value is also related to the network status.

[0080] For example, if the network status is connected when creating a scheduled task, the creation flag can be set to true; if the network status is not connected when creating a scheduled task, the creation flag can be set to false.

[0081] The target time value is the sum of the current system time UTCcur and the timing duration ΔT, where the current system time UTCcur is related to the network status.

[0082] In the embodiments of this application, when the network connection status is connected, the local clock can be calibrated by obtaining the UTC time, that is, the current system time UTCcur can be calibrated.

[0083] When the network connection is off, the local clock is not calibrated and the default local clock is used. This means the current system time (UTCcur) is not calibrated. See details for further information. Figure 3 .

[0084] refer to Figure 3 The specific description is as follows.

[0085] S41: Power on.

[0086] That is, power on the central controller.

[0087] The centralized controller is connected via a power supply loop (see...) Figure 1 Power-on control is performed.

[0088] S42: Initialization

[0089] After the central controller is powered on, it is initialized in order to enter centralized control.

[0090] S43: Determine if the network connection is successful. If successful, proceed to S44; otherwise, proceed to S46.

[0091] Determining whether a centralized controller is connected to the network can be done using existing technologies, which will not be elaborated here.

[0092] S44: Determine whether to obtain UTC time. If yes, proceed to S45; otherwise, proceed to S46.

[0093] To calibrate your local clock, you should obtain the UTC time.

[0094] Therefore, when the central controller is connected to the network, it will first send a timestamp request to the cloud to obtain the UTC time.

[0095] S45: Calibrate the local clock.

[0096] After obtaining the UTC time, local clock calibration is performed; that is, time calibration is mandatory when connected to the internet.

[0097] The time will be synchronized immediately upon first network connection, and regular time synchronization will be performed thereafter.

[0098] S46: Default local clock.

[0099] If the central controller is not connected to the network, the system can keep time according to the default local clock. This usually happens when the central controller cannot connect to the network after restarting.

[0100] Once the central controller reconnects to the network, it will automatically acquire UTC time and perform local clock calibration.

[0101] Thus, when connected to the internet, the system time UTCcur will be calibrated, and at this time the system time UTCcur and UTC time are consistent; when not connected to the internet, the system time UTCcur will not be calibrated, and at this time there will be a deviation between the system time UTCcur and UTC time. Once connected to the internet again, the system time UTCcur will be calibrated immediately.

[0102] The system time UTCcur is forward-clocked.

[0103] The following describes the parameter settings when creating a scheduled task in forward timing mode.

[0104] When creating a scheduled task, the user calculates the target time value by adding the current system time UTCcur to the scheduled duration ΔT.

[0105] That is, UTCend = UTCcur + ΔT.

[0106] Since the system time UTCcur is continuously updated in a positive direction, a scheduled task is triggered when the current system time reaches UTCend.

[0107] It should be noted that scheduled tasks are primarily local. Therefore, whether a scheduled task is created locally or remotely, the target time UTCend will be stored locally.

[0108] Thus, see the figure, which shows the parameters in the positive timing mode.

[0109] Suppose that the positive timing mode is a structure member Time1, which has two parameters: {creation flag; target time value}.

[0110] (1) In the network state, create an identifier flag=true and target time value=UTCend.

[0111] That is, Time1.flag=true, Time1.value=UTCend.

[0112] UTCcur, which is the calibrated time, is involved in UTCend.

[0113] (2) In the offline state, create an identifier flag=false and target time value=UTCend.

[0114] That is, Time1.flag= false, Time1.value=UTCend.

[0115] UTCcur, which is the uncalibrated time, is involved in UTCend.

[0116] [Reverse Timing Mode]

[0117] See Figure 2 This shows that the parameters in the reverse timing mode include the timing duration value.

[0118] See Figure 2 In reverse timing mode, the parameters include the timing duration (value).

[0119] In some embodiments of this application, the centralized controller does not have a backup battery unit for RTC (Real-Time Clock) due to factors such as transportation costs. The time is no longer saved when power is lost, and the RTC of the system keeps time with second-level precision.

[0120] Therefore, in reverse timing mode, in order to match the system time, when creating a scheduled task, the user will convert the timing duration value ΔT into seconds, that is, convert it into seconds Ts.

[0121] Suppose that the reverse timing mode is a structure member Time2, which has a parameter {timing duration value}.

[0122] That is, Time2.value=Ts.

[0123] Once the scheduled task is successfully created, Ts is stored as the initial value.

[0124] After the scheduled task is triggered and started, Ts begins to decrease until it decreases to zero, at which point the scheduled task is executed.

[0125] It should be noted that during the reverse timing mode, to prevent power outages or restarts from affecting the acquisition of the timing duration, the remaining duration is stored in real time, i.e., the updated timing duration. See details... Figure 4 The following description is provided.

[0126] S51: Set the timer duration.

[0127] The user-defined timeout duration, value ΔT, is set according to the created scheduled task.

[0128] S52: Convert to seconds Ts.

[0129] As mentioned above, in order to match the system time, when users create scheduled tasks, they will convert the scheduled duration ΔT into seconds, that is, into seconds Ts.

[0130] S53: Store Ts.

[0131] Store Ts for easy retrieval when the scheduled task starts.

[0132] S54: Start the scheduled task.

[0133] After completing the settings and saving the timer duration, start the scheduled task to begin execution.

[0134] S55: Determine if the timer has decreased to zero. If yes, proceed to S59; otherwise, proceed to S56.

[0135] Ts is also the timeout duration, which decreases during the execution of the scheduled task.

[0136] While Ts is decreasing, when the count decreases to a certain time t (i.e., the timing duration is updated to Ts-t), the timing duration is updated here (i.e., Ts-t is assigned the value Ts) and stored so that the timing duration can be obtained after a power outage and restart.

[0137] S56: Determine if time t has been reached. If yes, proceed to S57; otherwise, return to S55.

[0138] The value of time t can be freely defined by the user.

[0139] For example, in the application scenario of a centralized controller, the value of time t can be set. When higher timing accuracy is required, the value of time t can be set smaller, and when lower accuracy is required, time t can be set larger, and so on.

[0140] For example, the time t can be set to 2 seconds. That is, every time it decreases by 2 seconds, it proceeds to S57 to update the timing duration and then to S58 to store the updated timing duration.

[0141] S57: Update timer duration.

[0142] For example, the initial value of the timer duration Ts is 30 seconds, and the set time t is 3 seconds. That is, when the timer has accumulated a decrease of 3 seconds, the timer duration is updated to 30 seconds - 3 seconds = 27 seconds.

[0143] When the cumulative decrease reaches 3 seconds, the timer duration is updated to 20 seconds - 3 seconds = 17 seconds. This cycle continues until the timer decreases to 0, proceeding to S59.

[0144] S58: Storage update timeout.

[0145] Storage facilitates subsequent retrieval.

[0146] S59: Execute a scheduled task.

[0147] When the timer duration decreases to 0, the scheduled task is triggered and begins execution.

[0148] The above describes the forward timing mode and the reverse timing mode respectively. When creating a timed task, both timing modes are enabled simultaneously. The dual timing mode (including forward timing mode and reverse timing mode) ensures that the system can reliably and accurately execute the timing function.

[0149] It should be noted that, in order to identify which timing mode is currently being used when the scheduled task is running, a forward running status identifier (state) can be set for the forward timing mode and a reverse running status identifier (state) can be set for the reverse timing mode.

[0150] For example, when the forward timing mode is running, the forward running status identifier state=true, that is, Time1.state=true; otherwise, the forward running status identifier Time1.state=false.

[0151] When the reverse timing mode is running, the reverse running status identifier Time2.state = true; otherwise, the reverse running status identifier Time2.state = false.

[0152] After the scheduled task is completed, both the forward and reverse timing modes end, and all parameters {Time1.flag, Time1.value, Time1.state} in the forward timing mode and {Time2.value, Time2.state} in the reverse timing mode are cleared.

[0153] As mentioned above, when the network connection is active, the forward timing mode uses a more accurate UTC time, resulting in more precise timing. Therefore, when the network connection is active, the forward timing mode should be selected.

[0154] See Figure 5 It shows the operation of the dual-timed mode when the timed task is running.

[0155] The network connection status mainly includes the following situations.

[0156] (1) When the network is not connected during the scheduled task, execute the forward timer mode or the reverse timer mode.

[0157] Being offline throughout the scheduled task means that the task has been offline from the time it is created until it is triggered to execute.

[0158] At this point, the network is disconnected, and the timing accuracy remains consistent regardless of whether it is in forward or reverse timing mode.

[0159] In positive timing mode, the system time UTCcur cannot be calibrated throughout the entire time range described above, and the execution of the timed task depends on the timing duration ΔT.

[0160] In reverse timing mode, the execution of the timed task also depends on the timing duration ΔT.

[0161] (2) When the network is connected during the scheduled task, execute the forward timer mode or the reverse timer mode.

[0162] Being offline throughout the scheduled task means that the task has been offline from the time it is created until it is triggered to execute.

[0163] At this time, the network remains connected, and the timing accuracy is consistent regardless of whether it is in forward or reverse timing mode.

[0164] In positive timing mode, the system time UTCcur is calibrated throughout the entire time range described above, and the execution of the timed task depends on the timing duration ΔT.

[0165] In reverse timing mode, the execution of the timed task also depends on the timing duration ΔT.

[0166] (3) When a scheduled task is created while connected to the network and then disconnected, the forward scheduled mode is executed first, and the reverse scheduled mode is executed after the network is disconnected.

[0167] In this context, "network outage" refers to an outage occurring within the time frame between the creation of the scheduled task and its execution.

[0168] This situation refers to a situation where a centralized controller creates a scheduled task while connected to the network, but the network is subsequently interrupted, even if the initial value of Time1.flag is true.

[0169] Therefore, before disconnecting from the network, execute the positive timing mode to ensure precise timing.

[0170] If the network reconnects to synchronize the time, it may cause time to go backward. Therefore, the reverse timing mode is then executed to continue running the timed task.

[0171] When the network is disconnected, the timing accuracy remains consistent regardless of whether it is a forward or reverse timing mode.

[0172] However, if the positive timing mode is still used for timing after the network is disconnected, there is a risk that the scheduled task may be executed twice when the local clock is recalibrated after the central controller has been offline for a long time and then suddenly connected to the network.

[0173] For example, if a scheduled task is created to shut down the computer 36 hours later, 36 hours is equivalent to 129,600 seconds.

[0174] At this point, in the positive timing mode, Time1.value = UTCcur + 129600; Time1.flag = true.

[0175] In reverse timing mode, Time2.value = 12960.

[0176] If the forward timing mode is still used for timing after the central controller is disconnected from the network, the timed task will be triggered when the current system time UTCcur reaches Time1.value.

[0177] If the centralized controller successfully connects to the network again at this time, and UTCcur is less than Timer1.value again after local clock calibration, the scheduled task will be executed again, which will degrade the user experience.

[0178] Therefore, during the offline period, a reverse timing mode is used. When the timing duration decreases to 0, the timed task is triggered. After execution, Time1.state = false, and the timed task will no longer be executed, which can avoid the risk of repeatedly executing the timed task as mentioned above.

[0179] See Figure 6 The flowchart shown illustrates the execution of the scheduled task in this case.

[0180] S61: Network connection successful.

[0181] This indicates that the network connection was successful when creating the scheduled task.

[0182] S62: Set the creation flag to true.

[0183] As mentioned above, if connected to the internet, the creation flag in the positive timer mode is true.

[0184] If there is no internet connection, the creation flag in the forward timer mode is false.

[0185] S63: Execute forward timing mode.

[0186] As mentioned above, a positive timing mode is executed before the network is disconnected to achieve accurate timing.

[0187] S64: Determine if there is a network connection. If yes, return to S63; otherwise, proceed to S65.

[0188] The network connection determination mentioned above is to determine the current network connection status. If the network connection is still active, the positive timing mode is still used to achieve accurate timing.

[0189] S65: Execute reverse timing mode.

[0190] If the current network is not connected, then to avoid the risk of repeatedly executing scheduled tasks, the reverse scheduling mode is executed as described above.

[0191] It should be noted that when a scheduled task is run in forward scheduling mode, reverse scheduling mode will also be executed, that is, the parameters in reverse scheduling mode will be updated, but not for the scheduled task.

[0192] Similarly, when a scheduled task is run in reverse scheduling mode, forward scheduling mode will also be executed, that is, the parameters in forward scheduling mode will be updated, but not for the scheduled task.

[0193] (4) When a scheduled task is created without being connected to the network and then connected to the network, the reverse scheduling mode is executed first, and the forward scheduling mode is executed after the network is connected. In the forward scheduling mode, the target time is obtained based on the remaining duration.

[0194] When the centralized controller creates a timed task while not connected to the network, as mentioned earlier, the system time deviates from the UTC time because the local clock has not been calibrated. Therefore, the initial value of Time1.flag is false.

[0195] After the scheduled task is created, it will run in reverse scheduling mode.

[0196] If the user configures the network and successfully connects to the network at this time, the values ​​of the parameters in the forward timing system are meaningless because the local clock has been recalibrated. At this time, the target time value in the forward timing system is obtained based on the timing duration in the reverse timing mode.

[0197] See Figure 7 The flowchart shown illustrates the execution of the scheduled task in this case.

[0198] S71: Not currently connected to the network.

[0199] This indicates that no internet connection was established when the scheduled task was created.

[0200] S72: Set the creation flag to false.

[0201] As mentioned above, when not connected to the network, the creation flag in the forward timing mode is false; when connected to the network, the creation flag in the forward timing mode is true.

[0202] S73: Execute reverse timing mode.

[0203] As described above, the reverse timing mode is executed before networking.

[0204] S74: Determine if the network is connected. If yes, proceed to S73; otherwise, proceed to S75.

[0205] The network connection determination mentioned above is to determine the current network connection status. If the network connection is still not established, the reverse timing mode is still used.

[0206] If currently connected to the network, a positive timing mode is used to achieve accurate timing.

[0207] S75: Get the timing duration of the reverse timing mode.

[0208] As mentioned above, if the network is configured and connected successfully, the values ​​of the parameters in the forward timing system are meaningless because the local clock has been recalibrated. Therefore, if you want to execute the forward timing mode, you need to obtain the parameters in the forward timing mode, specifically the target time value.

[0209] S76: Update and store the target time for the positive timing mode.

[0210] In the embodiments of this application, the target time value in the forward timing system is obtained based on the timing duration of the reverse timing mode (since the timing duration is constantly decreasing and updated as the timing task runs, the timing duration at this time refers to the updated timing duration, that is, the duration to be completed).

[0211] Specifically, after connecting to the network, S761: obtains the timing duration in the reverse timing mode.

[0212] S762: Calibrate system time, obtain the current system time after calibration.

[0213] After connecting to the network, automatically calibrate the local clock to calibrate the current system time UTCcur.

[0214] S763: The target time value is the sum of the current system time UTCcur and the timer duration.

[0215] S764: Update and store the previous target time value in positive timing mode.

[0216] It should be noted that when a scheduled task is run in forward scheduling mode, reverse scheduling mode will also be executed, that is, the parameters in reverse scheduling mode will be updated, but not for the scheduled task.

[0217] Similarly, when a scheduled task is run in reverse scheduling mode, forward scheduling mode will also be executed, that is, the parameters in forward scheduling mode will be updated, but not for the scheduled task.

[0218] The process of running timed tasks as described above is the execution process under different network states (e.g., not connected, connected, not connected and then connected, connected and then disconnected) when the central controller is powered on.

[0219] During the use of the centralized controller, there may be instances where the centralized controller is powered off and restarted. This situation is different from the situation described above, and it is necessary to determine the duration of the power outage.

[0220] See Figure 8 The centralized controller includes a short-term stop detection circuit, which can detect short power outages of the centralized controller.

[0221] When the centralized controller is in a long-term stop, the instantaneous long-term stop detection circuit outputs a long-term stop signal; when the centralized controller is in a short-term stop, the instantaneous long-term stop detection circuit outputs an instantaneous stop signal.

[0222] Long stop and instantaneous stop are relative terms, and the duration can be adjusted by adjusting the component parameters in the instantaneous and long stop detection circuit.

[0223] See Figure 9 , showing the circuit diagram of the instantaneous long power failure detection circuit.

[0224] The power supply VCC can be an external power supply or the power supply of the instantaneous long power failure detection circuit自带 by the centralized controller (for example, +5V DC).

[0225] When the centralized controller is powered off, the capacitor C1 is in a discharging state. In a short period of time, the level output at the output terminal PL of the instantaneous long power failure circuit will not immediately drop to zero. A preset voltage Vset can be preset, and the period of time during which the voltage Vp output at the output terminal PL drops from the start of power-off to Vset is called the instantaneous power failure time of the centralized controller (or, when Vp >= Vset, it is called the instantaneous power failure of the centralized controller), that is, the first period T1.

[0226] And the second period after the first period is called the long power failure time of the centralized controller (or, when Vp < Vset, it is called the long power failure of the centralized controller). After that, Vp starts to decrease from Vset. The magnitude of the first period T1 is inversely proportional to the magnitude of Vset. The smaller the value of Vset, the longer T1, and the larger the value of Vset, the shorter T1.

[0227] Therefore, the length of the power-off of the centralized controller can be set by setting the magnitude of Vset, so that when the centralized controller is powered on again after the instantaneous power failure period T1 of the centralized controller, the centralized controller can collect Vp = Vset.

[0228] The instantaneous power failure signal as described above can be that the centralized controller collects Vp >= Vset at the output terminal PL, and the long power failure signal can be that the centralized controller collects Vp < Vset at the output terminal PL.

[0229] See Figure 10 , showing the flowchart of running the timing task after the centralized controller is powered off and restarted.

[0230] S91: Power off and restart.

[0231] S92: Read the timing task.

[0232] After power off and restart, read the timing tasks that were not triggered and executed before power off.

[0233] S93: Determine whether it is an instantaneous power failure. If so, proceed to S94; if not, proceed to S94'.

[0234] As described above, the instantaneous and long power failure of the centralized controller are judged by using the instantaneous long power failure detection circuit.

[0235] S94: Execute the reverse timing mode.

[0236] If a momentary stop occurs, after the central controller restarts, the scheduled tasks will continue to run according to the scheduled tasks stored in the directed timing mode.

[0237] S95: Determine if there is a network connection. If yes, proceed to S96; otherwise, return to S94.

[0238] The network connection determination mentioned above is to determine the current network connection status. If the network connection is still not established, the reverse timing mode is still used.

[0239] If the network is currently connected, the timing mode needs to be determined based on the network status before the power outage in order to achieve accurate timing.

[0240] S96: Determine if the creation flag of the positive timing mode is true. If yes, proceed to S97; otherwise, proceed to S97'.

[0241] The flag creation step here primarily determines the network connection status before power is supplied.

[0242] As mentioned earlier, if the scheduled task is created while connected to the internet, then Time1.flag=true; otherwise, Time1.flag=false.

[0243] S97: Execute positive timer mode.

[0244] If the creation flag of the forward timing mode is true, it means that the timed task was created while connected to the network before the power outage, and the network was connected again after the power outage and restart. Therefore, to ensure accurate timing, the forward timing mode is adopted.

[0245] At the same time, the system time UTCcur is calibrated.

[0246] S98: Update and store the timing duration of the reverse timing mode.

[0247] Specifically, S981: Get the duration of the positive timing mode to be completed.

[0248] When executing the forward timing mode, the parameters of the reverse timing mode also need to be updated. Therefore, it is necessary to obtain the timing duration in the reverse timing mode.

[0249] Specifically, the duration of the reverse timing mode is obtained by acquiring the duration to be completed in the forward timing mode.

[0250] S982: Update the timer duration in reverse timer mode using the duration to be completed.

[0251] S983: Store the updated timer duration.

[0252] S97: Execute positive timer mode.

[0253] If the creation flag of the forward timing mode is true, it means that the timed task was created while connected to the network before the power outage, and the network was connected again after the power outage and restart. Therefore, to ensure accurate timing, the forward timing mode is adopted.

[0254] At the same time, the system time UTCcur is calibrated.

[0255] S97': Update and store the target time for the positive timing mode.

[0256] In the embodiments of this application, the target time value in the forward timing system is obtained based on the duration to be completed in the reverse timing mode.

[0257] Specifically, S971': Get the timing duration of the reverse timing mode.

[0258] S972': Calibrate system time and obtain the calibrated current system time UTCcur.

[0259] After connecting to the network, automatically calibrate the local clock to calibrate the current system time UTCcur.

[0260] S973': The target time value is the sum of the current system time UTCcur and the timer duration.

[0261] S974': Update and store the target time value in the positive timing mode.

[0262] This enables the centralized controller to run timed tasks in a dual-timed mode after a brief stop and restart.

[0263] S94': All scheduled tasks are paused.

[0264] In the event of a prolonged power outage, since the duration of the outage cannot be assessed, all scheduled tasks will be suspended and will resume automatically once the network is reconnected.

[0265] Regardless of whether the centralized controller experiences a momentary or prolonged shutdown, all scheduled tasks can be resumed as long as the network connection is successfully established.

[0266] S95': Determine if the network is connected. If yes, proceed to S96'; otherwise, return to S94'.

[0267] The network connection determination mentioned above is to judge the current network connection status. If the network connection is still not working, all scheduled tasks will be paused.

[0268] S96': Resume all scheduled tasks and proceed to S99.

[0269] If currently connected to the internet, resume all scheduled tasks.

[0270] The specific timer mode used for a given scheduled task needs to be determined based on the network connection status before the power outage.

[0271] S99: Determine if the creation flag of the positive timing mode is true. If yes, proceed to S97; otherwise, return to S94.

[0272] The flag creation step here primarily determines the network connection status before power is supplied.

[0273] As mentioned earlier, if the scheduled task is created while connected to the internet, then Time1.flag=true; otherwise, Time1.flag=false.

[0274] This enables the centralized controller to run timed tasks in a positive timed mode after a long stop and restart.

[0275] The timing method for the centralized controller provided in this application takes into account the network status when creating the timing task and the current network status. It designs a dual timing mode, namely forward timing mode and reverse timing mode, to ensure that the centralized controller can achieve reliable timing under different network outage conditions. It is less affected by abnormal network outages and has high stability.

[0276] The centralized controller with dual timing modes can be flexibly applied to a variety of scenarios, improving the user experience.

[0277] In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0278] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A timing method for a centralized controller, characterized in that, include: Create a scheduled task and enable both forward and reverse scheduling modes simultaneously; When a scheduled task is created while connected to the internet and then disconnected, the forward scheduling mode is executed first, and the reverse scheduling mode is executed after the internet connection is disconnected. When a scheduled task is created offline and then connected to the internet, the reverse scheduling mode is executed first, and the forward scheduling mode is executed after the internet connection is established. In the forward scheduling mode, the target time is obtained based on the scheduling duration. If the system is connected to the internet or disconnected from the internet during the scheduled task, execute either the forward scheduling mode or the reverse scheduling mode. After the scheduled task is completed, the parameters in the forward timing mode and the reverse timing mode are cleared respectively. The parameters in the forward timing mode include a creation identifier and a target time for triggering the timing task, while the parameters in the reverse timing mode include the timing duration. The creation identifier is related to the network status of the centralized controller.

2. The timing method for a centralized controller according to claim 1, characterized in that, When the central controller is connected to the network, it acquires UTC time and performs local clock calibration to calibrate the system time of the central controller.

3. The timing method for a centralized controller according to claim 1, characterized in that, The system time of the centralized controller is timed with second-level precision. In the reverse timing mode, the timing duration is also calculated with second-level precision.

4. The timing method for a centralized controller according to claim 1, characterized in that, In the reverse timing mode, the timing duration is updated and stored in real time.

5. The timing method for a centralized controller according to claim 1, characterized in that, The creation of the scheduled task specifically involves: A scheduled task is created remotely, and the scheduled task is remotely synchronized to the central controller; or Create a scheduled task locally.

6. The timing method for a centralized controller according to claim 1, characterized in that, The parameters in the forward timing mode also include a forward running status identifier, which is used to identify whether the forward timing mode is running; The parameters in the reverse timing mode also include a reverse running status identifier, which is used to identify whether the reverse timing mode is running.

7. The timing method for a centralized controller according to claim 1, characterized in that, When a scheduled task is created offline and then connected to the internet, the target time in the forward scheduling mode is obtained based on the scheduling duration, specifically: After connecting to the network, obtain the timing duration in the reverse timing mode; Calibrate the system time and obtain the current system time after calibration; The target time is the sum of the current system time and the timer duration.

8. The timing method for a centralized controller according to claim 4, characterized in that, The centralized controller also includes: A momentary stop detection circuit outputs a long stop signal and a momentary stop signal, wherein the long stop signal represents a long stop of the centralized controller and the momentary stop signal represents a momentary stop of the centralized controller; The timing method further includes: S1: After the centralized controller is powered off and restarted, read the timed task; S2: Determine whether the centralized controller is in a long-term stop or a momentary stop. If it is a momentary stop, proceed to S3; if it is a long-term stop, proceed to S5. S3: Execute the reverse timing mode and determine in real time whether the centralized controller is connected to the network. If it is connected to the network, proceed to S4; otherwise, return to S3. S4: Determine the creation flag of the forward timing mode before the power outage. If the creation flag indicates that the network status is connected, then execute the forward timing mode and update and store the timing duration in the reverse timing mode. If the creation flag indicates that the network status is not connected, then update and store the target time in the forward timing mode. S5: All scheduled tasks are paused, and it is determined in real time whether the central controller is connected to the network. If it is connected to the network, proceed to S6; otherwise, return to S5. S6: Restore all scheduled tasks; S7: Determine the creation flag of the forward timing mode before the power outage. If the creation flag indicates that the network status is connected, then execute the forward timing mode and update and store the timing duration in the reverse timing mode. If the creation flag indicates that the network status is not connected, return to S5.

9. The timing method for a centralized controller according to claim 8, characterized in that, In step S4, updating and storing the timing duration in the reverse timing mode specifically involves: Get the duration of the positive timer mode to be completed; Update the timing duration in the reverse timing mode using the duration to be completed; Store the updated timer duration.

10. The timing method for a centralized controller according to claim 8 or 9, characterized in that, In step S4, updating and storing the target time in the positive timing mode specifically involves: Get the duration to be completed in reverse timer mode; Calibrate the system time and obtain the current system time after calibration; The target time is the sum of the current system time and the duration to be completed; Store the target time.

Citation Information

Patent Citations

  • System for timing household appliance through Internet of Things

    CN104125263A

  • Timing control method, device and storage medium

    CN107990488A

  • Terminal equipment control method and device, storage medium and terminal equipment

    CN112711447A