Functional safety signal diagnosis method and device, electronic equipment and storage medium

By setting a combination of fast cycle and slow cycle tasks in the electric drive system, the misdiagnosis, timeliness and insufficient coverage of functional safety signal diagnosis in the prior art is solved, and efficient and reliable diagnosis of functional safety key signals is achieved.

CN120065969APending Publication Date: 2025-05-30WUXI INFIMOTION PROPULSION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510003784.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The prior art has problems such as missed diagnosis, insufficient diagnostic timeliness and insufficient diagnostic coverage when diagnosing functional safety signals in electrical drive systems, especially when processing AC signals.

Method used

By setting two tasks with different cycles, the fast cycle task is used to sample and initially diagnose functional safety signals, and the slow cycle task accumulates the accumulated value of the periodic task within the set time window to determine signal failure.

Benefits of technology

It improves the accuracy and reliability of the diagnostics of functional safety signals, ensures that the time for fault diagnosis meets functional safety requirements, and realizes effective diagnosis of functional safety critical signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120065969A_ABST
    Figure CN120065969A_ABST
Patent Text Reader

Abstract

The invention provides a functional safety signal diagnosis method and device, electronic equipment and a storage medium, and relates to the technical field of automobile electric driving. The method comprises the steps that a first task and a second task are set, the first period of the first task is smaller than the second period of the second task, and the first task is used for sampling and diagnosing functional safety signals; in the first task, when a numerical value corresponding to the function safety signal is greater than a first threshold value, performing fault counting once, and accumulating all fault counts in the first task to determine a first accumulated value; setting a time window in the second task, acquiring a first accumulated value in the corresponding first period in the second task, and accumulating a difference value of the first accumulated values of every two adjacent first periods in the time window to determine a second accumulated value; and when the second accumulated value is greater than a second threshold value, determining that the function safety signal fails. According to the invention, the resource load can be reduced, and effective diagnosis of functional safety key signals can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automotive electric drive, and in particular, to a functional safety signal diagnosis method, device, electronic device and storage medium. Background Art

[0002] As the core power source of new energy vehicles, the electric drive system undertakes the important function of providing power for the whole vehicle. However, the fault risks existing in the electric drive system itself may lead to the failure of the electric drive system. The failure of the electric drive system will directly affect the safety objectives of the whole vehicle, and further threaten the safety of the vehicle and personnel. In the electric drive system, the failure of safety-related signals is one of the important factors affecting functional safety. Among them, the failure of three-phase phase current signals and resolver-related signals is crucial. The common feature of these signals is that they are essentially AC signals, with the characteristics of amplitude varying with time and relatively high frequency. Therefore, how to accurately diagnose the failure of the above key safety signals is of great significance for ensuring the functional safety of the whole vehicle.

[0003] Currently, the diagnostic methods for signals mainly include continuous diagnosis method and two-way diagnosis method. However, when these two methods are applied to the diagnosis of functional safety-related signals, there are the following deficiencies: (1) Missed diagnosis problem: For AC signals, the amplitude varies continuously with time and the frequency is relatively high. If the continuous diagnosis method is adopted, due to the difficulty of continuously meeting the diagnostic trigger conditions, missed diagnosis may occur, resulting in the inability to effectively identify signal failures; (2) Insufficient diagnostic timeliness: Although the two-way diagnosis method can cover the diagnosis of signal failures to a certain extent, due to the characteristics of AC signals, it is difficult to continuously meet the diagnostic trigger conditions, which may lead to uncertainty in the fault diagnosis time, and thus does not meet the requirements of the functional safety standard for the fault detection time interval (FDTI); (3) Insufficient diagnostic coverage: In the actual diagnosis of AC signals, the above methods cannot ensure sufficient diagnostic coverage, thus affecting the realization of functional safety requirements. Summary of the Invention

[0004] The problem solved by the present invention is how to effectively diagnose functional safety critical signals.

[0005] To solve the above problems, the present invention provides a functional safety signal diagnosis method, device, electronic device and storage medium.

[0006] In a first aspect, the present invention provides a functional safety signal diagnosis method, including:

[0007] Set a first task and a second task, where a first period of the first task is less than a second period of the second task, and the first task is used to sample and diagnose functional safety signals;

[0008] In the first task, when a value corresponding to the functional safety signal is greater than a first threshold, perform a fault count once, and accumulate all the fault counts in the first task to determine a first accumulated value;

[0009] Set a time window in the second task, obtain the first accumulated value in the corresponding first period in the second task, and accumulate differences between the first accumulated values of every two adjacent first periods within the time window to determine a second accumulated value;

[0010] When the second accumulated value is greater than a second threshold, determine that the functional safety signal has a fault.

[0011] Optionally, the setting of the first task and the second task includes:

[0012] Determine the first period according to the signal sampling frequency;

[0013] Determine the second period according to the first period, where the second period is N times the first period, and N is an integer greater than or equal to 2.

[0014] Optionally, the setting of the time window in the second task includes:

[0015] Determine an upper limit of the length of the time window according to a preset fault detection time;

[0016] Determine the length of the time window according to the second period and the upper limit, where the length of the time window is an integer multiple of the second period.

[0017] Optionally, the accumulating the differences between the first accumulated values of every two adjacent first periods within the time window includes:

[0018] When the first accumulated value in the previous period is less than or equal to the first accumulated value in the subsequent period, determine the difference according to the first accumulated value in the subsequent period and the first accumulated value in the previous period to accumulate the difference, where the previous period and the subsequent period are two adjacent periods, and the previous period is before the subsequent period;

[0019] When the first accumulated value in the previous period is greater than the first accumulated value in the subsequent period, determine the difference according to the first accumulated value in the subsequent period, the first accumulated value in the previous period, and the corresponding count data type value to accumulate the difference.

[0020] Optionally, the functional safety signal diagnosis method further includes:

[0021] When the second accumulated value is less than or equal to the second threshold, the time window is moved according to the second period.

[0022] Optionally, the moving of the time window according to the second period includes:

[0023] Determine a moving step according to the second period;

[0024] Move the time window backward according to the moving step.

[0025] Optionally, the functional safety signal diagnosis method further includes:

[0026] In the second task, when a fault recovery enable signal is obtained, the functional safety signal fault has been determined, and the second accumulated value is less than a third threshold, perform a fault recovery count once, and accumulate the fault recovery count in the second task to determine a third accumulated value;

[0027] When the third accumulated value is greater than a fourth threshold, clear the fault.

[0028] In a second aspect, the present invention provides a functional safety signal diagnosis device, including:

[0029] A first module, configured to set a first task and a second task, where a first period of the first task is less than a second period of the second task, and the first task is used to sample and diagnose functional safety signals;

[0030] A second module, configured to, in the first task, when a value corresponding to the functional safety signal is greater than a first threshold, perform a fault count once, and accumulate all the fault counts in the first task to determine a first accumulated value;

[0031] A third module, configured to set a time window in the second task, obtain the first accumulated value in the corresponding first period in the second task, and accumulate the differences between the first accumulated values of every two adjacent first periods within the time window to determine a second accumulated value;

[0032] A fourth module, configured to determine a functional safety signal fault when the second accumulated value is greater than a second threshold.

[0033] In a third aspect, the present invention provides an electronic device, including a memory and a processor;

[0034] The memory is used to store a computer program;

[0035] The processor is configured to implement the functional safety signal diagnosis method as described in the first aspect when executing the computer program.

[0036] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the functional safety signal diagnosis method as described in the first aspect is implemented.

[0037] The beneficial effects of the functional safety signal diagnosis method of the present invention are as follows: By setting a first task and a second task, in the first task, when the value corresponding to the functional safety signal is greater than a first threshold, a fault count is performed, and the fault counts are accumulated to determine a first accumulated value. A time window is set in the second task, and the difference between the first accumulated values of two adjacent first cycles is accumulated according to the time window to determine a second accumulated value. When the second accumulated value is greater than a second threshold, it is determined that the functional safety signal has failed. That is, fault signal diagnosis is performed in the first task, and fault anti-shake is performed in the second task. On the one hand, setting the second task can reduce the resource load. On the other hand, through the fault anti-shake strategy of the fixed-time sliding window, the reliability of the diagnosis can be improved, ensuring that the FDTI time of the fault diagnosis meets the functional safety requirements, thereby enabling effective diagnosis of functional safety critical signals. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a schematic flowchart of the functional safety signal diagnosis method according to an embodiment of the present invention;

