Relay adhesion detection method and device, electronic equipment and storage medium

By using an optocouple sampling circuit in relay detection, the effective value is output based on the number of times of the AC voltage, the problem of high cost and power consumption in the prior art is solved, and the adhesion detection of lower complexity, cost and power consumption is achieved, and the user experience is improved.

CN119881630APending Publication Date: 2025-04-25HANGZHOU EV TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510092363.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art detects whether the relay is stuck through the isolation op amp, which has high cost and power consumption, resulting in poor user experience.

Method used

An optocouple sampling circuit is used to determine whether the relay has an AC voltage outside during each sampling period, and output the effective value according to the number of times the voltage exists to realize adhesion detection. This method does not require additional power supply, reducing the complexity and cost of detection and avoiding additional power loss.

Benefits of technology

It reduces the complexity and cost of relay adhesion detection, reduces power consumption, improves detection reliability, and thus improves the user's experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119881630A_ABST
    Figure CN119881630A_ABST
Patent Text Reader

Abstract

The invention provides a relay adhesion detection method and device, electronic equipment and a storage medium. The method comprises the following steps: in each sampling period, based on a preset time interval, determining whether there is an AC voltage on the outer side of a relay; determining the number of times of existence of the alternating-current voltage on the inner side and the outer side in each sampling period; if the number of times is larger than a preset first threshold value, the effective value of the alternating-current voltage on the outer side is output as a first value; and if the number of times is smaller than or equal to the first threshold value, the effective value of the alternating-current voltage outside the output side is a second value. In the mode, no extra power supply is needed, and the complexity and cost of relay adhesion detection can be reduced; according to the relay adhesion detection method and device, extra power loss does not need to be introduced, power consumption of relay adhesion detection can be reduced, reliability of relay adhesion detection is improved, and therefore user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of relays, and in particular to a method, device, electronic equipment and storage medium for detecting relay adhesion. Background Art

[0002] At present, the existing technology generally detects whether the relay is stuck by isolating the operational amplifier. The isolating operational amplifier, also known as the isolation amplifier, is a special measurement amplifier circuit. There is no direct circuit coupling between its input, output and power supply circuit, that is, there is no common ground terminal during the signal transmission process. There is an ohmic isolation device between the input circuit and the amplifier output.

[0003] However, the solution of detecting whether the relay is stuck by isolating the op amp has the following defects: 1. Increased cost: Isolation op amps usually require additional power to provide electrical isolation, which increases the complexity and cost of the system. 2. Increased power consumption: Some isolation op amp technologies will introduce additional power loss, which may affect the overall efficiency of the system and increase the power consumption of the system.

[0004] Therefore, the existing solution of detecting whether the relay is stuck by isolating the operational amplifier has the problem of high cost and power consumption, resulting in a poor user experience. Summary of the invention

[0005] In view of this, the object of the present invention is to provide a method, device, electronic device and storage medium for relay adhesion detection, which do not require additional power supply and can reduce the complexity and cost of relay adhesion detection; do not require the introduction of additional power loss, can reduce the power consumption of relay adhesion detection, and improve the reliability of relay adhesion detection, thereby improving the user experience.

[0006] In a first aspect, an embodiment of the present invention provides a method for detecting relay adhesion, the method comprising: determining whether there is an external AC voltage on the relay based on a preset time interval within each sampling cycle; determining the number of times the external AC voltage exists within each sampling cycle; if the number is greater than a preset first threshold, outputting an effective value of the external AC voltage as a first value; if the number is less than or equal to the first threshold, outputting an effective value of the external AC voltage as a second value.

[0007] In an optional embodiment of the present application, a first count value and a second count value are pre-set; the above-mentioned step of determining whether there is an external AC voltage on the relay based on a preset time interval within each sampling period includes: at the beginning of each sampling period, setting both the first count value and the second count value to 0; when the preset time interval is reached, adding 1 to the second count value; and determining whether there is an external AC voltage on the relay.

[0008] In an optional embodiment of the present application, the above-mentioned step of determining whether there is an external AC voltage on the relay includes: collecting whether there is an external AC voltage on the relay through an optocoupler sampling circuit; if there is an external AC voltage on the sampling port of the optocoupler sampling circuit, outputting a low-level signal; if there is no external AC voltage on the sampling port of the optocoupler sampling circuit, outputting a high-level signal.

