Switch detection method, apparatus, device, medium, and program product

CN116699382BActive Publication Date: 2026-11-03NINGBO GONEO ELECTRIC APPLIANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310804024.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2026-11-03
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

When powered on, the relay cannot determine the contact position of the single-pole double-throw switch, causing the user to need to try external switches multiple times to determine the on and off state of the load, which is inefficient.

Method used

By setting a detection circuit in the loop, an electrical level signal is acquired to determine the on/off state of the status detection loop, and the relay switch is driven to the specified contact position. Combined with a random delay mechanism, the switch is automatically reset and the contact position is memorized for subsequent control.

Benefits of technology

It improves the efficiency of load status determination, reduces the number of trial and error attempts for users, saves energy, and improves interaction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116699382B_ABST
    Figure CN116699382B_ABST
Patent Text Reader

Abstract

The application discloses a switch detection method and device, equipment, medium and program product, relates to the electronic technical field, and the method is applied to a state detection loop, the state detection loop comprises a relay, at least one detection circuit, the relay comprises a multi-control switch group, the contact position of the switch in the multi-control switch group randomly jumps after the relay enters a power-on state, the multi-control switch group comprises a first switch and a second switch, and the method comprises the following steps: in response to the relay entering the power-on state, a first voltage signal detected by the detection circuit is acquired; a first state of the state detection loop is determined based on the first voltage signal; the contact position of the first switch is driven to a first direction contact; a second voltage signal detected by the detection circuit is acquired; and a second state of the state detection loop is determined based on the second voltage signal and the contact position of the first switch. The problem that the relay cannot determine the contact position of the switch when the power is just turned on can be solved, and the load state in the loop can be determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technology, and in particular to a switch detection method, apparatus, device, medium, and program product. Background Technology

[0002] A relay is an electronic control device commonly used in automatic control circuits. It acts as an "automatic switch" that uses a smaller current to control a larger current, playing roles such as automatic adjustment, safety protection, and circuit switching. A relay connects to a load to form a circuit. A relay includes at least one single-pole double-throw switch for controlling the circuit's on / off state; when the circuit is closed, the load is turned on, and when the circuit is closed, the load is turned off.

[0003] Users change the contact position of the relay's single-pole double-throw switch via an external switch, controlling the circuit to open / close and thus turning the load on / off. There is a one-to-one correspondence between the relay's single-pole double-throw switch and the external switch. When there are at least two external switches, the user can change the load state by triggering any one of them. Each triggering of an external switch changes the contact position of the relay's single-pole double-throw switch.

[0004] However, when the relay is first powered on, it cannot know the current contact position of the single-pole double-throw switch. When the user triggers an external switch, the single-pole double-throw switch of the relay corresponding to that external switch cannot determine which contact position to switch to. At this time, the user needs to try triggering the external switch multiple times to determine the on and off state of the load, which is inefficient. Summary of the Invention

[0005] This application provides a switch detection method, apparatus, device, medium, and program product capable of determining the position state of a multi-control switch in a relay and the load state in a circuit. The technical solution is as follows:

[0006] On the one hand, a switch detection method is provided, the method comprising:

[0007] In response to the relay entering the power-on state, the first level signal detected by the detection circuit is acquired;

[0008] The first state of the state detection circuit is determined based on the first level signal. The first state is used to indicate the load state and the conduction state of the state detection circuit.

[0009] Drive the contact position of the first switch to the first direction contact;

[0010] Obtain the second-level signal detected by the detection circuit;

[0011] The second state of the state detection circuit is determined based on the second level signal and the contact position of the first switch. The second state is used to represent the load state of the state detection circuit and the position state of the multi-control switch of the relay.

[0012] On the other hand, a switch detection device is provided, the device comprising:

[0013] The acquisition module, in response to the relay entering the power-on state, acquires the first level signal detected by the detection circuit;

[0014] The determination module determines a first state of the state detection circuit based on the first level signal. The first state is used to indicate the load state and the conduction state of the state detection circuit.

[0015] The driving module drives the contact position of the first switch to the first direction contact;

[0016] The acquisition module acquires the second level signal detected by the detection circuit.

[0017] The determining module determines the second state of the state detection circuit based on the second level signal and the contact position of the first switch. The second state is used to represent the load state of the state detection circuit and the position state of the multi-control switch of the relay.

[0018] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the switch detection method as described in any of the embodiments of this application above.

[0019] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the switch detection method as described in any of the embodiments of this application above.

[0020] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the switch detection methods described in the above embodiments.

[0021] The beneficial effects of the technical solutions provided in this application include at least the following:

[0022] In response to the relay entering the power-on state, a first-level signal detected by the detection circuit is acquired. Based on the first-level signal, the first state of the state detection loop is determined, enabling the detection circuit to initially determine the load state and conduction state of the state detection loop. The first switch contact is driven to the first directional contact. When the first switch contact is at the first directional contact, a second-level signal detected by the detection circuit is acquired. Based on the second-level signal and the contact position of the first switch, the second state of the state detection loop is determined. The second state represents the load state of the state detection loop and the multi-control switch position state of the relay. This solves the problem that the relay cannot determine the contact position of the switch when it is first powered on, and determines the load state in the loop, facilitating timely load replacement by the user. It also reduces the number of trial and error attempts when controlling the load to turn on and off, improving interaction efficiency. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of a switch detection method provided in an exemplary embodiment of this application;

[0025] Figure 2 This is a schematic diagram of a state detection loop including an off-state detection circuit provided in an exemplary embodiment of this application;

[0026] Figure 3 This is a schematic diagram of the signal of a detection circuit provided in an exemplary embodiment of this application;

[0027] Figure 4 This is a schematic diagram of a first type of multi-control switch position change provided in an exemplary embodiment of this application;

[0028] Figure 5 This is a schematic diagram of a second type of multi-control switch position change provided in an exemplary embodiment of this application;

[0029] Figure 6 This is a schematic diagram of a third type of multi-control switch position change provided in an exemplary embodiment of this application;

[0030] Figure 7 This is a schematic diagram of a fourth type of multi-control switch position change provided in an exemplary embodiment of this application;

[0031] Figure 8 This is a schematic diagram of a fifth type of multi-control switch position change provided in an exemplary embodiment of this application;

[0032] Figure 9 This is a schematic diagram illustrating the relationship between a first type of off-state detection circuit and its output signal provided in an exemplary embodiment of this application;

[0033] Figure 10 This is a schematic diagram illustrating the relationship between a second off-state detection circuit and its output signal, provided in an exemplary embodiment of this application.

[0034] Figure 11 This is a schematic diagram illustrating the relationship between a third off-state detection circuit and its output signal provided in an exemplary embodiment of this application;

[0035] Figure 12 This is a schematic diagram illustrating the relationship between a fourth off-state detection circuit and its output signal, provided in an exemplary embodiment of this application.

[0036] Figure 13 This is a schematic diagram illustrating the process of energizing the relay and determining the circuit state for the second to Nth times, provided in an exemplary embodiment of this application.

[0037] Figure 14 This is a schematic diagram of a state detection loop including a first off-state detection circuit and a second off-state detection circuit provided in an exemplary embodiment of this application;

[0038] Figure 15 This is a schematic diagram of a state detection loop where a level signal is high in the first off-state level signal and the second off-state level signal provided in another exemplary embodiment of this application;

[0039] Figure 16 This is a schematic diagram of a state detection loop including a first off-state detection circuit, a second off-state detection circuit, and a first on-state detection circuit, provided in an exemplary embodiment of this application;

[0040] Figure 17 This is a schematic diagram of a state detection loop provided in an exemplary embodiment of the present application when the first off-state level signal, the second off-state level signal, and the first on-state level signal have an off-state level signal that is high.

[0041] Figure 18 This is a schematic diagram of a state detection loop including a first open-state detection circuit provided in an exemplary embodiment of this application;

[0042] Figure 19 This is a schematic diagram of a state detection loop including a first open-state detection circuit and a first open-state detection circuit provided in an exemplary embodiment of this application;

[0043] Figure 20 This is a structural block diagram of a switch detection device provided in an exemplary embodiment of this application;

[0044] Figure 21 This is a structural block diagram of a switch detection device provided in another exemplary embodiment of this application;

[0045] Figure 22 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0048] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0049] It should be noted that all information and data involved in this application are authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0050] It should be understood that although the terms first, second, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0051] First, a brief introduction to the terms used in the embodiments of this application:

[0052] Load: A load is an electronic component connected across the power source in a circuit. If the two terminals of a power source are directly connected without a load, this connection is called a short circuit. Common loads include resistors, motors, and light bulbs—components that consume power. A load can also be a device that converts electrical energy into other forms of energy. An electric motor converts electrical energy into mechanical energy, a resistor converts electrical energy into heat energy, a light bulb converts electrical energy into heat and light energy, and a loudspeaker converts electrical energy into sound energy. Electric motors, resistors, light bulbs, and loudspeakers are all called loads.

[0053] A relay is an electrical control device that causes a predetermined step change in the controlled variable in the electrical output circuit when the change in the input quantity (excitation quantity) reaches a specified requirement. It has an interactive relationship between the control system (also known as the input circuit) and the controlled system (also known as the output circuit). It is commonly used in automated control circuits, and is essentially an "automatic switch" that uses a small current to control a large current. Therefore, it plays a role in automatic adjustment, safety protection, and circuit switching in circuits.

[0054] Transistor: A transistor, also known as a bipolar junction transistor (BJT), is a semiconductor device that controls current. Its function is to amplify weak signals into larger amplitude electrical signals; it is also used as a contactless switch. The transistor is one of the basic semiconductor components, possessing current amplification capabilities, and is a core component of electronic circuits.

