Failure protection method and device, equipment and storage medium

By judging the edge state of the main counting signal and the slave counting signal, the preset protection level is output, which solves the problem of uncertainty in the logic device level caused by the failure of the pulse width modulation module, and ensures the stability and security of the system.

CN119030509APending Publication Date: 2024-11-26SHANGHAI CHINT POWER SYST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411043034.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

When the pulse width modulation module fails, it may cause uncertain logic levels output by complex programmable logic devices, resulting in dangerous states such as direct through and short circuit of power devices, seriously affecting system stability.

Method used

By counting the edge of the main count signal output by itself, combining the edge state of the slave count signal output by the pulse width modulation module of the target chip, it is determined whether the pulse width modulation failure and logic device failure occur, and output preset protection power when failure occurs. Flat signal.

Benefits of technology

Ensure the normal operation of the controlled power device, avoid system crashes, and improve the safety and practicality of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030509A_ABST
    Figure CN119030509A_ABST
Patent Text Reader

Abstract

The invention discloses a failure protection method and device, equipment and a storage medium. The method comprises the following steps: counting the edge of a main counting signal output by the chip to obtain a first count, and determining edge state information according to the edge state of a slave counting signal output by a pulse width modulation module of a target chip; determining whether pulse width modulation failure occurs or not according to the edge state information, and determining whether logic device failure occurs or not according to the first count; and if it is determined that the pulse width modulation failure occurs and / or the logic device failure occurs, outputting a preset protection level signal. According to the technical scheme provided by the embodiment of the invention, when the failure of the pulse width modulation or logic device is determined, the determined logic level is output by using the existing logic device, so that the normal work of the controlled power device and the safety of the system are ensured, and the practicability is relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power electronics technology, and in particular to a failure protection method, device, equipment and storage medium. Background Art

[0002] Pulse Width Modulation (PWM) is a method of digitally encoding analog signal levels. A high-resolution counter can be used to generate a square wave in pulse width modulation, and the analog signal level can be encoded by adjusting the duty cycle of the square wave.

[0003] However, in current power electronic systems, the pulse width modulation modules used cannot ensure that the logic levels output by programmable logic devices, such as CPLD (Complex Programmable Logic Device) and FPGA (Field Programmable Gate Array), are in a certain state when they fail, which may cause the power devices they control to enter dangerous states such as direct conduction and short circuit, and even lead to the collapse of the entire system. Summary of the invention

[0004] The present invention provides a failure protection method, device, equipment and storage medium to solve the problem that a pulse width modulation module is likely to cause damage to a controlled device after failure.

[0005] In a first aspect, the present invention provides a failure protection method, which is applied to a logic device, and the method comprises:

[0006] Counting the edges of the master counting signal outputted by itself to obtain a first count, and determining edge state information according to the edge state of the slave counting signal outputted by the pulse width modulation module of the target chip;

[0007] determining whether a pulse width modulation failure occurs according to the edge state information, and determining whether a logic device failure occurs according to the first count;

[0008] If it is determined that a pulse width modulation failure occurs and / or it is determined that a logic device failure occurs, a preset protection level signal is output.

[0009] In a second aspect, the present invention provides a failure protection device, applied to a logic device, the device comprising:

[0010] A signal edge determination module, used for counting the edge of the main counting signal output by itself to obtain a first count, and determining edge state information according to the edge state of the slave counting signal output by the pulse width modulation module of the target chip;

[0011] a failure judgment module, used to determine whether a pulse width modulation failure occurs according to the edge state information, and to determine whether a logic device failure occurs according to the first count;

[0012] The signal output module is used to output a preset protection level signal if the information returned by the failure judgment module is yes.

[0013] In a third aspect, the present invention provides an electronic device, the electronic device comprising:

[0014] Target logic device;

[0015] The target logic device is capable of executing the failure protection method of the first aspect.

[0016] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a processor to implement the failure protection method of the first aspect when executed.