[0009] In an optional embodiment of the present application, the above-mentioned step of determining the number of times the external AC voltage exists in each sampling period includes: when the optocoupler sampling circuit outputs a low-level signal, the first count value is increased by 1; when the optocoupler sampling circuit outputs a high-level signal, the first count value remains unchanged; after the end of each sampling period, the first count value is used as the number of times the external AC voltage exists.

[0010] In an optional embodiment of the present application, the above-mentioned step of using the first count value as the number of times the external AC voltage exists after the end of each sampling cycle includes: after the optocoupler sampling circuit outputs a low-level signal or a high-level signal, determining whether the second count value is greater than a preset second threshold value; if the second count value is greater than the preset second threshold value, determining that the sampling cycle is over; using the first count value as the number of times the external AC voltage exists; if the second count value is less than or equal to the second threshold value, determining that the sampling cycle is not over; and continuing to execute the step of adding 1 to the second count value when the preset time interval is reached.

[0011] In an optional embodiment of the present application, the above method further includes: after outputting the effective value of the external AC voltage, setting both the first count value and the second count value to 0.

[0012] In an optional embodiment of the present application, the above method also includes: determining the AC voltage on the inside of the relay after a preset condition is met; wherein the preset condition includes at least one of the following: the relay is disconnected, the machine is in a non-operating state, and the AC voltage on the outside is within a preset range; detecting whether the relay is stuck based on the effective values ​​of the AC voltage on the inside and the AC voltage on the outside.

[0013] In a second aspect, an embodiment of the present invention further provides a device for detecting relay adhesion, the device comprising: an AC voltage detection module, for determining whether there is an external AC voltage in the relay based on a preset time interval within each sampling cycle; an existence times determination module, for determining the number of times the external AC voltage exists within each sampling cycle; a first effective value output module, for outputting the effective value of the external AC voltage as a first value if the number is greater than a preset first threshold; and a second effective value output module, for outputting the effective value of the external AC voltage as a second value if the number is less than or equal to the first threshold.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the above-mentioned method for detecting relay adhesion.

[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method for relay adhesion detection.

[0016] The embodiments of the present invention bring the following beneficial effects:

[0017] The embodiment of the present invention provides a method, device, electronic device and storage medium for relay adhesion detection, which determines whether there is an external AC voltage on the relay based on a preset time interval in each sampling period; determines the number of times the external AC voltage exists in each sampling period; if the number is greater than a preset first threshold, the effective value of the external AC voltage is output as a first value; if the number is less than or equal to the first threshold, the effective value of the external AC voltage is output as a second value. In this way, no additional power supply is required, which can reduce the complexity and cost of relay adhesion detection; no additional power loss is introduced, which can reduce the power consumption of relay adhesion detection, improve the reliability of relay adhesion detection, and thus improve the user experience.

[0018] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.

[0019] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 A flow chart of a method for detecting relay adhesion provided by an embodiment of the present invention;

[0022] Figure 2A flow chart of a second relay adhesion detection method provided by an embodiment of the present invention;

[0023] Figure 3 A schematic diagram of a method for detecting relay adhesion provided by an embodiment of the present invention;

[0024] Figure 4 A flowchart of a third relay adhesion detection method provided by an embodiment of the present invention;

[0025] Figure 5 A schematic diagram of another relay adhesion detection method provided by an embodiment of the present invention;

[0026] Figure 6 A schematic diagram of the structure of a device for detecting relay adhesion provided by an embodiment of the present invention;

[0027] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] At present, the existing technology generally detects whether the relay is stuck by isolating the operational amplifier. The isolating operational amplifier, also known as the isolation amplifier, is a special measurement amplifier circuit. There is no direct circuit coupling between its input, output and power supply circuit, that is, there is no common ground terminal during the signal transmission process. There is an ohmic isolation device between the input circuit and the amplifier output.

[0030] However, the solution of detecting whether the relay is stuck by isolating the op amp has the following defects: 1. Increased cost: Isolation op amps usually require additional power to provide electrical isolation, which increases the complexity and cost of the system. 2. Increased power consumption: Some isolation op amp technologies will introduce additional power loss, which may affect the overall efficiency of the system and increase the power consumption of the system.

[0031] Therefore, the existing solution of detecting whether the relay is stuck by isolating the operational amplifier has the problem of high cost and power consumption, resulting in a poor user experience.