[0055] A relay is connected to a load and forms a circuit with other electronic components. Each relay contains at least one single-pole double-throw (SPDT) switch, and each SPDT switch can change its contact position. When the relay is energized, it controls the circuit's opening or closing by changing the switch's contact position, thereby controlling the load's on or off state. When the circuit is open, the load is off; when the circuit is closed, the load is on.

[0056] A relay is connected to the load, and the relay includes a multi-control switch group. To improve the convenience of user control of the load, there can be multiple external switches, the number of which is the same as the number of switches in the relay, and they correspond one-to-one. Users can control the relay switches through the external switches (such as touch switches installed on the wall), thereby controlling the opening and closing of the load.

[0057] In related technologies, the position of external switches can be arbitrary. Taking a lighting fixture as an example, the lighting fixture has two external switches, external switch A and external switch B, located in different positions. External switch A corresponds to the first switch of the relay, and external switch B corresponds to the second switch of the relay. When the load and the relay are powered on, the user can control the load to turn on and off by pressing the external switches. If the load is in the off state, only one trigger operation is needed on either external switch, regardless of the current switch position, to change the load from the off state to the on state. For example, if the user triggers external switch A once, the first switch of the relay will correspondingly change the contact position once.

[0058] Due to the characteristics of multi-control switches, when a user triggers different external switches to control the load, there is no one-to-one correspondence between the switch position of each external switch and the state of the load. Similarly, there is no one-to-one correspondence between the contact position of the relay switch corresponding to the external switch and the state of the load. In this case, to change the on or off state of the load, it is only necessary to change the contact position of the relay switch. For example, if the relay switch's contact position is at the first contact position, then changing the contact position from the first contact position to the second contact position will change the state of the load.

[0059] However, when a relay is first powered on, it cannot determine the position of its contact points. When a user triggers an external switch to change the load state, although the relay only needs to turn the contact position of the relay switch corresponding to the external switch to the other side, it cannot determine the target contact position of the relay switch to change the load state because the relay cannot determine the current contact position of the relay switch.

[0060] In this application, a detection circuit is set in the circuit to detect the on / off state of the circuit. The circuit is determined to be on or off based on the signal output by the detection circuit. One switch in the multi-control switch group of the relay is then turned to a designated contact position. The contact position of the other switch is further determined based on the change in the signal output by the detection circuit. Once the relay determines the position state of the multi-control switches, the contact position of each switch is memorized. This allows the user to directly control the load on / off by triggering external switches based on the memorized contact positions.

[0061] In some embodiments, there are many interfering factors when determining the on / off state of a circuit. The on / off state can only be uniquely determined when a load exists in the circuit and is operating normally. To solve this problem, the solution provided in this application generates a random delay for the relay switch when it is first powered on. Each relay switch corresponds to a random delay, and these delays are not identical. Within their respective random delays, the contact positions of the relay switches randomly change to achieve automatic reset. Automatic reset means that when the relay is first powered on, regardless of the position of the external switch of the load, the relay switch changes its contact position, automatically turning off the load first. When the load is off and the relay is powered on, the signal output by the detection circuit can determine the on / off state of the circuit.

[0062] Taking a household appliance as an example, if a power outage occurs while the appliance is operating, the contacts of the relay's multi-control switch group remain unchanged. Even though the load is not powered on and therefore does not consume electrical energy, the relay keeps the load in an "on" state. If the user leaves to check the cause of the power outage, and the power outage is resolved after the user leaves, the load will immediately resume operation, consuming electrical energy and resulting in energy waste. Therefore, the automatic reset process described above, which shuts off the load as soon as the relay is powered on, solves this problem of unnecessary energy consumption. When the user wants the load to operate, only one trigger of the external switch is needed.

[0063] Based on the above-described terms and application scenarios, the switch detection method provided in this application will be described. This method is applied to a state detection circuit, which is used to determine the load state and the position state of the multi-control switch in the circuit. The state detection circuit includes a relay and at least one detection circuit. The relay includes a multi-control switch group, and the contact positions of the switches in the multi-control switch group randomly change after the relay enters the energized state. The multi-control switch group includes a first switch and a second switch, such as... Figure 1 As shown, Figure 1 This is a flowchart of a switch detection method provided in an exemplary embodiment of this application. The method includes the following steps.

[0064] Step 110: In response to the relay entering the power-on state, acquire the first level signal detected by the detection circuit.

[0065] Among them, the types of detection circuits include, but are not limited to: (1) off-state detection circuit, (2) on-state detection circuit.

[0066] The combination of the off-state detection circuit and the on-state detection circuit includes any of the following methods: 1. One off-state detection circuit detects alone; 2. Two off-state detection circuits are used together for detection; 3. Two off-state detection circuits are used together with one on-state detection circuit for detection; 4. One on-state detection circuit detects alone; 5. One off-state detection circuit is used together with one on-state detection circuit for detection.

[0067] In this embodiment, we will first provide an illustrative explanation of the case where a single off-state detection circuit is used for detection.

[0068] Optionally, at least one detection circuit includes a first off-state detection circuit, and the multi-control switch group of the relay includes a first switch and a second switch.

[0069] Indicative, such as Figure 2 As shown, Figure 2 This is a schematic diagram of a state detection loop including an off-state detection circuit provided in this application.

[0070] The status detection circuit 200 includes a first switch 201 of relays, a second switch 202, an off-state detection circuit 203, and a load 204.

[0071] Specifically, the state detection circuit 200 is in an ON state when the contact of the first switch 201 is in a first direction contact and the contact of the second switch 202 is in a fourth direction contact; the state detection circuit 200 is in an ON state when the contact of the first switch 201 is in a second direction contact and the contact of the second switch 202 is in a third direction contact; the state detection circuit 200 is in an OFF state when the contact of the first switch 201 is in a first direction contact and the contact of the second switch 202 is in a third direction contact; and the state detection circuit 200 is in an OFF state when the contact of the first switch 201 is in a second direction contact and the contact of the second switch 202 is in a fourth direction contact. When the state detection circuit 200 is in an ON state, the OFF state detection circuit 203 outputs a low-level signal, and the load 204 is turned on / powered on; when the state detection circuit 200 is in an OFF state, the OFF state detection circuit 203 outputs a high-level signal, and the load 204 is turned off / powered off.

[0072] When the relay is first powered on, the program controlling the relay will randomly generate a delay for each switch in the multi-control switch group of the relay. During the random delay, the first and second switches will automatically reset to shut off the load.

[0073] At this time, the first level signal detected by the detection circuit is obtained, which is the first level signal of the first off-state detection circuit.

[0074] Step 120: Determine the first state of the state detection circuit based on the first level signal. The first state is used to indicate the load state and the conduction state of the state detection circuit.

[0075] Optionally, the signal output by the detection circuit may include, but is not limited to, the following two forms: (1) high / low level signal; (2) square wave signal.

[0076] Indicative, such as Figure 3 As shown, Figure 3 This is a signal diagram of the detection circuit. In the square wave diagram 301, the signal is represented in the form of a square wave. In the high / low level diagram 302, the signal is represented in the form of a straight line (or in the form of 0 / 1, i.e., high level is 1 and low level is 0).

[0077] Optionally, taking the output signal as a high / low level signal as an example, when the detection circuit is a shutdown detection circuit, the output high level indicates that the circuit is in the open state; the output low level may have the following situations: (1) The state detection circuit does not contain a load. At this time, the shutdown detection circuit outputs a low level regardless of whether the circuit is in the on state or the off state; (2) The state detection circuit contains a load, but the load is damaged. The state of the damaged load can be equated to the state of not containing a load. At this time, the shutdown detection circuit outputs a low level regardless of whether the circuit is in the on state or the off state.

[0078] When determining the first state of the state detection circuit based on the first level signal, the following situations may occur: (1) In response to the first level signal of the first off-state detection circuit being high, the first state is determined to be that the state detection circuit contains a load and the state detection circuit is in an open state; (2) In response to the first level signal of the first off-state detection circuit being low, the first state cannot be uniquely determined, and the step of driving the contact position of the first switch to the first direction contact is executed, that is, step 130 is executed.

[0079] Step 130: Drive the contact position of the first switch to the first direction contact.

[0080] When the relay is first powered on, it cannot determine the contact position of each switch in the multi-control switch group. At this time, the first direction contact is taken as the preset contact position. Regardless of whether the contact position of the first switch is already located at the first direction contact, the action of driving the contact position of the first switch to the first direction contact is executed.

[0081] When the first level signal is high, it can be determined that there is a load in the circuit and the load is off (i.e., the status detection is in the off state), but the position of each switch in the multi-control switch group cannot be determined. At this time, the user manually drives the first switch to the first direction contact.

[0082] When the first level signal is low, it is impossible to determine whether the circuit is in a conducting state or does not contain a load. At this time, the relay automatically drives the first switch to the first direction contact.

[0083] Step 140: Obtain the second level signal detected by the detection circuit.

[0084] The second level signal has the same form as the first level signal.

[0085] Step 150: Determine the second state of the state detection circuit based on the second level signal and the contact position of the first switch.

[0086] The second state is used to indicate the load state of the state detection circuit and the position state of the multi-control switch of the relay.

[0087] This includes the following situations:

[0088] (1) In response to the first level signal of the first off-state detection circuit being low and the second level signal of the first off-state detection circuit being high, the second state is determined to be that the state detection circuit contains a load and the contact position of the second switch of the relay is located at the third direction contact.

[0089] At this time, the position change of the multi-control switch of the relay is as follows: Figure 4 As shown, the first switch 401 is switched from the second direction contact to the first direction contact, and the contact position of the second switch 402 is at the third direction contact.

[0090] (2) When the first level signal of the first off-state detection circuit is low and the second level signal of the first off-state detection circuit is low, it is impossible to determine whether the second state is due to the absence of load in the circuit or because the second switch randomly jumps to the fourth direction contact within a random delay.

