Data filtering method, device, electronic device and readable storage medium

By dividing the data queue into multiple data segments and constructing an arithmetic sequence, the problem of traditional moving average filtering algorithm occupying large memory in the microcontroller is solved, efficient data filtering processing is achieved, and the performance of the servo position control system is improved.

CN116303137BActive Publication Date: 2024-09-06KINCO ELECTRIC SHENZHEN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310216757.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-09-06
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

In the position servo control system, due to the sudden change of the target position command, the motor oscillates. The traditional moving average filter algorithm requires a large amount of memory for filtering processing, which limits the selection of microcontrollers.

Method used

By dividing the original data queue into multiple data segments, each data segment includes K adjacent data, using the target buffer to store the data sum of the data segments, and constructing an arithmetic sequence based on the historical buffer value and adjacent buffer value to calculate the filter value , update the buffer and reduce memory usage.

Benefits of technology

It effectively reduces the memory occupation of the microcontroller, while maintaining the filtering effect, improving the processing efficiency of the servo position control system, and broadening the selection range of the microcontroller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303137B
    Figure CN116303137B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data filtering method, device, electronic device and readable storage medium, the method comprising: obtaining new position instructions; judging whether the number of the new position instructions is equal to K, wherein K is a pre-designed value; when the number of the new position instructions is less than or equal to K, calculating the filter value of each new position instruction according to the historical buffer value corresponding to the new position instruction in the target buffer, and continuing to obtain new position instructions; when the number of the new position instructions is equal to K, calculating the new buffer value according to the data values ​​of all the new position instructions; updating the corresponding historical buffer value in the target buffer according to the new buffer value. The present invention uses the buffer value to effectively reduce the memory occupation of data while ensuring the filtering effect of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data filtering method, device, electronic equipment and readable storage medium. Background Art

[0002] In the position servo control system, the servo driver receives the target position command from the main controller and controls the motor to rotate the corresponding number of circles. When the target position command sent by the main controller has a sudden change, due to the bandwidth limitation of the servo driver control loop, the actual position of the motor cannot quickly follow the target position command. At this time, the motor is prone to oscillation, resulting in a decrease in the running smoothness and processing accuracy of the servo control system.

[0003] In order to overcome the disadvantages caused by the sudden change of the target position command, the sliding average filter algorithm is often used to filter the target position command. In the traditional sliding average filter algorithm, a large amount of memory is consumed in the microcontroller to realize the filtering of a large number of position commands, which has a great restriction on the selection of the microcontroller.

[0004] Therefore, there is an urgent need for a data filtering solution that can reduce the memory usage of the microcontroller. Summary of the invention

[0005] In order to solve the above technical problems, the embodiments of the present application provide a data filtering method, device, electronic device and readable storage medium. The specific solutions are as follows:

[0006] In a first aspect, an embodiment of the present application provides a data filtering method, the method comprising:

[0007] Get new position command;

[0008] Determine whether the number of the new position instructions is equal to K, where K is a pre-designed value;

[0009] When the number of the new position instructions is less than or equal to K, the filter value of each new position instruction is calculated according to the historical buffer value corresponding to the new position instruction in the target buffer, and the new position instruction is continuously acquired;

[0010] When the number of the new position instructions is greater than K, a new buffer value is calculated according to the data values ​​of all the new position instructions;

[0011] The corresponding historical buffer value in the target buffer is updated according to the new buffer value.

[0012] According to a specific implementation of the embodiment of the present application, before obtaining the new position instruction, the method further includes:

[0013] Apply for target buffer;

[0014] Divide the N data in the original data queue into M data segments in sequence, each data segment includes K adjacent data, and store the data sum of the M data segments in the target buffer in sequence, wherein the data of a single data segment stored in the target buffer occupies the same memory as a single data in the original data queue, and the buffer value is the data sum of the data segments.

[0015] According to a specific implementation of the embodiment of the present application, the filtering value of each new position instruction is calculated according to the historical buffer value corresponding to the new position instruction in the target buffer, including:

[0016] Determine a target reconstructed arithmetic sequence according to the historical buffer value and two adjacent buffer values;

[0017] The filtering value of each new position instruction is calculated according to the first data sum of the target reconstructed arithmetic progression and the second data sum of the new position instruction.

[0018] According to a specific implementation of the embodiment of the present application, the target buffer is a ring buffer.

