Pulse signal processing method and system and electronic equipment
By designing a signal filtering strategy and a time dejittering strategy based on duty cycle and frequency parameters, the problem of poor processing of PWM pulse signal measurement is solved, reducing the data volume and load pressure, and improving the processing efficiency.
Patent Information
- Application Number
- CN202510339691.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, the measurement processing of PWM pulse signals is poor, especially when processing 0% and 100% signals.
By designing a signal filtering strategy based on duty cycle and frequency parameters, the invalid PWM pulse signals are filtered, and the time dejitter strategy of time parameters is used to reduce the number of refreshes of the pulse signals.
The data volume and load pressure of the pulse signal are reduced, and the measurement and processing effect of the PWM pulse signal is improved.
Smart Images

Figure CN120277341A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of signal processing, and in particular, to a method, a system, and an electronic device for processing pulse signals. Background Art
[0002] PWM (Pulse Width Modulation) refers to pulse width modulation, which is mainly used to control analog circuits as the digital output result of a microprocessor and is widely used in fields such as measurement, communication, and power control. In actual use, different output controls need to be achieved by measuring the duty cycle and frequency of the input PWM. Traditional PWM signal measurement methods are implemented by using the blocking method, the interrupt method, and the timer capture function. Among them, the blocking method occupies CPU time and is only applicable to systems with low real-time performance; the interrupt method has good real-time performance, but cannot process signals of 0% and 100%; the capture method has high stability and accuracy and requires hardware support, but cannot process signals of 0% and 100%.
[0003] It can be seen that there are still problems with poor processing effects in the measurement and processing of PWM pulse signals in the prior art. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, a system, and an electronic device for processing pulse signals. This method designs a signal filtering strategy by using the duty cycle parameter and the frequency parameter of the PWM pulse signal, so as to filter out invalid PWM pulse signals and reduce the data volume of the pulse signal; in addition, this method determines a time jitter elimination strategy by using the time parameter, and then uses the time jitter elimination strategy to perform time-limited processing on the PWM pulse signal, reducing the refresh times of the PWM pulse signal, thereby further reducing the load pressure of the pulse signal and solving the problem of poor measurement and processing effects of PWM pulse signals in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a method for processing pulse signals, the method comprising:
[0006] A signal acquisition step: acquiring a PWM pulse signal to be processed;
[0007] A signal filtering step: determining a signal filtering strategy for the PWM pulse signal based on the duty cycle parameter and the frequency parameter of the PWM pulse signal, and after filtering the PWM pulse signal by using the signal filtering strategy, obtaining a first pulse signal corresponding to the PWM pulse signal;
[0008] Time debounce step: Determine the time debounce strategy for the first pulse signal according to the time parameters of the first pulse signal, and update the first pulse signal according to the time parameters using the time debounce strategy to obtain the second pulse signal corresponding to the first pulse signal;
[0009] Signal processing step: Determine the processing strategy for the second pulse signal using the attribute parameters of the PWM pulse signal, and process the second pulse signal using the processing strategy.
[0010] In one implementation, the signal filtering step includes:
[0011] Determine the first filtering strategy included in the signal filtering strategy using the duty cycle parameter of the PWM pulse signal, and determine the second filtering strategy included in the signal filtering strategy using the frequency parameter of the PWM pulse signal;
[0012] Filter the PWM pulse signal using the first filtering strategy to obtain the first filtering result corresponding to the PWM pulse signal;
[0013] Filter the first filtering result using the second filtering strategy to obtain the second filtering result corresponding to the PWM pulse signal;
[0014] Generate the first pulse signal based on the second filtering result.
[0015] In one implementation, filtering the PWM pulse signal using the first filtering strategy to obtain the first filtering result corresponding to the PWM pulse signal includes:
[0016] Obtain the pulse duration and pulse period duration of the PWM pulse signal included in the first filtering strategy;
[0017] Obtain the standard duty cycle of the PWM pulse signal using the pulse duration and pulse period duration;
[0018] Filter the PWM pulse signal according to the numerical relationship between the duty cycle parameter and the standard duty cycle to obtain the first filtering result.
[0019] In one implementation, after filtering the PWM pulse signal using the first filtering strategy to obtain the first filtering result corresponding to the PWM pulse signal, the method further includes:
[0020] Back up the first filtering result based on the duty cycle parameter.
[0021] In one implementation, filtering the first filtering result using the second filtering strategy to obtain the second filtering result corresponding to the PWM pulse signal includes:
[0022] Obtain the signal acquisition interval and voltage jump time of the PWM pulse signal included in the second filtering strategy;
[0023] Determine the frequency value corresponding to the PWM pulse signal in the first filtering result by using the signal acquisition interval and voltage jump time;
[0024] Obtain the safe frequency interval included in the second filtering strategy, and filter the first filtering result according to the numerical relationship between the frequency value and the safe frequency interval to obtain the second filtering result.
[0025] In one implementation, determining the frequency value corresponding to the PWM pulse signal in the first filtering result by using the signal acquisition interval and voltage jump time includes:
[0026] Obtain the voltage jump time corresponding to the PWM pulse signal in the first filtering result within the signal acquisition interval;
[0027] Determine the first jump time, second jump time, and third jump time included in the voltage jump time; wherein the first jump time and the third jump time correspond to the high level of the PWM pulse signal, and the second jump time corresponds to the low level of the PWM pulse signal;
[0028] Determine the frequency value corresponding to the PWM pulse signal based on the first jump time, second jump time, and third jump time.
[0029] In one implementation, the time debounce step includes:
[0030] Obtain the time parameter corresponding to the first pulse signal, and determine the jump count threshold of the first pulse signal according to the duration corresponding to the time parameter;
[0031] Determine the time debounce strategy corresponding to the first pulse signal by using the jump count threshold, and obtain the invalid signals in the first pulse signal by using the time debounce strategy;
[0032] Control the first pulse signal to discard the invalid signals, and then update the first pulse signal to obtain the second pulse signal.
[0033] In one implementation, determining the time debounce strategy corresponding to the first pulse signal by using the jump count threshold, and obtaining the invalid signals in the first pulse signal by using the time debounce strategy includes:
[0034] Initialize a timer by using the duration corresponding to the time parameter; wherein, the timing duration of the timer is the duration corresponding to the time parameter;
[0035] Obtain the voltage jump count of the first pulse signal within the timing duration of the timer, and determine the time debounce strategy according to the numerical relationship between the voltage jump count and the jump count threshold;
[0036] The first pulse signal with the number of voltage jumps less than the jump number threshold is determined as an invalid signal by using a time debounce strategy.
[0037] In a second aspect, an embodiment of the present invention provides a pulse signal processing system, which includes:
[0038] A signal acquisition module, configured to acquire a PWM pulse signal to be processed;
[0039] A signal filtering module, configured to determine a signal filtering strategy for the PWM pulse signal based on the duty cycle parameter and the frequency parameter of the PWM pulse signal, and after filtering the PWM pulse signal by using the signal filtering strategy, obtain a first pulse signal corresponding to the PWM pulse signal;
[0040] A time debounce module, configured to determine a time debounce strategy for the first pulse signal according to the time parameter of the first pulse signal, and after updating the first pulse signal according to the time parameter by using the time debounce strategy, obtain a second pulse signal corresponding to the first pulse signal;
[0041] A signal processing module, configured to determine a processing strategy for the second pulse signal by using the attribute parameter of the PWM pulse signal, and process the second pulse signal by using the processing strategy.
[0042] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, where the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the pulse signal processing method provided in the first aspect.
[0043] In a fourth aspect, an embodiment of the present invention further provides a storage medium, which stores computer executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to implement the steps of the pulse signal processing method provided in the first aspect.
[0044] A pulse signal processing method, system and electronic device provided by an embodiment of the present invention. During the measurement and processing of a PWM pulse signal, the method first obtains the PWM pulse signal to be processed; then determines a signal filtering strategy based on the duty cycle parameter and frequency parameter of the PWM pulse signal, and filters the PWM pulse signal using the signal filtering strategy to obtain a first pulse signal corresponding to the PWM pulse signal; subsequently, determines a time jitter elimination strategy for the first pulse signal according to the time parameter of the first pulse signal, and updates the first pulse signal according to the time parameter using the time jitter elimination strategy to obtain a second pulse signal corresponding to the first pulse signal; finally, determines a processing strategy for the second pulse signal using the attribute parameter of the PWM pulse signal, and processes the second pulse signal using the processing strategy. The method designs a signal filtering strategy using the duty cycle parameter and frequency parameter of the PWM pulse signal, thereby filtering out invalid PWM pulse signals and reducing the data volume of the pulse signal; in addition, the method determines a time jitter elimination strategy using the time parameter, thereby performing time-limited processing on the PWM pulse signal using the time jitter elimination strategy, reducing the refresh frequency of the PWM pulse signal, and further reducing the load pressure of the pulse signal, solving the problem of poor measurement and processing effect of PWM pulse signals in the prior art.
[0045] Other features and advantages of the present invention will be described in the following specification, and in part will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention are achieved and obtained by the structures specifically pointed out in the specification, claims and drawings.
[0046] To make the above objectives, features and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0048] Figure 1 It is a flowchart of a pulse signal processing method provided by an embodiment of the present invention;
[0049] Figure 2 It is a flowchart of step S102 in a pulse signal processing method provided by an embodiment of the present invention;
[0050] Figure 3Flowchart of step S202 in a pulse signal processing method provided by an embodiment of the present invention;
[0051] Figure 4 Flowchart of step S203 in a pulse signal processing method provided by an embodiment of the present invention;
[0052] Figure 5 Flowchart of step S402 in a pulse signal processing method provided by an embodiment of the present invention;
[0053] Figure 6 Flowchart of step S103 in a pulse signal processing method provided by an embodiment of the present invention;
[0054] Figure 7 Flowchart of step S602 in a pulse signal processing method provided by an embodiment of the present invention;
[0055] Figure 8 Flowchart of step S102 in another pulse signal processing method provided by an embodiment of the present invention;
[0056] Figure 9 Flowchart of step S103 in another pulse signal processing method provided by an embodiment of the present invention;
[0057] Figure 10 Structural schematic diagram of a pulse signal processing system provided by an embodiment of the present invention;
[0058] Figure 11 Structural schematic diagram of an electronic device provided by an embodiment of the present invention.
[0059] Icon:
[0060] 1010 - Signal acquisition module; 1020 - Signal filtering module; 1030 - Time jitter elimination module; 1040 - Signal processing module;
[0061] 101 - Processor; 102 - Memory; 103 - Bus; 104 - Communication interface. Detailed implementation manners
[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are some, rather than all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0063] The PWM pulse signal is mainly used to control analog circuits as the digital output result of a microprocessor and is widely applied in fields such as measurement, communication, and power control. During actual use, different output controls need to be achieved by measuring the duty cycle and frequency of the input PWM. Traditional PWM signal measurement methods are implemented using the blocking method, the interrupt method, and the timer capture function. Among them, the blocking method occupies CPU time and is only applicable to systems with low real-time performance; the interrupt method has better real-time performance, but it cannot handle signals of 0% and 100%; the capture method has higher stability and accuracy and requires hardware support, but it cannot handle signals of 0% and 100%.
[0064] It can be seen that there are still problems with poor processing effects in the measurement and processing of PWM pulse signals in the prior art. Based on this, the embodiments of the present invention provide a pulse signal processing method, system, and electronic device. This method designs a signal filtering strategy using the duty cycle parameter and frequency parameter of the PWM pulse signal to filter out invalid PWM pulse signals, reducing the data volume of the pulse signal; in addition, this method determines a time debounce strategy using the time parameter and uses the time debounce strategy to perform time-limited processing on the PWM pulse signal, reducing the refresh times of the PWM pulse signal, thereby further reducing the load pressure of the pulse signal and solving the problem of poor measurement and processing effects of PWM pulse signals in the prior art.
[0065] For the convenience of understanding this embodiment, first, a pulse signal processing method disclosed in the embodiments of the present invention will be introduced in detail, as Figure 1 shown. This method includes:
[0066] Signal acquisition step S101, acquiring the PWM pulse signal to be processed;
[0067] Signal filtering step S102, determining the signal filtering strategy of the PWM pulse signal based on the duty cycle parameter and frequency parameter of the PWM pulse signal, and after filtering the PWM pulse signal using the signal filtering strategy, obtaining the first pulse signal corresponding to the PWM pulse signal;
[0068] Time debounce step S103, determining the time debounce strategy of the first pulse signal according to the time parameter of the first pulse signal, and after updating the first pulse signal according to the time parameter using the time debounce strategy, obtaining the second pulse signal corresponding to the first pulse signal;
[0069] Signal processing step S104, determining the processing strategy of the second pulse signal using the attribute parameter of the PWM pulse signal, and processing the second pulse signal using the processing strategy.
[0070] To solve the problem of measuring PWM signals in the existing technical solutions, in this embodiment, a signal filtering strategy and a time jitter elimination strategy are designed for the above problems, and after obtaining the PWM pulse signal to be processed, the PWM pulse signal is calculated and analyzed. Based on the duty cycle parameter and frequency parameter of the PWM pulse signal, a signal filtering strategy for the PWM pulse signal is determined, and the signal filtering strategy is used to filter the PWM pulse signal, so as to filter out the effective PWM signal and eliminate other invalid PWM signals. In the actual scenario, the PWM pulse signal is finally sent to the relevant ECU device, and using the signal filtering strategy can solve the impact of the invalid PWM signal on the ECU load and greatly reduce the pressure on the ECU load.
[0071] After filtering the PWM pulse signal using the signal filtering strategy, the first pulse signal corresponding to the PWM pulse signal is obtained, and then the time jitter elimination strategy for the first pulse signal is determined according to the time parameter of the first pulse signal. After analyzing the effective PWM pulse signals with different frequencies or duty cycles, according to the actual system interaction function time experience perception, corresponding time jitter elimination strategies are made for the PWM pulse signals with different frequencies or duty cycles. Actually, a corresponding timer can be set according to the time parameter, and the timer is used to perform a time limit process on the PWM pulse signal, so as to reduce the refresh frequency of the PWM pulse signal parameters within a unit time and reduce the load pressure; finally, the processing strategy for the second pulse signal is determined using the attribute parameters of the PWM pulse signal, and the second pulse signal is processed using the processing strategy.
[0072] In one implementation manner, the signal filtering step S102, as Figure 2 shown, includes:
[0073] Step S201, determining the first filtering strategy included in the signal filtering strategy using the duty cycle parameter of the PWM pulse signal, and determining the second filtering strategy included in the signal filtering strategy using the frequency parameter of the PWM pulse signal;
[0074] Step S202, filtering the PWM pulse signal using the first filtering strategy to obtain the first filtering result corresponding to the PWM pulse signal;
[0075] Step S203, filtering the first filtering result using the second filtering strategy to obtain the second filtering result corresponding to the PWM pulse signal;
[0076] Step S204, generating the first pulse signal based on the second filtering result.
[0077] Specifically, the signal filtering step mainly determines the signal filtering strategy and uses this strategy to filter the PWM pulse signal. The signal filtering strategy in this embodiment mainly involves duty cycle filtering and frequency filtering. Specifically, the first filtering strategy included in the signal filtering strategy is determined by using the duty cycle parameter of the PWM pulse signal, and at the same time, the second filtering strategy included in the signal filtering strategy is determined by using the frequency parameter of the PWM pulse signal.
[0078] Then, the PWM pulse signal is filtered by using the first filtering strategy to obtain the first filtering result corresponding to the PWM pulse signal. Furthermore, the first filtering result is filtered by using the second filtering strategy to obtain the second filtering result corresponding to the PWM pulse signal, and a first pulse signal is generated based on the second filtering result. In an actual scenario, the duty cycle of the received PWM pulse signal can be filtered first, and then the frequency of the obtained PWM pulse signal can be judged.
[0079] In one embodiment, the PWM pulse signal is filtered by using the first filtering strategy to obtain the first filtering result S202 corresponding to the PWM pulse signal, as Figure 3 shown, including:
[0080] Step S301, obtaining the pulse duration and pulse period duration of the PWM pulse signal included in the first filtering strategy;
[0081] Step S302, obtaining the standard duty cycle of the PWM pulse signal by using the pulse duration and pulse period duration;
[0082] Step S303, filtering the PWM pulse signal according to the numerical relationship between the duty cycle parameter and the standard duty cycle to obtain the first filtering result.
[0083] This embodiment filters the duty cycle of the received PWM pulse signal. Generally speaking, the duty cycle is the ratio of the duration of the positive pulse to the total pulse period in an ideal pulse sequence (such as a square wave). For example, for a square wave with a frequency of 1 Hz (1000 ms), if the high-level duration is 400 ms, then the duty cycle = (400 / 1000)*100% = 40%. After obtaining the pulse duration and pulse period duration of the PWM pulse signal included in the first filtering strategy, the standard duty cycle of the PWM pulse signal can be calculated, and then the PWM pulse signal can be filtered by using the comparison result between the standard duty cycle and the duty cycle parameter to finally obtain the first filtering result.
[0084] In one embodiment, after filtering the PWM pulse signal using the first filtering strategy to obtain the first filtering result corresponding to the PWM pulse signal, the method further includes: backing up the first filtering result based on the duty cycle parameter. In the actual processing process, first, the received PWM pulse signal is calculated and analyzed, and the pulse signal with an effective duty cycle is backed up, and then the frequency of the received PWM signal is filtered. Specifically, the first filtering result is filtered using the second filtering strategy to obtain the second filtering result S203 corresponding to the PWM pulse signal, as Figure 4 shown, including:
[0085] Step S401, obtaining the signal acquisition interval and voltage jump time of the PWM pulse signal included in the second filtering strategy;
[0086] Step S402, determining the frequency value corresponding to the PWM pulse signal in the first filtering result using the signal acquisition interval and voltage jump time;
[0087] Step S403, obtaining the safe frequency range included in the second filtering strategy, and filtering the first filtering result according to the numerical relationship between the frequency value and the safe frequency range to obtain the second filtering result.
[0088] After filtering the duty cycle of the received PWM pulse signal, the frequency of the PWM pulse signal is judged. The frequency value corresponding to the PWM pulse signal is determined by obtaining the signal acquisition interval and voltage jump time of the PWM pulse signal included in the second filtering strategy, and then the frequency value is judged against the safe frequency range. If the frequency value is not within the safe frequency range, it is directly discarded without processing; if the frequency or duty cycle of the current PWM pulse signal changes, a time limit judgment is made. If the current PWM pulse signal has not reached the upload time, it is also discarded without processing. If the current PWM pulse signal reaches the time limit moment, the parameters of the current PWM signal are refreshed for processing.
[0089] In one embodiment, step S402 of determining the frequency value corresponding to the PWM pulse signal in the first filtering result using the signal acquisition interval and voltage jump time, as Figure 5 shown, including:
[0090] Step S501, obtaining the voltage jump time corresponding to the PWM pulse signal in the first filtering result within the signal acquisition interval;
[0091] Step S502, determining the first jump time, second jump time, and third jump time included in the voltage jump time; where the first jump time and the third jump time correspond to the high level of the PWM pulse signal, and the second jump time corresponds to the low level of the PWM pulse signal;
[0092] Step S503: Determine the frequency value corresponding to the PWM pulse signal based on the first transition moment, the second transition moment, and the third transition moment.
[0093] Specifically, the signal acquisition interval is 5 seconds. It is possible to detect whether there is a voltage transition in the voltage corresponding to the PWM pulse signal within 5 seconds. If there is a first transition and the voltage state after the transition is high level, record the time value of the transition moment as the first transition moment; if there is a second transition and the voltage state after the transition is low level, record the transition moment as the second transition moment; if there is a third transition and the voltage state after the transition is high level, record the time value of the transition moment as the third transition moment. After obtaining the first transition moment, the second transition moment, and the third transition moment, the frequency value corresponding to the PWM pulse signal can be determined. At this time, the duty cycle = ((t2 - t1) / (t3 - t1)) * 100%.
[0094] In one implementation, the time jitter elimination step S103, as Figure 6 shown, includes:
[0095] Step S601: Obtain the time parameter corresponding to the first pulse signal, and determine the jump count threshold of the first pulse signal according to the duration corresponding to the time parameter;
[0096] Step S602: Determine the time jitter elimination strategy corresponding to the first pulse signal using the jump count threshold, and obtain the invalid signals in the first pulse signal using the time jitter elimination strategy;
[0097] Step S603: Control the first pulse signal to discard the invalid signals, and then update the first pulse signal to obtain the second pulse signal.
[0098] The time jitter elimination strategy is mainly determined based on the time parameter. By obtaining the time parameter corresponding to the first pulse signal and determining the jump count threshold of the first pulse signal according to the duration corresponding to the time parameter; then using the jump count threshold to determine the time jitter elimination strategy corresponding to the first pulse signal, and obtaining the invalid signals in the first pulse signal using the time jitter elimination strategy, and discarding the invalid signals to update the first pulse signal to obtain the second pulse signal.
[0099] In one implementation, step S602 of determining the time jitter elimination strategy corresponding to the first pulse signal using the jump count threshold and obtaining the invalid signals in the first pulse signal using the time jitter elimination strategy, as Figure 7 shown, includes:
[0100] Step S701: Initialize the timer using the duration corresponding to the time parameter; where the timing duration of the timer is the duration corresponding to the time parameter;
[0101] Step S702: Obtain the number of voltage jumps of the first pulse signal within the timing duration of the timer, and determine the time debounce strategy based on the numerical relationship between the number of voltage jumps and the jump count threshold;
[0102] Step S703: Determine the first pulse signal with the number of voltage jumps less than the jump count threshold as an invalid signal using the time debounce strategy.
[0103] Initialize the timer with the duration corresponding to the time parameter and set the timer to 5 seconds; then obtain the number of voltage jumps of the first pulse signal within the timing duration of the timer, for example, 3 times, and subsequently determine the time debounce strategy based on the numerical relationship between the number of voltage jumps and the jump count threshold. Specifically, the time debounce strategy can be: if the number of voltage jumps detected within 5 seconds is less than 3 times, it is determined as an invalid signal and the detection data for this time is discarded. If the number of jumps detected within 5 seconds is greater than 3 times, it is determined as a valid signal and the detection data for this time is processed.
[0104] As Figure 8 shown in the flowchart of another signal filtering step S102, first filter the duty cycle of the received PWM pulse signal, and then judge the frequency of the obtained PWM pulse signal; if the current frequency is not within the valid range, it is directly discarded without processing; if the frequency or duty cycle of the currently received PWM signal changes, a time limit judgment is performed. If the current PWM signal has not reached the upload time, it is also discarded without processing. If the current PWM signal reaches the time limit moment, the parameters of the current PWM signal are refreshed and processed.
[0105] As Figure 9 shown in the flowchart of another time debounce step S103, specifically, the time debounce step first analyzes the PWM pulse signal to be received, analyzes the frequency and duty cycle of the PWM pulse signal to be processed, then calculates the frequency and duty cycle of the continuously obtained PWM pulse signals within the time limit, and finally calculates the average value as the new PWM signal parameter. After the time limit is reached, the newly obtained PWM signal parameter is compared with the previous PWM signal parameter. If there is a change, it is updated and the parameters are reset for a new calculation.
[0106] It can be seen from the pulse signal processing method in the above embodiments that this method designs a signal filtering strategy using the duty cycle parameter and frequency parameter of the PWM pulse signal, thereby filtering out invalid PWM pulse signals and reducing the data volume of the pulse signals; in addition, this method determines the time debounce strategy using the time parameter, thereby performing time limit processing on the PWM pulse signal using the time debounce strategy, reducing the refresh times of the PWM pulse signals, and further reducing the load pressure of the pulse signals, and solving the problem of poor measurement and processing effect of PWM pulse signals in the prior art.
[0107] For the pulse signal processing method provided in the foregoing embodiments, an embodiment of the present invention provides a pulse signal processing system, as Figure 10 shown. The system includes:
[0108] A signal acquisition module 1010, configured to acquire a PWM pulse signal to be processed;
[0109] A signal filtering module 1020, configured to determine a signal filtering strategy for the PWM pulse signal based on the duty cycle parameter and the frequency parameter of the PWM pulse signal, and after filtering the PWM pulse signal by using the signal filtering strategy, obtain a first pulse signal corresponding to the PWM pulse signal;
[0110] A time jitter elimination module 1030, configured to determine a time jitter elimination strategy for the first pulse signal according to the time parameter of the first pulse signal, and after updating the first pulse signal according to the time parameter by using the time jitter elimination strategy, obtain a second pulse signal corresponding to the first pulse signal;
[0111] A signal processing module 1040, configured to determine a processing strategy for the second pulse signal by using the attribute parameter of the PWM pulse signal, and process the second pulse signal by using the processing strategy.
[0112] As can be seen from the pulse signal processing system mentioned in the above embodiments, the system designs a signal filtering strategy by using the duty cycle parameter and the frequency parameter of the PWM pulse signal, so as to filter out invalid PWM pulse signals, reducing the data volume of the pulse signal; in addition, the system determines a time jitter elimination strategy by using the time parameter, so as to perform time-limited processing on the PWM pulse signal by using the time jitter elimination strategy, reducing the refresh times of the PWM pulse signal, thereby further reducing the load pressure of the pulse signal, and solving the problem of poor measurement and processing effect of PWM pulse signals in the prior art.
[0113] The implementation principle and the technical effects generated by the pulse signal processing system provided by the embodiment of the present invention are the same as those of the foregoing embodiment of the pulse signal processing method. For a brief description, for the parts not mentioned in this device embodiment, reference may be made to the corresponding content in the foregoing embodiment of the pulse signal processing method.
[0114] This embodiment also provides an electronic device. The structural schematic diagram of the electronic device is as Figure 11 shown. The device includes a processor 101 and a memory 102; wherein, the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the steps of the above pulse signal processing method.
[0115] Figure 11The electronic device shown also includes a bus 103 and a communication interface 104, and the processor 101, the communication interface 104, and the memory 102 are connected through the bus 103.
[0116] Among them, the memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The bus 103 may be an ISA bus, a PCI bus, an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 11 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0117] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 packet or IPv4 packet to the user terminal through the network interface.
[0118] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method can be completed by the integrated logic circuit in the hardware of the processor 101 or instructions in software form. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field programmable gate array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and combines its hardware to complete the steps of the method in the foregoing embodiments.
[0119] An embodiment of the present invention also provides a storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the pulse signal processing method in the foregoing embodiment.
[0120] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some communication interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0121] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, in each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0123] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0124] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims described.
Claims
1. A pulse signal processing method, characterized in that, The method includes: A signal acquisition step: acquiring a PWM pulse signal to be processed; A signal filtering step: determining a signal filtering strategy for the PWM pulse signal based on the duty cycle parameter and the frequency parameter of the PWM pulse signal, and after filtering the PWM pulse signal using the signal filtering strategy, obtaining a first pulse signal corresponding to the PWM pulse signal; A time jitter elimination step: determining a time jitter elimination strategy for the first pulse signal according to the time parameter of the first pulse signal, and after updating the first pulse signal according to the time parameter using the time jitter elimination strategy, obtaining a second pulse signal corresponding to the first pulse signal; A signal processing step: determining a processing strategy for the second pulse signal using the attribute parameter of the PWM pulse signal, and processing the second pulse signal using the processing strategy.
2. The pulse signal processing method according to claim 1, characterized in that, The signal filtering step includes: Determining a first filtering strategy included in the signal filtering strategy using the duty cycle parameter of the PWM pulse signal, and determining a second filtering strategy included in the signal filtering strategy using the frequency parameter of the PWM pulse signal; Filtering the PWM pulse signal using the first filtering strategy to obtain a first filtering result corresponding to the PWM pulse signal; Filtering the first filtering result using the second filtering strategy to obtain a second filtering result corresponding to the PWM pulse signal; Generating the first pulse signal based on the second filtering result.
3. The pulse signal processing method according to claim 2, wherein, Filtering the PWM pulse signal using the first filtering strategy to obtain a first filtering result corresponding to the PWM pulse signal, including: Obtaining the pulse duration and the pulse period duration of the PWM pulse signal included in the first filtering strategy; Obtaining the standard duty cycle of the PWM pulse signal using the pulse duration and the pulse period duration; Filtering the PWM pulse signal according to the numerical relationship between the duty cycle parameter and the standard duty cycle to obtain the first filtering result.
4. The pulse signal processing method according to claim 3, wherein After filtering the PWM pulse signal using the first filtering strategy to obtain a first filtering result corresponding to the PWM pulse signal, the method further includes: Backing up the first filtering result based on the duty cycle parameter.
5. The pulse signal processing method according to claim 2, wherein Filtering the first filtering result using the second filtering strategy to obtain a second filtering result corresponding to the PWM pulse signal, including: Obtaining the signal acquisition interval and the voltage jump moment of the PWM pulse signal included in the second filtering strategy; Determining the frequency value corresponding to the PWM pulse signal in the first filtering result using the signal acquisition interval and the voltage jump moment; Obtaining a safe frequency range included in the second filtering strategy, and filtering the first filtering result according to the numerical relationship between the frequency value and the safe frequency range to obtain the second filtering result.
6. The pulse signal processing method according to claim 5, wherein Determining the frequency value corresponding to the PWM pulse signal in the first filtering result by using the signal acquisition interval and the voltage jump moment includes: Obtaining the voltage jump moment corresponding to the PWM pulse signal in the first filtering result within the signal acquisition interval; Determining a first jump moment, a second jump moment, and a third jump moment included in the voltage jump moment; wherein the first jump moment and the third jump moment correspond to the high level of the PWM pulse signal, and the second jump moment corresponds to the low level of the PWM pulse signal; Determining the frequency value corresponding to the PWM pulse signal based on the first jump moment, the second jump moment, and the third jump moment.
7. The pulse signal processing method according to claim 1, wherein The time jitter elimination step includes: Obtaining the time parameter corresponding to the first pulse signal, and determining the jump count threshold of the first pulse signal according to the duration corresponding to the time parameter; Determining the time jitter elimination strategy corresponding to the first pulse signal by using the jump count threshold, and obtaining the invalid signals in the first pulse signal by using the time jitter elimination strategy; Controlling the first pulse signal to discard the invalid signals, and then updating the first pulse signal to obtain the second pulse signal.
8. The pulse signal processing method according to claim 7, wherein Determining the time jitter elimination strategy corresponding to the first pulse signal by using the jump count threshold, and obtaining the invalid signals in the first pulse signal by using the time jitter elimination strategy, including: Initializing a timer by using the duration corresponding to the time parameter; wherein the timing duration of the timer is the duration corresponding to the time parameter; Obtaining the number of voltage jumps of the first pulse signal within the timing duration of the timer, and determining the time jitter elimination strategy by using the numerical relationship between the number of voltage jumps and the jump count threshold; Determining the first pulse signals with the number of voltage jumps less than the jump count threshold as the invalid signals by using the time jitter elimination strategy.
9. A pulse signal processing system, characterized in that, The system includes: A signal acquisition module, configured to acquire a PWM pulse signal to be processed; A signal filtering module, configured to determine a signal filtering strategy for the PWM pulse signal based on the duty cycle parameter and the frequency parameter of the PWM pulse signal, and filter the PWM pulse signal by using the signal filtering strategy to obtain a first pulse signal corresponding to the PWM pulse signal; A time jitter elimination module, configured to determine a time jitter elimination strategy for the first pulse signal according to the time parameter of the first pulse signal, and update the first pulse signal according to the time parameter by using the time jitter elimination strategy to obtain a second pulse signal corresponding to the first pulse signal; A signal processing module, configured to determine a processing strategy for the second pulse signal by using the attribute parameter of the PWM pulse signal, and process the second pulse signal by using the processing strategy.
10. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores computer-executable instructions that can be executed by the processor. The processor executes the computer-executable instructions to implement the steps of the pulse signal processing method according to any one of claims 1 to 8.