[0039] Figure 2 is a schematic diagram of fault diagnosis for fast cycle task 1 according to an embodiment of the present invention;

[0040] Figure 3 is a schematic diagram of fault diagnosis for slow cycle task 2 according to an embodiment of the present invention;

[0041] Figure 4 is a schematic flowchart of setting the first task and the second task according to an embodiment of the present invention;

[0042] Figure 5 is a schematic flowchart of setting the time window according to an embodiment of the present invention;

[0043] Figure 6 is a schematic flowchart of difference accumulation according to an embodiment of the present invention;

[0044] Figure 7 is a schematic flowchart of moving the time window according to an embodiment of the present invention;

[0045] Figure 8 is a schematic flowchart of fault recovery according to an embodiment of the present invention;

[0046] Figure 9 Schematic diagram of the slow periodic task 2 fault recovery according to an embodiment of the present invention;

[0047] Figure 10 System architecture diagram of the functional safety signal diagnosis device according to an embodiment of the present invention;

[0048] Figure 11 System architecture diagram of the electronic device according to an embodiment of the present invention. Detailed implementation manners

[0049] To make the above objects, features and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention will be given with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.

[0050] It should be understood that the various steps recorded in the method embodiments of the present invention can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.

[0051] The terms "including" and its variants used herein are open-ended, that is, "including but not limited to"; the term "based on" is "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions performed by these devices, modules or units or the interdependent relationship.

[0052] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more".

[0053] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0054] Such as Figure 1As shown, a functional safety signal diagnosis method provided by an embodiment of the present invention includes:

[0055] S100: Set a first task and a second task, where the first period of the first task is less than the second period of the second task, and the first task is used to sample and diagnose functional safety signals.

[0056] Specifically, in combination with Figure 2 and Figure 3 As shown, the first task and the second task can be periodic tasks with the first period and the second period respectively, and the first period is less than the second period; first, determine the basic rules of the task period. Taking the first task as an example (also called the fast-cycle task 1 later), it is usually used to process tasks with high real-time requirements, such as signal sampling, key data processing, fault signal diagnosis, etc. This embodiment mainly reflects the fault signal diagnosis of functional safety signals. Since the second task (also called the slow-cycle task 2 later) has a longer period, it is usually used to process tasks with lower real-time requirements (to ensure sufficient system resources, the slow-cycle task can reduce the execution frequency). For example, in the slow-cycle task 2, anti-shake processing for faults is performed. That is, as described later, in the fast-cycle task 1, fault counting is performed to quickly detect whether there are potential faults. Within the time of one slow-cycle task 2, the fast-cycle task 1 can be executed multiple times, and the accumulated fault count values of each fast-cycle task 1 are passed to the slow-cycle task 2. In the slow-cycle task 2, a sliding window judgment and anti-shake processing are performed on the counting results passed by the fast-cycle task 1 to filter out short-term or occasional signal fluctuations to avoid misjudgment caused by short-term fluctuations and ensure that only continuous and stable abnormal signals are judged as faults.

[0057] Among them, this embodiment can perform failure diagnosis on safety-related signals of the electric drive system (such as three-phase phase current signals or resolver signals, etc.). For safety-related signals (usually AC signals), due to the periodic changes of AC signals, misreports or missed reports may occur due to the dynamic characteristics of the signals. This embodiment can perform anti-shake processing through the time window of the slow-cycle task 2 to solve problems such as misreports and missed reports. Taking the failure diagnosis of three-phase phase current signals as an example, the fast-cycle task 1 can capture the instantaneous value of the current signal and combine it with a threshold to judge whether it exceeds the safe range, and then perform anti-shake processing in the slow-cycle task 2 to prevent misjudgment caused by short-term fluctuations of the current signal.

[0058] S200: In the first task, when the value corresponding to the functional safety signal is greater than the first threshold, perform a fault count once, and accumulate all the fault counts in the first task to determine a first accumulated value.

