Device control method, intelligent switch and control system

CN117666400BActive Publication Date: 2026-10-23HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211057141.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-10-23
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

[0005]本申请提供一种设备控制方法、智能开关及控制系统,解决了相关技术中智能开关控制灯具的开启或关闭存在一定的延迟的问题

Benefits of technology

[0078]可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117666400B_ABST
    Figure CN117666400B_ABST
Patent Text Reader

Abstract

The application is suitable for the terminal technical field, and provides a device control method, an intelligent switch and a control system. The method comprises the following steps: in response to state switching triggered for the intelligent switch, adjusting the relay state of each relay in the intelligent switch according to an initial correspondence between the device state and the relay state; if the device state of the electrical device does not change, determining an actual correspondence between the device state and the relay state according to the initial correspondence; and adjusting the relay state of each relay in the intelligent switch according to the actual correspondence. The method provided in the application embodiment determines the actual correspondence between the lamp state and the relay state through twice acquisition of the lamp state, so that the lamp is controlled according to the actual correspondence, the time spent by the intelligent switch in controlling the lamp can be reduced, and the efficiency and accuracy of the intelligent switch in controlling the lamp are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart home technology, and in particular to a device control method, a smart switch and a control system. Background Technology

[0002] With the continuous development of smart home technology, smart switches have also emerged. Smart home devices can be connected to smart switches, and the smart switches can be used to control the smart home devices to start or stop.

[0003] In related technologies, taking the connection between smart switches and lighting fixtures as an example, such as... Figure 1 As shown, the wiring of the mechanical switch needs to be adjusted first to ensure that the smart switch is always powered on. When the state of the mechanical switch changes, that is, when the mechanical switch switches between L1 and L1S, the smart switch can detect the change in potential at the mechanical switch through the voltage detection module, thereby determining that the state of the mechanical switch has changed. Then, the processor can control the smart switch to conduct, realizing the control of the lamp.

[0004] However, since smart switches control the lights to turn on or off based on changes in the electrical potential at the mechanical switch, there is a certain delay. Summary of the Invention

[0005] This application provides a device control method, an intelligent switch, and a control system, which solves the problem of a certain delay in the intelligent switch control of lighting fixtures to turn on or off in related technologies.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] A first aspect provides a device control method applied to a smart switch, the smart switch being connected to electrical equipment, the smart switch including multiple relays, the method comprising:

[0008] In response to a state switch triggered by the smart switch, the relay state of each relay in the smart switch is adjusted according to the initial correspondence between the device state and the relay state;

[0009] If the equipment status of the electrical equipment has not changed, then the actual correspondence between the equipment status and the relay status is determined according to the initial correspondence.

[0010] Based on the actual correspondence, the relay state of each relay in the smart switch is adjusted;

[0011] If the device state of the electrical equipment changes, the initial correspondence is determined as the actual correspondence between the device state and the relay state.

[0012] By acquiring the status of the lighting fixtures and adjusting the relay status based on the triggered status switching action, combined with the initial correspondence between the lighting fixture status and the relay status, the status of the relay in the smart switch is adjusted. Then, the lighting fixture status is acquired again, and the actual correspondence between the lighting fixture status and the relay status is determined based on the two acquired lighting fixture statuses. The lighting fixtures are then controlled based on the actual correspondence, which can reduce the time spent by the smart switch in controlling the lighting fixtures and improve the efficiency and accuracy of the smart switch in controlling the lighting fixtures.

[0013] In a first possible implementation of the first aspect, before adjusting the relay state of each relay in the smart switch according to an initial correspondence between device states and relay states in response to a state switch triggered by the smart switch, the method further includes:

[0014] After detecting that the smart switch is powered on, the device status of the electrical equipment is obtained;

[0015] Establish the initial correspondence between the device status and the relay status.

[0016] Based on the first possible implementation of the first aspect, in the second possible implementation of the first aspect, the device state is an on state or an off state, and the relay state is an on state or an off state.

[0017] The establishment of the initial correspondence between device status and relay status includes:

[0018] Obtain the default state of each of the relays, which is either an on or off state;

[0019] Based on the device status of the electrical equipment, a first mapping relationship is established between the device status and the default status of each of the relays;

[0020] Based on the target state of the electrical equipment, a second mapping relationship is established between the target state and the non-default state of each of the relays, wherein the non-default state is the relay state opposite to the default state, and the target state is the state of the electrical equipment opposite to the equipment state;

[0021] The initial correspondence is obtained by combining the first mapping relationship and the second mapping relationship.

[0022] By acquiring the device status after the smart switch is powered on and establishing an initial correspondence between the device status and the relay status, the relay status can be adjusted through this initial correspondence, thereby improving the efficiency of adjusting the device status of electrical equipment.

[0023] Moreover, by establishing the first mapping relationship and the second mapping relationship, when it is necessary to adjust the initial correspondence relationship, the adjustment of the initial correspondence relationship can be completed conveniently and quickly based on the first mapping relationship and the second mapping relationship, which can improve the efficiency of determining the actual correspondence relationship.

[0024] In a third possible implementation of the first aspect, the device state is either an on state or an off state, and the relay state is either an on state or an off state.

[0025] The step of determining the actual correspondence between device states and relay states based on the initial correspondence includes:

[0026] Replace the device state corresponding to the default state of each relay in the initial correspondence with the target state of the electrical equipment, and replace the target state corresponding to the non-default state of each relay in the initial correspondence with the device state of the electrical equipment to obtain the actual correspondence;

[0027] Wherein, the non-default state is the relay state opposite to the default state, and the target state is the state of the electrical device opposite to the device state.

[0028] Based on any possible implementation of the first aspect, in a fourth possible implementation of the first aspect, adjusting the relay state of each relay in the smart switch according to the actual correspondence includes:

[0029] Determine the target state of the electrical equipment, wherein the target state is the opposite of the current state of the equipment;

[0030] Based on the actual correspondence, multiple target relay states that match the target state are obtained, and each target relay state corresponds one-to-one with each relay.

[0031] Each of the target relays is adjusted according to its state.

[0032] Based on the fourth possible implementation of the first aspect, in the fifth possible implementation of the first aspect, the adjustment of each of the target relays according to each of the target relay states includes:

[0033] Based on the target state, a priority relay state is selected from a plurality of target relay states, and the priority relay state is used to adjust the electrical equipment to switch to the target state;

[0034] Adjust the priority relay corresponding to the priority relay state according to the priority relay state;

[0035] Adjustments are made to the other relays among the multiple target relay states, excluding the priority relay state.

[0036] By determining the priority relay status and priority relays, and adjusting the status of each target relay according to the priority relay status and priority relays, the time spent switching equipment status can be reduced, and the efficiency of switching equipment status can be improved.

[0037] Based on any possible implementation of the first aspect, in a sixth possible implementation of the first aspect, the smart switch and the electrical device are further connected to a mechanical switch, and the method includes:

[0038] Detect the state transition triggered by the mechanical switch;

[0039] In response to the state switch triggered by the mechanical switch, the actual correspondence is updated.

[0040] By testing the mechanical switches, the actual correspondence can be updated in a timely manner, avoiding errors in the actual correspondence and improving the reliability and stability of the smart switches during normal operation.

[0041] Based on any possible implementation of the first aspect, in the seventh possible implementation of the first aspect, after adjusting the relay state of each relay in the smart switch according to the actual correspondence, the method further includes:

[0042] The state transition triggered by the mechanical switch or the smart switch is detected again;

[0043] In response to the state switching triggered by the mechanical switch or the smart switch, the relay state of each relay in the smart switch is adjusted according to the actual correspondence.

[0044] Secondly, a device control apparatus is provided, the apparatus comprising:

[0045] An adjustment module is used to adjust the relay state of each relay in the smart switch in response to a state switch triggered by the smart switch, based on the initial correspondence between the device state and the relay state.

[0046] The determination module is used to determine the actual correspondence between the device state and the relay state based on the initial correspondence if the device state of the electrical equipment has not changed.

[0047] The adjustment module is also used to adjust the relay state of each relay in the smart switch according to the actual correspondence;

[0048] The determining module is also used to determine the initial correspondence as the actual correspondence between the device state and the relay state if the device state of the electrical equipment changes.

[0049] In a first possible implementation of the second aspect, the device further includes:

[0050] The acquisition module is used to acquire the device status of the electrical equipment after detecting that the smart switch is powered on;

[0051] The module is used to establish the initial correspondence between device status and relay status.

[0052] Based on the first possible implementation of the second aspect, in the second possible implementation of the second aspect, the device state is either an on state or an off state, and the relay state is either an on state or an off state.

[0053] The module is specifically used to obtain a pre-set default state for each relay, which is either an on or off state; establish a first mapping relationship between the device state and the default state of each relay based on the device state of the electrical equipment; establish a second mapping relationship between the target state and the non-default state of each relay based on the target state of the electrical equipment, where the non-default state is the relay state opposite to the default state and the target state is the state of the electrical equipment opposite to the device state; and combine the first and second mapping relationships to obtain the initial correspondence.

[0054] In the third possible implementation of the second aspect, the device is in an on state or an off state, and the relay is in an on state or an off state.

[0055] The determining module is specifically used to replace the device state corresponding to the default state of each relay in the initial correspondence with the target state of the electrical device, and to replace the target state corresponding to the non-default state of each relay in the initial correspondence with the device state of the electrical device, thereby obtaining the actual correspondence.

[0056] The non-default state is the relay state opposite to the default state, and the target state is the state of the electrical device opposite to the device state.

[0057] Based on any possible implementation of the second aspect, in the fourth possible implementation of the second aspect, the adjustment module is specifically used to determine the target state of the electrical equipment, which is the state of the electrical equipment opposite to the state of the equipment; according to the actual correspondence, obtain a plurality of target relay states that match the target state, each target relay state corresponding one-to-one with each relay; and adjust each relay according to each target relay state.

[0058] Based on the fourth possible implementation of the second aspect, in the fifth possible implementation of the second aspect, the adjustment module is further specifically configured to select a priority relay state from a plurality of target relay states according to the target state, the priority relay state being used to adjust the electrical equipment to switch to the target state; adjust the priority relay corresponding to the priority relay state according to the priority relay state; and adjust the other relays from the plurality of target relay states other than the priority relay state according to the other target relay states from the plurality of target relay states other than the priority relay state.

[0059] Based on any possible implementation of the second aspect, in a sixth possible implementation of the second aspect, the smart switch and the electrical device are further connected to a mechanical switch, and the device further includes:

[0060] The first detection module is used to detect the state switching triggered by the mechanical switch.

[0061] The update module is used to update the actual correspondence in response to the state switch triggered by the mechanical switch.

[0062] Based on any possible implementation of the second aspect, in the seventh possible implementation of the second aspect, the device further includes:

[0063] The second detection module is used to detect the state transition triggered by the mechanical switch or the smart switch again.

[0064] The adjustment module is also used to adjust the relay state of each relay in the smart switch according to the actual correspondence in response to the state switch triggered by the mechanical switch or the smart switch.

[0065] Thirdly, a smart switch is provided, the smart switch comprising: a processor, a device status judgment module, multiple magnetic latching relays, an open-state power supply module and a closed-state power supply module;

[0066] The processor is connected to the device status judgment module, the open-state power supply module, and the closed-state power supply module respectively. The plurality of magnetic latching relays are connected to the open-state power supply module and the closed-state power supply module respectively. The device status judgment module is also connected to a voltage acquisition point, which is the potential between the plurality of magnetic latching relays and the open-state power supply module.

[0067] The device status determination module is used to determine the device status of the electrical equipment connected to the smart switch, and the processor is used to adjust the relay status of the plurality of magnetic latching relays according to the device status determined by the device status determination module.

[0068] In a first possible implementation of the third aspect, the device status determination module includes: a switching device, an energy storage capacitor, a voltage divider resistor, and a pull-up resistor;

[0069] The voltage divider resistor is connected in series between the control terminal of the switching device and the voltage acquisition point. The pull-up resistor is connected in series between the first terminal of the switching device and the power supply voltage. The energy storage capacitor is connected in series between the voltage acquisition point and the ground potential. The first terminal of the switching device is connected to the processor, and the second terminal of the switching device is connected to the ground potential.

[0070] In a second possible implementation of the third aspect, the device status determination module includes: a comparison module, an energy storage capacitor, and a voltage divider resistor;