[0019] According to a specific implementation of the embodiment of the present application, the determining of the target reconstructed arithmetic progression according to the historical buffer value and its two adjacent buffer values ​​includes:

[0020] Determine the step length of the target reconstructed arithmetic progression according to two buffer values ​​adjacent to the historical buffer value;

[0021] According to the principle that the first data sum is equal to the third data sum and the step length, the data values ​​of the target reconstructed arithmetic sequence are determined to obtain the reconstructed arithmetic sequence, wherein the third data sum is the sum of the filtered values ​​of each new position instruction.

[0022] In a second aspect, an embodiment of the present application provides a data filtering device, the device comprising:

[0023] An acquisition module, used to obtain new position instructions;

[0024] A judging module, used to judge whether the number of the new position instructions is equal to K, where K is a pre-designed value;

[0025] A filtering module, for calculating a filtering value of each new position instruction according to a historical buffer value corresponding to the new position instruction in a target buffer when the number of the new position instructions is less than or equal to K, and continuing to obtain new position instructions;

[0026] A storage module, used for calculating a new buffer value according to data values ​​of all new position instructions when the number of the new position instructions is greater than K;

[0027] An updating module is used to update the corresponding historical buffer value in the target buffer according to the new buffer value.

[0028] According to a specific implementation of the embodiment of the present application, the device further includes:

[0029] A buffer application module is used to apply for a target buffer; N data in the original data queue are divided into M data segments in sequence, each data segment includes K adjacent data, and the data sum of the M data segments is stored in the target buffer in sequence, wherein the data of a single data segment stored in the target buffer occupies the same memory as a single data in the original data queue, and the buffer value is the data sum of the data segments.

[0030] According to a specific implementation of an embodiment of the present application, the filtering module is specifically used to determine the target reconstructed arithmetic sequence based on the historical buffer value and its two adjacent buffer values; and calculate the filter value of each new position instruction based on the first data and the second data of the target reconstructed arithmetic sequence and the new position instruction.

[0031] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program runs on the processor, the data filtering method described in the first aspect and any implementation of the first aspect is executed.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is run on a processor, the data filtering method described in the first aspect and any implementation method of the first aspect is executed.

[0033] The embodiment of the present application provides a data filtering method, device, electronic device and readable storage medium, the method comprising: obtaining new position instructions; determining whether the number of the new position instructions is equal to K, wherein K is a pre-designed value; when the number of the new position instructions is less than or equal to K, calculating the filter value of each new position instruction according to the historical buffer value corresponding to the new position instruction in the target buffer, and continuing to obtain new position instructions; when the number of the new position instructions is greater than K, calculating the new buffer value according to the data values ​​of all the new position instructions; and updating the corresponding historical buffer value in the target buffer according to the new buffer value. The present invention uses buffer values ​​to effectively reduce the memory usage of data while ensuring the filtering effect of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to 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 should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.

[0035] Figure 1 A schematic diagram of a method flow of a data filtering method provided by an embodiment of the present application is shown;

[0036] Figure 2 A schematic diagram of an application scenario of a data filtering method provided by an embodiment of the present application is shown;

[0037] Figure 3 A schematic diagram of a device module of a data filtering device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0039] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0040] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.

[0041] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0042] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.

[0043] The existing sliding average filtering algorithm requires a buffer in the microcontroller that can store N position command data, which is used to store the position command X at the previous N moments. 1 To X N , by averaging these N position command data to obtain X N The corresponding filtered data X FN .

[0044] When the latest target position instruction X is obtained j When using X j Overwrite the oldest data in the buffer X j-N , then calculate X j-N+1 To X j , the average of a total of N data, as the sampling value X at time j j The corresponding filtered data X Fj , X Fj The calculation formula can be expressed as:

[0045]

[0046] The actual filtering effect of the sliding average filter algorithm is similar to that of a low-pass filter, and the filter cutoff frequency is inversely proportional to the buffer space size N. In the actual position servo control system, in order to reduce motor vibration and increase the running smoothness and processing accuracy of the servo control system, the value of N is often increased to enhance the filtering effect of the algorithm, but this will bring about the disadvantage of occupying too much microcontroller memory and increasing the cost of microcontroller selection.

[0047] This embodiment provides a data filtering method, which can effectively overcome the disadvantage of occupying a large amount of microcontroller memory and ensure the filtering effect of the data filtering algorithm.

[0048] refer to Figure 1 , is a method flow diagram of a data filtering method provided in an embodiment of the present application. The data filtering method provided in an embodiment of the present application is as follows: Figure 1 As shown, the method includes:

[0049] Step S101, obtaining a new position instruction;

[0050] Specifically, the data filtering method proposed in this embodiment can be used in a position servo control system to implement filtering processing on position instruction data.

[0051] The new position instruction in this embodiment is a position instruction newly received in the position servo control system. Figure 2 As shown, if x is stored in the position servo control system 1 to x 20 The data value of the position instruction, then x 21 It is the new position instruction received by the position servo control system.

[0052] Things to know: Figure 2 x in 1 to x 20 They represent the position commands received by the position servo control system from the 1st moment to the 20th moment. 1 to x 20 The 1st moment is the earliest moment and the 20th moment is the latest moment.

[0053] According to a specific implementation of the embodiment of the present application, before obtaining the new position instruction, the method further includes:

[0054] Apply for target buffer;

[0055] Divide the N data in the original data queue into M data segments in turn, each data segment includes K adjacent data, and store the data sum of the M data segments in turn in the target buffer, wherein the data sum of each data segment is the same as the occupied space of each data, and the buffer value is the data sum of the data segments.

[0056] Specifically, in this embodiment, a buffer area capable of storing the data and the data of M data segments is applied for in the memory as the target buffer area.

[0057] According to a specific implementation of the embodiment of the present application, the target buffer is a ring buffer. When the target buffer is full, the newly input data is stored starting from the first cache of the target buffer. If the position instructions at different times are stored in the target buffer in chronological order, when a new position instruction is input, the position instruction at the earliest time is replaced and stored.

[0058] like Figure 2 As shown, when the traditional sliding average filtering algorithm performs filtering processing on the position instruction, if the current original data queue includes 20 data, it is necessary to apply for a buffer of 20 data in the memory as the target buffer.

[0059] Different from the traditional sliding average filtering algorithm, a circular buffer of size N is established in the memory to store the target position instruction values ​​at N moments. This embodiment divides the data values ​​of the N position instructions in the original data queue into M data segments, each data segment represents the sum of the data values ​​of the position instructions at K adjacent moments. In the actual application process, K is a pre-designed value, and the value of K can be adaptively set according to the needs of the actual application scenario. The value of K is N / M.

[0060] like Figure 2 As shown, N = 20, M = 5, K = 20 / 5 = 4, y 1 Represents X 1 -X 4 The data and y 2 Represents X 5 -X 8 's data and, and so on.

[0061] Based on the data storage method provided in this embodiment, the memory occupied by position instructions can be effectively reduced. If N=20, M=5, K=4, compared with the traditional sliding average filtering algorithm, the memory occupied by the data storage method provided in this embodiment is only 1 / 4 of the traditional sliding average filtering algorithm.

[0062] Step S102, determining whether the number of the new position instructions is equal to K, where K is a pre-set value;

[0063] Step S103, when the number of the new position instructions is less than or equal to K, the filter value of each new position instruction is calculated according to the historical buffer value corresponding to the new position instruction in the target buffer, and the new position instruction is continuously acquired;

[0064] In a specific embodiment, whether the number of new position instructions is equal to K may be determined by defining a temporary variable.

[0065] For example, temporary variables I1 and I2 are defined. Before receiving a new position instruction, the temporary variables I1 and I2 are initialized so that I1 and I2 are both 1. After receiving a new position instruction, the filter value of the current new position instruction is calculated, and I1+1 is added. When I1 is less than or equal to 4, it means that 4 new position instructions have not been received. After calculating the filter value of the current new position instruction, the new position instruction continues to be obtained, and the buffer value is replaced when I1 is greater than 4. After replacing a buffer value, I2+1 is added. When I2 is less than or equal to M, it means that all buffer values ​​in the target buffer have not been updated. When I2 is greater than M, it means that all buffer values ​​in the target buffer have been updated. At this time, the first buffer value of the target buffer is updated again, and the algorithm parameters are initialized.

[0066] According to a specific implementation of the embodiment of the present application, the filtering value of each new position instruction is calculated according to the historical buffer value corresponding to the new position instruction in the target buffer, including:

[0067] Determine a target reconstructed arithmetic sequence according to the historical buffer value and two adjacent buffer values;

[0068] The filtering value of each new position instruction is calculated according to the first data sum of the target reconstructed arithmetic progression and the second data sum of the new position instruction.