[0059] Specifically, in fast cycle task 1, a functional safety signal (usually an alternating current signal) is obtained. The functional safety signal can be compared with a first threshold Thr1 (which can also be called a fault threshold or a diagnostic threshold). When the functional safety signal is greater than the first threshold Thr1, a fault count is performed, and the fault count is accumulated. For example, the fault count Error counter (ErrCnt) is incremented by 1, that is, the first accumulated value is determined.

[0060] Among them, when comparing the functional safety signal with the first threshold Thr1, the absolute value of the functional safety signal can be compared with the first threshold Thr1, that is, the negative half-cycle of the alternating current signal is converted into a positive value, and the signal becomes a positive cycle function, and the oscillation range becomes non-negative.

[0061] S300: Set a time window in the second task, obtain the first accumulated value in the corresponding first cycle in the second task, and accumulate the differences between the first accumulated values of every two adjacent first cycles within the time window to determine the second accumulated value.

[0062] Specifically, set a time window (Debounce Window) in the slow cycle task 2. For example, the time window can be set according to the FDTI time in the functional safety requirements, so as to ensure that the FDTI time of the fault diagnosis meets the functional safety requirements; take the difference between the fault counts Error counter (ErrCnt) of every two adjacent first cycles according to the time window to obtain the difference △ErrCnt, and accumulate the difference △ErrCnt in the time window to obtain the second accumulated value.

[0063] S400: When the second accumulated value is greater than the second threshold, it is determined that the functional safety signal has a fault.

[0064] Specifically, compare the second accumulated value with the second threshold Thr2 (or called the fault anti-shake confirmation threshold). When the second accumulated value is greater than the second threshold Thr2, determine the fault Errflg, that is, the functional safety signal has a fault.

[0065] In this embodiment, by setting the first task and the second task, in the first task, when the value corresponding to the functional safety signal is greater than the first threshold, a fault count is performed, and the fault counts are accumulated to determine the first accumulated value. In the second task, a time window is set, and the difference between the first accumulated values of two adjacent first periods is accumulated according to the time window to determine the second accumulated value. When the second accumulated value is greater than the second threshold, it is determined that the functional safety signal has failed, that is, the fault signal diagnosis is performed in the first task, and the fault anti-shake is performed in the second task. On the one hand, setting the second task can reduce the resource load. On the other hand, through the fault anti-shake strategy of the fixed-time sliding window, the reliability of the diagnosis can be improved, ensuring that the FDTI time of the fault diagnosis meets the functional safety requirements, so as to effectively diagnose the functional safety critical signal.

[0066] Optionally, the setting of the first task and the second task includes:

[0067] S110: Determine the first period according to the signal sampling frequency.

[0068] Specifically, as shown in Figure 4 According to the system requirements, the signal sampling frequency is selected. For example, if the sampling frequency is 1 kHz (1000 times per second), the corresponding first period can be determined to be 1 millisecond. Since the fast-period task usually has a higher priority, it can be ensured that it can be executed on time.

[0069] S120: Determine the second period according to the first period, where the second period is N times the first period, and N is an integer greater than or equal to 2.

[0070] Specifically, as shown in Figure 4 The second period is usually an integer multiple (an integer greater than or equal to 2) of the first period, that is, the slow-period task 2 can correspond to multiple fast-period tasks 1; if the workload of the slow-period task 2 is large, a larger multiple (such as 10, 20) can be selected to reduce the system load. If the execution result of the slow-period task has a certain real-time requirement for the system, a smaller multiple (such as 2, 5) needs to be selected.

[0071] In this optional embodiment, by separately setting the first period and the second period, it can be ensured that the functional safety critical signal can be effectively diagnosed on the premise of reducing the resource load.

[0072] Optionally, the setting of the time window in the second task includes:

[0073] S310: Determine the upper limit of the length of the time window according to the preset fault detection time.

[0074] Specifically, as shown in Figure 5As shown, FDTI (Fault Detection Time Interval) is the fault detection time defined in functional safety, representing the longest allowable time from the occurrence of a fault to its detection. The upper limit of the length of the time window cannot be greater than the FDTI time to ensure that the detection is completed within the safe time range.