[0071] The positive input terminal of the comparison module is connected to the reference voltage, the negative input terminal of the comparison module is connected to the voltage acquisition point, and the output terminal of the comparison module is connected to the processor.

[0072] The voltage divider resistors are connected in series between the positive input terminal of the comparator module and the reference voltage, and in series between the negative input terminal of the comparator module and the voltage acquisition point.

[0073] The energy storage capacitor is connected in series between the voltage acquisition point and the ground potential.

[0074] Fourthly, a control system is provided, the control system comprising: electrical equipment, intelligent switches, and mechanical switches;

[0075] The electrical equipment is connected in series with the smart switch and the mechanical switch respectively. The mechanical switch is used to adjust the equipment state of the electrical equipment, and the smart switch is used to adjust the equipment state of the electrical equipment according to the equipment control method as described in any one of the first aspects.

[0076] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the device control method as described in any one of the first aspects.

[0077] In a sixth aspect, a chip system is provided, the chip system including a memory and a processor, the processor executing a computer program stored in the memory to implement the device control method as described in any one of the first aspects.

[0078] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0079] Figure 1 This is a schematic diagram of a scenario for a smart switch provided in related technologies;

[0080] Figure 2A A circuit diagram of a conventional control system provided for an embodiment of this application;

[0081] Figure 2B A circuit diagram of an intelligent control system provided in an embodiment of this application;

[0082] Figure 2C A circuit diagram of an intelligent control system provided in an embodiment of this application;

[0083] Figure 3 This is a schematic diagram illustrating the application of a single-wire intelligent switch.

[0084] Figure 4A A schematic diagram of a double-pole single-control scenario based on a single-wire intelligent switch provided in this application embodiment;

[0085] Figure 4B A schematic diagram of another single-pole dual-control scenario based on a single-fire type smart switch provided in this application embodiment;

[0086] Figure 4C A circuit architecture diagram of a lamp status determination module provided in an embodiment of this application;

[0087] Figure 4D A circuit architecture diagram of another lamp status determination module provided in an embodiment of this application;

[0088] Figure 5 A schematic flowchart illustrating a device control method provided in an embodiment of this application;

[0089] Figure 6 This is a structural block diagram of a device control apparatus provided in an embodiment of this application. Detailed Implementation

[0090] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known switch connection methods, switch state switching methods, device state switching methods, and electronic devices are omitted to avoid unnecessary detail from obscuring the description of this application.

[0091] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “the,” “the,” and “the” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise.

[0092] With the continuous development of science and technology, traditional electrical equipment is gradually evolving towards intelligence, resulting in an increasing number of smart home devices. Correspondingly, traditional switches for controlling electrical equipment (such as mechanical switches) are also gradually developing into smart switches. In smart home scenarios, smart switches can be connected to smart home devices, allowing for control of these devices.

[0093] The following describes the device control method, smart switch and control system provided in the embodiments of this application, taking lighting fixtures as an example of smart home devices.

[0094] See Figure 2A , Figure 2A A circuit diagram of a conventional control system provided in an embodiment of this application is shown below. Figure 2A As shown, this conventional control system includes two single-pole double-throw (SPD) switches, both of which are connected in series with the lighting fixture. The two SPD switches can be installed in different locations, allowing control of the same lighting fixture from different positions using both switches.

[0095] See Figure 2B , Figure 2B A circuit diagram of an intelligent control system provided in an embodiment of this application is shown below. Figure 2B As shown, this traditional control system includes one smart switch and two lamps. The smart switch can integrate two relays to form two independent single-pole single-throw switches, so that the connected lamps can be controlled through each relay.

[0096] It should be noted that when connecting a mechanical switch to a light fixture, it only needs to be connected in series with the live wire. However, when replacing a mechanical switch with a smart switch, the smart switch also needs to be connected to the neutral (N) wire to ensure continuous power supply. However, in practical applications, due to wiring limitations, the switch slot where the mechanical switch is installed does not have a neutral wire, requiring adjustments to the wiring when replacing it with a smart switch.

[0097] Therefore, single-wire smart switches that only need to be connected to the live wire (L) have gradually emerged. That is, single-wire smart switches that can work normally simply by being connected in series between the live wire and the light fixture.

[0098] See Figure 2C , Figure 2C A circuit diagram of an intelligent control system provided in an embodiment of this application is shown below. Figure 2C As shown, this traditional control system includes one single-wire intelligent switch and one lamp, with the single-wire intelligent switch and the lamp connected in series.

[0099] The single-wire intelligent switch may include: a magnetic latching relay, a closed-state power supply module, an open-state power supply module, and a processor. The single-wire intelligent switch can use the power provided by the closed-state power supply module or the open-state power supply module, and the processor can turn the magnetic latching relay on or off to control the lighting fixture.

[0100] In summary, in smart home scenarios, mechanical switches have gradually evolved into smart switches. Considering the impact of indoor circuit wiring, single-wire smart switches have emerged based on smart switches. This allows for the convenient replacement of existing mechanical switches with single-wire smart switches, which in turn control smart home devices.

[0101] The following section provides a further introduction to single-wire intelligent switches.

[0102] See Figure 3 , Figure 3 This is a schematic diagram of an application of a single-wire intelligent switch, such as... Figure 3 As shown, the single-wire intelligent switch is connected in series with the mechanical switch and the light fixture. By adjusting the wiring method of the mechanical switch, the single-wire intelligent switch is always kept energized.

[0103] When the mechanical switch switches between L1 and L2, the potential at the mechanical switch will fluctuate. The single-wire intelligent switch can detect this fluctuation through a pre-set voltage detection module, and then control the single-wire intelligent switch to turn on or off through the processor, thereby realizing the control of the lamp.

[0104] During use, the aforementioned single-wire intelligent switch needs to detect potential fluctuations at the mechanical switch and then control the switch to turn on or off based on these fluctuations, thereby controlling the light fixture to be on or off. However, the single-wire intelligent switch requires a certain amount of time to turn the light fixture on or off after the above operation, resulting in a delay in turning the light fixture on or off.

[0105] Therefore, this application proposes a single-wire intelligent switch. By setting a correspondence between the lamp status and the relay status in the single-wire intelligent switch, the single-wire intelligent switch can, after detecting a user-triggered operation, perform an operation to change the lamp status based on this correspondence and the current status of the lamp, that is, adjust the relay status to complete the control of the lamp. This can reduce the time spent by the single-wire intelligent switch to turn the lamp on or off, and improve the efficiency and accuracy of the single-wire intelligent switch in controlling the lamp.