[0032] Based on this, the embodiments of the present invention provide a method, device, electronic device and storage medium for relay adhesion detection, which do not require additional power supply and can reduce the complexity and cost of relay adhesion detection; do not require the introduction of additional power loss and can reduce the power consumption of relay adhesion detection and improve the reliability of relay adhesion detection, thereby improving the user experience.

[0033] To facilitate understanding of this embodiment, a method for detecting relay adhesion disclosed in an embodiment of the present invention is first introduced in detail.

[0034] Embodiment 1:

[0035] The present invention provides a method for detecting relay adhesion. Figure 1 A flow chart of a method for detecting relay adhesion is shown, and the method for detecting relay adhesion includes the following steps:

[0036] Step S102: In each sampling period, determine whether there is an external AC voltage on the relay based on a preset time interval.

[0037] In this embodiment, whether there is an external AC voltage on the relay can be determined based on a preset time interval in each sampling period.

[0038] For example, the time interval may be 100us, and the sampling period may be 200 acquisitions, that is, a total of 200 determinations are made in each sampling period to determine whether there is an external AC voltage on the relay, and the sampling period is 100us×200=20000us=0.2s.

[0039] Step S104, determining the number of times the external AC voltage exists in each sampling period.

[0040] This embodiment can determine the number of times the external AC voltage exists in each sampling period. For example, in the first period, the number of times the external AC voltage exists can be 100; in the second period, the number of times the external AC voltage exists can be 5.

[0041] Step S106: If the number of times is greater than a preset first threshold, the effective value of the AC voltage outputted to the outside is a first value.

[0042] In this embodiment, a first threshold value (eg, 10) may be set. In this embodiment, the number of times the external AC voltage exists in each sampling period may be compared with the preset first threshold value, thereby outputting different effective values ​​of the external AC voltage.

[0043] For example, in the first cycle, the number of times the external AC voltage exists may be 100 and greater than the first threshold value 10, and then the effective value of the output current voltage may be the first value (eg, 30V).

[0044] Step S108: If the number is less than or equal to the first threshold, the effective value of the AC voltage outputted to the outside is a second value.

[0045] For example, in the second cycle, the number of times the external AC voltage exists may be 5 which is less than the first threshold value 10, and then the effective value of the output current voltage may be a second value (eg, 20V).

[0046] In summary, the comparison result of the number of times the external AC voltage exists in different sampling periods and the preset first threshold value can output different effective values ​​of the external AC voltage. This embodiment can determine whether the relay is stuck based on the above effective value.

[0047] The embodiment of the present invention provides a method for relay adhesion detection, in each sampling period, determining whether there is an external AC voltage on the relay based on a preset time interval; determining the number of times the external AC voltage exists in each sampling period; if the number is greater than a preset first threshold, the effective value of the external AC voltage is output as a first value; if the number is less than or equal to the first threshold, the effective value of the external AC voltage is output as a second value. In this method, no additional power supply is required, which can reduce the complexity and cost of relay adhesion detection; no additional power loss is introduced, which can reduce the power consumption of relay adhesion detection, improve the reliability of relay adhesion detection, and thus improve the user experience.

[0048] Embodiment 2:

[0049] This embodiment provides another method for relay adhesion detection, which is implemented on the basis of the above embodiment, focusing on describing the specific implementation scheme of relay adhesion detection. Figure 2 The flowchart of the second relay adhesion detection method shown in FIG. 1 includes the following steps:

[0050] Step S202, at the beginning of each sampling period, the first count value and the second count value are both set to 0; when the preset time interval is reached, the second count value is increased by 1; and it is determined whether there is an external AC voltage on the relay.

[0051] In this embodiment, a first count value and a second count value may be preset, the first count value is used to count the number of times the AC voltage exists inside and outside the sampling period, and the second count value is used to count the sampling period.

[0052] See also Figure 3A schematic diagram of a relay adhesion detection method is shown in FIG. Figure 3 As shown, at the beginning of each sampling period, the first count value Cnt1 and the second count value Cnt2 may be set to 0, that is, Cnt1=0, Cnt2=0.

[0053] like Figure 3 As shown, when the preset time interval (which can be set to 100us) is reached, the second count value is increased by 1, that is, Cnt2=Cnt2+1, and then a sampling judgment is performed to determine whether the external AC voltage exists.

[0054] In some embodiments, an optocoupler sampling circuit can be used to detect whether there is an external AC voltage on the relay; if there is an external AC voltage on the sampling port of the optocoupler sampling circuit, a low-level signal is output; if there is no external AC voltage on the sampling port of the optocoupler sampling circuit, a high-level signal is output.