[0017] The failure protection scheme provided by the present invention is applied to logic devices, and specifically includes: counting the edges of the main counting signal output by itself to obtain a first count, and determining edge state information according to the edge state of the slave counting signal output by the pulse width modulation module of the target chip, determining whether a pulse width modulation failure occurs according to the edge state information, and determining whether a logic device failure occurs according to the first count, and outputting a preset protection level signal if it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs. By adopting the above technical scheme, according to the edge count of the main counting signal and the edge state of the slave counting signal, it is accurately determined whether a pulse width modulation failure and a logic device failure occur. When a failure occurs, the existing control logic device is used to output a determined logic level, which ensures the normal operation of the controlled power device and the safety of the system, and has strong practicality.

[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1is a flow chart of a failure protection method provided according to Embodiment 1 of the present invention;

[0021] Figure 2 is a flow chart of a failure protection method provided according to Embodiment 2 of the present invention;

[0022] Figure 3 is a schematic diagram of the structure of a failure protection device provided according to Embodiment 3 of the present invention;

[0023] Figure 4 It is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In the description of the present invention, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are an "or" relationship. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Embodiment 1

[0027] Figure 1A flowchart of a failure protection method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of protecting against pulse width modulation failure. The method can be executed by a failure protection device of a logic device. The failure protection device can be implemented in the form of hardware and / or software. The failure protection device can be configured in an electronic device, and the electronic device includes a logic device that can execute the method.

[0028] like Figure 1 As shown, a failure protection method provided in the first embodiment of the present invention specifically includes the following steps:

[0029] S101 , counting the edges of a master counting signal outputted by itself to obtain a first count, and determining edge state information according to the edge state of a slave counting signal outputted by a pulse width modulation module of a target chip.

[0030] In this embodiment, the logic device (such as CPLD or FPGA) can provide a master counting signal by using a crystal oscillator with a preset frequency (such as 10 MHz). The pulse width modulation module of the target chip (such as DSP or MCU) can provide a slave counting signal with a frequency of 500 KHz. The logic device can count the edges of the master counting signal output by itself, such as the rising edge or the falling edge, to obtain a first count. The state of the edge of the slave counting signal output by the pulse width modulation module of the target chip is recorded to obtain edge state information.

[0031] S102: Determine whether a pulse width modulation failure occurs according to the edge state information, and determine whether a logic device failure occurs according to the first count.

[0032] In this embodiment, if the state of the slave counting signal does not change for a long time, it means that there is no edge signal in the slave counting, and it can be determined that the slave counting signal is invalid, that is, the pulse width modulation fails. If the first count of the edge of the main counting signal during the period when the previous edge state information of the slave counting signal remains unchanged is consistent with the first count of the edge of the main counting signal during the period when the current edge state information remains unchanged, it can be determined that the logic device fails.

[0033] S103: If it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs, output a preset protection level signal.

[0034] In this embodiment, the preset protection level signal output by the logic device can be a high level or a low level. The process of counting the edge of the main counting signal and the process of determining the edge state information of the edge state of the slave counting signal are two concurrent processes that are performed simultaneously. By judging whether each other fails, if either fails, the preset protection level signal will be output.

[0035] The failure protection method provided by the embodiment of the present invention is applied to a logic device, and specifically includes: counting the edges of the main counting signal output by itself to obtain a first count, and determining edge status information according to the edge state of the slave counting signal output by the pulse width modulation module of the target chip, determining whether a pulse width modulation failure occurs according to the edge state information, and determining whether a logic device failure occurs according to the first count, and if it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs, outputting a preset protection level signal. The technical solution of the embodiment of the present invention accurately determines whether a pulse width modulation failure and a logic device failure occur according to the edge count of the main counting signal and the edge state of the slave counting signal. When a failure occurs, the existing control logic device is used to output a determined logic level, thereby ensuring the normal operation of the controlled power device and the safety of the system, and having strong practicality.

[0036] Optionally, counting the edges of the main counting signal outputted by itself to obtain the first count includes: counting the number of rising edges or falling edges of the main counting signal outputted by itself to obtain the first count.

[0037] Exemplarily, the rising edge of the main counting signal outputted by itself may be counted to obtain the first count Cnt1.

[0038] Optionally, the edge state information is determined based on the edge state of a counting signal output by a pulse width modulation module of the target chip, including: when the counting signal output by the pulse width modulation module of the target chip is a rising edge, determining the edge state information to be a first preset value; when the counting signal output by the pulse width modulation module of the target chip is a falling edge, determining the edge state information to be a second preset value, wherein the first preset value is different from the second preset value.

[0039] Exemplarily, when the slave counting signal output by the pulse width modulation module of the target chip is a rising edge, the edge status information may be 1, and when the slave counting signal output by the pulse width modulation module of the target chip is a falling edge, the edge status information may be 0.

[0040] Embodiment 2

[0041] Figure 2 This is a flow chart of a failure protection method provided in the second embodiment of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions, and provides a specific method for protecting against pulse width modulation failure.

[0042] Optionally, the determining whether a pulse width modulation failure occurs according to the edge status information includes: judging whether the edge status information changes; if not, counting the edge of the main counting signal to obtain a second count; judging whether the number of times the second count is greater than the first threshold exceeds a preset threshold, wherein the first threshold is determined according to the frequency of the main counting signal and the frequency of the slave counting signal; wherein, before outputting a preset protection level signal if it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs, it also includes: if the preset threshold is exceeded, determining that a pulse width modulation failure occurs. The advantage of such a setting is that, during the period when the edge status information remains unchanged, by comparing the edge count of the main counting signal with the preset threshold, it is possible to accurately determine whether a pulse width modulation failure occurs.

[0043] Optionally, after judging whether the edge status information has changed, it also includes: if it has changed, judging whether the second count is less than a second threshold or greater than a third threshold, wherein the second threshold and the third threshold are both determined according to the frequency of the master counting signal and the frequency of the slave counting signal, the second threshold is less than the third threshold, and the third threshold is less than the first threshold; wherein, before outputting a preset protection level signal if it is determined that a pulse width modulation failure has occurred and / or a logic device failure has occurred, it also includes: if it is less than the second threshold or greater than the third threshold, determining that a pulse width modulation failure has occurred. The advantage of such a setting is that when the edge status information changes, by judging the size of the edge count of the master counting signal, it is possible to accurately determine whether a pulse width modulation failure has occurred.

[0044] Optionally, the determining whether a logic device failure occurs according to the first count includes: judging whether the first count during the holding period of the last rising edge or falling edge of the slave counting signal is the same as the first count during the holding period of the current rising edge or falling edge; wherein, before outputting a preset protection level signal if it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs, it also includes: if they are the same, determining that a logic device failure occurs. The advantage of such a setting is that by judging whether the first count of the last edge of the slave counting signal is the same as the first count of the current edge, it is possible to accurately determine whether a logic device failure occurs.

[0045] like Figure 2 As shown, a failure protection method provided by Embodiment 2 of the present invention specifically includes the following steps:

[0046] S201, counting the number of rising edges or falling edges of the main counting signal output by itself to obtain a first count, and when the slave counting signal output by the pulse width modulation module of the target chip is a rising edge, determining that the edge state information is a first preset value, and when the slave counting signal output by the pulse width modulation module of the target chip is a falling edge, determining that the edge state information is a second preset value, and executing steps 202 and 208.

[0047] S202 , determining whether the edge status information has changed, if not, executing step 203 , if changed, executing step 205 .

[0048] S203: Count the edges of the main counting signal to obtain a second count.

[0049] Exemplarily, the rising edges of the main counting signal may be counted to obtain the second count Cnt2.

[0050] S204 , determining whether the number of times the second count is greater than the first threshold exceeds a preset threshold, if so, executing step 206 , if not, executing step 207 .

[0051] The first threshold is determined according to the frequency of the master counting signal and the frequency of the slave counting signal.

[0052] Specifically, when the pulse width modulation fails, the edge state information may remain unchanged for a long time, and the second count will continue to increase. Therefore, a first threshold can be set to determine whether a failure occurs. When the pulse width modulation is normal, the second count corresponding to the time when the edge state information remains unchanged is approximately equal to the quotient of the frequency of the master count signal and the frequency of the slave count signal. Whether the second count is greater than the first threshold can be determined at least once. If the number of times greater than the first threshold exceeds the preset threshold, step 206 can be executed.

[0053] Optionally, the first threshold is a product of a quotient of a frequency of the master counting signal and a frequency of the slave counting signal and a preset coefficient.

[0054] Exemplarily, if the frequency f1 of the master counting signal is 10 MHz, the frequency f2 of the slave counting signal is 500 kHz, and the preset coefficient is 2.5, then the first threshold is 50.

[0055] S205 , determining whether the second count is less than a second threshold or greater than a third threshold, if so, executing step 206 , if not, executing step 207 .

[0056] The second threshold and the third threshold are both determined according to the frequency of the master counting signal and the frequency of the slave counting signal, the second threshold is smaller than the third threshold, and the third threshold is smaller than the first threshold.

[0057] Specifically, even after the edge state information changes, the pulse width modulation may fail, so the second count can continue to be monitored. The failure of the pulse width modulation will cause the second count to be too large or too small. When the pulse width modulation is normal, the corresponding second count when the edge state information changes will be approximately equal to the quotient of the frequency of the master count signal and the frequency of the slave count signal, that is, it will be greater than or equal to the second threshold and less than or equal to the third threshold. Therefore, if the second count is less than the second threshold or greater than the third threshold, it indicates that the pulse width modulation has failed.

[0058] Exemplarily, the second threshold is the product of the quotient of the frequency of the master count signal and the frequency of the slave count signal and the first set coefficient, and the third threshold is the product of the quotient of the frequency of the master count signal and the frequency of the slave count signal and the second set coefficient. If the first set coefficient is 0.5 and the second set coefficient is 1.5, then as described in the above example, the second threshold is 20 and the third threshold is 30. The number of times the second count is less than the second threshold or greater than the third threshold can also be counted, and if the count is greater than the set value, step 206 can be executed.

[0059] S206: Determine that a pulse width modulation failure occurs, and output a preset protection level signal.

[0060] Specifically, if the state of the slave counting signal does not change for a long time, it means that the slave counting has no edge signal, and it can be determined that the slave counting signal is invalid and the pulse width modulation is invalid.

[0061] Optionally, whether the slave counting signal is invalid can be determined according to the level state of the slave counting signal. In the process of the master clock, if the level state of the slave counting signal does not change within a preset time, it can be determined that the slave counting signal is invalid.

[0062] S207 , determine that the pulse width modulation is normal.

[0063] S208, determining whether the first count during the last rising edge or falling edge holding period of the slave counting signal is the same as the first count during the current rising edge or falling edge holding period, if so, executing step 209, if not, executing step 210.

[0064] Specifically, if the master clock fails, the first count during the edge holding period of the slave counting signal will be the same as the first count during the current edge holding period, thereby determining whether a logic device failure has occurred. The same number of times can also be counted, and if the number is greater than a set value, step 209 can be executed.

[0065] S209: Determine that a logic device failure occurs, and output a preset protection level signal.

[0066] S210: Determine whether the logic device is normal.

[0067] The failure protection method provided by the embodiment of the present invention can accurately determine whether a pulse width modulation failure occurs by comparing the edge count of the main counting signal with a preset threshold value during the period when the edge state information remains unchanged. When the edge state information changes, it can accurately determine whether a pulse width modulation failure occurs by judging the size of the edge count of the main counting signal. It can accurately determine whether a logic device failure occurs by judging whether the first count of the previous edge of the slave counting signal is the same as the first count of the current edge.

[0068] Embodiment 3

[0069] Figure 3 This is a schematic diagram of the structure of a failure protection device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device is applied to a logic device, and the device includes: a signal edge determination module 301, a failure judgment module 302 and a signal output module 303, wherein:

[0070] A signal edge determination module, used for counting the edge of the main counting signal output by itself to obtain a first count, and determining edge state information according to the edge state of the slave counting signal output by the pulse width modulation module of the target chip;

[0071] a failure judgment module, configured to determine whether a pulse width modulation failure occurs according to the edge state information, and determine whether a logic device failure occurs according to the first count;

[0072] The signal output module is used to output a preset protection level signal if the information returned by the failure judgment module is yes.

[0073] The failure protection device provided in the embodiment of the present invention can accurately determine whether a pulse width modulation failure and a logic device failure have occurred based on the edge count of the main counting signal and the edge state of the slave counting signal. When a failure occurs, the existing control logic device is used to output a certain logic level, thereby ensuring the normal operation of the controlled power device and the safety of the system, and has strong practicality.

[0074] Optionally, the signal edge determination module includes:

[0075] The first counting unit is used to count the number of rising edges or falling edges of the main counting signal output by itself to obtain a first count.

[0076] Optionally, the signal edge determination module includes:

[0077] A first state information determining unit, configured to determine that edge state information is a first preset value when a slave counting signal output by a pulse width modulation module of a target chip is a rising edge;

[0078] The second state information determining unit is used to determine that the edge state information is a second preset value when the slave counting signal output by the pulse width modulation module of the target chip is a falling edge, wherein the first preset value is different from the second preset value.

[0079] Optionally, the failure judgment module includes:

[0080] A first judging unit, used to judge whether the edge state information changes;

[0081] a second counting unit, for counting the edges of the main counting signal to obtain a second count if no change occurs;

[0082] The second judgment unit is used to judge whether the number of times that the second count is greater than the first threshold exceeds a preset threshold, wherein the first threshold is determined according to the frequency of the master counting signal and the frequency of the slave counting signal.

[0083] Optionally, the device further comprises:

[0084] The first modulation failure determination module is used to determine that a pulse width modulation failure occurs before outputting a preset protection level signal if the information returned by the second judgment unit exceeds a preset threshold.

[0085] Furthermore, the first threshold is a product of a quotient of a frequency of the master counting signal and a frequency of the slave counting signal and a preset coefficient.

[0086] Optionally, the failure judgment module includes:

[0087] A third judgment unit is used for judging whether the second count is less than a second threshold or greater than a third threshold after judging whether the edge status information has changed, if it is determined that the change has occurred, wherein the second threshold and the third threshold are both determined according to the frequency of the master counting signal and the frequency of the slave counting signal, the second threshold is less than the third threshold, and the third threshold is less than the first threshold.

[0088] Optionally, the device further comprises:

[0089] The second modulation failure determination module is used to determine that a pulse width modulation failure has occurred before outputting a preset protection level signal if the information returned by the third judgment unit is less than the second threshold or greater than the third threshold.

[0090] Optionally, the failure judgment module includes:

[0091] The fourth judgment unit is used to judge whether the first count during the last rising edge or falling edge holding period of the slave counting signal is the same as the first count during the current rising edge or falling edge holding period.

[0092] Optionally, the device further comprises:

[0093] The logic device failure determination module is used to determine that a logic device failure has occurred before outputting a preset protection level signal if the information returned by the fourth judgment unit is the same.

[0094] The failure protection device provided in the embodiment of the present invention can execute the failure protection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0095] Embodiment 4