[0091] Therefore, the relay automatically drives the contact position of the first switch to the second direction contact to obtain the third level signal of the first off-state detection circuit; based on the third level signal, the third state of the state detection circuit is determined, and the third state is used to represent the load state of the state detection circuit and the position state of the relay's multi-control switch.

[0092] The determination of the third state includes the following cases:

[0093] (1) In response to the third-level signal of the first off-state detection circuit being high, it is determined that the third state is a state detection circuit containing a load and the contact position of the second switch of the relay is located at the fourth direction contact. At this time, the position change of the multi-control switch of the relay is as follows: Figure 5As shown, the first switch 501 first switches from the first direction contact to the second direction contact, and then switches from the second direction contact back to the first direction contact. The contact position of the second switch 502 is at the fourth direction contact.

[0094] (2) In response to the third level signal of the first off-state detection circuit being low, it is necessary to further determine whether the second switch has caused a random action, resulting in the action of the first switch being canceled out. The relay is de-energized and then re-energized. In response to the relay entering the energized state, the fourth level signal of the first off-state detection circuit is acquired; in response to the fourth level signal of the first off-state detection circuit being low, the contact position of the first switch is driven to the first direction contact; the fifth level signal of the first off-state detection circuit is acquired; in response to the fifth level signal of the first off-state detection circuit being low, it is determined that the state detection loop does not contain a load.

[0095] Since the random delays of the first and second switches are both randomly generated, it is a low-probability event that the two random delays are the same. If, after repeatedly turning the entire relay off and on again, the signal output by the first off-state detection circuit remains low and stays at a low level, it can be determined that there is no load in the circuit or the load is damaged. The user can then promptly check and replace the load.

[0096] At this time, the position change of the multi-control switch of the relay is as follows: Figure 6 As shown, since no load is connected, the first off-state detection circuit always outputs a low level, so the contact positions of the first switch 601 and the second switch 602 can be arbitrary.

[0097] (3) In response to the first level signal of the first off-state detection circuit being high and the second level signal of the first off-state detection circuit being low, the second state is determined to be a state where the state detection circuit includes a load and the contact position of the second switch of the relay switch is located at the fourth direction contact. At this time, the position change of the multi-control switch of the relay is as follows: Figure 7 As shown, the first switch 701 is switched from the second direction contact to the first direction contact, and the contact position of the second switch 702 is at the fourth direction contact.

[0098] (4) In response to the first level signal of the first off-state detection circuit being high and the second level signal of the first off-state detection circuit being high, if the level signal does not change, it means that the contact position of the first switch was originally at the first direction contact. Therefore, the above steps of driving the contact position of the first switch to the first direction contact will not change the on / off state of the circuit.

[0099] Therefore, the relay automatically drives the contact position of the first switch to the second directional contact. At this time, the circuit is connected, and the second state is determined to be a state detection circuit containing a load and the contact position of the second switch of the relay switch is located at the fourth directional contact. At this time, the position change of the relay's multi-control switch is as follows: Figure 8 As shown, the initial position of the first switch 801 is at the first direction contact. The step of driving the first switch 801 to the first direction contact can be ignored. Then, it is switched from the first direction contact to the second direction contact. The contact position of the second switch 802 is at the third direction contact.

[0100] In this embodiment, the first off-state detection circuit outputs a high / low level to indicate that the state detection loop is in an open / closed state.

[0101] Indicative Figure 9 This is a schematic diagram showing the relationship between the first type of off-state detection circuit and its output signal. When the state detection circuit 900 is off, the square wave signal is high; when the state detection circuit 900 is on, the square wave signal is low.

[0102] Indicative Figure 10 This is a schematic diagram showing the relationship between the second type of off-state detection circuit and its output signal. When the state detection loop 1000 is open, the signal is high; when the state detection loop 1000 is on, the signal is low.

[0103] Indicative Figure 11 This is a schematic diagram showing the relationship between the third type of off-state detection circuit and its output signal. When the state detection circuit 1100 is open, the square wave signal is low; when the state detection circuit 1100 is on, the square wave signal is high.

[0104] Indicative Figure 12 This is a schematic diagram showing the relationship between the fourth type of off-state detection circuit and its output signal. When the state detection circuit 1200 is open, the signal is low; when the state detection circuit 1200 is on, the signal is high.

[0105] in, Figure 9 and Figure 11 The level signals are opposite. Figure 10 and Figure 12 The level signals are opposite. Figure 9 and Figure 10 The detection circuits in them are the same type of circuit, but Figure 9 No capacitor was installed in the middle. Figure 10 A capacitor is included; the size of the capacitor alters the form of the output level signal. Figure 9 The level signal output by the detection circuit is a square wave signal. Figure 10 The level signal output by the detection circuit is a high-level signal or a low-level signal. Figure 11 and Figure 12 The detection circuit in it is also the same type of circuit, but Figure 11 No capacitor was installed in the middle. Figure 12 A capacitor is included; the size of the capacitor alters the form of the output level signal. Figure 11 The level signal output by the detection circuit is a square wave signal. Figure 12 The level signal output by the detection circuit is a high-level signal or a low-level signal.

[0106] Figure 9 , 10 The corresponding detection circuit and Figure 11 , 12 The corresponding detection circuit achieves the same effect in the state detection loop, but the correspondence between the high / low level signal output and the on / off state of the state detection loop is reversed. The reason for this reversal is that... Figure 9 , 10 The corresponding detection circuit does not include a transistor. Figure 11 , 12 The corresponding detection circuit uses a transistor, which changes the direction of the current in the circuit.

[0107] It is worth noting that the type of off-state detection circuit, the form of the output signal, and the meaning it represents can be arbitrary. The above-mentioned off-state detection circuits are only examples. The number of switches included in the multi-control switch group of the relay can be arbitrary. The random delay generated when the relay is powered on can be of any length. When the relay is driven to make a specified switch in the multi-control switch group turn to a specified direction contact, the position of the specified switch and the position of the specified direction contact can be arbitrary. The type and number of detection circuits used to detect the on / off state in the circuit can be arbitrary. This embodiment does not limit this.

[0108] After the above steps, the relay can determine the contact position of each switch in the multi-control switch group. After memorizing the contact position of the switch, the contact position of the switch can be turned to the other side the next time it is driven by the user.

[0109] Each time the relay switch is powered on, a random delay is generated to enable the multi-control switch group to automatically reset. In some embodiments, the program memorizes the random delay, so that when the relay is powered off and then powered on again, the random delay memorized in the historical time period can be used again. This avoids the random delay of different switches being equal each time a random delay is generated, which would interfere with the relay's judgment of the switch position and circuit status.

[0110] Besides the need for the relay to determine the contact position of each switch in the multi-control switch group upon initial power-on, in some embodiments, the relay switch status can also be routinely monitored. (Illustrative example, such as...) Figure 13 As shown, Figure 13This is a schematic diagram illustrating the process of energizing the relay and determining the circuit status for the 2nd to Nth times in this application. It includes the following steps:

[0111] Step 1310: Power on the relay for the Nth time.

[0112] Where N is a positive integer greater than 1.

[0113] Step 1320: Call the random delay saved when the relay was last powered on, and the multi-control switch group will randomly switch within the random delay.

[0114] Step 1330: Obtain the first level signal detected by the detection circuit and determine whether the first level signal is high or low.

[0115] Step 1331: If the first level signal is high, it indicates that the circuit is in an open state and there is a load.

[0116] Step 1341: Since the position state of the multi-control switch in the relay has been memorized from the previous relay power-on, the contact position of the multi-control switch group can be determined when the relay is driven next time.

[0117] Step 1332: If the first level signal is low, it indicates that the circuit is in a conducting state or there is a load.

[0118] Step 1342: The relay automatically drives the position of the first switch to the other direction contact.

[0119] Step 1350: Obtain the second level signal detected by the detection circuit and determine whether the second level signal is high or low.

[0120] Step 1361: If the second level signal is high, it indicates that the circuit is in an open state and there is a load.

[0121] Step 1371: Since the position state of the multi-control switch in the relay has been memorized from the previous relay power-on, the contact position of the multi-control switch group can be determined when the relay is driven next time.

[0122] Step 1362: If the second level signal is low, it means that there is no load in the circuit or the second switch has randomly switched, causing the action of the first switch to be canceled.

[0123] This indicates that the random delays of the first and second switches are the same.

[0124] Step 1372: Generate a new random delay for the second switch and save the new random delay.

[0125] The second switch continues to operate within the new random delay to acquire the third level signal detected by the detection circuit.

[0126] Step 1380: Determine whether the third level signal is high or low.

[0127] Step 1391: If the third level signal is low, it means that there is no load in the circuit or the second switch has randomly switched, causing the action of the first switch to be canceled.

[0128] Step 13101: The relay automatically drives the position of the first switch to the other direction contact.

[0129] Obtain the fourth level signal detected by the detection circuit.

[0130] Step 13110: Determine whether the fourth level signal is high or low.

[0131] Step 13121: If the fourth level signal is low, it means that there is no load in the circuit or the second switch has randomly switched, causing the action of the first switch to be canceled.

[0132] Step 13131: Determine whether steps 1310 to 13121 were executed twice.

[0133] Specifically, this includes steps 1310, 1320, 1330, 1332, 1342, 1350, 1362, 1372, 1380, 1391, 13101, and 13121. If the above steps are not executed twice, they will be executed again in sequence.

[0134] Step 13140: If steps 1310 to 13121 above have been executed twice, then it is determined that there is no load in the loop.

[0135] Step 13150: If it is determined that there is no load in the circuit, since the position state of the multi-control switch in the relay has been memorized since the relay was powered on last time, the contact position of the multi-control switch group can be determined when the relay is driven next time.

