Short pulse signal filtering circuit and battery protection chip
By designing a short pulse signal filtering circuit in the battery management system, using the combination of the signal acquisition module and a bit-weighted filter, the effective filtering of the noise interference signal is achieved, and the signal amplitude and time requirements in the prior art are not met. The problem of the system improves the filtering accuracy.
Patent Information
- Application Number
- CN202411068693.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-22
AI Technical Summary
In the prior art, in the battery management system, short pulse signals caused by noise or interference are difficult to effectively filter out, affecting the normal operation of the system, especially in a delay system with strict signal amplitude and time requirements, the expected filtering effect cannot be met.
A short pulse signal filtering circuit is designed, including a signal acquisition module and a bit weighting filter. By acquiring the input signal within the preset working time and converting it into a bit code stream, empowering and weight accumulation processing are carried out. A dual filtering effect of signal amplitude and time is achieved, and an expected interrupt signal is output to trigger an interrupt.
It realizes effective filtering of short pulse signals, meets the signal amplitude and time requirements for event triggering in the delay system, improves the filtering accuracy of signal amplitude and time, and ensures the normal operation of the battery management system.
Smart Images

Figure CN119010852A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of signal filtering, and in particular to a short pulse signal filtering circuit and a battery protection chip. Background Art
[0002] BMS (Battery Management System) is a key component for monitoring, controlling and protecting batteries. BMS should have battery protection functions, namely overvoltage protection, undervoltage protection, overcurrent protection and overtemperature protection, to ensure that the battery can supply power safely and stably.
[0003] Figure 1 This is a schematic diagram of the working principle of the comparator provided in the background technology of this application. Figure 1 Therefore, in the prior art, when the input signal of the comparator is slightly higher than the flip threshold VTH, if some noise or interference (such as Figure 1 The downward fluctuation part of the Vin curve in the middle causes the input voltage Vin to fluctuate in the short term and be lower than VTH. At this time, the comparator will output a short low pulse, resulting in erroneous output results or problems that are inconsistent with the actual situation, affecting the normal operation of the BMS.
[0004] Therefore, there is an urgent need for a short pulse signal filtering circuit, a short pulse signal filtering method and a device to solve the above technical problems. Summary of the invention
[0005] The present application provides a short pulse signal filtering circuit and a battery protection chip, which can achieve dual filtering effects on signal amplitude and time, meet the requirements of signal amplitude and time for event triggering in the delay system, and achieve the expected short pulse signal filtering effect.
[0006] In a first aspect, the present application provides a short pulse signal filtering circuit, comprising: a signal acquisition module and a bit weighted filter;
[0007] The signal acquisition module is used to acquire an input signal within a preset working time and convert the input signal into a bit stream;
[0008] The input end of the bit weighted filter is connected to the output end of the signal acquisition module. The bit weighted filter is used to perform weighted processing and weight accumulation processing on the bit code stream output by the signal acquisition module within the preset working time to obtain a first weight accumulation value, and when it is detected that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, the expected interrupt signal is output.
[0009] In some possible embodiments, the bit weighted filter includes: a bit weighting module and a bit weight accumulation module; wherein the input end of the bit weighting module is connected to the output end of the signal acquisition module, and the bit weighting module is used to receive the bit code stream output by the signal acquisition module within the preset time length and perform weighted processing to obtain a weighted bit code stream; the input end of the bit weight accumulation module is connected to the output end of the bit weighting module, and the bit weight accumulation module is used to perform weighted accumulation processing on the bit code stream output by the bit weighting module to obtain a first weighted accumulation value, and when the first weighted accumulation value is detected to reach the interrupt trigger threshold at the end of the preset working time, an expected interrupt signal is output.
[0010] In some possible embodiments, the preset working duration includes multiple cycles; accordingly, the signal acquisition module is specifically used to: acquire the input signal in each cycle within the preset working duration in turn, and convert the input signal corresponding to each cycle into a bit code; and determine the bit codes corresponding to all cycles within the preset working duration as a bit code stream.
[0011] In some possible embodiments, the bit weight accumulation module is specifically used to: perform weighted processing on the bit code stream output by the signal acquisition module within the preset working duration to obtain a weighted bit code corresponding to each period; determine the weighted bit codes corresponding to all periods within the preset working duration as a weighted bit code stream; perform weighted accumulation processing on the weighted bit code stream to obtain a first weighted accumulation value; and output an expected interrupt signal when it is detected that the first weighted accumulation value reaches an interrupt trigger threshold at the end of the preset working duration.
[0012] In some possible embodiments, the bit weight accumulation module is used to, after detecting that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, also be used to: determine the interrupt signal output time interval based on the preset working time, the preset time error and the interrupt trigger threshold; and output the expected interrupt signal within the interrupt signal output time interval.
[0013] In some possible ways, the preset working duration includes multiple cycles; accordingly, the bit weight accumulation module is used to determine the interrupt signal output time interval according to the preset working duration, the preset time error and the interrupt trigger threshold, and the calculation formula is:
[0014] ΔT=[(1-E)×n×cycle, n×cycle]
[0015] In the formula, ΔT is the interrupt signal output time interval, E is the preset time error, n×cycle is the preset working time, where cycle is a cycle in the preset working time, and n is the number of all cycles in the preset working time.
[0016] In some possible embodiments, the bit code stream includes at least one bit 1 and / or at least one bit 0, and the preset working duration includes multiple cycles; accordingly, the bit weighted filter is used to perform weighted processing on the bit code stream output by the signal acquisition module within the preset working duration, and is also used to: determine a first weight value corresponding to bit 1 and a second weight value corresponding to bit 0 based on the preset working duration, a preset time error and the interrupt trigger threshold.
[0017] In some possible embodiments, the bit weighted filter is used to determine a first weight value corresponding to bit 1 and a second weight value corresponding to bit 0 according to the preset working time, the preset time error and the interrupt trigger threshold, and the calculation formula is:
[0018]
[0019] In the formula, W1 is the first weight value corresponding to bit 1, W0 is the second weight value corresponding to bit 0, TH is the interrupt trigger threshold, n is the number of cycles in the preset working duration, and E is the preset time error.
[0020] In some possible embodiments, the signal acquisition module is also used to: obtain an input signal within the next preset working time of the preset working time and convert the input signal into a bit code stream; the bit weighted filter is also used to: perform weighting processing and weight accumulation processing on the bit code stream output by the signal acquisition module within the next preset working time of the preset working time to obtain a second weight accumulation value, and when it is detected that the second weight accumulation value reaches the interrupt trigger threshold at the end of the next preset working time, continue to output the expected interrupt signal; or when it is detected that the second weight accumulation value is less than the interrupt trigger threshold at the end of the next preset working time, stop outputting the expected interrupt signal.
[0021] In a second aspect, an embodiment of the present application provides a battery protection chip, comprising the short pulse signal filtering circuit described in the first aspect.
[0022] The present application provides a short pulse signal filtering circuit and a battery protection chip. When the short pulse signal filtering circuit is working, the signal acquisition module first obtains an input signal within a preset working time and converts the input signal into a bit code stream, and then performs weighting processing and weight accumulation processing on the bit code stream output by the signal acquisition module within the preset working time through a bit weighted filter to obtain a first weighted accumulated value, and when it is detected that the first weighted accumulated value reaches an interrupt trigger threshold at the end of the preset working time, an expected interrupt signal is output to trigger an interrupt, thereby achieving a dual filtering effect on signal amplitude and time, improving the filtering of time and signal amplitude, meeting the requirements of the signal amplitude and time of the interrupt trigger in the delay system, and achieving the expected short pulse signal filtering effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 A schematic diagram of the working principle of the comparator provided in the background technology of this application;
[0025] Figure 2 A schematic diagram of the working principle of a dual-threshold comparator provided in an embodiment of the present application;
[0026] Figure 3 A circuit connection diagram of a short pulse signal filtering circuit is provided for an embodiment of the present application;
[0027] Figure 4 A schematic diagram of a flow chart of a short pulse signal filtering method provided in an embodiment of the present application;
[0028] Figure 5 A working principle diagram of a digital de-glitch comparator used in the first special demand scenario provided in an embodiment of the present application;
[0029] Figure 6 A signal schematic diagram of the short pulse signal filtering method provided in this embodiment in the first special demand scenario provided in the embodiment of the present application;
[0030] Figure 7 A signal schematic diagram of the short pulse signal filtering method provided in this embodiment using the second special demand scenario provided in the embodiment of the present application;
[0031] Figure 8A signal diagram of a digital de-glitch comparator used in the second special demand scenario provided by an embodiment of the present application;
[0032] Fig. 9 A signal schematic diagram of the short pulse signal filtering method provided in this embodiment using the third special demand scenario provided in the embodiment of the present application;
[0033] Fig.10 A signal diagram of a digital de-glitch comparator used in the third special demand scenario provided by an embodiment of the present application;
[0034] Fig.11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0035] Figure numerals: 31 - signal acquisition module; 32 - bit weighted filter; 321 - bit weighting module; 322 - bit weight accumulation module. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] Figure 2 A schematic diagram of the working principle of a dual-threshold comparator provided in an embodiment of the present application.
[0038] In the prior art, in order to avoid the short pulse signal generated by noise or interference, resulting in output error results, the following methods are also used: Figure 2 The dual threshold comparator shown in Figure 1 filters out short pulse signals. Figure 2 As shown, the threshold of the comparator is changed into a high level and a low level, and the high level and the low level form a hysteresis. When Vin>VTH2 (flip threshold 2), the dual threshold comparator outputs 1, and when Vin is less than VTH1 (flip threshold 1), the comparator will output 0. As long as the hysteresis range is large enough, it can effectively filter out interference or noise such as short pulse signals. However, the inventors found that in the protection system (such as overvoltage protection), some users require that within a time t0, after the average voltage exceeds the protection threshold, an overvoltage protection interrupt is issued at time t0, thereby triggering the BMS host to handle abnormal events. Of course, there are also requirements for the triggering time, such as requiring the error not to exceed 20%. At this time, the inventors found that for these requirements, Figure 2The dual threshold comparator shown in the figure requires a sufficiently large hysteresis voltage range. However, for high-precision protection systems, some of the thresholds that need to trigger protection are in the uV range. In this case, Figure 2 The dual threshold comparator shown does not achieve the expected accuracy, and the problem of hysteresis cannot be achieved. From the above content and background technology, it can be seen that the short pulse signal generated by non-ideal factors such as noise and metastable state in the corresponding system can be filtered out in a quasi-timely system (i.e., a system that takes effect immediately when the amplitude and duration of the signal meet the trigger threshold) to avoid the system from generating erroneous behavior, but it cannot meet the requirements of the signal amplitude and time for event triggering in the delay system to achieve the expected filtering effect.
[0039] In order to solve the above technical problems, the embodiments of the present application provide the following technical concepts for solving the problems: first, the bit code stream emitted by the timely system is passed through a weighting module to assign different weights to 1 and 0, and then a weight accumulation module is used to achieve a dual filtering effect on the signal amplitude and time, thereby meeting the requirements of the signal amplitude and time triggered by the event in the delay system and achieving the expected short pulse signal filtering effect.
[0040] It should be noted that the short pulse signal filtering circuit, short pulse signal filtering method and device provided in the embodiments of the present application can be used in the field of signal processing technology, and can also be used in fields other than signal processing, such as power supply, BMS and other technical fields. The present application does not limit the application field of the short pulse signal filtering circuit, short pulse signal filtering method and device.
[0041] Figure 3 A circuit connection diagram of a short pulse signal filtering circuit is provided for an embodiment of the present application.
[0042] like Figure 3 As shown, the short pulse signal filtering circuit provided in the embodiment of the present application includes: a signal acquisition module 31 and a bit weighted filter 32.
[0043] The signal acquisition module 31 is used to acquire input signals within a preset working time and convert the input signals into a bit stream.
[0044] The input end of the bit weighted filter 32 is connected to the output end of the signal acquisition module 31. The bit weighted filter 32 is used to perform weighted processing and weight accumulation processing on the bit code stream output by the signal acquisition module 31 within the preset working time to obtain a first weight accumulation value, and when it is detected that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, the expected interrupt signal is output.
[0045] In this embodiment, the signal acquisition module may be a comparator or other circuit structure capable of realizing the signal acquisition function, and the input end of the bit weighted filter 32 may be connected to the output end of the signal acquisition module 31 by electrical connection.
[0046] Specifically, in an optional embodiment of the present application, the bit weighted filter 32 includes: a bit weighting module 321 and a bit weight accumulation module 322.
[0047] The input end of the bit weighting module 321 is connected to the output end of the signal acquisition module 31, and the bit weighting module 321 is used to receive the bit code stream output by the signal acquisition module 31 within a preset working time and perform weighting processing to obtain a weighted bit code stream;
[0048] The input end of the bit weight accumulation module 322 is connected to the output end of the bit weighting module 321. The bit weight accumulation module 322 is used to perform weight accumulation processing on the bit code stream output by the bit weighting module 321 to obtain a first weight accumulation value, and when it is detected that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, the expected interrupt signal is output.
[0049] In this embodiment, the input terminal of the bit weighting module 321 and the output terminal of the signal acquisition module 31 may be electrically connected. The input terminal of the bit weight accumulation module 322 and the output terminal of the bit weighting module 321 may be electrically connected.
[0050] Based on the above embodiments, in an optional embodiment of the present application, a short pulse signal filtering circuit is provided, and a preset working duration includes multiple cycles; accordingly, the signal acquisition module 31 is specifically used to: sequentially acquire input signals in each cycle within the preset working duration, and convert the input signals corresponding to each cycle into bit codes; and determine the bit codes corresponding to all cycles within the preset working duration as a bit code stream.
[0051] In an optional embodiment of the present application, the bit weight accumulation module 322 in the short pulse signal filtering circuit is specifically used to: perform weighted processing on the bit code stream output by the signal acquisition module 31 within the preset working duration to obtain the weighted bit code corresponding to each period; determine the weighted bit codes corresponding to all periods within the preset working duration as the weighted bit code stream; perform weighted accumulation processing on the weighted bit code stream to obtain a first weighted accumulated value; when it is detected that the first weighted accumulated value reaches the interrupt trigger threshold at the end of the preset working duration, output the expected interrupt signal.
[0052] In an optional embodiment of the present application, the bit weight accumulation module 322 in the short pulse signal filtering circuit is used to, after detecting that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, also be used to: determine the interrupt signal output time interval based on the preset working time, the preset time error and the interrupt trigger threshold; and output the expected interrupt signal within the interrupt signal output time interval.
[0053] In an optional embodiment of the present application, a short pulse signal filtering circuit is further provided, and the preset working duration includes multiple cycles; accordingly, the bit weight accumulation module 322 is used to determine the interrupt signal output time interval according to the preset working duration, the preset time error and the interrupt trigger threshold, and the calculation formula is:
[0054] ΔT=[(1-E)×n×cycle, n×cycle]
[0055] In the formula, ΔT is the interrupt signal output time interval, E is the preset time error, n×cycle is the preset working time, where cycle is a cycle in the preset working time, and n is the number of all cycles in the preset working time.
[0056] In an optional embodiment of the present application, a short pulse signal filtering circuit is also provided. In this embodiment, the bit code stream includes at least one bit 1 and / or at least one bit 0, and the preset working duration includes multiple cycles; accordingly, the bit weighting filter 32 is used to perform weighted processing on the bit code stream output by the signal acquisition module 31 within the preset working duration, and is also used to: determine the first weight value corresponding to bit 1 and the second weight value corresponding to bit 0 according to the preset working duration, the preset time error and the interrupt trigger threshold.
[0057] In an optional embodiment of the application, the bit weighted filter in the short pulse signal filtering circuit is used to determine the first weight value corresponding to bit 1 and the second weight value corresponding to bit 0 according to the preset working time, the preset time error and the interrupt trigger threshold, and the calculation formula is:
[0058]
[0059] In the formula, W1 is the first weight value corresponding to bit 1, W0 is the second weight value corresponding to bit 0, TH is the interrupt trigger threshold, n is the number of cycles in the preset working duration, and E is the preset time error.
[0060] In an optional embodiment of the present application, the signal acquisition module in the short pulse signal filtering circuit is also used to: obtain the input signal within the next preset working time of the preset working time and convert the input signal into a bit code stream; the bit weighted filter is also used to: perform weighting processing and weight accumulation processing on the bit code stream output by the signal acquisition module within the next preset working time of the preset working time to obtain a second weight accumulation value, and when it is detected that the second weight accumulation value reaches the interrupt trigger threshold at the end of the next preset working time, continue to output the expected interrupt signal; or when it is detected that the second weight accumulation value is less than the interrupt trigger threshold at the end of the next preset working time, stop outputting the expected interrupt signal.
[0061] In summary, an embodiment of the present application provides a short pulse signal filtering circuit. When the short pulse signal filtering circuit is working, the signal acquisition module first obtains the input signal within a preset working time and converts the input signal into a bit code stream, and then uses a bit weighted filter to perform weighted processing and weight accumulation processing on the bit code stream output by the signal acquisition module within the preset working time to obtain a first weighted accumulated value, and when it is detected that the first weighted accumulated value reaches the interrupt trigger threshold at the end of the preset working time, the expected interrupt signal is output to trigger the interrupt, thereby achieving a dual filtering effect on signal amplitude and time, improving the filtering of time and signal amplitude, meeting the requirements of the signal amplitude and time of the interrupt trigger in the delay system, and achieving the expected short pulse signal filtering effect.
[0062] The above is the connection relationship and purpose of each module in the short pulse signal filtering circuit. Specifically, the specific uses and instructions of the signal acquisition module 31, the bit weighted filter 32, the bit weighting module 321 and the bit weight accumulation module 322 in the above embodiment will be described in conjunction with the method step embodiment. Each module is not numbered in the method embodiment.
[0063] Figure 4 A schematic diagram of a flow chart of a short pulse signal filtering method provided in an embodiment of the present application. The execution subject of this embodiment may include: Figure 3 The chip, power supply or server of the short pulse signal filtering circuit shown may also be other computer-related hardware devices, and there is no particular limitation on this embodiment.
[0064] like Figure 4 As shown, the short pulse signal filtering method includes:
[0065] S401: Acquire an input signal within a preset working time and convert the input signal into a bit stream.
[0066] In this embodiment, the input power signal may be a voltage signal or a current signal in a battery management system. The bit code stream may be a sequence consisting of a series of binary bits, each binary bit representing a bit (0 or 1).
[0067] In this embodiment, the preset working time refers to a time preset manually. Specifically, in an optional embodiment of the present application, the preset working time includes multiple cycles, and accordingly, step S401 includes:
[0068] S401a: acquiring input signals in sequence in each cycle within a preset working duration, and converting the input signals corresponding to each cycle into bit codes.
[0069] S401b: Determine the bit codes corresponding to all periods within the preset working duration as a bit code stream.
[0070] In this embodiment, the complete preset working time may be a time period preset manually, and the time period may be divided into a plurality of cycles, each of which may have a corresponding bit.
[0071] To facilitate understanding of the short pulse signal filtering method provided in the embodiment of the present application, a special scenario (hereinafter referred to as the first special scenario) that cannot be satisfied by the prior art is described, and the prior art adopted here is a digital interference filtering de-glitch comparator. In this embodiment, the bit corresponding to each cycle may include bit 1 and bit 0.
[0072] Figure 5 This is a working principle diagram of a digital de-glitch comparator used in the first special demand scenario provided in an embodiment of the present application.
[0073] like Figure 5 As shown, in the first special demand scenario, it is assumed that the preset working time is t0=10cycle, where one cycle is one cycle. In the protection system (such as the overvoltage protection system), the requirement is within a time t0, that is, within ten cycles, when the average value of Vin within the preset working time t0 is greater than VTH, an interrupt is issued at the end of t0. That is, after the output of the pre-comparator exceeds a set upper limit value, it is necessary to trigger the host to handle the abnormal event. In this embodiment, the digital De-glitch comparator needs to output a bit 1 greater than or equal to 6 cycles and a bit 0 less than or equal to 4 cycles. If a digital De-glitch comparator is used, at least four cycles are required. Assuming that the following occurs Figure 5 The extreme case represented by the Vin curve shown will cause the interrupt to be triggered 6 cycles earlier, resulting in erroneous results.
[0074] S402: Perform weighting processing and weight accumulation processing on the bit code stream output by the signal acquisition module 31 within the preset working time to obtain a first weight accumulation value, and when it is detected that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, output the expected interrupt signal.
[0075] In this embodiment, weighting processing refers to defining a corresponding weight for each bit in the bit stream. Weight accumulation processing refers to the process of accumulating the weight corresponding to each bit. The interrupt triggering threshold may be a preset value. When the first weight accumulation value reaches the value, it indicates that the expected interrupt signal can be output to trigger the interrupt at the end of the current preset working time.
[0076] Figure 6 This is a signal schematic diagram of using the short pulse signal filtering method provided in this embodiment in the first special demand scenario provided in the embodiment of the present application.
[0077] Specifically, in an optional embodiment of the present application, step S402 includes:
[0078] S402a: weighting the bit code stream output by the signal acquisition module 31 within a preset working time to obtain a weighted bit code corresponding to each period.
[0079] S402b: Determine the weighted bit codes corresponding to all periods within the preset working duration as a weighted bit code stream.
[0080] In this embodiment, the weighted bit code refers to the bit values after different weights are defined for different bits. Figure 6 As shown, the weight 1 assigned to bit 1 corresponding to the first cycle cycle within the preset working duration t0 is used as the weighted bit code corresponding to the first cycle, the weight 0.5 assigned to bit 0 corresponding to the fifth cycle is used as the weighted bit code corresponding to the fifth cycle, and so on. Assuming that the bit code stream from the first cycle to the tenth cycle output by the signal acquisition module 31 is [1,1,1,1,0,0,0,0,1,1], then after the weighting process, the weighted bit code stream obtained is [1,1,1,1,0.5,0.5,0.5,0.5,1,1].
[0081] S402c: Perform weight accumulation processing on the weighted bit stream to obtain a first weight accumulation value.
[0082] In this embodiment, the weight accumulation process refers to the process of accumulating and summing the weighted bit streams in sequence from the first value.
[0083] For example: Figure 6As shown, the weighted bit code stream is [1,1,1,1,0.5,0.5,0.5,0.5,1,1], and the first weight accumulated values obtained from the first cycle to the tenth cycle are 1,2,3,4,4.5,5,5.5,6,7,8 respectively.
[0084] S402d: When it is detected that the first weight accumulated value reaches the interruption triggering threshold at the end of the preset working time, an expected interruption signal is output.
[0085] In this embodiment, the first weight accumulated value reaches the interruption triggering threshold value means that the first weight accumulated value is greater than or equal to the interruption triggering threshold value.
[0086] Based on the above embodiment, in an optional embodiment of the present application, when it is detected in step S402 that the first weight accumulated value reaches the interruption triggering threshold at the end of the preset working time, the method further includes:
[0087] Step A: Determine the interrupt signal output time interval according to the preset working time, the preset time error and the interrupt trigger threshold.
[0088] In this embodiment, the interrupt signal output time interval refers to the time period within which the interrupt is allowed to be triggered. The preset time error may be a preset error ratio within which the interrupt is allowed to be triggered, for example, the error of the interrupt trigger time is 20%.
[0089] Specifically, in an optional embodiment of the present application, the preset working time includes multiple cycles. Accordingly, the calculation formula of step A is: ΔT = [(1-E) × n × cycle, n × cycle]
[0090] In the formula, ΔT is the interrupt signal output time interval, E is the preset time error, n×cycle is the preset working time, where cycle is a cycle in the preset working time, and n is the number of all cycles in the preset working time.
[0091] Step B: Outputting the expected interrupt signal within the interrupt signal output time interval.
[0092] In this embodiment, outputting the expected interrupt signal within the interrupt signal output time interval means that the expected interrupt signal can be triggered within the interrupt signal output time interval obtained in step A, and does not have to be triggered at the end of the preset working time. Figure 6 As shown, at the end of t0, the interrupt is triggered, the expected interrupt signal is the same as the actual interrupt signal, and the output result is accurate.
[0093] The weights described in the above embodiments are preset fixed values. Different weights may be determined based on different scenarios and for different delay requirements.
[0094] In an optional embodiment of the present application, at least one bit is 1 and / or at least one bit is 0, and the preset working duration includes multiple cycles. Correspondingly, before weighting the bit code stream output by the signal acquisition module 31 within the preset working duration in step S402, the method further includes:
[0095] Step C: Determine a first weight value corresponding to bit 1 and a second weight value corresponding to bit 0 according to a preset working duration, a preset time error and an interruption trigger threshold.
[0096] In this embodiment, the first weight value and the second weight value may be pre-set according to requirements or calculated according to constraint conditions.
[0097] Specifically, in an optional embodiment of the present application, the calculation formula of step C is:
[0098]
[0099] In the formula, W1 is the first weight value corresponding to bit 1, W0 is the second weight value corresponding to bit 0, TH is the interrupt trigger threshold, n is the number of cycles in the preset working duration, and E is the preset time error.
[0100] In this embodiment, the first weight value W1=1 can be obtained from the above formula, and the second weight value W0 is related to the three parameters E, TH and n.
[0101] In summary, the short pulse signal filtering method provided in the embodiment of the present application first obtains the input signal within the preset working time and converts the input signal into a bit code stream, and then performs weighted processing and weight accumulation processing on the bit code stream output by the signal acquisition module 31 within the preset working time to obtain a first weight accumulation value, and when it is detected that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, the expected interrupt signal is output to trigger the interrupt, thereby achieving a dual filtering effect on signal amplitude and time, improving the filtering of time and signal amplitude, meeting the requirements of signal amplitude and time for interrupt triggering in the delay system, and achieving the expected short pulse signal filtering effect.
[0102] The above embodiment is aimed at filtering out short pulse signals that appear in a complete preset working duration. The following will combine the embodiments and drawings to illustrate the implementation process of the short pulse signal filtering method provided in the embodiment of the present application when short pulse signals appear in two complete and consecutive preset working durations.
[0103] Figure 7 A signal schematic diagram of the short pulse signal filtering method provided in this embodiment using the second special demand scenario provided in the embodiment of the present application.
[0104] Figure 8A signal diagram of a digital de-glitch comparator used in the second special demand scenario provided in an embodiment of the present application.
[0105] like Figure 7 As shown, the second special demand scenario refers to the situation in which the short pulse signal lasts for a long time within two consecutive and complete preset working time periods, for example, multiple consecutive bits 0 are output from the signal acquisition module 31, and these multiple consecutive bits 0 extend from the last few cycles of the first preset working time period to the first few cycles of the second preset working time period. At this time, if the following method is used Figure 5 The digital de-glitch comparator shown in the figure is used for filtering, which will produce Figure 8 The expected interrupt is inconsistent with the actual interrupt triggered, resulting in incorrect output results.
[0106] Fig. 9 A signal schematic diagram of the short pulse signal filtering method provided in this embodiment using the third special demand scenario provided in the embodiment of the present application.
[0107] Fig.10 A signal diagram of a digital de-glitch comparator used in the third special requirement scenario provided in an embodiment of the present application.
[0108] At this time, if you use Figure 5 The digital de-glitch comparator shown in the figure is used for filtering, which will produce Fig.10 The problem shown is that the expected interrupt required is inconsistent with the actual interrupt triggered, resulting in an erroneous output result.
[0109] like Fig. 9 As shown, the difference between the third special demand scenario and the second special demand scenario is that the duration of the short pulse signal in the next preset working duration is longer than that in the first preset working duration.
[0110] The short pulse signal filtering method provided in an optional embodiment of the present application further includes:
[0111] Step D: acquiring an input signal within the next preset working time of the preset working time and converting the input signal into a bit code stream.
[0112] Step E: Perform weighting processing and weight accumulation processing on the bit code stream output by the signal acquisition module 31 within the next preset working time of the preset working time to obtain a second weight accumulation value, and when it is detected that the second weight accumulation value reaches the interrupt trigger threshold at the end of the next preset working time, continue to output the expected interrupt signal.
[0113] In this embodiment, the second weighted accumulated value is for the bit stream output within the next preset working time. The process of step D and step E is similar to the process of steps 401 to 402 in the above embodiment, so this embodiment will not be repeated here. The specific implementation principle and the actual output result obtained are as follows Figure 6 In the example shown, when the first preset working time ends, it can be seen that the first weight accumulated value is 8 and reaches the interrupt trigger threshold of 8. Therefore, the interrupt is triggered at the end of the 10th cycle of the first preset working time. Then, when the next preset working time ends, it can be seen that the second weight accumulated value is also 8, which reaches the interrupt trigger threshold. Therefore, the expected interrupt signal continues to be output at the end of the next preset working time.
[0114] Step F: or when it is detected that the second weight accumulated value is less than the interruption triggering threshold value at the end of the next preset working time, the expected interruption signal is stopped from being output.
[0115] In this embodiment, the specific implementation principle of step F and the actual output result obtained are as follows: Figure 8 In the example shown, when the first preset working time ends, it can be seen that the first weight accumulated value is 8, reaching the interrupt trigger threshold, so the interrupt is triggered at the end of the 10th cycle of the first preset working time, and then at the end of the next preset working time, it can be seen that the second weight accumulated value is 7, and the second weight accumulated value is less than or equal to the interrupt trigger threshold 8, then the expected interrupt signal is stopped at the end of the 10th cycle of the next preset working time.
[0116] An embodiment of the present application further provides a battery protection chip, comprising the short pulse signal filtering circuit described in the above embodiment.
[0117] In this embodiment, the battery protection chip is used in a protection system such as an overvoltage protection system. After the average voltage exceeds the set protection threshold within a period of time t0, the battery protection chip can perform an overvoltage protection interrupt operation at time t0, triggering the protection system host to handle abnormal events. In this scenario, the working principle of the short pulse signal filtering circuit has been explained in the above embodiment, so this embodiment will not be repeated here.
[0118] Fig.11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the electronic device includes: at least one processor 1101 and a memory 1102 .
[0119] The memory 1102 is used to store computer-executable instructions.
[0120] The processor 1101 is used to execute the computer-executable instructions stored in the memory 1102 to implement the various steps involved in the above method embodiment. For details, please refer to the relevant description in the above method embodiment.
[0121] Optionally, the memory 1102 may be independent or integrated with the processor 1101 .
[0122] When the memory 1102 is independently provided, the electronic device includes a bus 1103 for connecting the memory 1102 and the processor 1101 .
[0123] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above short pulse signal filtering method is implemented.
[0124] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above short pulse signal filtering method when executed by a processor.
[0125] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0126] The modules described above as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0127] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each module may exist physically separately, or two or more modules may be integrated into one unit. The unit composed of the above modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0128] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method of each embodiment of the present application.
[0129] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0130] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0131] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0132] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0133] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0134] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0135] The present invention is intended to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solution from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A short pulse signal filtering circuit, characterized in that: include: Signal acquisition module and bit weighting filter; The signal acquisition module is used to acquire an input signal within a preset working time and convert the input signal into a bit stream; The input end of the bit weighted filter is connected to the output end of the signal acquisition module. The bit weighted filter is used to perform weighted processing and weight accumulation processing on the bit code stream output by the signal acquisition module within the preset working time to obtain a first weight accumulation value, and when it is detected that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, the expected interrupt signal is output.
2. The short pulse signal filtering circuit according to claim 1, characterized in that: The bit weighted filter comprises: a bit weighting module and a bit weight accumulation module; The input end of the bit weighting module is connected to the output end of the signal acquisition module, and the bit weighting module is used to receive the bit code stream output by the signal acquisition module within the preset time length and perform weighting processing to obtain a weighted bit code stream; The input end of the bit weight accumulation module is connected to the output end of the bit weighting module. The bit weight accumulation module is used to perform weight accumulation processing on the bit code stream output by the bit weighting module to obtain a first weight accumulation value, and output an expected interrupt signal when it is detected that the first weight accumulation value reaches an interrupt trigger threshold at the end of the preset working time.
3. The short pulse signal filtering circuit according to claim 2, characterized in that: The preset working duration includes multiple cycles; accordingly, the signal acquisition module is specifically used to: acquire input signals in each cycle within the preset working duration in turn, and convert the input signals corresponding to each cycle into bit codes; and determine the bit codes corresponding to all cycles within the preset working duration as a bit code stream.
4. The short pulse signal filtering circuit according to claim 3, characterized in that: The bit weight accumulation module is specifically used to: perform weighted processing on the bit code stream output by the signal acquisition module within the preset working duration to obtain a weighted bit code corresponding to each period; determine the weighted bit codes corresponding to all periods within the preset working duration as a weighted bit code stream; perform weighted accumulation processing on the weighted bit code stream to obtain a first weighted accumulation value; and output an expected interrupt signal when it is detected that the first weighted accumulation value reaches an interrupt trigger threshold at the end of the preset working duration.
5. The short pulse signal filtering circuit according to claim 1, characterized in that: The bit weight accumulation module is used to, when it is detected that the first weight accumulation value reaches the interrupt trigger threshold at the end of the preset working time, also used to: determine the interrupt signal output time interval based on the preset working time, the preset time error and the interrupt trigger threshold; and output the expected interrupt signal within the interrupt signal output time interval.
6. The short pulse signal filtering circuit according to claim 5, characterized in that: The preset working duration includes multiple cycles; accordingly, the bit weight accumulation module is used to determine the interrupt signal output time interval according to the preset working duration, the preset time error and the interrupt trigger threshold, and the calculation formula is: ΔT=[(1-E)×n×cycle, n×cycle] In the formula, ΔT is the interrupt signal output time interval, E is the preset time error, n×cycle is the preset working time, where cycle is a cycle in the preset working time, and n is the number of all cycles in the preset working time.
7. The short pulse signal filtering circuit according to any one of claims 1 to 6, characterized in that: The bit code stream includes at least one bit 1 and / or at least one bit 0, and the preset working duration includes multiple cycles; accordingly, the bit weighted filter is used to determine the first weight value corresponding to bit 1 and the second weight value corresponding to bit 0 according to the preset working duration, the preset time error and the interrupt trigger threshold before weighting the bit code stream output by the signal acquisition module within the preset working duration.
8. The short pulse signal filtering circuit according to claim 7, characterized in that: The bit weighted filter is used to determine a first weight value corresponding to bit 1 and a second weight value corresponding to bit 0 according to the preset working time, the preset time error and the interrupt trigger threshold, and the calculation formula is: In the formula, W1 is the first weight value corresponding to bit 1, W0 is the second weight value corresponding to bit 0, TH is the interrupt trigger threshold, n is the number of cycles in the preset working duration, and E is the preset time error.
9. The short pulse signal filtering circuit according to claim 1, characterized in that: The signal acquisition module is also used to: obtain the input signal within the next preset working time of the preset working time and convert the input signal into a bit code stream; the bit weighted filter is also used to: perform weighting processing and weight accumulation processing on the bit code stream output by the signal acquisition module within the next preset working time of the preset working time to obtain a second weight accumulation value, and when it is detected that the second weight accumulation value reaches the interrupt trigger threshold at the end of the next preset working time, continue to output the expected interrupt signal; or when it is detected that the second weight accumulation value is less than the interrupt trigger threshold at the end of the next preset working time, stop outputting the expected interrupt signal.
10. A battery protection chip, characterized in that: The method comprises the short pulse signal filtering circuit as claimed in any one of claims 1 to 9.