[0106] The following describes the lighting control scenarios involved in a single-wire intelligent switch provided in the embodiments of this application. See also... Figure 4A , Figure 4A This application provides a schematic diagram of a scenario for a double-pole single-controllability scenario based on a single-wire intelligent switch, as shown in the embodiment of the present application. Figure 4A As shown, this double-pole single-control scenario may include: a single-wire smart switch 410, a lamp A 420, and a lamp B 430.

[0107] One end of lamp A 420 and one end of lamp B 430 are both connected to the neutral wire, and the other end of lamp A 420 and the other end of lamp B 430 are both connected to the single-wire intelligent switch 410, which is also connected to the live wire.

[0108] Furthermore, the single-wire intelligent switch 410 may include: a processor 4101, a magnetic latching relay A 4102, a magnetic latching relay B 4103, a closed-state power supply module 4104, and an open-state power supply module 4105.

[0109] The processor 4101 may include a wireless communication system, enabling it to access the wireless network of the current environment. Furthermore, the single-wire smart switch 410 is equipped with multiple diodes to prevent backflow of current.

[0110] Specifically, such as Figure 4AAs shown, lamp A 420 can be connected to magnetic latching relay A 4102 and closed-state power supply module 4104 respectively, lamp B 430 can be connected to magnetic latching relay B 4103 and closed-state power supply module 4104 respectively, magnetic latching relay A 4102 and magnetic latching relay B 4103 can both be connected to open-state power supply module 4105, open-state power supply module 4105 is also connected to the live wire, closed-state power supply module 4104 and open-state power supply module 4105 are both connected to processor 4101.

[0111] The processor 4101 can control the lamp A420 to turn on or off by controlling the magnetic latching relay A 4102 to turn it on or off. Similarly, the processor 4101 can control the lamp B 430 to turn on or off by controlling the magnetic latching relay B 4103 to turn it on or off.

[0112] based on Figure 4A The dual-opening single-control scenario shown in the previous embodiment is further illustrated in this application, which proposes a single-opening dual-control scenario. See [link to previous embodiment]. Figure 4B , Figure 4B This application provides another scenario illustration of a single-pole dual-control scenario based on a single-wire intelligent switch, as shown in the embodiment of the present application. Figure 4B As shown, the double-pole single-control scenario may include: a single-fire type smart switch 410, a lamp A 420, and a mechanical switch 430, wherein the mechanical switch 430 is a single-pole double-throw switch.

[0113] One end of the lamp A 420 is connected to the neutral wire, and the other end of the lamp A 420 is connected to the mechanical switch 430. The mechanical switch 430 is connected to the single-wire intelligent switch 410, and the single-wire intelligent switch 410 is also connected to the live wire.

[0114] Furthermore, the single-wire intelligent switch 410 may include: a processor 4101, a magnetic latching relay A 4102, a magnetic latching relay B 4103, a closed-state power supply module 4104, an open-state power supply module 4105, and a lamp status judgment module 4106.

[0115] Among them, such as Figure 4B The single-fire type smart switch 410 shown is Figure 4A The single-wire smart switch 410 shown is similar and will not be described in detail here.

[0116] It should be noted that, as Figure 4BThe single-wire smart switch 410 shown incorporates a lamp status determination module 4106. The processor 4101 can determine whether lamp A 420 is currently on or off based on the lamp status determination module 4106. Then, by combining this with the on / off states of magnetic latching relays A 4102 and B 4103, a correspondence between the lamp status and the relay states is established. Subsequently, when a triggering operation to turn the lamp on or off is detected, the corresponding relay state can be determined based on the lamp status in the correspondence. The processor 4101 then adjusts magnetic latching relays A 4102 and B 4103 so that the adjusted relay states correspond to the lamp status indicated by the triggered operation.

[0117] Among them, such as Figure 4C As shown, the lamp status determination module 4106 may include: a switching device 4106a, an energy storage capacitor 4106b, a voltage divider resistor 4106c, and a pull-up resistor 4106d.