[0075] S320: Determine the length of the time window according to the second period and the upper limit of the length, where the length of the time window is an integer multiple of the second period.

[0076] Specifically, in combination with Figure 5 As shown, the length of the time window is usually an integer multiple of the period of the slow periodic task 2. For example, if the FDTI time is 100 ms and the period of the slow periodic task 2 is 10 ms, then the length of the time window can be 10 ms, 20 ms,..., 100 ms. If the time window is too short, it may lead to misjudgment, especially in the case of instantaneous fluctuations or interference in the signal. The longer the time window, the slower the system's response time to faults, but the stronger the anti-interference ability. If more sensitive fault detection is required, a smaller length can be selected. If more stable fault judgment (to avoid misjudgment) is required, a larger length can be selected.

[0077] In this optional embodiment, the length of the time window is determined according to the second period and the upper limit of the length of the time window. By reasonably setting the time window, the functional safety requirements and the design requirements of the slow periodic task are met.

[0078] Optionally, the accumulation of the differences between the first accumulation values of every two adjacent first periods within the time window includes:

[0079] S330: When the first accumulation value in the previous period is less than or equal to the first accumulation value in the subsequent period, determine the difference according to the first accumulation value in the subsequent period and the first accumulation value in the previous period to accumulate the difference, where the previous period and the subsequent period are two adjacent periods, and the previous period is before the subsequent period.

[0080] Specifically, in combination with Figure 6 As shown, the previous period is before the subsequent period. When the first accumulation value ErrCnt_Front in the previous period is less than or equal to the first accumulation value ErrCnt_Rear in the subsequent period, then ErrCnt_Rear minus ErrCnt_Front can determine the difference △ErrCnt, and then accumulate △ErrCnt.

[0081] S340: When the first accumulated value in the previous cycle is greater than the first accumulated value in the subsequent cycle, determine the difference based on the first accumulated value in the subsequent cycle, the first accumulated value in the previous cycle, and the corresponding count data type value, and accumulate the difference.

[0082] Specifically, as shown in Figure 6 , when the first accumulated value ErrCnt_Front in the previous cycle is greater than the first accumulated value ErrCnt_Rear in the subsequent cycle, it is necessary to perform data overflow processing on the difference △ErrCnt. Taking the data type of the fault count ErrCnt as uint16 as an example, the difference △ErrCnt satisfies:

[0083] The difference △ErrCnt = ErrCnt_Rear - ErrCnt_Front + 65535;

[0084] In this alternative embodiment, by comparing the magnitudes of the first accumulated values in the previous cycle and the subsequent cycle, counting overflow in abnormal situations is avoided, thereby ensuring effective diagnosis of the functional safety critical signal.

[0085] Optionally, the functional safety signal diagnosis method further includes:

[0086] When the second accumulated value is less than or equal to the second threshold, move the time window according to the second cycle.

[0087] Specifically, when the second accumulated value is less than or equal to the second threshold Thr2, move the time window according to the second cycle. For example, after determining the moving step size according to the second cycle, move the time window backward according to the moving step size.

[0088] In this alternative embodiment, by moving the time window according to the second cycle when the second accumulated value is less than or equal to the second threshold, continuous monitoring of faults is ensured.

[0089] Optionally, moving the time window according to the second cycle includes:

[0090] S500: Determine the moving step size according to the second cycle.

[0091] Specifically, as shown in Figure 7 , first determine the moving step size according to the second cycle.

[0092] S600: Move the time window backward according to the moving step size.

[0093] Specifically, as shown in Figure 7As shown, the step size of each movement is one period of the slow periodic task 2, which means that the anti-shake window will gradually "slide" over time, ensuring that the system has the ability to respond to fault signals in real time. Moreover, by extending the observation time of the fault, it is possible to more accurately identify whether it is a persistent fault, avoiding misjudgment caused by temporary fluctuations or instantaneous errors.

[0094] In this optional embodiment, the time window is moved backward according to the movement step size determined by the second period, ensuring that the system has the ability to respond to fault signals in real time and can more accurately identify whether it is a persistent fault, avoiding misjudgment caused by temporary fluctuations or instantaneous errors.