[0136] Step 13122: If the fourth level signal is high, it indicates that the circuit is in an open state and there is a load.

[0137] Step 13132: Since the position state of the multi-control switch in the relay has been memorized from the previous relay power-on, the contact position of the multi-control switch group can be determined when the relay is driven next time.

[0138] Step 1392: If the third level signal is high, it indicates that the circuit is in an open state and there is a load.

[0139] Step 13102: Since the position state of the multi-control switch in the relay has been memorized from the previous relay power-on, the contact position of the multi-control switch group can be determined when the relay is driven next time.

[0140] The above embodiment takes the case where there is an off-state detection circuit in the state detection loop as an example to introduce the process of detecting the state of the switch when the relay is powered on for the first to Nth time. When there are other detection circuits in the state detection loop, the process of detecting the state of the switch is the same as the above steps, the only difference is the level signal output by the detection circuit. The process of detecting the state of the switch after the relay is powered on for the second to Nth time will not be described again.

[0141] In summary, the method provided in this application, in response to the relay entering the power-on state, acquires a first-level signal detected by the detection circuit, determines the first state of the state detection loop based on the first-level signal, and can preliminarily determine the load state and conduction state of the state detection loop through the detection circuit. It drives the contact position of the first switch to the first directional contact. When the contact position of the first switch is at the first directional contact, it acquires a second-level signal detected by the detection circuit, and determines the second state of the state detection loop based on the second-level signal and the contact position of the first switch. The second state represents the load state of the state detection loop and the multi-control switch position state of the relay. This solves the problem that the relay cannot determine the contact position of the switch when it is first powered on, and determines the load state in the loop, facilitating timely load replacement by the user, reducing trial and error when controlling the load to open and close, and improving interaction efficiency.

[0142] The method provided in this embodiment determines the on / off state of the entire circuit through a detection circuit and sets the first switch of the relay to a designated directional contact. Based on the contact position of the first switch and the signal output by the detection circuit, it can determine the presence of a load in the circuit and further determine the position status of other switches of the relay. This solves the problem that the relay cannot determine the contact position of the switches when it is first powered on and promptly prompts the user to check the load status.

[0143] The method provided in this embodiment generates a random delay when the power is first applied, which automatically resets the relay switch. This avoids the load from remaining in a closed state when it is not needed, improves energy utilization, and provides a basis for the relay to determine the contact position of the switch, avoiding trial and error by the user.

[0144] The method provided in this embodiment can obtain the changes in the output signal of the detection circuit by continuously controlling the position change of the first switch in the relay, and further determine the load state of the circuit and the position state of the multi-control switch, thereby improving work efficiency.

[0145] In some embodiments, at least one detection circuit includes a first off-state detection circuit and a second off-state detection circuit, and the first level signal includes a first off-state level signal from the first off-state detection circuit and a second off-state level signal from the second off-state detection circuit. The multi-control switch group of the relay includes a first switch and a second switch.

[0146] Indicative, such as Figure 14 As shown, Figure 14 This is a schematic diagram of the state detection loop provided in this application, which includes a first off-state detection circuit and a second off-state detection circuit.

[0147] The state detection circuit 1400 includes a first switch of a relay, a second switch, a first off-state detection circuit, a second off-state detection circuit, and a load. The contact positions of the relay's multi-control switch group include: a first direction contact, a second direction contact, a third direction contact, and a fourth direction contact. These contact positions are related to... Figure 2 The contact points are in the same position, that is: the contact point above the first switch is the first direction contact point, the contact point below the first switch is the second direction contact point, the contact point above the second switch is the fourth direction contact point, and the contact point below the second switch is the third direction contact point.

[0148] Specifically, the state detection circuit is in a conducting state when the contact of the first switch is located at the first directional contact and the contact of the second switch is located at the fourth directional contact; the state detection circuit is in a conducting state when the contact of the first switch is located at the second directional contact and the contact of the second switch is located at the third directional contact; the state detection circuit is in a disconnected state when the contact of the first switch is located at the first directional contact and the contact of the second switch is located at the third directional contact; and the state detection circuit is in a disconnected state when the contact of the first switch is located at the second directional contact and the contact of the second switch is located at the fourth directional contact.

[0149] When the state detection loop is in the open state, the level signals output by the first off-state detection circuit and the second off-state detection circuit are opposite, and the load is turned off; when the state detection loop is in the on state, the level signals output by the first off-state detection circuit and the second off-state detection circuit are both low, and the load is turned on.

[0150] The contact positions in all state detection circuits in this application are the same as above, and will not be repeated below.

[0151] Step 120 above can also be implemented as follows: in response to the opposite levels of the first off-state level signal and the second off-state level signal, it is determined that the state detection circuit contains a load and the state detection circuit is in an open state; or, in response to both the first off-state level signal and the second off-state level signal being low, the step of driving the contact position of the first switch to the first direction contact is executed.

[0152] The complete process is as follows: After the relay is powered on, the program controlling the relay is to randomly generate a random delay for the multi-control switch group of the relay. The first switch and the second switch are automatically reset within their respective random delays, so that the load is in the off state and the circuit is in the open state.

[0153] At this time, acquire the first off-state level signal and the second off-state level signal, such as... Figure 14 As shown, regardless of the contact positions of the first and second switches, at most one voltage level will be high. At this time, the circuit state can be preliminarily determined based on the voltage level signal. This includes the following cases:

[0154] 1. If either the first off-state level signal or the second off-state level signal is high, it indicates that the circuit is open and there is a load in the circuit. For example... Figure 15 As shown, Figure 15 This is a schematic diagram of a state detection circuit where one of the first and second off-state level signals is high. It includes two scenarios: In the first state detection circuit 1510, the first switch is located at the first directional contact and the second switch is located at the third directional contact; in this case, the first off-state level signal is low and the second off-state level signal is high. In the second state detection circuit 1520, the first switch is located at the second directional contact and the second switch is located at the fourth directional contact; in this case, the first off-state level signal is high and the second off-state level signal is low. Therefore, when the circuit is open, the contact position of the first switch points towards the off-state detection circuit that outputs a low-level signal.

[0155] Therefore, if either the first off-state level signal or the second off-state level signal is high, then the next time the relay switch is driven, it is only necessary to switch the contact position of the first switch from low to high. This determines and memorizes the position state of the relay multi-control switch group.

[0156] 2. If both the first off-state level signal and the second off-state level signal are low, it indicates that the circuit is in a conducting state or there is no load in the circuit. At this time, the relay automatically drives the first switch to the first direction contact, and after the first switch is driven, it detects and updates the first off-state level signal and the second off-state level signal.

[0157] This includes the following situations:

[0158] 2.1 If either the updated first off-state level signal or the second off-state level signal is high, then the next time the relay switch is driven, it is only necessary to switch the contact position of the first switch from low to high. This determines and memorizes the position state of the relay multi-control switch group.

[0159] 2.2 If both the updated first and second off-state level signals are low, a new random delay is generated and saved for the second switch. The second switch will then randomly transition within this new delay. The process of acquiring and updating the first and second off-state level signals continues, resulting in a second updated level signal. This includes the following cases:

[0160] (1) If a high level is present in the level signal of the second update at this time, it indicates that the circuit is in an open state and there is a load in the circuit. Then, when driving the relay switch next time, it is only necessary to switch the contact position of the first switch from the low level end to the high level end. This determines and memorizes the position state of the relay multi-control switch group.

[0161] (2) If the updated level signal does not contain a high level at this time, it indicates that there is no load in the circuit or that the random transition of the second switch within the new random delay has affected the level signal. At this time, the relay automatically drives the first switch to the second direction contact. The first off-state level signal and the second off-state level signal are then acquired and updated to obtain the level signal updated three times. This includes the following situations:

[0162] <1> If a high level is present in any of the three updated level signals, it indicates that the circuit is open and there is a load in the circuit. Therefore, when driving the relay switch next time, it is only necessary to switch the contact position of the first switch from low to high. This determines and memorizes the position state of the relay multi-control switch group.

[0163] <2> If none of the three updated level signals are high, it indicates that there is no load in the circuit. Since the identical random delays of the first and second switches are a low-probability event, in some embodiments, repeatedly powering off and on the relay while repeating all the above steps can confirm the absence of a load in the circuit. In this case, the contact positions of the first and second switches are memorized, and only one switch needs to be repositioned the next time the relay is driven.

[0164] In summary, the method provided in this application, in response to the relay entering the power-on state, acquires a first-level signal detected by the detection circuit, determines the first state of the state detection loop based on the first-level signal, and can preliminarily determine the load state and conduction state of the state detection loop through the detection circuit. It drives the contact position of the first switch to the first directional contact. When the contact position of the first switch is at the first directional contact, it acquires a second-level signal detected by the detection circuit, and determines the second state of the state detection loop based on the second-level signal and the contact position of the first switch. The second state represents the load state of the state detection loop and the multi-control switch position state of the relay. This solves the problem that the relay cannot determine the contact position of the switch when it is first powered on, and determines the load state in the loop, facilitating timely load replacement by the user, reducing trial and error when controlling the load to open and close, and improving interaction efficiency.

[0165] The method provided in this embodiment improves the accuracy of the position status of the multi-control switch by setting two off-state detection circuits in the state detection loop for signal detection. Furthermore, when there is a load in the loop, the first switch does not need to repeatedly perform multiple contact position changes, thus improving the efficiency of switch state detection.

[0166] In some embodiments, at least one detection circuit includes a first off-state detection circuit, a second off-state detection circuit, and a first on-state detection circuit. The first level signal includes a first off-state level signal from the first off-state detection circuit, a second off-state level signal from the second off-state detection circuit, and a first on-state level signal from the first on-state detection circuit. The multi-control switch group of the relay includes a first switch and a second switch.