[0096] Figure 4 A schematic structural diagram of an electronic device 40 that can be used to implement an embodiment of the present invention is shown.

[0097] like Figure 4 As shown, the electronic device 40 includes at least one target chip 41 and a target logic device 42. The target logic device 42 can execute the failure protection method described in the above embodiment.

[0098] The components shown herein, their connections and relationships, and their functions, are intended to be exemplary only, and are not intended to limit implementations of the inventions described and / or claimed herein.

[0099] The computer device provided above can be used to execute the failure protection method provided by any of the above embodiments, and has corresponding functions and beneficial effects.

[0100] Embodiment 5

[0101] In the context of the present invention, a computer readable storage medium may be a tangible medium, wherein the computer executable instructions, when executed by a computer processor, are used to perform a fail-safe method, applied to a logic device, the method comprising:

[0102] Counting the edges of the master counting signal outputted by itself to obtain a first count, and determining edge state information according to the edge state of the slave counting signal outputted by the pulse width modulation module of the target chip;

[0103] determining whether a pulse width modulation failure occurs according to the edge state information, and determining whether a logic device failure occurs according to the first count;

[0104] If it is determined that a pulse width modulation failure occurs and / or it is determined that a logic device failure occurs, a preset protection level signal is output.

[0105] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by an instruction execution system, device or equipment or used with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0106] The computer device provided above can be used to execute the failure protection method provided by any of the above embodiments, and has corresponding functions and beneficial effects.