[0118] Among them, the voltage divider resistor 4106c is connected in series between the control terminal of the switching device 4106a and the voltage acquisition point (e.g., Figure 4B Between the connection point shown to the on-state power supply module 4105, a pull-up resistor 4106d is connected in series between the first terminal of the switching device 4106a and the supply voltage (VCC), and the second terminal of the switching device 4106a is connected to the ground potential (GND).

[0119] Furthermore, the energy storage capacitor 4106b can be connected in series between the voltage acquisition point and the ground potential, and the first terminal of the switching device 4106a can be connected to... Figure 4B The processor 4101 shown is connected.

[0120] During operation, both the single-wire intelligent switch 410 and the lamp A420 are connected to the AC power grid. The direction of the current flowing through the single-wire intelligent switch 410 and the lamp A420 changes continuously with the cycle of the AC power.

[0121] If lamp A420 is on and AC current flows from the neutral wire to the live wire, the voltage gradually increases, charging the energy storage capacitor 4106b during this process, keeping the control terminal of the switching device 4106a at a high potential. When the voltage reaches the rated voltage of the single-wire intelligent switch 410, the switch 410 controls the switching device in the on-state power module 4105 to conduct, allowing AC current to flow through the switching device 4106a to the live wire, ceasing to charge the energy storage capacitor 4106b. The energy storage capacitor 4106b then continues to discharge, maintaining the control terminal of the switching device 4106a at a high potential until the next AC cycle begins.

[0122] It should be noted that the aforementioned switching device 4106a can be a transistor, a metal oxide semiconductor field effect transistor (MOSFET), or other devices with switching functions. This application embodiment does not limit the switching device 4106a.

[0123] For example, when the switching device 4106a is a transistor, the control terminal of the switching device 4106a can be the base of the transistor, the first terminal of the switching device 4106a can be the collector of the transistor, and the second terminal of the switching device 4106a can be the emitter of the transistor.

[0124] Alternatively, when the switching device 4106a is a MOSFET, the control terminal of the switching device 4106a can be the gate of the MOSFET, the first terminal of the switching device 4106a can be the drain or source of the MOSFET, and the second terminal of the switching device 4106a can be the source or drain of the MOSFET.

[0125] In addition, the above-mentioned lamp status judgment module 4106 may also include: a filter capacitor 4106e and a filter resistor 4106f. Both the filter capacitor 4106e and the filter resistor 4106f can be connected in series between the control terminal of the switching device 4106a and the ground potential, so that spikes, glitches and noise in the AC power can be filtered through the filter capacitor 4106e and the filter resistor 4106f.

[0126] In addition, in practical applications, the lamp status judgment module 4106 can also be constructed using other components, such as... Figure 4D As shown, the lamp status determination module 4106 may include: a comparison module 4106a, an energy storage capacitor 4106b, and a voltage divider resistor 4106c.

[0127] In this module, the positive input terminal of the 4106a comparator is connected to the reference voltage, and the negative input terminal of the 4106a comparator is connected to the voltage acquisition point (e.g., ...). Figure 4B The connection point shown is connected to the power-on module 4105 (indicated by the connection point shown), and the output terminal of the comparison module 4106a is connected to... Figure 4B The processor 4101 shown is connected.

[0128] Furthermore, the voltage divider resistor 4106c can be connected in series between the positive input terminal of the comparator module 4106a and the reference voltage (Vref), and in series between the negative input terminal of the comparator module 4106a and the voltage acquisition point. Additionally, the energy storage capacitor 4106b is connected in series between the voltage acquisition point and ground potential (GND).

[0129] Among them, such as Figure 4D The working process of the lamp status judgment module 4106 shown above is the same as that described above. Figure 4C The working process of the lamp status judgment module 4106 shown is similar, and will not be described again here.

[0130] It should be noted that during operation, the comparison module 4106a can compare the potential of the voltage acquisition point with the reference potential. If the potential of the voltage acquisition point is less than the reference potential, the signal output by the comparison module 4106a indicates that the lamp A420 is in the off state; if the potential of the voltage acquisition point is greater than or equal to the reference potential, the signal output by the comparison module 4106a indicates that the lamp A420 is in the on state.

[0131] The comparison module 4106a can be a comparator, a comparison circuit composed of various components, or other circuit modules with comparison functions. This application embodiment does not limit the comparison module 4106a.

[0132] Furthermore, during the process of adjusting the state of the lamps described above, the lamp A420 can be controlled by a mechanical switch 430, a single-wire smart switch 410, or a terminal device wirelessly connected to the single-wire smart switch 410, based on an application installed on the terminal device. This application embodiment does not limit the method of controlling the state of the lamps.

[0133] Figure 5 This is a schematic flowchart illustrating a device control method provided in an embodiment of this application. It is intended as an example and not a limitation. This method can be applied to the aforementioned single-wire smart switch (hereinafter referred to as a smart switch). For simplicity, this embodiment uses a lamp as a smart home device for illustration. See [link to documentation]. Figure 5 The method includes:

[0134] Step 501: After detecting that the smart switch is powered on, obtain the status of the lamp.

[0135] In a smart home scenario, smart switches need to connect to lighting fixtures via pre-installed wiring within the smart home environment to control the lights. However, the smart home environment must be powered off before connecting the smart switch to the lights to ensure the safety of the connection.

[0136] Correspondingly, once the smart switch and the light fixture are connected, the smart home scenario can restore power, thus supplying power to the smart switch. After detecting power, the smart switch can determine the light fixture's status through a pre-set light fixture status judgment module.

[0137] The status of the light fixture can be either on or off.

[0138] For example, a smart switch can use a lamp status judgment module to detect the potential at the lamp power supply module. If the detected potential is high, it can be determined that the lamp is on, indicating that the lamp is illuminating; if the detected potential is low, it can be determined that the lamp is off, indicating that the lamp is not illuminating.

[0139] Step 502: In response to the triggered state switching action, adjust the state of the relay in the smart switch according to the initial correspondence between the state of the lamp and the state of the relay.

[0140] The state switching action is a user-triggered action used to switch the state of the lighting fixture. Furthermore, this state switching action can be triggered by a smart switch, a mechanical switch, or an application installed on the terminal device; this embodiment does not limit the specific triggering action.

[0141] After power is supplied to the smart switch, the smart switch can detect user-triggered state switching actions. If a user-triggered state switching action is detected, the smart switch can respond to the action by triggering a state switching mechanism. Based on the pre-set initial correspondence between the lamp state and the relay state, the state of each relay in the smart switch is adjusted to switch the lamp state.

[0142] Specifically, after detecting a triggered state switching action, the smart switch can initiate a state switch and determine a target state opposite to the lamp state determined in step 501. Then, the smart switch can obtain the initial correspondence between the lamp state and the relay state, find the relay state corresponding to the target state from the initial correspondence, and adjust the relays of the smart switch according to the found relay state, so that the adjusted relay state is consistent with the relay state corresponding to the target state.

[0143] It should be noted that, with Figure 4B Taking the single-fire type smart switch with two magnetic latching relays as an example, in the process of obtaining the initial correspondence, the smart switch can establish the correspondence between the lamp state and the default state of the relay based on the lamp state obtained in step 501, that is, establish the initial correspondence.

[0144] Optionally, the smart switch can acquire the pre-set default state of each relay. Then, based on the lamp's state, the smart switch can establish a first mapping relationship between the lamp's state and the default state of each relay, and based on the lamp's target state, establish a second mapping relationship between the target state and the non-default state of each relay. Finally, the smart switch can combine the first and second mapping relationships to obtain an initial correspondence.

[0145] The default state of a relay can be either on or off, while the non-default state is the opposite of the default state.

[0146] For example, the default state of two magnetic latching relays can be 1A2B, where the numbers "1" and "2" represent the serial numbers of the two magnetic latching relays, the letter "A" indicates that the magnetic latching relay is in the connected state, and the letter "B" indicates that the magnetic latching relay is in the off state. Therefore, 1A2B can represent magnetic latching relay number 1 (e.g., ...). Figure 4B The magnetic latching relay A shown is in the connected state, and the magnetic latching relay No. 2 (as shown) is in the connected state. Figure 4B The magnetic latching relay B shown is in the off state.

[0147] If the smart switch determines in step 501 that the light fixture is in the on state, the smart switch can establish an initial correspondence between the on state and 1A2B, and an initial correspondence between the off state and 1B2A. Similarly, if the smart switch determines in step 501 that the light fixture is in the off state, the smart switch can establish an initial correspondence between the off state and 1A2B, and an initial correspondence between the on state and 1B2A.

[0148] Correspondingly, if in step 501 the smart switch determines that the lamp is in the on state and the initial correspondence is: the on state corresponds to 1A2B and the off state corresponds to 1B2A, then after detecting the triggered state switching action, the smart switch can determine the off state as the target state of the lamp, and adjust the two magnetic latching relays of the smart switch according to 1B2A corresponding to the off state in the initial correspondence, so that the two magnetic latching relays are in the 1B2A state after adjustment.

[0149] Step 503: Determine if the status of the lighting fixtures has changed.

[0150] After the smart switch adjusts the relay, it can obtain the lamp status again to determine whether the lamp status has changed after adjusting the relay status in the smart switch in step 502. That is, it determines whether the adjustment of the relay status is effective, so that in subsequent steps, the actual correspondence between the lamp status and the relay status can be determined based on the judgment result.

[0151] The process of the smart switch acquiring the lamp status in step 503 is similar to that in step 501, and will not be described again here.

[0152] Specifically, after the smart switch acquires the lamp status again, it can compare the acquired lamp status with the lamp status acquired in step 501 to determine whether the lamp status has changed. If the lamp status has changed, it means that the smart switch's adjustment of the relay status is effective, and the smart switch can proceed to step 504; if the lamp status has not changed, it means that the smart switch's adjustment of the relay status is ineffective, and the smart switch can proceed to step 505.

[0153] For example, the on state of a light fixture can be represented by "1" and the off state can be represented by "0". If the light fixture state obtained by the smart switch in step 501 is 0, and the light fixture state obtained again in step 503 is 1, then after comparing the two obtained light fixture states, the smart switch can determine that the light fixture state has changed, and the smart switch can effectively adjust the state of the relay.

[0154] Step 504: If the status of the lamp changes, the initial correspondence is determined as the actual correspondence, and the state switching action triggered again is detected.

[0155] Corresponding to step 503, after the smart switch determines that the state of the lamp has changed, the smart switch can determine that the initial correspondence is accurate. Without adjusting the initial correspondence, the smart switch can determine the initial correspondence as the actual correspondence between the state of the lamp and the state of the relay. This allows the smart switch to adjust the state of the relay according to the actual correspondence and complete the control of the lamp.

[0156] It should be noted that in practical applications, lighting fixtures can be controlled not only through smart switches, but also through applications installed on terminal devices, and even through mechanical switches. Therefore, during the continued monitoring of state transitions, if the smart switch detects a change in the state of the mechanical switch, it can adjust the relay state accordingly to coordinate with the mechanical switch in controlling the lighting fixture. Furthermore, the smart switch can update the actual correspondence between the lighting fixture state and the relay state.

[0157] Specifically, the smart switch can monitor the potential changes at the mechanical switch. If a change in potential is detected at the mechanical switch, it can be determined that the state of the mechanical switch has changed, and the user has triggered a state switching action of turning the light on or off by the mechanical switch.

[0158] Correspondingly, the smart switch can adjust the state of the relay according to the established actual correspondence, so as to cooperate with the mechanical switch to adjust the state of the lamp. Moreover, the smart switch also needs to update the actual correspondence so that after the state of the mechanical switch changes, the smart switch can continue to control the lamp according to the updated actual correspondence.

[0159] For example, corresponding to the example in step 502, if the actual correspondence between the determined lamp state and the relay state includes: the on state corresponds to 1A2B and the off state corresponds to 1B2A, then after the smart switch detects a change in the state of the mechanical switch, it can adjust the states of the two relays and update the actual correspondence to obtain the updated actual correspondence, which includes: the on state corresponds to 1B2A and the off state corresponds to 1A2B.

[0160] Step 505: If the status of the lamp has not changed, determine the actual correspondence between the lamp status and the relay status based on the initial correspondence.

[0161] Conversely, if the smart switch determines that the state of the lamp has not changed, it means that the initial correspondence obtained is incorrect and needs to be adjusted to obtain the actual correspondence between the lamp state and the relay state, so that the smart switch can control the lamp according to the actual correspondence.

[0162] Correspondingly, during the adjustment of the initial correspondence, if the smart switch includes two relays, the smart switch can swap the relay state corresponding to the light fixture's on state with the relay state corresponding to the light fixture's off state to obtain the actual correspondence between the light fixture's state and the relay state.

[0163] Optionally, the smart switch can replace the device state corresponding to the default state of each relay in the initial correspondence with the target state of the lamp, and replace the target state corresponding to the non-default state of each relay in the initial correspondence with the lamp state, thus obtaining the actual correspondence between the lamp state and the relay state.

[0164] For example, corresponding to the example in step 502, if the initial correspondence between the lamp state and the relay state includes: the on state corresponds to 1A2B and the off state corresponds to 1B2A, and the lamp state does not change after executing step 502, then the smart switch can adjust the on state to correspond to 1B2A and the off state to correspond to 1A2B according to the initial correspondence, thereby obtaining the actual correspondence.

[0165] It should be noted that in practical applications, if the state of the lamp does not change after the relay state of the smart switch is adjusted, it means that the state of the relay in the smart switch has not actually changed during the execution of step 502, but has maintained its original state. That is, the state that the smart switch needs the relay to reach in step 502 is the current state of the relay, so that the current state of the relay can be determined.

[0166] Step 506: Adjust the state of the relay in the smart switch according to the actual correspondence.

[0167] The adjustment process for the relay in step 506 is similar to the adjustment process for the relay in step 502, and will not be described again here.

[0168] It should be noted that in practical applications, smart switches can adjust the states of the various relays in the smart switch in different sequences. Therefore, when the smart switch adjusts the states of the relays again, it can prioritize adjusting the relays that can change the state of the light fixture.

[0169] Optionally, the smart switch can obtain multiple target relay states that match the target state of the lamp according to the actual correspondence, and then adjust each relay according to each target relay state.

[0170] The target relay state indicates the current state of each relay in the smart switch after the light fixture switches to the target state. Furthermore, each target relay state corresponds one-to-one with each relay.

[0171] During the adjustment of each relay, the smart switch can select a priority relay state from multiple target relay states based on the target state, and then adjust the priority relay corresponding to that priority relay state. Afterwards, it adjusts the other relays from the multiple target relay states, excluding the priority relay state.

[0172] The priority relay status is used to adjust the switching of the lamp to the target status, and the relay corresponding to the priority relay status is the priority relay.

[0173] Specifically, the smart switch can determine the target state of the lamp in step 502 based on the current state of the relay and the actual correspondence, and then find the target relay state corresponding to each relay in the actual correspondence.

[0174] If the smart switch includes two magnetic latching relays, the smart switch can determine, based on the target relay state corresponding to each magnetic latching relay, whether to adjust one of the two magnetic latching relays to the on state and the other relay to the off state.

[0175] If the target state of the light fixture is "on," then it's necessary to first determine the status of the priority relay among the two magnetically latched relays, based on their current states. Then, the priority relay is adjusted to its "on" state, creating a circuit between it and the light fixture, thus turning it on. Therefore, a smart switch can first determine the priority relay, then adjust it from "off" to "on," and finally adjust the other relay from "on" to "off," quickly turning on the light fixture and reducing the switch's latency.

[0176] Similarly, if the target state of the light fixture is to be off, it is also necessary to first determine the state of the priority relay and the priority relay state among the two magnetic latching relays based on their current states. Then, the priority relay is adjusted to the priority relay state, that is, adjusted to the off state, so that the priority relay is disconnected from the light fixture, thereby turning off the light fixture. Therefore, the smart switch can first determine the priority relay, then adjust the priority relay from the on state to the off state, and then adjust the other relay from the off state to the on state, thereby quickly turning off the light fixture and reducing the delay time of the smart switch.

[0177] For example, corresponding to the example in step 505, the actual correspondence between the lamp state and the relay state includes: the on state corresponds to 1B2A, and the off state corresponds to 1A2B. If the triggered state switching action indicates that the lamp is turned on, then the target state of the lamp is the on state, and the target relay state corresponding to the target state is 1B2A. The smart switch can first determine that the conducting state is the priority relay state, and determine that the No. 2 magnetic latching relay is the priority relay. Then, the No. 2 magnetic latching relay can be adjusted from the off state to the conducting state to form the relay state 1A2A, and then the No. 1 magnetic latching relay can be adjusted from the conducting state to the off state, so that the two relays reach the state 1B2A.

[0178] Similarly, if the triggered state switching action indicates that the light fixture is off, then the target state of the light fixture is off. The relay state corresponding to the target state is 1A2B. The smart switch can first determine that the off state is the priority relay state, and determine that the No. 2 magnetic latching relay is the priority relay. Then, the No. 2 magnetic latching relay can be adjusted from the on state to the off state, forming a relay state of 1B2B. Then, the No. 1 magnetic latching relay can be adjusted from the off state to the on state, so that the two relays reach the 1A2B state.

[0179] It should be noted that in practical applications, when a smart switch adjusts the state of two relays, after adjusting the state of one relay, it can wait a certain period of time before adjusting the state of the other relay to improve the reliability of the relay state adjustment. For example, after adjusting the state of one relay, the smart switch can wait a millisecond-level interval (such as 100 to 200 milliseconds) before adjusting the state of the other relay.

[0180] Step 507: Detect the state switching action that is triggered again.

[0181] The process of detecting the re-triggered state switching action in step 507 is similar to the process of detecting the re-triggered state switching action in step 504, and will not be described again here.

[0182] It should be noted that in practical applications, in smart home scenarios, there may be situations where smart switches are installed, or there may be situations where the smart home scenario loses power. In both cases, it is necessary to re-power the smart switch. In this case, the smart switch can execute steps 501 to 507 again to control the smart home devices through the smart switch.

[0183] In summary, the device control method provided in this application obtains the lamp status, adjusts the relay status in the smart switch based on the triggered state switching action and the initial correspondence between the lamp status and the relay status, and then obtains the lamp status again. Based on the two obtained lamp statuses, the actual correspondence between the lamp status and the relay status is determined, and the lamp is controlled according to the actual correspondence. This reduces the time spent by the smart switch in controlling the lamp and improves the efficiency and accuracy of the smart switch in controlling the lamp.

[0184] Moreover, during the process of adjusting the relay states, the smart switch can determine the order in which to adjust the states of each relay based on the state of the relay corresponding to the target state in the actual correspondence, combined with the target state of the lamp. Then, by adjusting the states of the relays in the determined order, the time required for the lamp to switch to the target state can be further reduced, thereby improving the efficiency of lamp control.

[0185] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0186] Corresponding to the device control method described in the above embodiments, Figure 6 This is a structural block diagram of a device control apparatus provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.