[0095] Optionally, the functional safety signal diagnosis method further includes:

[0096] S700: In the second task, when a fault recovery enable signal is obtained, the functional safety signal fault has been determined, and the second cumulative value is less than the third threshold, a fault recovery count is performed once, and the fault recovery count in the second task is accumulated to determine the third cumulative value.

[0097] Specifically, as shown in Figure 8 and Figure 9 , a fault recovery judgment logic is set in the slow periodic task 2. When the fault recovery function is enabled (for example, a fault recovery enable signal is obtained), the functional safety signal fault has been determined, and the second cumulative value is less than the third threshold Thr3 (which can be set the same as the second threshold Thr2), a fault recovery Recovery Ccounter (Rcry_Cnt) count is performed to determine the third cumulative value.

[0098] S800: When the third cumulative value is greater than the fourth threshold, the fault is cleared.

[0099] Specifically, as shown in Figure 8 and Figure 9 , when the Rcry_Cnt continuously counts and exceeds the fourth threshold (or called the fault recovery time threshold), the fault Errflg is cleared.

[0100] Among them, in the slow periodic task 2, when the fault recovery function is enabled and there is no fault Errflg, the fault recovery Rcry_Cnt count is not performed.

[0101] In this optional embodiment, by setting the fault recovery judgment logic, the recovery process of the fault can be correctly identified and responded to, and it can effectively return to the normal operating state.

[0102] As Figure 10 shown, a functional safety signal diagnosis device 1000 provided by an embodiment of the present invention includes:

[0103] The first module 1010 is used to set a first task and a second task, wherein a first period of the first task is less than a second period of the second task, and the first task is used to sample and diagnose functional safety signals;

[0104] The second module 1020 is used to perform a fault count once when a value corresponding to the functional safety signal is greater than a first threshold in the first task, and accumulate all the fault counts in the first task to determine a first accumulated value;

[0105] The third module 1030 is used to set a time window in the second task, obtain the first accumulated value in the corresponding first period in the second task, and accumulate differences between the first accumulated values of every two adjacent first periods within the time window to determine a second accumulated value;

[0106] The fourth module 1040 is used to determine that a functional safety signal fails when the second accumulated value is greater than a second threshold.

[0107] As Figure 11 shown, an electronic device 1100 provided by an embodiment of the present invention includes a memory 1120 and a processor 1110; the memory 1120 is used to store a computer program; the processor 1110 is used to implement the above-mentioned functional safety signal diagnosis method when executing the computer program.

[0108] Or, an electronic device 1100 includes a memory 1120 and a processor 1110 coupled to the memory 1120; the memory 1120 is configured to store a computer program; the processor 1110 is configured to perform the following operations when executing the computer program:

[0109] Set a first task and a second task, wherein a first period of the first task is less than a second period of the second task, and the first task is used to sample and diagnose functional safety signals;

[0110] In the first task, when a value corresponding to the functional safety signal is greater than a first threshold, perform a fault count once, and accumulate all the fault counts in the first task to determine a first accumulated value;

[0111] Set a time window in the second task, obtain the first accumulated value in the corresponding first period in the second task, and accumulate differences between the first accumulated values of every two adjacent first periods within the time window to determine a second accumulated value;

[0112] Determine that a functional safety signal fails when the second accumulated value is greater than a second threshold.

[0113] A computer-readable storage medium provided by an embodiment of the present invention, on which a computer program is stored. When the computer program is executed by a processor, the function safety signal diagnosis method as described above is implemented.

[0114] Or, a non-volatile computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following operations:

[0115] Set a first task and a second task, wherein a first period of the first task is less than a second period of the second task, and the first task is used for sampling and diagnosing function safety signals;

[0116] In the first task, when a value corresponding to the function safety signal is greater than a first threshold, perform a fault count once, and accumulate all the fault counts in the first task to determine a first accumulated value;

[0117] Set a time window in the second task, obtain the first accumulated value in the corresponding first period in the second task, and accumulate the differences between the first accumulated values of every two adjacent first periods within the time window to determine a second accumulated value;