[0107] It is worth noting that in the above-mentioned embodiment of the failure protection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0108] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A failure protection method, characterized in that: Applied to a logic device, the method includes: Counting the edges of the master counting signal outputted by the self to obtain a first count, and determining edge state information according to the edge state of the slave counting signal outputted by the pulse width modulation module of the target chip; determining whether a pulse width modulation failure occurs according to the edge state information, and determining whether a logic device failure occurs according to the first count; If it is determined that a pulse width modulation failure occurs and / or it is determined that a logic device failure occurs, a preset protection level signal is output.

2. The method according to claim 1, characterized in that Counting the edges of the main counting signal outputted by itself to obtain a first count includes: The number of rising edges or falling edges of the main counting signal outputted by the self is counted to obtain a first count.

3. The method according to claim 1 or 2, characterized in that The step of determining edge state information according to the edge state of a slave counting signal output by a pulse width modulation module of the target chip includes: When the slave counting signal output by the pulse width modulation module of the target chip is a rising edge, determining that the edge state information is a first preset value; When the slave counting signal output by the pulse width modulation module of the target chip is a falling edge, it is determined that the edge state information is a second preset value, wherein the first preset value is different from the second preset value.

4. The method according to claim 1, wherein The determining whether pulse width modulation failure occurs according to the edge status information includes: Determining whether the edge status information changes; If no change occurs, counting the edges of the main counting signal to obtain a second count; determining whether the number of times the second count is greater than a first threshold exceeds a preset threshold, wherein the first threshold is determined according to the frequency of the master counting signal and the frequency of the slave counting signal; Wherein, before outputting a preset protection level signal if it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs, the method further includes: If the preset threshold is exceeded, it is determined that a pulse width modulation failure occurs.