[0187] Reference Figure 6 The device includes:

[0188] The adjustment module 601 is used to adjust the relay state of each relay in the smart switch according to the initial correspondence between the device state and the relay state in response to the state switching triggered by the smart switch.

[0189] The determination module 602 is used to determine the actual correspondence between the equipment state and the relay state based on the initial correspondence if the equipment state of the electrical equipment has not changed.

[0190] The adjustment module 601 is also used to adjust the relay state of each relay in the smart switch according to the actual correspondence;

[0191] The determining module 602 is further configured to, if the equipment state of the electrical equipment changes, determine the initial correspondence as the actual correspondence between the equipment state and the relay state.

[0192] Optionally, the device may also include:

[0193] The acquisition module 603 is used to acquire the device status of the electrical device after detecting that the smart switch is powered on;

[0194] Module 604 is used to establish the initial correspondence between the device status and the relay status.

[0195] Optionally, the device status is either on or off, and the relay status is either on or off.

[0196] The establishment module 604 is specifically used to obtain a pre-set default state for each of the relays, which is either an on or off state; establish a first mapping relationship between the device state and the default state of each relay based on the device state of the electrical equipment; establish a second mapping relationship between the target state and the non-default state of each relay based on the target state of the electrical equipment, where the non-default state is the relay state opposite to the default state and the target state is the state of the electrical equipment opposite to the device state; and combine the first mapping relationship and the second mapping relationship to obtain the initial correspondence.