[0069] In a specific embodiment, since the buffer value is the sum of the data values ​​of multiple adjacent position instructions, after obtaining a new position instruction, filtering the new position instruction needs to obtain sampled data corresponding to the new position instruction. This embodiment obtains sampled data corresponding to the new position instruction by constructing a target reconstructed arithmetic progression corresponding to the historical buffer value.

[0070] According to a specific implementation of the embodiment of the present application, the determining of the target reconstructed arithmetic progression according to the historical buffer value and its two adjacent buffer values ​​includes:

[0071] Determine the step length of the target reconstructed arithmetic progression according to two buffer values ​​adjacent to the historical buffer value;

[0072] According to the principle that the first data sum is equal to the third data sum and the step length, the data values ​​of the target reconstructed arithmetic sequence are determined to obtain the reconstructed arithmetic sequence, wherein the third data sum is the sum of the filtered values ​​of each new position instruction.

[0073] Specifically, the step size of the arithmetic progression is determined according to two buffer values ​​adjacent to the current historical buffer value.

[0074] like Figure 2 As shown, N = 20, M = 5, K = 4, with y 1 For example, the calculation formula of step length is: d = (y 2 / Ky 5 / K) / (2*K)=(y 2 / 4-y 5 / 4) / (2*4)

[0075] y 1 Reconstructed into an arithmetic progression with 4 terms, X' 1 , X' 2 , X' 3 and X' 4 , that is, X' 1 -X' 4 To reconstruct X 1 -X 4 , where the first term is X'1 , with a step size of d.

[0076] Then, according to the principle that the data sum of the traditional filtering algorithm is equal to the data sum of the filtering algorithm provided by this embodiment, the first term X' is determined. 1 .

[0077] At this time, X 21 -X 24 The corresponding filtered value X F21 -X F24 It can be expressed as:

[0078]

[0079]

[0080] Step S104, when the number of the new position instructions is greater than K, a new buffer value is calculated according to the data values ​​of all the new position instructions;

[0081] In a specific embodiment, after calculating X 21 -X 24 The corresponding filter value X F21 -X F24 Then, by calculating X 21 -X 24 of and y 6 , use y 6 Covery 1 , and y 2 Reconstructed into an arithmetic progression with 4 terms to participate in X 25 -X 28 The corresponding filter value is calculated, and so on. The data filtering method provided in this embodiment can overcome the disadvantage of large memory usage of the algorithm while completing the sliding average filtering.

[0082] In actual application, the buffer value is the sum of the data values ​​of all new position instructions.

[0083] Step S105: updating the corresponding historical buffer value in the target buffer according to the new buffer value.

[0084] In a specific embodiment, after the new buffer value is obtained, the historical buffer value in the target buffer may be updated in real time according to the storage rule of the ring buffer.

[0085] For example, if Figure 2 As shown, if the target buffer contains y 1 -y 5 The historical buffer value of , then the new buffer value y is obtained 6 After that, use y 6 Replace y 1, that is, the update of the target buffer is completed. Get the new buffer value y 7 After that, use y 7 Replace y 2 That is, the update of the target buffer is completed.

[0086] In summary, the embodiment of the present application provides a data filtering method. Compared with the traditional sliding average filtering algorithm, the improved algorithm overcomes the disadvantage of wasting the memory of the single-chip microcomputer in the traditional sliding average filtering algorithm. At the same time, the embodiment of the present application completes the filtering processing of the algorithm by constructing an arithmetic progression, thereby ensuring the filtering effect of the algorithm. It effectively improves the data processing efficiency of the servo position control system and broadens the selection range of the single-chip microcomputer.

[0087] refer to Figure 3 , is a schematic diagram of a device module of a data filtering device 300 provided in an embodiment of the present application. The data filtering device 300 provided in an embodiment of the present application, such as Figure 3 As shown, the device comprises:

[0088] An acquisition module 301 is used to acquire a new position instruction;

[0089] A judging module 302 is used to judge whether the number of the new position instructions is equal to K, where K is a pre-designed value;

[0090] The filtering module 303 is used to calculate the filtering value of each new position instruction according to the historical buffer value corresponding to the new position instruction in the target buffer when the number of the new position instructions is less than or equal to K, and continue to obtain the new position instruction;

[0091] The storage module 304 is used to calculate the new buffer value according to the data values ​​of all the new position instructions when the number of the new position instructions is greater than K;

[0092] The updating module 305 is used to update the corresponding historical buffer value in the target buffer according to the new buffer value.