[0055] Optocoupler, also known as photoelectric coupler, is an electric-to-optical-to-electrical conversion device that uses light as a medium to transmit electrical signals. It consists of two parts: a light source and a light receiver. The light source and the light receiver are assembled in the same sealed housing and isolated from each other by a transparent insulator. The pin of the light source is the input end, and the pin of the light receiver is the output end. The common light source is a light emitting diode, and the light receiver is a photodiode, a phototransistor, etc.

[0056] Unlike isolation amplifiers, optocouplers do not require additional power supply, which can reduce the complexity and cost of relay sticking detection. They also do not need to introduce additional power loss, which can reduce the power consumption of relay sticking detection and improve the reliability of relay sticking detection, thereby improving the user experience.

[0057] Among them, the optocoupler sampling circuit can collect the AC (alternating current) voltage on the outside of the relay and report it, so as to determine whether there is AC voltage on the outside of the relay and realize subsequent relay adhesion detection.

[0058] Among them, if there is an external AC voltage at the sampling port of the optocoupler sampling circuit, a low-level signal is input into the corresponding GPIO (General-purpose input / output) port for detection. If there is no external AC voltage at the sampling port of the optocoupler sampling circuit, the GPIO port can output a high-level signal.

[0059] Therefore, this embodiment can detect whether there is an external AC voltage on the relay through the optical coupling sampling circuit, and can output a low level signal or a high level signal based on the existence or non-existence of the external AC voltage.

[0060] Step S204, determining the number of times the external AC voltage exists in each sampling period.

[0061] In some embodiments, when the optocoupler sampling circuit outputs a low-level signal, the first count value is increased by 1; when the optocoupler sampling circuit outputs a high-level signal, the first count value remains unchanged; after each sampling cycle, the first count value is used as the number of times the external AC voltage exists.

[0062] In this embodiment, the first count value Cnt1 is used to count the number of times the AC voltage exists inside and outside the sampling period. Specifically, the first count value Cnt1 can be used to detect the number of low-level signals.

[0063] like Figure 3 As shown, when the optocoupler sampling circuit outputs a low level signal, the first count value is increased by 1, that is, Cnt1=Cnt1+1; when the optocoupler sampling circuit outputs a high level signal, the first count value remains unchanged, that is, Cnt1=Cnt1.

[0064] In some embodiments, after the optocoupler sampling circuit outputs a low-level signal or a high-level signal, it is determined whether the second count value is greater than a preset second threshold value; if the second count value is greater than the preset second threshold value, it is determined that the sampling period is over; the first count value is used as the number of times the external AC voltage exists; if the second count value is less than or equal to the second threshold value, it is determined that the sampling period is not over; and the step of adding 1 to the second count value is continued when the preset time interval is reached.

[0065] The second count value Cnt2 in this embodiment is used to count the sampling period. Figure 3 As shown, the second threshold is set to 200. In this embodiment, after the first count value Cnt1 is increased by 1 based on the low-level signal output by the optocoupler sampling circuit or the high-level signal remains unchanged, it can be determined whether the second count value Cnt2 is greater than 200, that is, Cnt2>200.

[0066] like Figure 3 As shown, if the second count value Cnt2 is greater than the second threshold value 200, it is determined that the sampling period is over; the first count value Cnt1 is used as the number of times the external AC voltage exists. If the second count value Cnt2 is less than or equal to the second threshold value 200, it is determined that the sampling period is not over and the step of adding 1 to the second count value when the preset time interval is reached is continued, that is, Cnt2=Cnt2+1 is continued.

[0067] Step S206: If the number of times is greater than a preset first threshold, the effective value of the AC voltage outputted to the outside is a first value.

[0068] like Figure 3As shown, if the second count value Cnt2 is greater than the second threshold value 200, it is determined that the sampling period is over, and the first count value Cnt1 is used as the number of times the external AC voltage exists. Figure 3 The first threshold in is set to 10. If the first count value Cnt1 is greater than the first threshold 10, the effective value Vac of the external AC voltage is the first value 30V.

[0069] Step S208: If the number is less than or equal to the first threshold, the effective value of the AC voltage outputted to the outside is a second value.