[0167] Indicative, such as Figure 16 As shown, Figure 16 This is a schematic diagram of the state detection loop provided in this application, which includes a first off-state detection circuit, a second off-state detection circuit, and a first on-state detection circuit.

[0168] The state detection circuit 1600 includes a first switch of a relay, a second switch, a first off-state detection circuit, a second off-state detection circuit, a first on-state detection circuit, and a load.

[0169] Specifically, the state detection circuit is in a conducting state when the contact of the first switch is located at the first directional contact and the contact of the second switch is located at the fourth directional contact; the state detection circuit is in a conducting state when the contact of the first switch is located at the second directional contact and the contact of the second switch is located at the third directional contact; the state detection circuit is in a disconnected state when the contact of the first switch is located at the first directional contact and the contact of the second switch is located at the third directional contact; and the state detection circuit is in a disconnected state when the contact of the first switch is located at the second directional contact and the contact of the second switch is located at the fourth directional contact.

[0170] When the state detection loop is in the open state, the level signals output by the first off-state detection circuit and the second off-state detection circuit are opposite, and the level signal output by the first on-state detection circuit is low, indicating that the load is off. When the state detection loop is in the on state, the level signals output by the first off-state detection circuit and the second off-state detection circuit are both low, and the level signal output by the first on-state detection circuit is high, indicating that the load is on.

[0171] Step 120 above can also be implemented as follows: in response to the opposite levels of the first off-state level signal and the second off-state level signal and the first on-state level signal being low, determine that the state detection circuit contains a load and the state detection circuit is in an open state; or, in response to both the first off-state level signal and the second off-state level signal being low and the first on-state level signal being high, execute the step of driving the contact position of the first switch to the first direction contact.

[0172] The complete process is as follows: After the relay is powered on, the program controlling the relay is to randomly generate a random delay for the multi-control switch group of the relay. The first switch and the second switch are automatically reset within their respective random delays, so that the load is in the off state and the circuit is in the open state.

[0173] At this time, the first off-state level signal, the second off-state level signal, and the first on-state level signal are acquired, such as... Figure 16 As shown, regardless of the contact positions of the first and second switches, at most one voltage level will be high. At this time, the circuit state can be preliminarily determined based on the voltage level signal. This includes the following cases:

[0174] 1. If none of the following signals—the first off-state signal, the second off-state signal, and the first on-state signal—is high, it indicates that there is no load in the circuit or that the second switch is in the process of random switching. In this case, the contact position of the second switch is neither the third-direction contact nor the fourth-direction contact. Therefore, the step of de-energizing and re-energizing the relay should be repeated.

[0175] If the relay is repeatedly powered off and then powered on again and there is still no high-level signal, it means there is no load in the circuit. At this time, the relay will automatically drive the first switch to the first direction contact and remember the direction of the first switch. When the relay is driven again, the contact position of the first switch can be changed.

[0176] 2. If any of the following signals—the first off-state signal, the second off-state signal, and the first on-state signal—is high, it indicates that a load exists in the circuit. Further determine whether the high-level signal is the first on-state signal.

[0177] 2.1 If the high-level signal is not the first on-state level signal, it indicates that the high-level signal is the signal output by the off-state detection circuit, which confirms that the loop is in an open state and that there is a load in the loop. For example... Figure 17 As shown, Figure 17 This is a schematic diagram of a state detection circuit where the first off-state level signal, the second off-state level signal, and the first on-state level signal are all at a high level. It includes two scenarios: In the first state detection circuit 1710, the first switch is located at the first direction contact and the second switch is located at the third direction contact; in this case, the first off-state level signal is low, the second off-state level signal is high, and the first on-state level signal is low. In the second state detection circuit 1720, the first switch is located at the second direction contact and the second switch is located at the fourth direction contact; in this case, the first off-state level signal is high, the second off-state level signal is low, and the first on-state level signal is low. Therefore, when the circuit is in the open state, the contact position of the first switch points towards the off-state detection circuit that outputs a low-level signal.

[0178] Therefore, if either the first off-state level signal or the second off-state level signal is high, then the next time the relay switch is driven, it is only necessary to switch the contact position of the first switch from the low-level end of the off-state detection circuit to the high-level end of the off-state detection circuit. This determines and memorizes the position state of the relay multi-control switch group.

[0179] 2.2 If the high-level signal is the first open-state signal, it can be determined that the circuit is in a conducting state and there is a load in the circuit. The relay automatically drives the first switch to the first direction contact, and detects and updates the first open-state signal after the first switch is driven.

[0180] (1) If the updated first open-state level signal is low, it indicates that the circuit is in an open state and there is a load in the circuit. Then, when driving the relay switch next time, it is only necessary to switch the contact position of the first switch from the low-level end of the off-state detection circuit to the high-level end of the off-state detection circuit. This determines and memorizes the position state of the relay multi-control switch group.

[0181] (2) If the updated first open-state level signal is high, it indicates that the second switch has generated a random transition, or the initial contact position of the first switch is at the first direction contact. In this case, a new random delay is generated for the second switch and saved. At this time, the second switch will perform a random transition within the new random delay. Continue to acquire and update the first open-state level signal to obtain the second updated level signal.

[0182] <1> If the updated signal level is still low, it indicates that the circuit is open and there is a load in the circuit. Therefore, when driving the relay switch next time, it is only necessary to switch the contact position of the first switch from the low-level end of the off-state detection circuit to the high-level end of the off-state detection circuit. This determines and memorizes the position state of the relay multi-control switch group.

[0183] <2> If the updated voltage level signal is high at this time, the relay automatically drives the first switch to the second direction contact. The first on-state voltage level signal is then acquired and updated again, resulting in a third updated voltage level signal.

[0184] [1] If the level signal updated three times is low at this time, it means that the circuit is in the open state and there is a load in the circuit. Then, when driving the relay switch next time, it is only necessary to switch the contact position of the first switch from the low level end of the off-state detection circuit to the high level end of the off-state detection circuit. In this way, the position state of the relay multi-control switch group is determined and memorized.

[0185] [2] If the updated signal level is still high at this time, it indicates that the second switch has randomly switched again during the process, and the circuit is still in the conducting state. By repeatedly turning the relay off and on and repeating all the above steps, it can be determined that the first and second switches have reset collisions during this process. Among them, a reset collision means that the first and second switches switch simultaneously switch when resetting within a random delay, causing the actions of the switches to cancel each other out. At this time, the contact positions of the first and second switches are memorized, and only one switch needs to be changed in position when driving the relay next time.

[0186] In summary, the method provided in this application, in response to the relay entering the power-on state, acquires a first-level signal detected by the detection circuit, determines the first state of the state detection loop based on the first-level signal, and can preliminarily determine the load state and conduction state of the state detection loop through the detection circuit. It drives the contact position of the first switch to the first directional contact. When the contact position of the first switch is at the first directional contact, it acquires a second-level signal detected by the detection circuit, and determines the second state of the state detection loop based on the second-level signal and the contact position of the first switch. The second state represents the load state of the state detection loop and the multi-control switch position state of the relay. This solves the problem that the relay cannot determine the contact position of the switch when it is first powered on, and determines the load state in the loop, facilitating timely load replacement by the user, reducing trial and error when controlling the load to open and close, and improving interaction efficiency.

[0187] The method provided in this embodiment improves the accuracy of the position status of the multi-control switch by setting two off-state detection circuits and one on-state detection circuit in the state detection loop for signal detection. Furthermore, when there is a load in the loop, the first switch does not need to repeatedly perform multiple contact position changes, thus improving the efficiency of switch state detection.

[0188] In some embodiments, at least one detection circuit includes a first on-state detection circuit, and the first level signal includes the first on-state level signal of the first on-state detection circuit. The multi-control switch group of the relay includes a first switch and a second switch.

[0189] Indicative, such as Figure 18 As shown, Figure 18 This is a schematic diagram of the state detection loop including the first open-state detection circuit provided in this application.

[0190] The state detection circuit 1800 includes a first switch of a relay, a second switch, a first on-state detection circuit, and a load. Specifically, the state detection circuit is in a conducting state when the contact of the first switch is in a first-direction contact and the contact of the second switch is in a fourth-direction contact; the state detection circuit is in a conducting state when the contact of the first switch is in a second-direction contact and the contact of the second switch is in a third-direction contact; the state detection circuit is in a disconnected state when the contact of the first switch is in a first-direction contact and the contact of the second switch is in a third-direction contact; and the state detection circuit is in a disconnected state when the contact of the first switch is in a second-direction contact and the contact of the second switch is in a fourth-direction contact.

[0191] When the state detection loop is in the open state, the output signal of the first open state detection circuit is low, and the load is off; when the state detection loop is in the on state, the output signal of the first open state detection circuit is high, and the load is on.

[0192] Step 120 above can also be implemented as follows: in response to the first level signal of the first open state detection circuit being low, it is determined that the state detection circuit contains a load and the state detection circuit is in an open state; or, in response to the first level signal of the first open state detection circuit being high, the step of driving the contact position of the first switch to the first direction contact is executed.

[0193] The complete process is as follows: After the relay is powered on, the program controlling the relay is to randomly generate a random delay for the multi-control switch group of the relay. The first switch and the second switch are automatically reset within their respective random delays, so that the load is in the off state and the circuit is in the open state.

[0194] At this time, the first open-state level signal is obtained. Optionally, the first open-state level signal is a high / low level signal for explanation. A high level output indicates that the circuit is in the conducting state and there is a load in the circuit; a low level output may have the following situations: (1) The state detection circuit does not contain a load. In this case, the detection circuit outputs a low level regardless of whether the circuit is in the conducting or open state; (2) The state detection circuit contains a load, but the load is damaged. The state of load damage can be equated to not containing a load. In this case, the detection circuit outputs a low level regardless of whether the circuit is in the conducting or open state. When determining the first state of the state detection circuit based on the first level signal, the following situations are included:

[0195] 1. If the first open-state level signal is high, it indicates that the first state is that there is a load in the circuit and it is in a conducting state.

[0196] 2. If the first open-state level signal is low, it indicates that there may be no load in the circuit or the circuit is in an open state. At this time, the first state cannot be uniquely determined, the first switch is driven, and the state of the state detection circuit is determined.

[0197] The first switch is driven to the first directional contact position, and a second level signal is acquired. This second level signal is the second open-state level signal detected by the first open-state detection circuit. Based on the second level signal and the contact position of the first switch, the second state of the state detection circuit is further determined. This includes the following cases:

[0198] 2.1 In response to the first open-state level signal of the first open-state detection circuit being high and the second open-state signal being low, the second state is determined to be that the state detection circuit contains a load and the contact position of the second switch of the relay is located at the third-direction contact.

[0199] 2.2 In response to the first open-state level signal of the first open-state detection circuit being high and the second open-state signal being high, the second state is determined to be a state detection circuit containing a load and the contact position of the second switch of the relay being located at the fourth direction contact.

[0200] 2.3 In response to the first open-state level signal of the first open-state detection circuit being low and the second open-state signal being high, the second state is determined to be that the state detection circuit contains a load and the contact position of the second switch of the relay is located at the fourth direction contact.

[0201] 2.4 In response to the first open-state detection circuit's first open-state level signal being low and the second open-state level signal being low, further determination is needed to determine whether this is due to the absence of load in the state detection circuit (or load failure) or because the relay's second switch randomly switched during the process of driving the first switch's contact position to the first direction contact, switching to the third direction contact. At this time, the first switch's contact position is driven to the second direction contact, and the third open-state level signal of the first open-state detection circuit is acquired. Based on the third open-state level signal, the second open-state level signal, and the contact position of the first switch, the third state of the state detection circuit is determined. This includes the following cases:

[0202] (1) In response to the second open state level signal being low and the third open state level signal being high, the third state is determined to be a state detection circuit containing a load and the contact position of the second switch of the relay being located at the third directional contact.

[0203] (2) In response to both the second open-state level signal and the third open-state level signal being low, it is still necessary to further determine whether the state detection circuit does not contain a load (or the load is damaged) or whether the second switch of the relay randomly jumps to the fourth direction contact during the process of the relay driving the first switch's contact position to the first direction contact. The relay is repeatedly de-energized and energized, and the above steps are repeated a preset number of times (e.g., twice). If the first open-state detection circuit does not output a high level even once during this process, it is determined that the state detection circuit does not contain a load (or the load is damaged), and the contact position of the relay switch is promptly memorized. In summary, the method provided in this application, in response to the relay entering the energized state, acquires the first level signal detected by the detection circuit, determines the first state of the state detection circuit based on the first level signal, and can preliminarily determine the load state and conduction state of the state detection circuit through the detection circuit. The first switch is driven to move its contact position to the first directional contact. When the first switch's contact position is at the first directional contact, the second level signal detected by the detection circuit is acquired. Based on the second level signal and the contact position of the first switch, the second state of the state detection loop is determined. The second state is used to represent the load state of the state detection loop and the multi-control switch position state of the relay. This solves the problem that the relay cannot determine the contact position of the switch when it is first powered on, and determines the load state in the loop, making it easier for users to replace the load in a timely manner. It also reduces the number of trial and error attempts when controlling the load to turn on and off, and improves the interaction efficiency.

[0204] The method provided in this embodiment improves the accuracy of obtaining the position status of the multi-control switch by setting an open-state detection circuit in the state detection loop for signal detection. Furthermore, when there is a load in the loop, the first switch does not need to repeatedly perform multiple contact position changes, thus improving the efficiency of switch state detection.

[0205] In some embodiments, at least one detection circuit includes a first off-state detection circuit and a first on-state detection circuit, and the first level signal includes a first off-state level signal of the first off-state detection circuit and a first on-state level signal of the first on-state detection circuit; the multi-control switch group of the relay includes a first switch and a second switch.

[0206] Indicative, such as Figure 19 As shown, Figure 19 This is a schematic diagram of the state detection loop including the first open-state detection circuit and the first open-state detection circuit provided in this application.

[0207] The state detection circuit 1800 includes a first switch of a relay, a second switch, a first off-state detection circuit, a first on-state detection circuit, and a load. Specifically, the state detection circuit is in a conducting state when the contact of the first switch is in a first-direction contact and the contact of the second switch is in a fourth-direction contact; the state detection circuit is in a conducting state when the contact of the first switch is in a second-direction contact and the contact of the second switch is in a third-direction contact; the state detection circuit is in a disconnected state when the contact of the first switch is in a first-direction contact and the contact of the second switch is in a third-direction contact; and the state detection circuit is in a disconnected state when the contact of the first switch is in a second-direction contact and the contact of the second switch is in a fourth-direction contact.

[0208] When the state detection loop is in the open state, the level signal output by the first off-state detection circuit is high and the level signal output by the first on-state detection circuit is low, and the load is off; when the state detection loop is in the on state, the level signal output by the first off-state detection circuit is low and the level signal output by the first on-state detection circuit is high, and the load is on.

[0209] Step 120 above can also be implemented as follows: in response to the first off-state level signal being high and the first on-state level signal being low, determine that the state detection circuit contains a load and the state detection circuit is in an open state; or, in response to the first off-state level signal being low and the first on-state level signal being high, execute the step of driving the contact position of the first switch to the first direction contact.

[0210] The complete process is as follows: After the relay is powered on, the program controlling the relay is to randomly generate a random delay for the multi-control switch group of the relay. The first switch and the second switch are automatically reset within their respective random delays, so that the load is in the off state and the circuit is in the open state.

[0211] At this time, the first off-state level signal and the first on-state level signal are obtained. Optionally, the first off-state level signal and the first on-state level signal are both high / low level signals for explanation. When the first on-state level signal is high and the first off-state level signal is low, it means that the circuit is in the conducting state and there is a load in the circuit. When the first on-state level signal is low and the first off-state level signal is high, it means that the circuit is in the disconnected state and there is a load in the circuit. When both the first on-state level signal and the first off-state level signal are low, the following situations may exist: (1) The state detection circuit does not contain a load. At this time, regardless of whether the circuit is in the conducting state or the disconnected state, each detection circuit outputs a low level. (2) The state detection circuit contains a load, but the load is damaged. The state of the damaged load can be equated to the state of not containing a load. At this time, regardless of whether the circuit is in the conducting state or the disconnected state, each detection circuit outputs a low level. When determining the first state of the state detection circuit based on the first level signal, the following situations are included:

[0212] 1. If the first on-state level signal is high and the first off-state level signal is low, it indicates that the first state is that there is a load in the circuit and it is in a conducting state.

[0213] 2. If the first open-state level signal is low and the first closed-state level signal is high, it indicates that the first state is that there is a load in the circuit and it is in an open state.

[0214] 3. If the first open-state level signal is low and the first closed-state level signal is also low, it indicates that there may be no load in the circuit or that the switch has generated a random jump within a random delay, affecting the level signal. In this case, the first state cannot be uniquely determined, the first switch cannot be driven, and the state of the state detection circuit cannot be determined.

[0215] The first switch is driven to a first directional contact position, and a second level signal is acquired. This second level signal includes a second open-state level signal detected by the first open-state detection circuit and a second closed-state level signal detected by the first closed-state detection circuit. Based on the second level signal and the contact position of the first switch, the second state of the state detection circuit is further determined. This includes the following cases:

[0216] 3.1 In response to the second open-state level signal being high and the second closed-state level open-state signal being low, the second state is determined to be a state detection circuit containing a load and the contact position of the second switch of the relay being located at the fourth direction contact.

[0217] 3.2 In response to the second open-state level signal being low and the second closed-state level open-state signal being high, the second state is determined to be a state detection circuit containing a load and the contact position of the second switch of the relay being located at a third-direction contact.

[0218] 3.3 In response to both the second on-state level signal being low and the second off-state level signal being low, it is necessary to further determine whether the issue is due to the absence of a load in the state detection circuit or a random transition of the second switch within a random delay affecting the level signal. At this time, the contact position of the first switch is driven to the second direction contact, and the third on-state level signal of the first on-state detection circuit and the third off-state level signal of the first off-state detection circuit are acquired. Based on the third on-state level signal, the third off-state level signal, and the contact position of the first switch, the third state of the state detection circuit is determined. This includes the following cases:

[0219] (1) In response to the third open state level signal being high and the third closed state level open state signal being low, the third state is determined to be a state detection circuit containing a load and the contact position of the second switch of the relay being located at the third directional contact.

[0220] (2) In response to the third open state level signal being low and the third closed state level open state signal being high, the third state is determined to be a state detection circuit containing a load and the contact position of the second switch of the relay being located at the fourth direction contact.

[0221] (3) In response to the third open-state level signal being low and the third closed-state level open-state signal being low, it is still necessary to further determine whether the state detection circuit does not contain a load (or the load is damaged) or whether the second switch of the relay has a random jump affecting the level signal during the process of the relay driving the first switch contact position to the second direction contact. Repeatedly de-energize and energize the relay, and repeat the above steps to a preset number of times (e.g., twice). If neither the first open-state detection circuit nor the first closed-state detection circuit outputs an excessively high level during this process, it is determined that the state detection circuit does not contain a load (or the load is damaged), and the contact position of the relay switch is promptly memorized.

