Equipment monitoring and intelligent re-triggering method and system for scene control of kinetic energy switch
Patent Information
- Application Number
- CN202510764491.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-23
Smart Images

Figure CN120692305A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology, and in particular to a device monitoring and intelligent re-triggering method and system for kinetic energy switch scene control. Background Art
[0002] With the continuous development of electronic technology, smart homes and smart lighting based on electronic technology are becoming increasingly popular in people's lives. Smart homes can include smart devices such as smart air conditioners, smart curtains, and smart lights. Smart homes can be pre-set with multiple scene modes. Each scene mode can include multiple smart devices and the status information of each controlled smart home device in the scene mode. For example, a scene can set the air conditioner temperature to 26°C, close the curtains, and dim the lights. When performing scene control, users generally generate different control signals through different operations of the switch button, such as long press and short press. After recognizing the corresponding control signal, the server will send instructions to specific devices. For example, if the user selects the above scene by long pressing the switch button, the server will send a command to set the temperature to 26°C to the air conditioner, a command to close the curtains, and a command to dim the lights. In each scene, there are often multiple smart devices to be controlled, and the server must send a large number of instructions accordingly. In existing smart control systems, packet loss often occurs, resulting in some devices not being controlled according to the scene settings, causing scene switching failures.
[0003] Furthermore, since achieving multi-scene control requires sufficient control signals to meet the required number of scene settings, existing intelligent scene controls mostly rely on active switches or remote controls. Active switches and remote controls can identify button presses when powered by a power source, such as accurately identifying long and short presses to distinguish different control signals. However, such switches or remote controls generally rely on battery power, which does not meet the current era's environmental protection requirements. Although self-generating wireless switches are widely used with technological developments, since self-generating switches require button presses to generate electricity, a single press requires both power generation and button recognition, and power generation can only be turned on when the button is in motion. Unlike active switches, they cannot achieve long-term button recognition. Therefore, current self-generating switches are generally only used to achieve simple on / off control of electrical switches and cannot meet the control needs of intelligent switching in multiple scenes.
[0004] At the same time, since switches or remote controls send control signals unidirectionally, when the device is not controlled according to the scene setting requirements, the user can only control it by operating the switch or remote control again. When the control signal is a switch signal, it may cause confusion in scene switching. That is, some devices have been turned on or off according to the scene switching requirements in the previous operation. Operating again will cause the status of these devices to be switched again, which cannot meet user needs. Summary of the Invention
[0005] One object of the present invention is to provide a device monitoring and intelligent re-triggering method and system for kinetic energy switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic energy switch scene control further checks whether the status of the smart device is updated after broadcasting instructions to the corresponding smart device to identify whether the scene switching is completed.
[0006] Another object of the present invention is to provide a device monitoring and intelligent re-triggering method and system for kinetic switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic switch scene control re-broadcasts instructions to smart devices that have not completed status updates to prevent scene switching failures caused by packet loss.
[0007] Another object of the present invention is to provide a device monitoring and intelligent re-triggering method and system for kinetic energy switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic energy switch scene control checks again whether the status of the smart device is updated after retransmitting the instruction to grasp the latest status of the smart device.
[0008] Another object of the present invention is to provide a device monitoring and intelligent re-triggering method and system for kinetic switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic switch scene control re-broadcasts instructions within a limited number of times, so as to avoid scene switching failure caused by packet loss based on the re-broadcast of instructions when the status of the smart device is not updated, and marks the smart device as offline when the instructions are broadcast a limited number of times and the status of the smart device is not updated, so as to avoid repeated broadcasting of instructions occupying network resources.
[0009] Another object of the present invention is to provide a device monitoring and intelligent re-triggering method and system for kinetic switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic switch scene control, when detecting that the smart device has not completed the status update within a set time period, broadcasts instructions again to the smart device that has not completed the status update, so as to avoid repeated sending of instructions due to device status update delays or network reasons.
[0010] Another object of the present invention is to provide a device monitoring and intelligent re-triggering method and system for kinetic energy switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic energy switch scene control establishes a status database based on the current status of the smart device, and updates the status database when the status of the smart device changes, wherein the device monitoring and intelligent re-triggering method for kinetic energy switch scene control queries a scene database based on the corresponding control signal after receiving the corresponding control signal, wherein the scene database is established based on the matching relationship between the corresponding control signal and the status of each smart device in the corresponding scene, wherein the device monitoring and intelligent re-triggering method for kinetic energy switch scene control obtains the target status of each smart device based on the query of the scene database, and based on the comparison of the target status with the status database, when the target status does not match the status database, broadcasts the instructions of the corresponding smart device to avoid sending instructions to the smart device when the target status is consistent with the current status of the smart device, which can effectively reduce the sending of invalid instructions, and also avoid conflicts between scene switching and the individual control of each smart device.
[0011] According to one aspect of the present invention, the present invention provides a device monitoring and intelligent re-triggering method for kinetic energy switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic energy switch scene control comprises the steps of:
[0012] A. A self-generating switch sends a control signal in one direction;
[0013] B. A gateway receives the control signal and uploads it to a server;
[0014] C. The server queries a scenario database to retrieve scenario information corresponding to the control signal received in step A, wherein the scenario database is established based on a matching relationship between the corresponding control signal and the corresponding scenario information, wherein the scenario information includes a target state of each smart device corresponding to the scenario information;
[0015] D. According to the scene information retrieved in step C, the gateway broadcasts instructions to each smart device corresponding to the scene information;
[0016] E. Check whether the state of the smart device is updated to the target state. If not, return to step D.
[0017] In one embodiment, after step E returns to step D three times, if the check result of step E is still no, the corresponding smart device is recorded as offline and the process stops returning to step D.
[0018] In one embodiment, step D comprises the steps of:
[0019] D1. Obtaining the target state of each smart device based on the scenario information;
[0020] D2. Comparing the target state with a state database, wherein the state database is established based on the current state of the smart device;
[0021] D3. Broadcasting instructions to the smart device corresponding to the target state not matching the current state.
[0022] In one embodiment, step E is configured to start timing based on the broadcast instruction of step D. When the timing time is greater than N, if the state of the smart device is not updated to the target state, the process returns to step D.
[0023] In one embodiment, step E checks whether the status of the smart device is updated by comparing the target status with the status database.
[0024] In one embodiment, the state database is updated when the state of the smart device changes, comprising the steps of:
[0025] Ⅰ. The smart device uploads status information;
[0026] II. The state information is stored in the state database as the current state. When the state of the smart device is changed, the current state is updated. When the state of the smart device is unchanged, the current state remains unchanged.
[0027] In one embodiment, step I is triggered to be executed after the smart device receives the instruction sent in step D, and step E is executed in real time when the number of smart devices is greater than or equal to 3.
[0028] In one embodiment, the step of generating a signal by the self-generating switch includes:
[0029] S1, a key is pressed to generate the first signal;
[0030] S2, the button is reset to generate a second signal;
[0031] S3. Calculate the time difference between the first signal and the second signal. If the time difference is outside a preset time period, determine that the key is long pressed. If the time difference is within the preset time period, determine that the key is single pressed.
[0032] S4. Identify the corresponding control signal based on the pressing condition of the button.
[0033] In one embodiment, when the number of keys pressed in step S1 is greater than 1, step S1 and step S2 generate the first signal and the second signal for each key respectively, step S3 determines the pressing status of each key based on the first signal and the second signal of each key, and step S4 identifies the corresponding control signal based on the pressing status of all keys.
[0034] According to another aspect of the present invention, the present invention provides a device monitoring and intelligent re-triggering system for kinetic energy switch scene control, wherein the device monitoring and intelligent re-triggering system for kinetic energy switch scene control includes:
[0035] a self-generating switch, wherein the self-generating switch sends a control signal unidirectionally;
[0036] a gateway, wherein the gateway is communicatively connected to the self-generating switch and receives the control signal;
[0037] a server, wherein the gateway is communicatively connected to the server and uploads the control signal to the server, wherein the server includes a scenario database, wherein the scenario database is established based on a matching relationship between corresponding control signals and corresponding scenario information, wherein the scenario information includes a target state of each smart device corresponding to the scenario information, wherein the server retrieves the scenario information corresponding to the control signal transmitted by the gateway from the scenario database, and issues a command corresponding to the scenario information to the gateway; and
[0038] A smart device, wherein the gateway is communicatively connected to the smart device and broadcasts the instruction, wherein the server checks whether the current state of the smart device is the target state, and if not, the gateway broadcasts the instruction again.
[0039] In one embodiment, when the gateway broadcasts the instruction three times, if the check result is still negative, the corresponding smart device is recorded as offline and the broadcasting of the instruction is stopped.
[0040] In one embodiment, the server obtains the target state of each smart device based on the scene information, compares the target state with a state database, where the state database is established based on the current state of the smart device, and sends instructions to the gateway for the corresponding smart device whose target state does not match the current state, where the gateway broadcasts the instructions to the corresponding smart device.
[0041] In one embodiment, the server starts timing based on the gateway broadcasting the instruction. When the timing time is greater than N, if the state of the smart device is not updated to the target state, the gateway broadcasts the instruction again.
[0042] In one embodiment, the smart device performs corresponding working state adjustments after receiving the instruction and sends a state information to the gateway. The gateway triggers ACK confirmation upon receiving the state information. If the confirmation is successful, the state information is stored in the state database as the current state. If the confirmation fails, a retry is performed. When the number of retries reaches 3 and the confirmation still fails, the corresponding smart device is marked as an abnormal state.
[0043] In one embodiment, the server checks whether the status of the smart device is updated based on a comparison between the target status and the current status in the status database.
[0044] In one embodiment, the self-generating switch has at least one button, wherein the self-generating switch generates a first signal when the button is pressed and generates a second signal when the button is reset, wherein the gateway calculates the time difference between the first signal and the second signal, and when the time difference is outside a preset time length, it is determined that the button is long pressed, and when the time difference is within the preset time length, it is determined that the button is pressed once, and the gateway uploads the corresponding control signal to the server based on the pressing condition of the button.
[0045] In one embodiment, the number of the keys is greater than 1, and pressing each key generates the first signal and the second signal corresponding to the key. The gateway determines the pressing status of each key based on the first signal and the second signal of each key, and uploads the corresponding control signal based on the pressing status of all the keys.
[0046] Further objects and advantages of the present invention will be fully apparent from an understanding of the following description and accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 Schematic diagram of an application scenario of a device monitoring and intelligent re-triggering system for kinetic switch scenario control according to an embodiment of the present invention.
[0048] Figure 2 1 is a schematic diagram of the working process of a device monitoring and intelligent re-triggering method for kinetic energy switch scene control according to the above embodiment of the present invention.
[0049] Figure 31 is a flowchart of the instruction issuance and status checking workflow of the device monitoring and intelligent re-triggering method for the kinetic energy switch scene control according to the above embodiment of the present invention.
[0050] Figure 4 1 is a schematic diagram of a workflow of a server checking whether the status of a smart device is updated in the device monitoring and intelligent re-triggering system for the kinetic energy switch scene control according to the above embodiment of the present invention.
[0051] Figure 5 1 is a schematic diagram of the working process of the intelligent device of the device monitoring and intelligent re-triggering system of the kinetic energy switch scene control according to the above embodiment of the present invention after receiving an instruction.
[0052] Figure 6 1 is a schematic diagram of a workflow for a gateway of the device monitoring and intelligent re-triggering system for kinetic energy switch scene control to check the working status of an intelligent device according to the above embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following description is intended to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are for illustrative purposes only, and those skilled in the art will readily appreciate other obvious variations. The basic principles of the present invention defined in the following description may be applied to other embodiments, variations, improvements, equivalents, and other technical solutions that do not depart from the spirit and scope of the present invention.
[0054] Those skilled in the art should understand that, in the disclosure of the present invention, the terms "longitudinal", "transverse", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like to indicate orientations or positional relationships are based on the orientations or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the above terms should not be understood as limiting the present invention.
[0055] It is to be understood that the term "one" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element may be one, while in another embodiment, the number of the elements may be multiple, and the term "one" should not be understood as a limitation on the quantity.
[0056] With reference to the accompanying drawings of the present invention Figures 1 to 6According to an embodiment of the present invention, an application scenario and a workflow of a device monitoring and intelligent re-triggering system for kinetic energy switch scene control are illustrated respectively, wherein the device monitoring and intelligent re-triggering system for kinetic energy switch scene control includes a gateway 10, a server 20, a self-generating switch 30 and a smart device 40, wherein the self-generating switch 30 sends a control message unidirectionally, wherein the gateway 10 is communicatively connected to the self-generating switch 30 and receives the control message, wherein the gateway 10 is communicatively connected to the server 20 and uploads the received control message to the server 20, wherein the server 20 recognizes the control message to activate the corresponding smart scene and sends a control instruction to the gateway 10, wherein the gateway 10 broadcasts the instruction, and the corresponding smart device 40 performs the corresponding working state adjustment after receiving the corresponding instruction, wherein after the instruction is broadcast, the server 20 further checks whether the state of the smart device 40 is updated to identify whether the scene switching is completed.
[0057] The self-generating switch 30 generates a kinetic energy emission signal when pressed, and uploads different key values by short pressing and long pressing. Specifically, the self-generating switch 30 has at least one button, wherein the self-generating switch 30 generates a first signal when the button is pressed and a second signal when the button is reset, wherein the gateway 10 calculates the time difference between the first signal and the second signal, and when the time difference is outside a preset time length, it is judged that the button is long pressed, and when the time difference is within the preset time length, it is judged that the button is pressed once, so that the self-generating switch can judge short presses and long presses without having to continuously identify the pressing of the button for a long time, and wherein the gateway 10 uploads the corresponding control signal to the server 20 based on the pressing of the button.
[0058] It is worth mentioning that in order to enrich the number of instructions, the number of buttons of the self-generating switch 30 is set to be greater than 1, and the pressing of each button generates the first signal and the second signal corresponding to the button respectively. The gateway 10 judges the pressing status of each button based on the first signal and the second signal of each button, and uploads the corresponding control signal based on the pressing status of all the buttons. That is to say, the self-generating switch 30 can generate different control signals by pressing different buttons in combination to enrich the number of instructions and meet the scene switching requirements.
[0059] Furthermore, the server 20 creates different scenarios to match different key values to trigger different scenarios. Specifically, the server 20 includes a scenario database, wherein the scenario database is established based on the matching relationship between corresponding control signals and corresponding scenario information, wherein the scenario information includes the target state of each smart device under the corresponding scenario information, and the server 20 retrieves the scenario information corresponding to the control signal transmitted by the gateway 10 from the scenario database and issues a command corresponding to the scenario information to the gateway 10, wherein the gateway 10 is communicatively connected to the smart device 40 and broadcasts the command. After the broadcast, the server 20 checks whether the current state of the smart device 40 is the target state. If not, the gateway 10 broadcasts the command again to prevent scene switching failures caused by packet loss. In other words, the device monitoring and intelligent re-triggering system of the kinetic switch scene control automatically checks the device status and automatically re-broadcasts the command, ensuring seamless scene switching and avoiding scene switching failures caused by the self-generating switch 30 being unable to receive feedback information from the device due to prolonged power outage.
[0060] refer to Figure 3 After receiving the control signal and identifying the corresponding scene information, the server 20 issues instructions in batches, wherein the instructions generate instruction queues according to the smart device group, and group and merge the batch instructions, such as merging switch instructions and taking the final value of the adjustment instructions, thereby effectively reducing the amount of broadcast data. The gateway 10 broadcasts the instruction. After broadcasting the instruction, the server 20 checks whether the smart device 40 has successfully received the instruction. The server 20 includes a status database, wherein the status database is established based on the current status of the smart device 40, that is, the status database stores the current status of the smart device 40. After receiving the instruction broadcast by the gateway 10, the smart device 40 executes the instruction and reports the status. The server 20 receives the status reported by the smart device 40 and updates the status database, thereby determining that the smart device 40 has successfully received the instruction. If the smart device 40 does not upload the status after a timeout, the server 20 controls the gateway 10 to broadcast the instruction again. In other words, the server 20 starts a timer based on the instruction broadcast by the gateway 10. When the timer is greater than N, if the status of the smart device 40 has not been updated, the gateway broadcasts the instruction again to prevent scene switching failures caused by packet loss. After the timer is determined to have not updated the status of the smart device 40, the server broadcasts the instruction again to avoid repeated instruction transmission due to device status update delays or network problems that cause the status of the smart device 40 to be not updated immediately.
[0061] In particular, when the gateway 10 broadcasts the instruction again three times, if the result of checking the status update of the smart device 40 is still no, the corresponding smart device 40 is marked as offline and the broadcast of the instruction is stopped. In this way, when the instruction is broadcast a limited number of times and the status of the smart device is not updated, the smart device is marked as offline, avoiding repeated broadcasting of instructions to occupy network resources. That is, after the gateway 10 broadcasts the instruction again, it will check again whether the status of the smart device 40 is updated. If not, the instruction will be broadcast again, and repeated three times. If the corresponding smart device 40 still does not upload the status, it is determined that the smart device 40 is offline. In this way, the instruction will be broadcast again within a limited number of times, so as to avoid the scene switching failure caused by packet loss based on the rebroadcast of the instruction when the status of the smart device 40 is not updated, and mark the smart device as offline when the instruction is broadcast a limited number of times and the status of the smart device 40 is not updated, avoiding repeated broadcasting of instructions to occupy network resources.
[0062] refer to Figure 4 , wherein the workflow of the server 20 checking whether the status of the smart device 40 is updated is illustrated, wherein after the instruction is broadcast, the server 20 polls the time series database, that is, compares the target status with the current status of the status database to determine whether the device status is updated. If the target status matches the current status, it means that the device status has been updated and the update control command status is successful. If the target status does not match the current status, it means that the device status has not been updated, the instruction is reissued, and the instruction log is updated to record the number of times the instruction is reissued.
[0063] refer to Figure 5 If the smart device 40 successfully receives the instruction, the smart device 40 will execute the instruction and start polling, collect various working data to determine the working status, and perform data verification. If the data verification is successful, the status information will be reported to the gateway 10, wherein the smart device 40 reports the status information to the gateway 10 via wireless protocols such as ZigBee and WiFi.
[0064] refer to Figure 6 When the gateway 10 receives the data, it triggers the ACK confirmation. If the confirmation is successful, the data is written into the database and uploaded to the server 20 to store the status information in the status database as the current status. If the confirmation fails, a retry is performed. When the number of retries reaches 3 and the confirmation still fails, the corresponding smart device 40 is marked as an abnormal state.
[0065] It is worth mentioning that after the server 20 determines the scene information according to the control information, it compares the target state corresponding to the scene information with the current state in the state database. When the target state matches the current state, it is judged that the state of the smart device 40 of the target state and the current state does not need to be changed. When the target state is inconsistent with the current state, it is judged that the state of the smart device 40 of the target state and the current state needs to be changed, and the gateway 10 sends the corresponding instruction of the smart device 40 whose target state does not match the current state, wherein the gateway 10 broadcasts the instruction of the corresponding smart device, thereby reducing the number of the broadcasted instructions, so as to avoid sending instructions to the smart device 40 when the target state is consistent with the current state of the smart device, and can effectively reduce the sending of invalid instructions. At the same time, it also avoids conflicts between scene switching and individual control of each smart device. For example, in some usage scenarios, the smart device 40 has been turned on separately. If the target state is also that the smart device 40 is turned on, the gateway 10 will broadcast the switch instruction of the smart device 40 based on the target state, and the smart device 40 will be turned off. Therefore, based on the comparison between the target state and the current state, the present invention can ensure that the control of the smart device 40 meets the requirements of scene switching.
[0066] To further understand the present invention, the present invention also provides a device monitoring and intelligent re-triggering method for kinetic energy switch scene control, wherein the device monitoring and intelligent re-triggering method for kinetic energy switch scene control comprises the following steps:
[0067] A. A self-generating switch 30 sends a control signal in one direction;
[0068] B. A gateway 10 receives the control signal and uploads it to a server 20;
[0069] C. The server 20 queries a scenario database to retrieve scenario information corresponding to the control signal received in step A, wherein the scenario database is established based on a matching relationship between the corresponding control signal and the corresponding scenario information, wherein the scenario information includes a target state of each smart device corresponding to the scenario information;
[0070] D. According to the scene information retrieved in step C, the gateway 10 broadcasts instructions to each smart device 40 corresponding to the scene information;
[0071] E. Check whether the state of the smart device 40 is updated to the target state. If not, return to step D, thereby preventing scene switching failure caused by packet loss based on the re-broadcast of the instruction.
[0072] It is worth mentioning that after step E returns to step D three times, if the check result of step E is still no, the corresponding smart device 40 is recorded as offline and the return to step C is stopped, thereby avoiding repeated broadcasting of instructions to occupy network resources.
[0073] In particular, wherein said step D comprises the steps of:
[0074] D1. Obtaining the target state of each smart device 40 according to the scene information;
[0075] D2. Comparing the target state with a state database, wherein the state database is established based on the current state of the smart device 40 , i.e., the state database stores the current state of the smart device 40 ;
[0076] D3. Broadcast instructions to the smart device corresponding to the target state that does not match the current state, thereby helping to reduce the number of broadcast instructions, avoiding sending instructions to the smart device 40 when the target state is consistent with the current state of the smart device 40, and effectively reducing the sending of invalid instructions.
[0077] It is worth mentioning that step E is set to start timing based on the broadcast instruction of step D. When the timing time is greater than N, if the status of the smart device 40 is not updated to the target status, it returns to step D, so as to determine that the status of the smart device 40 has not been updated after timing and broadcast the instruction again, thereby avoiding repeated sending of instructions due to device status update delay or network reasons causing the status of the smart device 40 to not be updated immediately.
[0078] In particular, in step D, instructions corresponding to the scene information are obtained according to the scene information retrieved in step C, and the instructions generate an instruction queue according to the smart device group, and batch instructions are grouped and merged, such as merging switch instructions and taking final values of value adjustment instructions, thereby effectively reducing the amount of broadcast data.
[0079] It is worth mentioning that step E checks whether the status of the smart device is updated by comparing the target status with the status database. After receiving the instruction broadcast by the gateway 10, the smart device 40 executes the instruction and reports the status. The server 20 receives the status reported by the smart device 40 and updates the status database, then it is judged that the smart device 40 has successfully received the instruction. If the smart device 40 times out and fails to upload the status, it is judged that the smart device 40 has not received the instruction.
[0080] That is, the state database is updated when the state of the smart device changes, including the steps of:
[0081] Ⅰ. The smart device 40 uploads a status message;
[0082] II. The state information is stored in the state database as the current state. When the state of the smart device 40 is changed, the current state is updated. When the state of the smart device 40 is unchanged, the current state remains unchanged.
[0083] Step I is triggered and executed after the smart device 40 receives the instruction sent in step D.
[0084] It is worth mentioning that in the scenario where the number of the smart devices 40 is large, in order to ensure the status update of each of the smart devices 40, the device monitoring and intelligent re-triggering method of the kinetic switch scene control monitors the device status in real time and triggers the re-execution mechanism according to the device status. For example, when the number of the smart devices 40 is greater than or equal to 3, the device monitoring and intelligent re-triggering method of the kinetic switch scene control executes step E in real time.
[0085] The self-generating switch 30 generates a kinetic energy emission signal when pressed, and uploads different key values by short pressing and long pressing. Specifically, the step of generating the control signal by the self-generating switch 30 includes:
[0086] S1, a key is pressed to generate the first signal;
[0087] S2, the button is reset to generate a second signal;
[0088] S3. Calculate the time difference between the first signal and the second signal. If the time difference is outside a preset time period, determine that the key is long pressed. If the time difference is within the preset time period, determine that the key is single pressed.
[0089] S4. Sending the corresponding control signal based on the pressing condition of the button.
[0090] In particular, in order to enrich the number of instructions, the number of buttons of the self-generating switch 30 is set to be greater than 1, and when the number of buttons pressed in step S1 is greater than 1, step S1 and step S2 generate the first signal and the second signal for each button respectively, step S3 judges the pressing status of each button based on the first signal and the second signal of each button, and step S4 sends the corresponding control signal based on the pressing status of all buttons. That is to say, the self-generating switch 30 can generate different control signals by pressing different buttons in combination to enrich the number of instructions and meet the scene switching requirements.
[0091] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0092] Those skilled in the art will appreciate that the embodiments of the present invention described above and shown in the accompanying drawings are intended to be illustrative only and are not intended to limit the present invention. The objectives of the present invention have been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and illustrated in the embodiments. Any variations or modifications may be made to the embodiments of the present invention without departing from the principles described.
Claims
1. A multi-device scenario control method for a self-generating switch, characterized in that: include: A. A self-generating switch sends a control signal in one direction; B. A gateway receives the control signal and uploads it to a server; C. The server queries a scenario database to retrieve scenario information corresponding to the control signal received in step A, wherein the scenario database is established based on a matching relationship between the corresponding control signal and the corresponding scenario information, wherein the scenario information includes a target state of each smart device corresponding to the scenario information; D. According to the scene information retrieved in step C, the gateway broadcasts instructions to each smart device corresponding to the scene information; E. Check whether the state of the smart device is updated to the target state. If not, return to step D.
2. The multi-device scenario control method for a self-generating switch according to claim 1, wherein after step E returns to step D three times, if the check result of step E is still no, the corresponding smart device is recorded as offline and the process stops returning to step D.
3. The multi-device scenario control method of the self-generating switch according to claim 2, wherein the step D comprises the steps of: D1. Obtaining the target state of each smart device based on the scenario information; D2. Comparing the target state with a state database, wherein the state database is established based on the current state of the smart device; D3. Broadcasting instructions to the smart device corresponding to the target state not matching the current state.
4. The multi-device scenario control method of the self-generating switch according to claim 3, wherein the step E is set to start timing based on the broadcast instruction of the step D, and when the timing time is greater than N, if the state of the smart device is not updated to the target state, then return to step D.
5. The multi-device scenario control method of the self-generating switch according to claim 4, wherein the step E checks whether the status of the smart device is updated by comparing the target status with the status database.
6. The multi-device scenario control method of a self-generating switch according to claim 5, wherein the state database is updated when the state of the smart device changes, comprising the steps of: Ⅰ. The smart device uploads status information; II. The state information is stored in the state database as the current state. When the state of the smart device is changed, the current state is updated. When the state of the smart device is unchanged, the current state remains unchanged.
7. The multi-device scenario control method for a self-generating switch according to claim 6, wherein step I is triggered to be executed after the smart device receives the instruction sent in step D, and wherein step E is executed in real time when the number of smart devices is greater than or equal to 3.
8. The multi-device scene control method of the self-generating switch according to claim 1, wherein the step of generating a signal by the self-generating switch comprises: S1, a key is pressed to generate the first signal; S2, the button is reset to generate a second signal; S3. Calculate the time difference between the first signal and the second signal. If the time difference is outside a preset time period, determine that the key is long pressed. If the time difference is within the preset time period, determine that the key is single pressed. S4. Identify the corresponding control signal based on the pressing condition of the button.
9. The multi-device scenario control method of the self-generating switch according to claim 8, wherein when the number of the buttons pressed in step S1 is greater than 1, steps S1 and S2 generate the first signal and the second signal for each button respectively, step S3 determines the pressing status of each button based on the first signal and the second signal of each button, and step S4 identifies the corresponding control signal based on the pressing status of all buttons.
10. A multi-device scenario control system for a self-generating switch, characterized in that: include: a self-generating switch, wherein the self-generating switch sends a control signal unidirectionally; a gateway, wherein the gateway is communicatively connected to the self-generating switch and receives the control signal; a server, wherein the gateway is communicatively connected to the server and uploads the control signal to the server, wherein the server includes a scenario database, wherein the scenario database is established based on a matching relationship between corresponding control signals and corresponding scenario information, wherein the scenario information includes a target state of each smart device corresponding to the scenario information, wherein the server retrieves the scenario information corresponding to the control signal transmitted by the gateway from the scenario database, and issues a command corresponding to the scenario information to the gateway; and A smart device, wherein the gateway is communicatively connected to the smart device and broadcasts the instruction, wherein the server checks whether the current state of the smart device is the target state, and if not, the gateway broadcasts the instruction again.
11. The multi-device scenario control system of the self-generating switch according to claim 10, wherein when the gateway broadcasts the instruction again for three times, if the check result is still negative, the corresponding smart device is recorded as offline and the broadcasting of the instruction is stopped.
12. The multi-device scenario control system of the self-generating switch according to claim 11, wherein the server obtains the target state of each smart device based on the scenario information, compares the target state with a state database, wherein the state database is established based on the current state of the smart device, and sends instructions to the gateway for the corresponding smart device whose target state does not match the current state, wherein the gateway broadcasts the instructions to the corresponding smart device.
13. The multi-device scenario control system of the self-generating switch according to claim 12, wherein the server starts timing based on the gateway broadcasting the instruction, and when the timing time is greater than N, if the state of the smart device is not updated to the target state, the gateway broadcasts the instruction again.
14. The multi-device scenario control system of the self-generating switch according to claim 13, wherein the smart device performs corresponding working state adjustments after receiving the instruction and sends a state information to the gateway. The gateway triggers ACK confirmation upon receiving the state information. If the confirmation is successful, the state information is stored in the state database as the current state. If the confirmation fails, a retry is performed. When the number of retries reaches 3 and the confirmation still fails, the corresponding smart device is marked as an abnormal state. 15 . The multi-device scenario control system of the self-generating switch according to claim 14 , wherein the server checks whether the status of the smart device is updated based on the comparison between the target status and the current status of the status database.
16. A multi-device scene control system of a self-generating switch according to claim 10, wherein the self-generating switch has at least one button, wherein the self-generating switch generates a first signal when the button is pressed and generates a second signal when the button is reset, wherein the gateway calculates the time difference between the first signal and the second signal, and when the time difference is outside a preset time length, it is judged that the button is long pressed, and when the time difference is within the preset time length, it is judged that the button is pressed once, wherein the gateway uploads the corresponding control signal to the server based on the pressing condition of the button.
17. The multi-device scenario control system of the self-generating switch according to claim 16, wherein the number of the buttons is greater than 1, and pressing each of the buttons generates the first signal and the second signal corresponding to the button respectively, and the gateway determines the pressing status of each button based on the first signal and the second signal of each button, and uploads the corresponding control signal based on the pressing status of all the buttons.