[0197] Optionally, the device status is either on or off, and the relay status is either on or off.

[0198] The determining module 602 is specifically used to replace the device state corresponding to the default state of each relay in the initial correspondence with the target state of the electrical device, and to replace the target state corresponding to the non-default state of each relay in the initial correspondence with the device state of the electrical device, so as to obtain the actual correspondence.

[0199] The non-default state is the relay state opposite to the default state, and the target state is the state of the electrical device opposite to the device state.

[0200] Optionally, the adjustment module 601 is specifically used to determine the target state of the electrical equipment, which is the opposite state of the electrical equipment; according to the actual correspondence, obtain multiple target relay states that match the target state, with each target relay state corresponding to each relay; and adjust each relay according to each target relay state.

[0201] Optionally, the adjustment module 601 is further configured to: select a priority relay state from a plurality of target relay states according to the target state, the priority relay state being used to adjust the electrical equipment to switch to the target state; adjust the priority relay corresponding to the priority relay state according to the priority relay state; and adjust the other relays from the plurality of target relay states other than the priority relay state according to the other target relay states from the plurality of target relay states other than the priority relay state.

[0202] Optionally, the smart switch and the electrical device are also connected to a mechanical switch, and the device further includes:

[0203] The first detection module 605 is used to detect the state switching triggered by the mechanical switch.