[0222] In summary, regardless of the number and type of detection circuits in the state detection loop, a random delay will be generated for the multi-control switch group after the relay is powered on. This delay allows the multi-control switch group to automatically reset, putting the loop in an open state and preventing the load from operating when not needed, thus saving energy. Simultaneously, while the circuit is in an open state, the contact position of each switch in the multi-control switch group is not uniquely determined. A contact position switching operation can be performed on a specific switch in the multi-control switch group, causing the specified contact to be set to a specific direction, thereby determining the position of the specified switch. Combined with the level signal output by the detection circuit, it is further determined whether the on / off state of the loop has changed, further determining the state of the load in the loop and the contact positions of the remaining switches, memorizing the contact positions of each switch. In some cases, at least two switches in the multi-control switch group may have the same random delay. In this case, switch reset collision will occur; that is, multiple switches operating simultaneously will cause the position switching operations to cancel each other out, interfering with the level output of the detection circuit. Repeatedly switching the designated switch position on the relay ensures that a load is present in the current circuit and is not damaged, as long as the detection circuit outputs a high level. Once a load is identified, simply repeat the process of switching the designated switch's contact position towards the designated direction to determine and memorize the contact position of each switch. The next time the relay switch is triggered, the contact position is simply flipped. If the detection circuit never outputs a high level after repeatedly switching the designated switch's contact position towards the designated direction, it indicates that there is no load in the circuit (or the load is damaged) or the switch is continuously experiencing reset collisions. Since the random delay of each switch is randomly generated, the same random delay for different switches is a low-probability event. If the detection circuit still does not output a high level after repeating the process of switching the designated switch's contact position towards the designated direction more than a preset number of times, it can be determined that there is no load in the circuit (or the load is damaged), prompting the user to promptly check and replace the switch.

[0223] In all embodiments of this application, the contact positions of the first switch include a first-direction contact and a second-direction contact, and the contact positions of the second switch include a third-direction contact and a fourth-direction contact. When the state detection circuit is in a conducting state, the contact positions of the first switch and the second switch are located at the first-direction contact and the fourth-direction contact, or the contact positions of the first switch and the second switch are located at the second-direction contact and the third-direction contact. Similarly, when the state detection circuit is in a disconnected state, the contact positions of the first switch and the second switch are located at the first-direction contact and the third-direction contact, or the contact positions of the first switch and the second switch are located at the second-direction contact and the fourth-direction contact.

[0224] It is worth noting that in all embodiments of this application, the number and type of detection circuits used to detect whether the circuit is in a conducting / disconnecting state are arbitrary; the position of the load in the circuit can be arbitrary, and the process of determining the conducting / disconnecting state of the circuit based on the level signal output by the detection circuit will change according to the actual situation when the position of the load is different; when the detection circuit includes an on-state detection circuit, the components in the on-state detection circuit can be of any number and type; when the detection circuit includes an off-state detection circuit, the components in the off-state detection circuit can be of any number and type; when determining the conducting and disconnecting state of the circuit based on the level signal output by the detection circuit, the correspondence between the level signal and the conducting / disconnecting state of the circuit can be arbitrary; the number and position of the switches included in the multi-control switch group in the relay can be arbitrary; the type of multi-control switch group includes at least one of thyristor switch group and electronic switch group, and the type of each switch in the multi-control switch group can be arbitrary; this application does not limit this.

[0225] In summary, the method provided in this application, in response to the relay entering the power-on state, acquires a first-level signal detected by the detection circuit, determines the first state of the state detection loop based on the first-level signal, and can preliminarily determine the load state and conduction state of the state detection loop through the detection circuit. It drives the contact position of the first switch to the first directional contact. When the contact position of the first switch is at the first directional contact, it acquires a second-level signal detected by the detection circuit, and determines the second state of the state detection loop based on the second-level signal and the contact position of the first switch. The second state represents the load state of the state detection loop and the multi-control switch position state of the relay. This solves the problem that the relay cannot determine the contact position of the switch when it is first powered on, and determines the load state in the loop, facilitating timely load replacement by the user, reducing trial and error when controlling the load to open and close, and improving interaction efficiency.

[0226] The method provided in this embodiment improves the accuracy of obtaining the position status of the multi-control switch by setting an on-state detection circuit and an off-state detection circuit in the state detection loop for signal detection. Furthermore, when there is a load in the loop, the first switch does not need to repeatedly perform multiple contact position changes, thus improving the efficiency of switch state detection.

[0227] Figure 20 This is a structural block diagram of a switch detection device provided in an exemplary embodiment of this application. The device is applied to a state detection circuit, which includes a relay and at least one detection circuit. The relay includes a multi-control switch group, where the contact positions of the switches in the multi-control switch group randomly change after the relay enters a powered-on state. The multi-control switch group includes a first switch and a second switch, such as... Figure 20As shown, the device includes the following parts.

[0228] Acquisition module 2010 is used to acquire the first level signal detected by the detection circuit in response to the relay entering the power-on state;

[0229] The determination module 2020 is used to determine a first state of the state detection circuit based on the first level signal, wherein the first state is used to indicate the load state of the state detection circuit and the conduction state of the state detection circuit.

[0230] The driving module 2030 is used to drive the contact position of the first switch to the first direction contact.

[0231] The acquisition module 2010 is further configured to acquire the second level signal detected by the detection circuit;

[0232] The determining module 2020 is further configured to determine a second state of the state detection circuit based on the second level signal and the contact position of the first switch, wherein the second state is used to represent the load state of the state detection circuit and the multi-control switch position state of the relay.

[0233] In an optional embodiment, the at least one detection circuit includes a first off-state detection circuit; the determining module 2020 is further configured to determine, in response to the first level signal of the first off-state detection circuit being high, that the first state is that the state detection loop contains a load and the state detection loop is in an open state; or, in response to the first level signal of the first off-state detection circuit being low, to perform the step of driving the contact position of the first switch to the first direction contact.

[0234] In an optional embodiment, such as Figure 21 As shown, the determining module 2020 further includes:

[0235] The first determining unit 2021 is configured to, in response to a low level signal from the first off-state detection circuit and a low level signal from the second off-state detection circuit, drive the contact position of the first switch to a second direction contact, and determine the state of the state detection circuit based on the second direction contact; or,

[0236] The second determining unit 2022 is configured to determine, in response to the first level signal of the first off-state detection circuit being low and the second level signal of the first off-state detection circuit being high, that the second state is that the state detection circuit contains a load and the contact position of the second switch of the relay is located at a third-direction contact.

[0237] In an optional embodiment, the first determining unit 2021 is further configured to acquire a third level signal of the first off-state detection circuit; and determine a third state of the state detection loop based on the third level signal, wherein the third state is used to represent the load state of the state detection loop and the multi-control switch position state of the relay.

[0238] In an optional embodiment, the first determining unit 2021 is further configured to de-energize and re-energize the relay in response to the third level signal of the first off-state detection circuit being low; or, in response to the third level signal of the first off-state detection circuit being high, determine that the third state is that the state detection circuit contains a load and the contact position of the second switch of the relay is located at the fourth direction contact.

[0239] In an optional embodiment, after the determining module 2020,

[0240] The acquisition module 2010 is also used to acquire the fourth level signal of the first off-state detection circuit in response to the relay entering the power-on state;

[0241] The driving module 2030 is also used to drive the contact position of the first switch to the first direction contact in response to the fourth level signal of the first off-state detection circuit being low.

[0242] The acquisition module 2010 is also used to acquire the fifth level signal of the first off-state detection circuit;

[0243] The determining module 2020 is further configured to determine that the state detection loop does not contain a load in response to the fifth level signal of the first off-state detection circuit being low.

[0244] In an optional embodiment, the at least one detection circuit includes a first off-state detection circuit and a second off-state detection circuit, and the first level signal includes a first off-state level signal of the first off-state detection circuit and a second off-state level signal of the second off-state detection circuit.

[0245] The determining module 2020 is further configured to determine that the state detection circuit contains a load and the state detection circuit is in an open state in response to the opposite levels of the first off-state level signal and the second off-state level signal; or, in response to both the first off-state level signal and the second off-state level signal being low, to perform the step of driving the contact position of the first switch to the first direction contact.

[0246] In an optional embodiment, the at least one detection circuit includes a first off-state detection circuit, a second off-state detection circuit, and a first on-state detection circuit, and the first level signal includes a first off-state level signal of the first off-state detection circuit, a second off-state level signal of the second off-state detection circuit, and a first on-state level signal of the first on-state detection circuit.

[0247] The determining module 2020 is further configured to determine that the state detection circuit contains a load and the state detection circuit is in an open state in response to the first off-state level signal and the second off-state level signal having opposite levels and the first on-state level signal being low; or, in response to the first off-state level signal and the second off-state level signal both being low and the first on-state level signal being high, to perform the step of driving the contact position of the first switch to the first direction contact.

[0248] In an optional embodiment, the at least one detection circuit includes a first on-state detection circuit;

[0249] The determining module 2020 is further configured to determine that the state detection circuit contains a load and the state detection circuit is in an open state in response to the first level signal of the first open state detection circuit being low; or, in response to the first level signal of the first open state detection circuit being high, to perform the step of driving the contact position of the first switch to the first direction contact.

[0250] In an optional embodiment, the at least one detection circuit includes a first off-state detection circuit and a first on-state detection circuit, and the first level signal includes a first off-state level signal of the first off-state detection circuit and a first on-state level signal of the first on-state detection circuit.

[0251] The determining module 2020 is further configured to determine that the state detection circuit contains a load and the state detection circuit is in an open state in response to the first off-state level signal being high and the first on-state level signal being low; or, in response to the first off-state level signal being low and the first on-state level signal being high, to execute the step of driving the contact position of the first switch to the first direction contact.

[0252] In an optional embodiment, the type of the multi-control switch group includes at least one of the following: a thyristor switch group and an electronic switch group.

[0253] In an optional embodiment, the contact positions of the first switch include a first directional contact and a second directional contact, and the contact positions of the second switch include a third directional contact and a fourth directional contact.

