Torque sensor signal filtering method, device, equipment, medium and product
By combining the moving average and median filtering methods, the insertion sorting mechanism is used to optimize the calculation efficiency, and the noise impact and calculation complexity problems in the signal processing of torque sensors are solved, real-time and accuracy of signal processing are achieved.
Patent Information
- Application Number
- CN202510565732.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-04-30
AI Technical Summary
In the powertrain test system of new energy vehicles, the signal data collected by the torque sensor contains noise, which affects the accuracy and consistency of the test. The traditional moving median filtering method has high calculation complexity, while the moving average filtering method is prone to introduce a hysteresis effect when processing mutation signals.
Combining the moving average filtering method and the median filtering method, the initial queue is generated by obtaining the window size, and the calculation efficiency is optimized by using the insertion sorting mechanism, and the filtering process is performed after inserting new data.
It improves the real-time and accuracy of torque signal processing, while reducing the computational complexity, ensuring the efficiency and accuracy of signal processing.
Smart Images

Figure CN120489406A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of new energy vehicle powertrain control technology, and in particular to a torque sensor signal filtering method, device, equipment, medium and product. Background Art
[0002] In new energy vehicle powertrain test systems, the signal data collected by torque sensors often contains noise, affecting the accuracy and consistency of the test samples. While traditional moving median filtering effectively removes noise, it requires reordering the data within the window for each calculation, increasing computational complexity and rendering it inefficient, especially in scenarios requiring high real-time performance. While moving average filtering is computationally simple, it can easily introduce lag effects when processing sudden changes in signals. Therefore, combining the advantages of these two filtering methods while optimizing computational efficiency has become a pressing issue. Summary of the Invention
[0003] Embodiments of the present invention provide a torque sensor signal filtering method, apparatus, device, medium, and product to improve the real-time performance and accuracy of torque signal processing while reducing computational complexity.
[0004] According to one aspect of the present invention, a method for filtering a torque sensor signal is provided, comprising:
[0005] Acquire a signal data set of a torque sensor;
[0006] Obtaining a window size, and generating an initial queue according to the signal data set based on the window size;
[0007] If there is new data, insert the new data into the initial queue to obtain the target queue;
[0008] The signal of the torque sensor is filtered based on the target queue.
[0009] According to another aspect of the present invention, a torque sensor signal filtering device is provided, the device comprising:
[0010] An acquisition module, used to acquire a signal data set of a torque sensor;
[0011] a generating module, configured to obtain a window size, and generate an initial queue according to the signal data set based on the window size;
[0012] An inserting module, configured to insert the newly added data into the initial queue if there is any, to obtain a target queue;
[0013] A filtering module is used to filter the signal of the torque sensor based on the target queue.
[0014] According to another aspect of the present invention, an electronic device is provided, comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the torque sensor signal filtering method according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the torque sensor signal filtering method according to any embodiment of the present invention when executed.
[0019] According to another aspect of the present invention, an embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the torque sensor signal filtering method described in any embodiment of the present invention.
[0020] This embodiment of the present invention first obtains a signal data set from a torque sensor, then determines a window size. Based on the window size, an initial queue is generated from the signal data set. If new data exists, the new data is inserted into the initial queue to obtain a target queue. Finally, the torque sensor signal is filtered based on the target queue. By combining the advantages of moving average filtering and median filtering, and employing an insertion sort mechanism to optimize computational efficiency, the present invention improves the real-time performance and accuracy of torque signal processing while reducing computational complexity.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1is a flow chart of a torque sensor signal filtering method according to an embodiment of the present invention;
[0024] Figure 2 is a flow chart of an exemplary method for filtering a torque sensor signal in an embodiment of the present invention;
[0025] Figure 3 1 is a schematic structural diagram of a torque sensor signal filtering device according to an embodiment of the present invention;
[0026] Figure 4 3 is a schematic structural diagram of an electronic device for implementing the torque sensor signal filtering method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and their inclusion are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0030] Example 1
[0031] Figure 1 This is a flow chart of a method for filtering a torque sensor signal in an embodiment of the present invention. This embodiment is applicable to the case of filtering a torque sensor signal of a powertrain. This method can be executed by a torque sensor signal filtering device in an embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1As shown, the method specifically includes the following steps:
[0032] S101 : Acquire a signal data set of a torque sensor.
[0033] A torque sensor is a sensor used to measure torque (i.e., rotational moment) on a rotating shaft or drivetrain. It is widely used in various industrial and automotive fields to monitor and control the torque output of mechanical systems. Signal filtering in torque sensors is a critical step in ensuring the accuracy and reliability of measurement data.
[0034] The torque sensor signal filtering method of the present invention can be applied to new energy vehicle powertrain testing scenarios. In this embodiment, the torque sensor is primarily a torque sensor in a new energy vehicle powertrain testing system. It should be noted that the signal data set can be a set of signal data collected by the torque sensor.
[0035] Specifically, in the new energy vehicle powertrain test system, the original signal of the torque sensor on the new energy vehicle powertrain test bench is obtained in real time, and the signal data set is composed of the original signal.
[0036] S102: Acquire a window size, and generate an initial queue according to a signal data set based on the window size.
[0037] In this embodiment, a fixed-size sliding window can be initialized for signal filtering of the torque sensor. This embodiment does not limit the specific window size, and the user can set the window size based on actual conditions or experience.
[0038] It should be noted that the initial queue may be a sorted queue formed by arranging the signal data within the window according to a certain sorting rule. For example, the sorting rule may be ascending order based on the numerical value of the signal data, or descending order based on the numerical value of the signal data. In actual operation, the queue may essentially be a circular queue.
[0039] Specifically, a sliding window of a fixed size is initialized, and the signal data in the signal data set are arranged according to a certain sorting rule to generate an initial queue.
[0040] S103: If there is new data, insert the new data into the initial queue to obtain the target queue.
[0041] The newly added data may be new signal data collected by the torque sensor.
[0042] In this embodiment, the target queue may be a queue in an ordered state obtained after the newly added data is inserted into the initial queue according to the sorting rule.
[0043] Specifically, each time the torque sensor collects new torque signal data, it inserts it into the circular queue to ensure that the queue is always in an orderly state.
[0044] S104: Filter the signal of the torque sensor based on the target queue.
[0045] Specifically, a moving average is calculated based on the updated queue to generate a final filtering result.
[0046] This embodiment of the present invention first obtains a signal data set from a torque sensor, then determines a window size. Based on the window size, an initial queue is generated from the signal data set. If new data exists, the new data is inserted into the initial queue to obtain a target queue. Finally, the torque sensor signal is filtered based on the target queue. By combining the advantages of moving average filtering and median filtering, and employing an insertion sort mechanism to optimize computational efficiency, the present invention improves the real-time performance and accuracy of torque signal processing while reducing computational complexity.
[0047] Optionally, obtaining a window size and generating an initial queue based on the signal data set based on the window size includes:
[0048] The window size is obtained, and the signal data in the signal data set is divided based on the window size to obtain a subset of the signal data within the window.
[0049] The signal data subset may refer to a set of signal data included in the window.
[0050] Specifically, the signal data in the signal data set can be divided according to the window size to obtain a subset of the signal data contained within the window. For example, if the window size is 5, meaning that a sliding window can accommodate 5 signal data points, then 5 signal data points are selected from the signal data set and placed in the window. In actual operation, the order in which the signal data are selected can be, for example, based on the chronological order in which the signal data were acquired by the torque sensor. For example, the signal data subset can be represented as {X1, X2, X3, X4, X5}.
[0051] The signal data in the signal data subset within the window are arranged in ascending order according to the magnitude of the values to obtain a sorted signal data subset.
[0052] For example, the sorting rule in this embodiment is ascending order, that is, the signal data in the signal data subset within the window are sorted in ascending order of the signal data values. For example, the sorted signal data subset can be represented as {X3, X2, X5, X1, X4}.
[0053] Generate an initial queue based on the sorted subset of signal data.
[0054] Specifically, the signal data is arranged in ascending order to form a sorted queue.
[0055] The technical solution of the embodiment of the present invention uses a circular queue as the data storage structure of the sliding window, avoiding frequent memory allocation and release, and significantly reducing memory overhead and management complexity.
[0056] Optionally, generate an initial queue based on the sorted subset of signal data, including:
[0057] The marking time corresponding to each signal data is determined according to the sorting position of each signal data in the sorted signal data subset.
[0058] It should be noted that the sorting position may be the order of the signal data in the window. For example, if a signal data X5 is ranked third in the window from smallest to largest, the sorting position of the signal data X5 is 3.
[0059] In this embodiment, the marking time may be the time for marking each signal data entering the circular queue.
[0060] Specifically, each signal data can be time-stamped according to its sorting position in the initial queue, marking the order in which each signal data is added to the queue. Exemplarily, the sorting position of each signal data in the sorted signal data subset can be marked as the marking time sequence corresponding to each signal data, that is, the marking time is initialized. For example, the marking time of the signal data with a sorting position of 1 in the initial queue can be assigned to T1, and the marking time of the signal data with a sorting position of 2 in the initial queue can be assigned to T2, and so on. Among them, the time of T1 is earlier than T2, which means that the time when the signal data with a sorting position of 1 in the initial queue is added to the initial queue is earlier than the signal data with a sorting position of 2 in the initial queue.
[0061] A data pair corresponding to each signal data is generated according to each signal data and the marking time corresponding to each signal data.
[0062] In this embodiment, the data pair may be a two-dimensional data pair consisting of signal data and marking time.
[0063] Specifically, each signal data and the marking time corresponding to each signal data are formed into a data pair. Exemplarily, the data pair can be expressed in the form of (signal data, marking time).
[0064] An initial queue is generated according to the data pairs corresponding to each signal data.
[0065] Specifically, each data pair forms the final initial queue. For example, the initial queue can be represented as {(X3, T1), (X2, T2), (X5, T3), (X1, T4), (X4, T5)}, where T1 is earlier than T2, T2 is earlier than T3, and so on.
[0066] The technical solution of the embodiment of the present invention uses two-dimensional data pairs consisting of signal data and marking time for representation, so that the order in which the signal data are added to the queue can still be known after the signal data are sorted.
[0067] Optionally, if there is new data, the new data is inserted into the initial queue to obtain the target queue, including:
[0068] If there is new data, the data pair with the largest marking time in the initial queue will be deleted.
[0069] Specifically, each time the torque sensor acquires new torque signal data, it searches the circular queue for the data pair with the largest marking time and deletes it. For example, if T5 is the largest marking time in the initial queue {(X3, T1), (X2, T2), (X5, T3), (X1, T4), (X4, T5)}, then the data pair (X4, T5) can be deleted.
[0070] In ascending order, the newly added data is compared with each signal data in the initial queue to determine the data pair corresponding to the first signal data in the initial queue that is larger than the newly added data.
[0071] Specifically, the newly added data is compared with each signal data in the initial queue in ascending order according to the ascending rule, until the first signal data in the initial queue that is larger than the newly added data is found, and then the data pair corresponding to the first signal data in the initial queue that is larger than the newly added data is determined. For example, if the newly added data is X6, then X6 is compared in the order of X3, X2, X5, and X1. Assuming that X3 is smaller than X6, X2 is smaller than X6, and X5 is larger than X6, then X5 is the first signal data in the initial queue that is larger than the newly added data, and (X5, T3) is the data pair corresponding to the first signal data in the initial queue that is larger than the newly added data.
[0072] The sorting position of each data pair corresponding to each signal data greater than the newly added data in the initial queue is moved backward by one position in the initial queue.
[0073] For example, the sorting positions of (X5, T3) and (X1, T4) in the initial queue can be moved back one position, and then the initial queue can be expressed as {(X3, T1), (X2, T2), empty, (X5, T3), (X1, T4)}.
[0074] Insert the newly added data before the data pair corresponding to the first signal data that is larger than the newly added data in the initial queue to obtain the target queue.
[0075] Exemplarily, the newly added data is inserted into an empty position in the initial queue to generate a target queue.
[0076] The technical solution of the embodiment of the present invention implements an insertion sort mechanism based on a circular queue, dynamically maintaining the order of data in the circular queue, ensuring that the data in the queue is always in order and that the median value can be quickly extracted. Because the queue is already in order, there is no need to reorder the data when inserting new data, avoiding reordering for each calculation and improving computational efficiency.
[0077] Optionally, the newly added data is inserted before the first data pair corresponding to the signal data that is larger than the newly added data in the initial queue to obtain the target queue, including:
[0078] Assign the target time to the marking time of the new data, and generate new data pairs based on the new data and the target time.
[0079] In this embodiment, the target time may be T0, which is used to indicate the time when new data is added to the queue.
[0080] Specifically, the marking time of the newly added data can be recorded as T0, and a newly added data pair can be generated with the newly added data. Exemplarily, the newly added data pair can be expressed as (X6, T0).
[0081] Insert the newly added data pair before the data pair corresponding to the first signal data that is larger than the newly added data in the initial queue.
[0082] Specifically, the newly added data pair is inserted into the empty position in the initial queue. For example, the queue at this time can be expressed as {(X3, T1), (X2, T2), (X6, T0), (X5, T3), (X1, T4)}.
[0083] The marking time of all data pairs in the target queue except the newly added data is increased by one to obtain the target queue.
[0084] Exemplarily, the target queue may be represented as {(X3, T2), (X2, T3), (X6, T0), (X5, T4), (X1, T5)}.
[0085] The technical solution of the embodiment of the present invention can maintain the orderliness of the circular queue and ensure the rapid extraction of the median by adopting the insertion sort mechanism.
[0086] Optionally, the torque sensor signal is filtered based on the target queue, including:
[0087] A set of data pairs at intermediate target number of data pairs in the target queue is determined based on the window size.
[0088] The target quantity may be a value preset by the user based on actual conditions or experience, and this embodiment does not limit this.
[0089] It should be noted that the data pair set may be a set consisting of a target number of intermediate data pairs in the target queue.
[0090] For example, when the window size is an odd number, the target number can also be set to an odd number; when the window size is an even number, the target number can also be set to an even number, so as to facilitate determination of the data pair closest to the middle position.
[0091] A moving average is calculated on the data pair set to implement filtering processing on the torque sensor signal.
[0092] Specifically, the average value of the signal data of the intermediate target number data pairs in the current target queue is calculated, and the advantages of the moving average and median filtering are combined to generate the final filtering result.
[0093] The technical solution of the embodiment of the present invention combines the smoothing property of the moving average and the anti-noise property of the median filter, taking into account both signal smoothness and transient response capability.
[0094] Figure 2 FIG. 1 is a flow chart of an exemplary method for filtering torque sensor signals in an embodiment of the present invention. Figure 2 As shown in the figure, the process of the torque sensor signal filtering method can be described as:
[0095] Step a: Generate an initial queue of N two-dimensional data pairs (signal data, marking time).
[0096] Specifically, in a new energy vehicle powertrain test system, real-time signal data from a torque sensor on a new energy vehicle powertrain test bench is acquired. A fixed-size sliding window is initialized, where the window size can be represented by N. The signal data is divided according to the window size, and then the signal data within the window is sorted in ascending order. Each signal data is time-stamped according to its sorting position in the initial queue, marking the time when each signal data was added to the queue. Each signal data and the corresponding marking time are combined to form a two-dimensional data pair (signal data, marking time) to generate the initial queue.
[0097] Step b: Is new data collected? If yes, proceed to step c; if no, return to step b.
[0098] Specifically, determine whether the torque sensor has collected new torque signal data (i.e., newly added data). If newly added data has been collected, execute step c to find the data pair with the largest marking time in the initial queue and delete it; if not, return to step b to determine whether the torque sensor has collected newly added data.
[0099] Step c: Find the data pair with the largest marking time in the initial queue and delete it.
[0100] Specifically, each time the torque sensor collects new torque signal data, it searches for the data pair with the largest marking time in the initial queue and deletes it.
[0101] Step d: Find the sorting position of the newly added data in the queue according to the ascending rule.
[0102] Specifically, the newly added data is compared with each signal data in the initial queue in ascending order, until the first signal data in the initial queue that is larger than the newly added data is found. The data pair corresponding to the first signal data in the initial queue that is larger than the newly added data is then determined. At this point, the newly added data is sorted in the queue before the data pair corresponding to the first signal data in the initial queue that is larger than the newly added data.
[0103] Step e: Move all data pairs larger than the newly added data backward by one position.
[0104] Specifically, the data pair corresponding to each signal data larger than the newly added data in the initial queue is shifted back one position in the initial queue, and the newly added data is inserted before the first data pair corresponding to the signal data larger than the newly added data in the initial queue.
[0105] Step f: record the marking time of the newly inserted data as T0, and add 1 to the marking time of the remaining data pairs to obtain the target queue.
[0106] Specifically, the marking time of the newly added data can be recorded as T0, and the marking time of the remaining data pairs can be increased by 1 to obtain the target queue.
[0107] Step g: Take the average value of the W signal data in the middle of the target queue and output it.
[0108] Where W is the target number. Specifically, the moving average of the middle W signal data in the target queue can be calculated to output the final filtering result.
[0109] The technical solution of the embodiment of the present invention provides an improved filtering algorithm for powertrain torque sensor signal processing. By combining the advantages of moving average filtering and median filtering and adopting an insertion sort mechanism to optimize computational efficiency, it can improve the real-time performance and accuracy of torque signal processing while reducing computational complexity.
[0110] Example 2
[0111] Figure 3 : This is a schematic diagram of the structure of a torque sensor signal filtering device in an embodiment of the present invention. This embodiment is applicable to the case of powertrain torque sensor signal filtering. The device can be implemented in software and / or hardware. The device can be integrated into any device that provides torque sensor signal filtering function, such as Figure 3 As shown, the torque sensor signal filtering device specifically includes: an acquisition module 201 , a generation module 202 , an insertion module 203 and a filtering module 204 .
[0112] Wherein, the acquisition module 201 is used to acquire a signal data set of a torque sensor;
[0113] A generating module 202 is configured to obtain a window size and generate an initial queue according to the signal data set based on the window size;
[0114] Insertion module 203, configured to insert the newly added data into the initial queue if there is any, to obtain a target queue;
[0115] The filtering module 204 is configured to filter the signal of the torque sensor based on the target queue.
[0116] Optionally, the generating module 202 includes:
[0117] a partitioning unit, configured to obtain a window size, and partition the signal data in the signal data set based on the window size to obtain a subset of the signal data within the window;
[0118] an arranging unit, configured to arrange the signal data in the signal data subset within the window in ascending order according to numerical values to obtain a sorted signal data subset;
[0119] The generating unit is used to generate an initial queue according to the sorted signal data subset.
[0120] Optionally, the generating unit is specifically configured to:
[0121] determining a marking time corresponding to each signal data according to a sorting position of each signal data in the sorted signal data subset;
[0122] generating a data pair corresponding to each signal data according to each signal data and a marking time corresponding to each signal data;
[0123] An initial queue is generated according to the data pairs corresponding to each of the signal data.
[0124] Optionally, the insertion module 203 includes:
[0125] a deleting unit, configured to delete the data pair with the largest marking time in the initial queue if there is new data;
[0126] a comparing unit, configured to compare the newly added data with each of the signal data in the initial queue in ascending order, and determine a data pair corresponding to the first signal data in the initial queue that is greater than the newly added data;
[0127] A backward shifting unit, configured to shift the sorting position of each data pair corresponding to the signal data greater than the newly added data in the initial queue backward by one position in the initial queue;
[0128] The inserting unit is used to insert the newly added data before the first data pair corresponding to the signal data that is larger than the newly added data in the initial queue to obtain a target queue.
[0129] Optionally, the insertion unit is specifically used to:
[0130] Assigning a target time to the marking time of the newly added data, and generating a newly added data pair according to the newly added data and the target time;
[0131] Inserting the newly added data pair before the first data pair corresponding to the signal data larger than the newly added data in the initial queue;
[0132] The marking time of all data pairs except the newly added data in the target queue is increased by one to obtain the target queue.
[0133] Optionally, the filtering module 204 is specifically configured to:
[0134] Determine, based on the window size, a set of data pairs at intermediate target number of data pairs in the target queue;
[0135] A moving average is calculated on the data pair set to implement filtering processing on the signal of the torque sensor.
[0136] The above-mentioned product can execute the torque sensor signal filtering method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0137] Example 3
[0138] Figure 4 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0139] like Figure 4 As shown, the electronic device 30 includes at least one processor 31 and a memory, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., which is communicatively connected to the at least one processor 31. The memory stores a computer program that can be executed by the at least one processor. The processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 into the random access memory (RAM) 33. Various programs and data required for the operation of the electronic device 30 can also be stored in the RAM 33. The processor 31, ROM 32, and RAM 33 are connected to each other via a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.
[0140] Multiple components in the electronic device 30 are connected to the I / O interface 35, including an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a magnetic disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0141] The processor 31 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 31 executes the various methods and processes described above, such as the torque sensor signal filtering method:
[0142] Acquire a data pair set corresponding to the torque sensor, the data pair including signal data and a marking time corresponding to the signal data;
[0143] Obtaining a window size, and generating an initial queue according to the data pair set based on the window size;
[0144] If there is a new data pair, insert the new data pair into the initial queue to obtain a target queue;
[0145] The signal of the torque sensor is filtered based on the target queue.
[0146] In some embodiments, the torque sensor signal filtering method can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 38. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 30 via ROM 32 and / or communication unit 39. When the computer program is loaded into RAM 33 and executed by processor 31, one or more steps of the torque sensor signal filtering method described above can be performed. Alternatively, in other embodiments, processor 31 can be configured to execute the torque sensor signal filtering method in any other suitable manner (e.g., via firmware).
[0147] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system comprising at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0148] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0149] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0150] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0151] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0152] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0153] In one embodiment, the present invention further includes a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the torque sensor signal filtering method of any embodiment of the present invention.
[0154] The computer program product may be implemented by writing computer program code for performing the operations of the present invention in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0155] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0156] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for filtering torque sensor signals, characterized in that: include: Acquire a signal data set of a torque sensor; Obtaining a window size, and generating an initial queue according to the signal data set based on the window size; If there is new data, insert the new data into the initial queue to obtain the target queue; The signal of the torque sensor is filtered based on the target queue.
2. The method according to claim 1, characterized in that Obtaining a window size, and generating an initial queue according to the signal data set based on the window size, comprising: Obtaining a window size, and dividing the signal data in the signal data set based on the window size to obtain a subset of signal data within the window; Arrange the signal data in the signal data subset within the window in ascending order according to the magnitude of the values to obtain a sorted signal data subset; Generate an initial queue based on the sorted subset of signal data.
3. The method according to claim 2, characterized in that Generate an initial queue based on the sorted subset of signal data, including: determining a marking time corresponding to each signal data according to a sorting position of each signal data in the sorted signal data subset; generating a data pair corresponding to each signal data according to each signal data and a marking time corresponding to each signal data; An initial queue is generated according to the data pairs corresponding to each of the signal data.
4. The method according to claim 3, characterized in that If there is new data, the new data is inserted into the initial queue to obtain the target queue, including: If there is new data, the data pair with the largest marking time in the initial queue is deleted; Comparing the newly added data with each of the signal data in the initial queue in ascending order, and determining a data pair corresponding to the first signal data in the initial queue that is greater than the newly added data; Shifting the sorting position of each data pair corresponding to each signal data greater than the newly added data in the initial queue backward by one position; The newly added data is inserted before the first data pair corresponding to the signal data that is larger than the newly added data in the initial queue to obtain a target queue.
5. The method according to claim 4, characterized in that Inserting the newly added data before the first data pair corresponding to the signal data that is larger than the newly added data in the initial queue to obtain a target queue includes: Assigning a target time to the marking time of the newly added data, and generating a newly added data pair according to the newly added data and the target time; Inserting the newly added data pair before the first data pair corresponding to the signal data larger than the newly added data in the initial queue; The marking time of all data pairs except the newly added data in the target queue is increased by one to obtain the target queue.
6. The method according to claim 1, characterized in that Filtering the signal of the torque sensor based on the target queue includes: Determine, based on the window size, a set of data pairs in the target queue that are at intermediate target number of data pairs; A moving average value is calculated on the data pair set to implement filtering processing on the signal of the torque sensor.
7. A torque sensor signal filtering device, characterized in that: include: An acquisition module, used to acquire a signal data set of a torque sensor; a generating module, configured to obtain a window size, and generate an initial queue according to the signal data set based on the window size; An inserting module, configured to insert the newly added data into the initial queue if there is any, to obtain a target queue; A filtering module is used to filter the signal of the torque sensor based on the target queue.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the torque sensor signal filtering method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the torque sensor signal filtering method according to any one of claims 1 to 6 when executed.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the torque sensor signal filtering method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Torque filtering control method for electric automobile
CN103587431A
Motor torque filtering method and motor torque filtering device as well as vehicle
CN109955726A
Tango tree construction method and system based on sliding window
CN111488496A
Well logging torque sensor signal processing method based on improved Kalman filtering
CN117386351A
Method, device, and computer program product for managing memories
US20210279002A1