[0204] The update module 606 is used to update the actual correspondence in response to the state switch triggered by the mechanical switch.

[0205] Optionally, the device may also include:

[0206] The second detection module 607 is used to detect the state switching triggered by the mechanical switch or the smart switch again.

[0207] The adjustment module 601 is also configured to adjust the relay state of each relay in the smart switch according to the actual correspondence in response to the state switching triggered by the mechanical switch or the smart switch.

[0208] In summary, the device control apparatus provided in this application obtains the lamp status, and adjusts the relay status in the smart switch based on the triggered state switching action and the initial correspondence between the lamp status and the relay status. Then, it obtains the lamp status again, thereby determining the actual correspondence between the lamp status and the relay status based on the two obtained lamp statuses. This allows for control of the lamp based on the actual correspondence, reducing the time spent by the smart switch in controlling the lamp and improving the efficiency and accuracy of the smart switch in controlling the lamp.

[0209] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0210] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0211] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0212] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0213] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0214] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0215] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to the smart switch, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0216] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A device control method, characterized in that, Applied to a smart switch connected to electrical equipment, the smart switch includes multiple relays, and the method includes: In response to a state switch triggered by the smart switch, the relay state of each relay in the smart switch is adjusted according to the initial correspondence between the device state and the relay state; If the equipment status of the electrical equipment has not changed, then the actual correspondence between the equipment status and the relay status is determined according to the initial correspondence. Based on the actual correspondence, the relay state of each relay in the smart switch is adjusted; If the device state of the electrical equipment changes, the initial correspondence is determined as the actual correspondence between the device state and the relay state.

2. The method according to claim 1, characterized in that, Before adjusting the relay state of each relay in the smart switch according to the initial correspondence between the device state and the relay state in response to a state switch triggered by the smart switch, the method further includes: After detecting that the smart switch is powered on, the device status of the electrical equipment is obtained; Establish the initial correspondence between the device status and the relay status.

3. The method according to claim 2, characterized in that, The device status is either in the start state or the stop state, and the relay status is either in the on state or the off state; The establishment of the initial correspondence between device status and relay status includes: Obtain the default state of each of the relays, which is either an on or off state; Based on the device status of the electrical equipment, a first mapping relationship is established between the device status and the default status of each relay; Based on the target state of the electrical equipment, a second mapping relationship is established between the target state and the non-default state of each of the relays, wherein the non-default state is the relay state opposite to the default state, and the target state is the state of the electrical equipment opposite to the equipment state; The initial correspondence is obtained by combining the first mapping relationship and the second mapping relationship.

4. The method according to claim 1, characterized in that, The device status is either in the start state or the stop state, and the relay status is either in the on state or the off state; The step of determining the actual correspondence between device states and relay states based on the initial correspondence includes: Replace the device state corresponding to the default state of each relay in the initial correspondence with the target state of the electrical equipment, and replace the target state corresponding to the non-default state of each relay in the initial correspondence with the device state of the electrical equipment to obtain the actual correspondence; Wherein, the non-default state is the relay state opposite to the default state, and the target state is the state of the electrical device opposite to the device state.

5. The method according to any one of claims 1 to 4, characterized in that, The step of adjusting the relay state of each relay in the smart switch according to the actual correspondence includes: Determine the target state of the electrical equipment, wherein the target state is the opposite of the current state of the equipment; Based on the actual correspondence, multiple target relay states that match the target state are obtained, and each target relay state corresponds one-to-one with each relay. Each of the target relays is adjusted according to its state.

6. The method according to claim 5, characterized in that, The step of adjusting each of the target relays according to each target relay state includes: Based on the target state, a priority relay state is selected from a plurality of target relay states, and the priority relay state is used to adjust the electrical equipment to switch to the target state; Adjust the priority relay corresponding to the priority relay state according to the priority relay state; Adjustments are made to the other relays among the multiple target relay states, excluding the priority relay state.

7. The method according to any one of claims 1 to 4, characterized in that, The smart switch and the electrical device are also connected to a mechanical switch, and the method includes: Detect the state transition triggered by the mechanical switch; In response to the state switch triggered by the mechanical switch, the actual correspondence is updated.

8. The method according to any one of claims 1 to 4, characterized in that, After adjusting the relay state of each relay in the smart switch according to the actual correspondence, the method further includes: The state transition triggered by the mechanical switch or the smart switch is detected again; In response to the state switching triggered by the mechanical switch or the smart switch, the relay state of each relay in the smart switch is adjusted according to the actual correspondence.

9. A control system, characterized in that, The control system includes: electrical equipment, intelligent switches, and mechanical switches; The electrical equipment is connected in series with the intelligent switch and the mechanical switch respectively. The mechanical switch is used to adjust the equipment state of the electrical equipment, and the intelligent switch is used to adjust the equipment state of the electrical equipment according to the equipment control method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the device control method as described in any one of claims 1 to 8.

11. A chip system, characterized in that, The chip system includes a memory and a processor, the processor executing a computer program stored in the memory to implement the device control method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Single-live-wire intelligent switch and single-live-wire multi-control switch

    CN114844491A