[0070] like Figure 3 As shown, if the second count value Cnt2 is greater than the second threshold value 200, it is determined that the sampling period is over, and the first count value Cnt1 is used as the number of times the external AC voltage exists. Figure 3 The first threshold in is set to 10. If the first count value Cnt1 is less than or equal to the first threshold 10, the effective value Vac of the external AC voltage is the second value 20V.

[0071] After the optocoupler sampling circuit reports the effective value Vac of the external AC voltage, it can be determined whether the relay is stuck based on the effective value Vac of the external AC voltage.

[0072] In some embodiments, after the effective value of the external AC voltage is output, the first count value and the second count value are both set to 0.

[0073] like Figure 3 As shown, after the optocoupler sampling circuit reports the effective value Vac of the external AC voltage, the first count value Cnt1 and the second count value Cnt2 can also be set to 0, that is, Cnt1=0, Cnt2=0, thereby ensuring that the first count value Cnt1 and the second count value Cnt2 are both 0 at the beginning of the next acquisition cycle.

[0074] After each counting cycle, the count is reset and the output is updated with the voltage detection value. Repeating the above operation can realize the AC voltage detection for each cycle.

[0075] The above method provided by the embodiment of the present invention can perform relay adhesion detection based on the first count value Cnt1 and the second count value Cnt2 in each sampling period, and collect whether there is an external AC voltage of the relay through an optical coupling sampling circuit. In this method, no additional power supply is required, which can reduce the complexity and cost of relay adhesion detection; no additional power loss is required, which can reduce the power consumption of relay adhesion detection, improve the reliability of relay adhesion detection, and thus improve the user experience.

[0076] Embodiment three:

[0077] This embodiment provides another method for relay adhesion detection, which is implemented on the basis of the above embodiment, focusing on describing the specific implementation scheme of relay adhesion detection. Figure 4 The flowchart of the third relay adhesion detection method shown in FIG. 1 includes the following steps:

[0078] Step S402: In each sampling period, determine whether there is an external AC voltage on the relay based on a preset time interval.

[0079] Step S404, determining the number of times the external AC voltage exists in each sampling period.

[0080] Step S406: If the number is greater than a preset first threshold, the effective value of the AC voltage outputted to the outside is a first value.

[0081] Step S408: If the number is less than or equal to the first threshold, the effective value of the AC voltage outputted to the outside is a second value.

[0082] Step S410, when the preset conditions are met, determine the AC voltage inside the relay; wherein the preset conditions include at least one of the following: the relay is disconnected, the machine is in a non-operating state, and the AC voltage outside is within a preset range.

[0083] In this embodiment, by determining the difference in effective values ​​of the AC voltages inside and outside the relay when the relay is closed or opened, it can be determined whether the relay is stuck based on the difference.

[0084] See also Figure 5 A schematic diagram of another method for detecting relay adhesion is shown, wherein U1 is the command voltage, U2 is the AC voltage inside the relay, and U3 is the AC voltage outside the relay.

[0085] like Figure 5 As shown, it can be determined whether the pre-set conditions are met. Figure 5 The conditions include: 1) The relay is disconnected. 2) The machine is not in operation. 3) The external AC voltage U3 is less than 20V.

[0086] like Figure 5 As shown, only when the above three conditions are met can subsequent operations be performed; otherwise, the machine is shut down to exit the adhesion detection, and the adhesion detection result can be reported as: state 4 (unable to detect).

[0087] Step S412, detecting whether the relay is stuck based on the effective values ​​of the inner AC voltage and the outer AC voltage.

[0088] like Figure 5As shown, when the above three conditions are met, the relay can be left unoperated, and the slave machine performs inverter output according to the voltage setting of adding 10V (effective value) to the current AC voltage U3 outside the relay, that is, the inverter output is U3+10V.

[0089] like Figure 5 As shown, if the voltage difference between the command voltage U1 and the inner AC voltage U2 is less than 3V, that is, |U1-U2|<3V, then it is determined whether the difference between the command voltage U1 and the outer AC voltage U3 is greater than 5V, that is, |U1-U3|>5V, and it lasts for 200ms.

[0090] like Figure 5 As shown, if the difference between the command voltage U1 and the external AC voltage U3 for 200ms is less than or equal to 5V, the machine can be shut down to exit the sticking detection, and the sticking detection result reported is: state 2 (stuck in closed, i.e., sticking state).