[0254] When the state detection circuit is in the ON state, the contact position of the first switch is located at the first direction contact and the contact position of the second switch is located at the fourth direction contact, or the contact position of the first switch is located at the second direction contact and the contact position of the second switch is located at the third direction contact.

[0255] In summary, the device provided in this application can, in response to the relay entering a powered-on state, acquire a first-level signal detected by the detection circuit, determine a first state of the state detection circuit based on the first-level signal, and preliminarily determine the load state and conduction state of the state detection circuit through the detection circuit. It drives the contact position of the first switch to the first directional contact. When the contact position of the first switch is at the first directional contact, it acquires a second-level signal detected by the detection circuit, and determines a second state of the state detection circuit based on the second-level signal and the contact position of the first switch. The second state represents the load state of the state detection circuit and the multi-control switch position state of the relay. This solves the problem that the relay cannot determine the contact position of the switch when it is first powered on, and determines the load state in the circuit, facilitating timely load replacement by the user, reducing trial and error when controlling the load to open and close, and improving interaction efficiency.

[0256] It should be noted that the switch detection device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the switch detection device and the switch detection method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0257] Figure 22 A structural block diagram of a computer device 2200 provided in an exemplary embodiment of this application is shown. The computer device 2200 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The computer device 2200 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.

[0258] Typically, computer device 2200 includes a processor 2201 and a memory 2202.

[0259] Processor 2201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 2201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 2201 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 2201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 2201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0260] The memory 2202 may include one or more computer-readable storage media, which may be non-transitory. The memory 2202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2202 is used to store at least one instruction, which is executed by the processor 2201 to implement the switch detection method provided in the method embodiments of this application.

[0261] In some embodiments, the computer device 2200 also includes other components, as those skilled in the art will understand. Figure 22 The structure shown does not constitute a limitation on terminal 2200 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0262] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0263] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, a code set, or an instruction set. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the switch detection method as described in any of the above embodiments of this application.

[0264] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the switch detection method as described in any of the above embodiments of this application.

[0265] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the switch detection methods described in the above embodiments.

[0266] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0267] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A switch detection method, characterized in that, This invention relates to a state detection circuit, which includes a relay and at least one detection circuit. The relay includes a multi-control switch group, wherein the contact positions of the switches in the multi-control switch group randomly change after the relay is energized. The multi-control switch group includes a first switch and a second switch. The contact positions of the first switch include a first-direction contact and a second-direction contact, and the contact positions of the second switch include a third-direction contact and a fourth-direction contact. When the state detection circuit is in a conducting state, the contact positions of the first switch and the second switch are located at the first-direction contact and the fourth-direction contact, or the first switch and the second switch are located at the second-direction contact and the third-direction contact, respectively. When the state detection circuit is in a disconnected state, the contact positions of the first switch and the second switch are located at the first-direction contact and the third-direction contact, or the first switch and the second switch are located at the second-direction contact and the fourth-direction contact, respectively. The method includes: In response to the relay entering the power-on state, the first level signal detected by the detection circuit is acquired; The first state of the state detection circuit is determined based on the first level signal. The first state is used to indicate the load state and the conduction state of the state detection circuit. Drive the contact position of the first switch to the first direction contact; Obtain the second-level signal detected by the detection circuit; The second state of the state detection circuit is determined based on the second level signal and the contact position of the first switch. The second state is used to represent the load state of the state detection circuit and the position state of the multi-control switch of the relay.

2. The method according to claim 1, characterized in that, The at least one detection circuit includes a first off-state detection circuit; Determining the first state of the state detection loop based on the first level signal includes: In response to the first level signal of the first off-state detection circuit being high, it is determined that the first state is that the state detection circuit contains a load and the state detection circuit is in an open state. or, In response to the first level signal of the first off-state detection circuit being low, the step of driving the contact position of the first switch to the first direction contact is executed.

3. The method according to claim 2, characterized in that, Determining the second state of the state detection circuit based on the second level signal and the contact position of the first switch includes: In response to the first level signal of the first off-state detection circuit being low and the second level signal of the first off-state detection circuit being low, the contact position of the first switch is driven to the second direction contact, and the state of the state detection circuit is determined based on the second direction contact. or, In response to the first level signal of the first off-state detection circuit being low and the second level signal of the first off-state detection circuit being high, it is determined that the second state is that the state detection circuit contains a load and the contact position of the second switch of the relay is located at a third-direction contact.

4. The method according to claim 3, characterized in that, The step of driving the contact position of the first switch to the second directional contact in response to the first level signal of the first off-state detection circuit being low and the second level signal of the first off-state detection circuit being low, and determining the state of the state detection circuit based on the second directional contact, includes: Obtain the third level signal of the first off-state detection circuit; The third state of the state detection circuit is determined based on the third level signal. The third state is used to represent the load state of the state detection circuit and the multi-control switch position state of the relay.

5. The method according to claim 4, characterized in that, Determining the third state of the state detection loop based on the third level signal includes: In response to the third level signal of the first off-state detection circuit being low, the relay is de-energized and then re-energized; or, In response to the third level signal of the first off-state detection circuit being high, the third state is determined to be that the state detection circuit contains a load and the contact position of the second switch of the relay is located at the fourth direction contact.

6. The method according to claim 5, characterized in that, After the relay is powered off and then powered on again in response to the third-level signal of the first off-state detection circuit being low, the method further includes: In response to the relay entering the power-on state, the fourth level signal of the first off-state detection circuit is acquired; In response to the fourth level signal of the first off-state detection circuit being low, the contact position of the first switch is driven to the first direction contact. Obtain the fifth level signal of the first off-state detection circuit; In response to the fifth level signal of the first off-state detection circuit being low, it is determined that there is no load in the state detection loop.

7. The method according to claim 1, characterized in that, The at least one detection circuit includes a first off-state detection circuit and a second off-state detection circuit, and the first level signal includes a first off-state level signal of the first off-state detection circuit and a second off-state level signal of the second off-state detection circuit; The step of determining the first state of the state detection loop based on the first level signal further includes: In response to the opposite levels of the first off-state level signal and the second off-state level signal, it is determined that the state detection loop contains a load and the state detection loop is in an open state; or, In response to both the first off-state level signal and the second off-state level signal being low, the step of driving the contact position of the first switch to the first direction contact is executed.

8. The method according to claim 1, characterized in that, The at least one detection circuit includes a first off-state detection circuit, a second off-state detection circuit, and a first on-state detection circuit. The first level signal includes a first off-state level signal of the first off-state detection circuit, a second off-state level signal of the second off-state detection circuit, and a first on-state level signal of the first on-state detection circuit. The step of determining the first state of the state detection loop based on the first level signal further includes: In response to the opposite levels of the first off-state level signal and the second off-state level signal and the first on-state level signal being low, it is determined that the state detection loop contains a load and the state detection loop is in an open state; or, In response to both the first off-state level signal and the second off-state level signal being low and the first on-state level signal being high, the step of driving the contact position of the first switch to the first direction contact is executed.

9. The method according to claim 1, characterized in that, The at least one detection circuit includes a first on-state detection circuit; The step of determining the first state of the state detection loop based on the first level signal further includes: In response to the first level signal of the first open state detection circuit being low, it is determined that the state detection circuit contains a load and the state detection circuit is in an open state; or, In response to the first level signal of the first open state detection circuit being high, the step of driving the contact position of the first switch to the first direction contact is executed.

10. The method according to claim 1, characterized in that, The at least one detection circuit includes a first off-state detection circuit and a first on-state detection circuit, and the first level signal includes a first off-state level signal of the first off-state detection circuit and a first on-state level signal of the first on-state detection circuit. The step of determining the first state of the state detection loop based on the first level signal further includes: In response to the first off-state level signal being high and the first on-state level signal being low, it is determined that the state detection loop contains a load and the state detection loop is in an open state; or, In response to the first off-state level signal being low and the first on-state level signal being high, the step of driving the contact position of the first switch to the first direction contact is executed.

11. The method according to any one of claims 1 to 10, characterized in that, The types of multi-control switch groups include at least one of thyristor switch groups and electronic switch groups.

12. A switch detection device, characterized in that, This invention relates to a state detection circuit, which includes a relay and at least one detection circuit. The relay includes a multi-control switch group, wherein the contact positions of the switches in the multi-control switch group randomly change after the relay is energized. The multi-control switch group includes a first switch and a second switch. The contact positions of the first switch include a first-direction contact and a second-direction contact, and the contact positions of the second switch include a third-direction contact and a fourth-direction contact. When the state detection circuit is in a conducting state, the contact positions of the first switch and the second switch are located at the first-direction contact and the fourth-direction contact, or the first switch and the second switch are located at the second-direction contact and the third-direction contact, respectively. When the state detection circuit is in a disconnected state, the contact positions of the first switch and the second switch are located at the first-direction contact and the third-direction contact, or the first switch and the second switch are located at the second-direction contact and the fourth-direction contact, respectively. The device includes: The acquisition module, in response to the relay entering the power-on state, acquires the first level signal detected by the detection circuit; The determination module determines a first state of the state detection circuit based on the first level signal. The first state is used to indicate the load state and the conduction state of the state detection circuit. The driving module drives the contact position of the first switch to the first direction contact; The acquisition module acquires the second level signal detected by the detection circuit. The determining module determines the second state of the state detection circuit based on the second level signal and the contact position of the first switch. The second state is used to represent the load state of the state detection circuit and the position state of the multi-control switch of the relay.

13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the switch detection method as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is loaded and executed by a processor to implement the switch detection method as described in any one of claims 1 to 11.

15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the switch detection method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Switch control circuit, chip, adaptor and switch control method

    CN108712062A

  • Detection apparatus for ternary switch

    CN204789937U