[0093] According to a specific implementation of the embodiment of the present application, the device further includes:

[0094] A buffer application module is used to apply for a target buffer; N data in the original data queue are divided into M data segments in sequence, each data segment includes K adjacent data, and the data sum of the M data segments is stored in the target buffer in sequence, wherein the data of a single data segment stored in the target buffer occupies the same memory as a single data in the original data queue, and the buffer value is the data sum of the data segments.

[0095] According to a specific implementation of an embodiment of the present application, the filtering module 303 is specifically used to determine the target reconstructed arithmetic sequence based on the historical buffer value and its two adjacent buffer values; and calculate the filter value of each new position instruction based on the first data and the second data of the target reconstructed arithmetic sequence and the new position instruction.

[0096] In addition, an embodiment of the present application further provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer program, and when the computer program runs on the processor, the data filtering method in the aforementioned method embodiment is executed.

[0097] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is run on a processor, the data filtering method in the aforementioned method embodiment is executed.

[0098] In addition, the specific implementation process of the data filtering device, electronic device and computer-readable storage medium mentioned in the above embodiments can refer to the specific implementation process of the above method embodiments, which will not be repeated here.

[0099] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0100] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0101] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0102] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A data filtering method, characterized in that: The method comprises: Apply for target buffer; Divide N data in the original data queue into M data segments in sequence, each data segment includes K adjacent data, and store the data sum of the M data segments in the target buffer in sequence, wherein the data of a single data segment stored in the target buffer occupies the same memory as a single data in the original data queue, and the buffer value is the data sum of the data segment; Get new position command; Determine whether the number of the new position instructions is equal to K, where K is a pre-designed value; When the number of the new position instructions is less than or equal to K, the filter value of each new position instruction is calculated according to the historical buffer value corresponding to the new position instruction in the target buffer, and the new position instruction is continuously acquired; When the number of the new position instructions is greater than K, a new buffer value is calculated according to the data values ​​of all the new position instructions; The corresponding historical buffer value in the target buffer is updated according to the new buffer value.

2. The method according to claim 1, characterized in that The step of calculating the filter value of each new position instruction according to the historical buffer value corresponding to the new position instruction in the target buffer includes: Determine a target reconstructed arithmetic sequence according to the historical buffer value and two adjacent buffer values; The filtering value of each new position instruction is calculated according to the first data sum of the target reconstructed arithmetic progression and the second data sum of the new position instruction.

3. The method according to claim 1, characterized in that The target buffer is a ring buffer.

4. The method according to claim 2, characterized in that: The step of determining a target reconstructed arithmetic progression according to the historical buffer value and two adjacent buffer values ​​thereof includes: Determine the step length of the target reconstructed arithmetic progression according to two buffer values ​​adjacent to the historical buffer value; According to the principle that the first data sum is equal to the third data sum and the step length, the data values ​​of the target reconstructed arithmetic sequence are determined to obtain the reconstructed arithmetic sequence, wherein the third data sum is the sum of the filtered values ​​of each new position instruction.

5. A data filtering device, characterized in that: The device comprises: A buffer application module is used to apply for a target buffer; divide N data in the original data queue into M data segments in sequence, each data segment includes K adjacent data, and store the data sum of the M data segments in the target buffer in sequence, wherein the data of a single data segment stored in the target buffer has the same memory occupied by a single data in the original data queue, and the buffer value is the data sum of the data segment; An acquisition module, used to obtain new position instructions; A judging module, used to judge whether the number of the new position instructions is equal to K, where K is a pre-designed value; A filtering module, for calculating a filtering value of each new position instruction according to a historical buffer value corresponding to the new position instruction in a target buffer when the number of the new position instructions is less than or equal to K, and continuing to obtain new position instructions; A storage module, used for calculating a new buffer value according to data values ​​of all new position instructions when the number of the new position instructions is greater than K; An updating module is used to update the corresponding historical buffer value in the target buffer according to the new buffer value.

6. The device according to claim 5, characterized in that The filtering module is specifically used to determine the target reconstructed arithmetic sequence based on the historical buffer value and its two adjacent buffer values; and calculate the filtering value of each new position instruction based on the first data sum of the target reconstructed arithmetic sequence and the second data sum of the new position instruction.

7. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is run on the processor, the data filtering method according to any one of claims 1 to 4 is executed.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is run on a processor, the data filtering method according to any one of claims 1 to 4 is executed.