[0091] like Figure 5 As shown, if the difference between the command voltage U1 and the external AC voltage U3 for 200ms is greater than 5V, the inverter output can be stopped, and the next step of judgment can be made after the AC voltage U2 inside the relay drops.

[0092] like Figure 5 As shown, the slave performs inverter output according to the voltage setting of adding 10V (effective value) to the current AC voltage U3 outside the relay, that is, the inverter output is U3+10V, and sends a relay closing instruction.

[0093] like Figure 5 As shown, it is determined that the voltage difference between the command voltage U1 and the inner AC voltage U2 is less than 3V, that is, |U1-U2|<3V. If the voltage difference between the command voltage U1 and the inner AC voltage U2 is greater than or equal to 3V and lasts for 1s, the machine can be shut down to exit the adhesion detection, and the adhesion detection result is reported as: State 4 (unable to detect).

[0094] like Figure 5 As shown, if the voltage difference between the command voltage U1 and the inner AC voltage U2 is less than 3V, it is determined whether the difference between the relay command voltage U1 and the outer AC voltage U3 is less than 5V, that is, |U1-U3|<5V, and it lasts for 200ms.

[0095] like Figure 5 As shown, if the difference between the command voltage U1 and the external AC voltage U3 for 200ms is greater than or equal to 5V, the machine can be shut down to exit the sticking detection, and the sticking detection result reported is: state 3 (stuck in open, i.e., unable to close).

[0096] like Figure 5 As shown, if the difference between the command voltage U1 and the external AC voltage U3 for 200ms is less than 5V, the inverter output can be stopped and the adhesion detection result can be reported as: state 1 (no adhesion).

[0097] The above method provided by the embodiment of the present invention can determine the difference in the effective value of the AC voltage inside and outside the relay when the relay is closed or opened, and determine whether the relay is stuck based on the above difference, thereby quickly and accurately realizing the sticking detection of the relay.

[0098] Embodiment 4:

[0099] Corresponding to the above method embodiment, the embodiment of the present invention provides a device for detecting relay adhesion, see Figure 6 A schematic structural diagram of a relay adhesion detection device is shown, and the relay adhesion detection device includes:

[0100] The AC voltage detection module 61 is used to determine whether there is an external AC voltage on the relay based on a preset time interval in each sampling period;

[0101] The existence times determination module 62 is used to determine the number of times the external AC voltage exists in each sampling period;

[0102] A first effective value output module 63, configured to output the effective value of the external AC voltage as a first value if the number of times is greater than a preset first threshold;

[0103] The second effective value output module 64 is used to output the effective value of the external AC voltage as a second value if the number is less than or equal to the first threshold.

[0104] The embodiment of the present invention provides a device for relay adhesion detection, which determines whether there is an external AC voltage on the relay based on a preset time interval in each sampling period; determines the number of times the external AC voltage exists in each sampling period; if the number is greater than a preset first threshold, the effective value of the external AC voltage is output as a first value; if the number is less than or equal to the first threshold, the effective value of the external AC voltage is output as a second value. In this method, no additional power supply is required, which can reduce the complexity and cost of relay adhesion detection; no additional power loss is introduced, which can reduce the power consumption of relay adhesion detection, improve the reliability of relay adhesion detection, and thus improve the user experience.

[0105] The first count value and the second count value are preset; the above-mentioned AC voltage detection module is used to set the first count value and the second count value to 0 at the beginning of each sampling cycle; when the preset time interval is reached, the second count value is increased by 1; and it is determined whether there is an external AC voltage in the relay.

[0106] The above-mentioned AC voltage detection module is used to collect whether there is an external AC voltage on the relay through an optocoupler sampling circuit; if there is an external AC voltage on the sampling port of the optocoupler sampling circuit, a low-level signal is output; if there is no external AC voltage on the sampling port of the optocoupler sampling circuit, a high-level signal is output.

[0107] The above-mentioned existence count determination module is used to increase the first count value by 1 when the optocoupler sampling circuit outputs a low-level signal; when the optocoupler sampling circuit outputs a high-level signal, the first count value remains unchanged; after each sampling cycle, the first count value is used as the number of times the external AC voltage exists.

[0108] The above-mentioned existence count determination module is used to determine whether the second count value is greater than the preset second threshold value after the optocoupler sampling circuit outputs a low-level signal or a high-level signal; if the second count value is greater than the preset second threshold value, determine that the sampling period is over; use the first count value as the number of times the external AC voltage exists; if the second count value is less than or equal to the second threshold value, determine that the sampling period is not over; and continue to execute the step of adding 1 to the second count value when the preset time interval is reached.