[0118] When the second accumulated value is greater than a second threshold, determine that the function safety signal has a fault.

[0119] Now, an electronic device 1100 that can be used as a server or a client of the present invention will be described. It is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device 1100 is intended to represent various forms of digital electronic computer devices, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device 1100 can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described herein and / or claimed.

[0120] The electronic device 1100 includes a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The computing unit, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.

[0121] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. One can select some or all of the units according to actual needs to achieve the purpose of the solution of the embodiments of the present invention. In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0122] Although the present invention is disclosed as above, the scope of protection of the present invention is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will all fall within the scope of protection of the present invention.

Claims

1. A functional safety signal diagnosis method, characterized in that: include: Setting a first task and a second task, wherein a first period of the first task is smaller than a second period of the second task, and the first task is used to sample and diagnose a functional safety signal; In the first task, when the value corresponding to the functional safety signal is greater than a first threshold, a fault count is performed, and all the fault counts in the first task are accumulated to determine a first accumulated value; A time window is set in the second task, the first accumulated value in the corresponding first cycle is obtained in the second task, and a difference between the first accumulated values ​​of every two adjacent first cycles in the time window is accumulated to determine a second accumulated value; When the second accumulated value is greater than a second threshold, it is determined that the functional safety signal is faulty.

2. The functional safety signal diagnosis method according to claim 1, characterized in that: The setting of the first task and the second task includes: Determine the first period according to the signal sampling frequency; The second period is determined according to the first period, wherein the second period is N times the first period, where N is an integer greater than or equal to 2.

3. The functional safety signal diagnosis method according to claim 2, characterized in that: The step of setting a time window in the second task includes: Determine the upper limit of the length of the time window according to the preset fault detection time; The length of the time window is determined according to the second period and the upper limit of the length, wherein the length of the time window is an integer multiple of the second period.

4. The functional safety signal diagnosis method according to claim 1, characterized in that: The accumulating the difference between the first accumulated values ​​of every two adjacent first periods in the time window comprises: When the first accumulated value of the previous cycle is less than or equal to the first accumulated value of the subsequent cycle, the difference is determined according to the first accumulated value of the subsequent cycle and the first accumulated value of the previous cycle, so as to accumulate the difference, wherein the previous cycle and the subsequent cycle are two adjacent cycles, and the previous cycle is located before the subsequent cycle; When the first accumulated value of the previous cycle is greater than the first accumulated value of the subsequent cycle, the difference is determined according to the first accumulated value of the subsequent cycle, the first accumulated value of the previous cycle and the corresponding counting data type value to accumulate the difference.

5. The functional safety signal diagnosis method according to claim 1, characterized in that: Also includes: When the second accumulated value is less than or equal to the second threshold, the time window is moved according to the second period.

6. The functional safety signal diagnosis method according to claim 5, characterized in that: The moving the time window according to the second period includes: Determine a moving step length according to the second period; The time window is moved backward according to the moving step size.

7. The functional safety signal diagnosis method according to claim 1, characterized in that: Also includes: In the second task, when a fault recovery enable signal is obtained, the functional safety signal fault is determined, and the second accumulated value is less than a third threshold, a fault recovery count is performed, and the fault recovery count in the second task is accumulated to determine a third accumulated value; When the third accumulated value is greater than a fourth threshold, the fault is cleared.

8. A functional safety signal diagnostic device, characterized in that: include: A first module is used to set a first task and a second task, wherein a first period of the first task is smaller than a second period of the second task, and the first task is used to sample and diagnose a functional safety signal; A second module is used for, in the first task, when the value corresponding to the functional safety signal is greater than a first threshold, performing a fault count, and accumulating all the fault counts in the first task to determine a first accumulated value; A third module is used to set a time window in the second task, obtain the first accumulated value in the corresponding first period in the second task, and accumulate the difference between the first accumulated values ​​of every two adjacent first periods in the time window to determine a second accumulated value; The fourth module is used to determine that the functional safety signal is faulty when the second accumulated value is greater than a second threshold.

9. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the functional safety signal diagnosis method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the functional safety signal diagnosis method according to any one of claims 1 to 7 is implemented.