5. The method according to claim 4, characterized in that The first threshold is a product of a quotient of a frequency of the master counting signal and a frequency of the slave counting signal and a preset coefficient.

6. The method according to claim 4, characterized in that After determining whether the edge status information has changed, the method further includes: If there is a change, determining whether the second count is less than a second threshold or greater than a third threshold, wherein the second threshold and the third threshold are both determined according to the frequency of the master counting signal and the frequency of the slave counting signal, the second threshold is less than the third threshold, and the third threshold is less than the first threshold; Wherein, before outputting a preset protection level signal if it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs, the method further includes: If the value is smaller than the second threshold or larger than the third threshold, it is determined that a pulse width modulation failure occurs.

7. The method according to claim 1, characterized in that The determining whether a logic device failure occurs according to the first count includes: Determine whether the first count during the holding period of the last rising edge or falling edge of the slave counting signal is the same as the first count during the holding period of the current rising edge or falling edge; Wherein, before outputting a preset protection level signal if it is determined that a pulse width modulation failure occurs and / or a logic device failure occurs, the method further includes: If they are the same, it is determined that a logic device failure has occurred.

8. A failure protection device, characterized in that: Applied to a logic device, the device comprises: a signal edge determination module, configured to count edges of a master counting signal outputted by itself to obtain a first count, and determine edge state information according to an edge state of a slave counting signal outputted by a pulse width modulation module of a target chip; a failure judgment module, configured to determine whether a pulse width modulation failure occurs according to the edge state information, and determine whether a logic device failure occurs according to the first count; The signal output module is used to output a preset protection level signal if the information returned by the failure judgment module is yes.

9. An electronic device, characterized in that: The electronic device includes a target logic device; The target logic device is capable of executing the failure protection method 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 instructions, and the computer instructions are used to enable a processor to implement the failure protection method according to any one of claims 1 to 7 when executed.