[0109] The above device also includes: a count value clearing module, which is used to set both the first count value and the second count value to 0 after outputting the effective value of the external AC voltage.

[0110] The above-mentioned device also includes: a relay adhesion detection module, which is used to determine the AC voltage inside the relay when the preset conditions are met; wherein the preset conditions include at least one of the following: the relay is disconnected, the machine is in a non-operating state, and the AC voltage outside is within a preset range; based on the effective value of the AC voltage inside and the AC voltage outside, detect whether the relay is stuck.

[0111] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system for relay sticking detection described above can refer to the corresponding process in the embodiment of the aforementioned method for relay sticking detection, and will not be repeated here.

[0112] Embodiment five:

[0113] The embodiment of the present invention also provides an electronic device for executing the above relay adhesion detection method; see Figure 7 A structural schematic diagram of an electronic device is shown, the electronic device includes a memory 100 and a processor 101, wherein the memory 100 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 101 to implement the above-mentioned method for relay adhesion detection.

[0114] Further, Figure 7 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .

[0115] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0116] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.

[0117] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method for relay adhesion detection. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0118] The computer program product of the method, device, electronic device and storage medium for relay adhesion detection provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0120] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0121] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0122] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0123] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for detecting relay adhesion, characterized in that: The method comprises: In each sampling period, determining whether there is an external AC voltage at the relay based on a preset time interval; Determining the number of times the external AC voltage exists in each sampling period; If the number is greater than a preset first threshold, the effective value of the AC voltage outputted from the outside is a first value; If the number of times is less than or equal to the first threshold, the effective value of the AC voltage outputted from the outside is a second value.

2. The method according to claim 1, characterized in that The steps of presetting a first count value and a second count value; and determining whether there is an external AC voltage on the relay based on a preset time interval within each sampling period include: At the beginning of each sampling period, the first count value and the second count value are both set to 0; When the preset time interval is reached, the second count value is increased by 1; Determine if there is AC voltage outside the relay.

3. The method according to claim 2, characterized in that The steps for determining whether there is AC voltage outside the relay include: The photocoupler sampling circuit is used to detect whether there is an AC voltage outside the relay; If the external AC voltage exists at the sampling port of the optical coupling sampling circuit, a low level signal is output; If the external AC voltage does not exist at the sampling port of the optocoupler sampling circuit, a high level signal is output.

4. The method according to claim 3, characterized in that The step of determining the number of times the external AC voltage exists in each sampling period comprises: When the optical coupler sampling circuit outputs the low level signal, the first count value is increased by 1; When the optical coupler sampling circuit outputs the high level signal, the first count value remains unchanged; After each sampling period ends, the first count value is used as the number of times the external AC voltage exists.

5. The method according to claim 4, characterized in that After each sampling period ends, the step of using the first count value as the number of times the external AC voltage exists includes: After the optical coupler sampling circuit outputs the low level signal or the high level signal, determining whether the second count value is greater than a preset second threshold value; If the second count value is greater than a preset second threshold value, it is determined that the sampling period ends; the first count value is used as the number of times the external AC voltage exists; If the second count value is less than or equal to the second threshold, it is determined that the sampling period has not ended; and the step of increasing the second count value by 1 when the preset time interval is reached is continued.

6. The method according to claim 2, characterized in that The method further comprises: After the effective value of the external AC voltage is output, the first count value and the second count value are both set to 0.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When a preset condition is met, the AC voltage inside the relay is determined; wherein the preset condition includes at least one of the following: the relay is disconnected, the machine is in a non-operating state, and the AC voltage outside meets a preset range; Whether the relay is stuck is detected based on effective values ​​of the inner AC voltage and the outer AC voltage.

8. A device for detecting relay adhesion, characterized in that: The device comprises: The AC voltage detection module is used to determine whether there is an external AC voltage on the relay based on a preset time interval in each sampling period; An existence times determination module, used to determine the number of times the external AC voltage exists in each sampling period; A first effective value output module, configured to output the effective value of the external AC voltage as a first value if the number of times is greater than a preset first threshold; The second effective value output module is configured to output the effective value of the external AC voltage as a second value if the number of times is less than or equal to the first threshold.

9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method for detecting relay adhesion according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for detecting relay adhesion according to any one of claims 1 to 7.