Data processing method and device, electronic equipment, chip and storage medium

By combining forward and reverse smoothing methods in data processing to process trajectory data, the problems of poor smoothing effect and high computational overhead in the existing technology are solved, online fast smoothing and efficient data processing are achieved, and the accuracy of data prediction is improved. sex.

CN118626770APending Publication Date: 2024-09-10BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410658470.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing data processing methods have poor smoothing effects, high computational overhead, and cannot meet real-time requirements. In particular, it is difficult to effectively remove noise in trajectory data processing, which affects the accuracy of data prediction.

Method used

The method of combining forward smoothing and reverse smoothing is used to perform forward smoothing processing by obtaining M data in the data sequence to be processed, and perform reverse smoothing processing on K data, combined with the estimated value and error covariance matrix, Reduce the amount of data required for reverse smoothing processing, reduce computational overhead, and improve processing efficiency.

Benefits of technology

It achieves fast online smoothing of data, reduces the amount of calculation, improves the smoothing effect and calculation efficiency, meets the needs of real-time processing of trajectory data, and enhances the accuracy of data prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626770A
    Figure CN118626770A
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment, a chip and a storage medium, and the method comprises the steps: obtaining a to-be-processed data sequence, the to-be-processed data sequence comprises M pieces of data corresponding to a current moment and N pieces of data corresponding to a previous moment before the current moment, and M and N are positive integers; forward smoothing processing is carried out on M data in the to-be-processed data sequence, reverse smoothing processing is carried out on K data in the to-be-processed data sequence, a target data sequence is obtained, and K is larger than or equal to M and smaller than N + M. According to the method, the reverse smoothing data volume can be reduced, the calculation overhead is reduced, the calculation speed is improved, and online real-time smoothing processing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and in particular to a data processing method, device, electronic device, chip and storage medium. Background Art

[0002] In the related technology, data can be smoothed, such as trajectory data, but the related data smoothing methods have problems such as poor smoothing effect, high computational overhead, and failure to meet real-time requirements. Summary of the invention

[0003] The present disclosure provides a data processing method, device, electronic device, chip and storage medium to solve the problems in the related art.

[0004] A first aspect embodiment of the present disclosure proposes a data processing method, which includes: obtaining a data sequence to be processed, the data sequence to be processed includes M data corresponding to a current moment and N data corresponding to a previous moment before the current moment, where M and N are positive integers; performing forward smoothing processing on the M data in the data sequence to be processed, and performing reverse smoothing processing on the K data in the data sequence to be processed to obtain a target data sequence, where M≤K<N+M.

[0005] In some embodiments of the present disclosure, the method also includes: performing forward smoothing processing on M data in the data sequence to be processed, and performing reverse smoothing processing on K data in the data sequence to be processed, including: performing forward smoothing processing on M data in the data sequence to be processed to obtain estimated values ​​and error covariance matrices of the M data; based on the estimated values ​​and error covariance matrix of at least M data, performing reverse smoothing processing on K data in the data sequence to be processed to obtain smoothed values ​​of the K data; splicing the historical values ​​of N+MK data and the smoothed values ​​of K data to obtain a target data sequence.

[0006] In some embodiments of the present disclosure, forward smoothing is performed on M data in a processed data sequence to obtain estimated values ​​and error covariance matrices of the M data, including: starting from the N+1th data among the N+M data, for the ith data among the N+M data, using the estimated value of the i-1th data and the error covariance matrix, determining the predicted value and predicted covariance matrix of the ith data; based on the actual value of the ith data, the predicted value of the ith data and the predicted covariance matrix, determining the estimated value and error covariance matrix of the ith data, until the N+Mth data, obtaining the estimated value and error covariance matrix of each of the N+M data, where N+1≤i≤N+M.

[0007] In some embodiments of the present disclosure, based on the estimated values ​​and error covariance matrix of at least M data, reverse smoothing processing is performed on K data in the processed data sequence to obtain the smoothed values ​​of K data, including: taking the estimated value of the N+Mth data as the smoothed value of the N+Mth data; starting from the N+M-1th data, for the jth data in the N+M-1 data, using the estimated value and error covariance matrix of the jth data and the smoothed value of the j+1th data, determine the smoothed value of the jth data, until the smoothed value of the N+MKth data is confirmed, to obtain the smoothed values ​​of the K data, where 1≤j≤N+M-1.

[0008] In some embodiments of the present disclosure, the historical values ​​of N+MK data and the smoothed values ​​of K data are spliced ​​to obtain a target data sequence, including: when K=M, the historical values ​​of N+MK data and the smoothed values ​​of K data are spliced ​​to obtain the target data sequence; when M<K<N+M, the smoothed values ​​of the N+M-K+1th data to the Nth data are used to replace the historical values ​​of the N+M-K+1th data to the Nth data to obtain the target data sequence.

[0009] In some embodiments of the present disclosure, the value of K is preset based on empirical data, or is determined or acquired based on an application scenario of the data sequence to be processed.

[0010] The second aspect embodiment of the present disclosure proposes a data processing device, which includes: an acquisition module, used to acquire a data sequence to be processed, the data sequence to be processed includes M data corresponding to the current moment and N data corresponding to the previous moment before the current moment, where M and N are positive integers; a processing module, used to perform forward smoothing processing on the M data in the data sequence to be processed, and perform reverse smoothing processing on the K data in the data sequence to be processed to obtain a target data sequence, where M≤K<N+M.

[0011] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect embodiment of the present disclosure.

[0012] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.

[0013] The fifth aspect embodiment of the present disclosure proposes a chip, characterized in that it includes at least one processor and a communication interface; the communication interface is used to receive signals input into the chip or signals output from the chip, and the processor communicates with the communication interface and implements the method described in the first aspect embodiment of the present disclosure through logic circuits or execution code instructions.

[0014] In summary, the data processing method proposed in the present invention can reduce the amount of data for reverse smoothing processing, reduce the amount of calculation, reduce the calculation overhead, improve processing efficiency, and can achieve both smoothness and calculation efficiency to meet the needs of online fast smoothing of data.

[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0017] Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure;

[0018] Figure 2 A flowchart of a data processing method provided by an embodiment of the present disclosure;

[0019] Figure 3 A flowchart of a data processing method provided by an embodiment of the present disclosure;

[0020] Figure 4 A smooth splicing effect diagram provided by an embodiment of the present disclosure;

[0021] Figure 5 Another smooth splicing effect diagram provided by an embodiment of the present disclosure;

[0022] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present disclosure;

[0023] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure;

[0024] Figure 8 A schematic diagram of the chip structure provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0026] Time series data is a data column recorded in chronological order for the same statistical indicator. The purpose of time series analysis is to find out the statistical characteristics and development regularity of the time series within the sample, build a time series model, and make out-of-sample predictions. Time series data sometimes contain noise, and the sources of noise include environmental interference, observation errors, etc. Filtering the noise in the data during the data processing stage can effectively improve the accuracy of time series data prediction.

[0027] The observation values ​​of time series data can be updated over time. Some time series analysis operations, such as online time series prediction, have high requirements on computational efficiency and require online fast smoothing.

[0028] For example, the smoothing methods for time series include averaging method, fitting method, filtering method, etc.

[0029] Averaging is a simple low-pass filtering method, including moving average, exponential average, etc. Simple moving average is a method of smoothing data by calculating the average value of data points within a fixed window; exponentially weighted moving average is a method of smoothing data by applying exponential weights to data points.

[0030] The averaging method will slow down the trend change of the curve. The smoother it is, the greater the gap with the true value. In addition, the averaging method does not take into account the noise in the physical world and has no model supervision, so it is difficult to effectively eliminate the noise in time series data.

[0031] Fitting methods include polynomial fitting, Bezier curve fitting, etc. Polynomial fitting approximates or fits the original data by using polynomial functions; Bezier curve fitting is defined by control points and can be used to create smooth curves or paths. The most common forms of Bezier curves are quadratic Bezier curves and cubic Bezier curves, which are defined by 2 and 3 control points respectively.

[0032] The drawback of the fitting method is that the time series data may not necessarily be a regular curve, may not conform to the characteristics of the curve, and the order is difficult to determine.

[0033] The filtering method can be divided into first-order filtering, second-order filtering, ..., and infinite-order filtering according to the order. A first-order filter refers to a filter with only one storage element, and its output value depends only on the current input value and the previous output value. Alpha filtering belongs to the first-order filter; a second-order filter refers to a filter with two storage elements, and its output value depends not only on the current input value and the previous output value, but also on the previous output value; Kalman filtering is an infinite-order filter, which can continuously improve the order of the filter by recursively updating the state estimate and covariance matrix. In practical applications, it is usually only necessary to use a finite-order Kalman filter to meet specific performance requirements.

[0034] Ordinary Kalman filtering is a forward filtering through the data of the previous period of time. Its advantage is that it is simple to calculate and is suitable for time series data filtering. It only needs to use new observations to update the state. The RTS smoothing algorithm (The Rauch–Tung–Striebel smoother) first performs forward filtering from front to back, and then reverse filtering from back to front, and the entire interval is smoothed by fusion.

[0035] Kalman filtering is a forward recursive process, which is divided into the prediction process:

[0036] m k ′=A k m k-1

[0037]

[0038] And the update process:

[0039]

[0040] m k =m k ′+K k (z k -H k m k ′)

[0041] P k =(IK k H k ) k '

[0042] Among them, z k is the observed value at time k, A k ,H k ,P k ,Q k ,K kis the state transfer matrix, observation matrix, error covariance matrix, process noise covariance matrix and Kalman gain at time k, m k is the state estimate at time k, R k is the observation noise covariance matrix.

[0043] The forward recursive process of RTS smoothing is the Kalman filtering process, and the backward recursive process is as follows:

[0044]

[0045] The forward filtering method (first-order filtering, second-order filtering, ..., Kalman filtering) has a worse smoothing effect than the RTS interval smoothing algorithm. However, for time series, the RTS interval smoothing algorithm must perform forward filtering and reverse filtering on the entire sequence each time. If used for online smoothing, the time overhead will far exceed forward filtering.

[0046] None of the above smoothing methods can take into account both smoothness and computational efficiency, and meet the requirements of online fast smoothing of time series data.

[0047] In order to solve the above problems, the present disclosure proposes a data processing method, which can reduce the amount of data for reverse smoothing processing and improve computing efficiency. The method of this scheme can be used in any scenario where time series data needs to be smoothed, such as trajectory-oriented coordinate smoothing scenarios, such as traffic data, human movement data, animal migration trajectory data, and natural phenomenon trajectory data. In general, trajectory data has the characteristics of spatiotemporal sequence, heterogeneous sampling, and poor data quality. The continuous motion trajectory is represented by discretization, which is affected by sampling accuracy, position uncertainty and preprocessing methods, which brings certain difficulties to the analysis based on trajectory data. Therefore, the trajectory data is often smoothed in the trajectory processing link, for example:

[0048] 1. The movement trajectories of pedestrians and vehicles are smooth, and their noise may come from measurement deviation;

[0049] 2. The stylus screen display trajectory is smooth, and its noise may come from sensors, hardware devices, timestamp accuracy deviation, etc.

[0050] In the above example, the original trajectory of the stylus may not be smooth and the data distribution may be uneven. The data acquisition time is related to the screen sampling rate. When making predictions based on trajectory data, the trajectory data needs to be smoothed online to improve the prediction accuracy. At the same time, the time efficiency of online smoothing needs to be considered to avoid large time overhead in the data processing link. This solution uses a smoothing method that combines forward smoothing and reverse smoothing. First, the newly added observation points within the time interval are used for state update and forward smoothing; then the nearest K coordinate points are reversely smoothed, and the coordinate points with existing smoothed values ​​are overwritten and saved with the smoothing results.

[0051] The specific contents of this method are as follows.

[0052] Figure 1 A flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 1 As shown, the method may include the following steps.

[0053] Step 101, obtaining a data sequence to be processed.

[0054] In some embodiments, the sequence of data to be processed may include M data corresponding to the current moment and N data corresponding to a previous moment before the current moment, where M and N are positive integers.

[0055] In some embodiments, for example, a list may be used to store data up to the current moment, that is, a list may be used to store N historical data, and after receiving M data corresponding to the current moment, the M data may also be stored in the list.

[0056] For example, the current moment may be represented as moment T, the previous moment before the current moment may be represented as moment T-1, and the M data corresponding to the current moment may be the M data received between moment T-1 and moment T.

[0057] In some embodiments, the N data corresponding to the previous time may be N historical data received from time 1 to time TI.

[0058] In some embodiments, optionally, the data sequence may be a time series data sequence, that is, the data sequence may be data collected over time, for example, a trajectory data sequence, such as a trajectory data sequence of a stylus, a trajectory data sequence of a vehicle, etc.; another example is a trend data sequence, such as a meteorological data sequence, etc., which is not limited by the present disclosure.

[0059] Step 102, forward smoothing is performed on M data in the data sequence to be processed, and reverse smoothing is performed on K data in the data sequence to be processed, to obtain a target data sequence.

[0060] In some embodiments, M≤K<N+M, where N+M is the number of all data received at the current moment.

[0061] In some embodiments, optionally, forward smoothing processing may be performed only on M data in the data sequence to be processed, that is, forward smoothing processing may be performed only on all newly received data.

[0062] In some embodiments, optionally, forward smoothing processing may be performed on P data, where M≤P≤N+M.

[0063] In some embodiments, at the current moment, the M data received at the current moment have not been forward smoothed, and the N data received at the previous moment of the current moment have been forward smoothed at the T-1 moment. At this time, the P data can be forward smoothed. P is greater than or equal to M, indicating that at least all newly received data must be forward smoothed. P is less than or equal to N+M, indicating that part of the data can be forward smoothed, and at most all of the data can be forward smoothed. In other words, part of the data that has been forward smoothed at the previous moment can be forward smoothed again at the current moment. At this time, the forward smoothing results of these data at the current moment can be used to update and overwrite the forward smoothing results determined at the previous moment of the current moment.

[0064] In some embodiments, at the current moment, the M data received at the current moment have not yet been reverse smoothed, and the N data received at the previous moment of the current moment have been reverse smoothed at time T-1. At this time, K data can be reverse smoothed. K is greater than or equal to M, which means that at least all newly received data must be reverse smoothed. K is less than or equal to N+M, which means that part of the data can be reverse smoothed, and at most all of the data can be forward smoothed.

[0065] In other words, some data that have been reverse smoothed at a previous moment can be reverse smoothed again at the current moment. At this time, the reverse smoothing results of these data at the current moment can be used to update and overwrite the reverse smoothing results determined at the previous moment at the current moment.

[0066] In some embodiments, the value of K is preset based on empirical data, or is determined or acquired based on an application scenario of the data sequence to be processed.

[0067] Specifically, the value of K can usually be greater than M and less than N+M, which can avoid reverse smoothing processing on all data at the current moment and reduce the amount of calculation.

[0068] In summary, the above embodiments of the present disclosure can reduce the amount of calculation by acquiring a data sequence, performing forward smoothing on the data, and performing reverse smoothing on part of the data, thereby improving the calculation efficiency while taking into account smoothness, and realizing online smoothing of the data.

[0069] Figure 2 A flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 2 As shown, based on Figure 1 In the illustrated embodiment, the method further explains the above step 102, and the method includes the following steps.

[0070] Step 201 , forward smoothing is performed on M data in the data sequence to be processed to obtain estimated values ​​and an error covariance matrix of the M data.

[0071] In some embodiments, optionally, forward smoothing processing can be performed on the M data in the processed data sequence, that is, only the M data received at the current moment are forward smoothed to obtain the estimated values ​​and error covariance matrix of the M data, and the estimated values ​​and error covariance matrix of other historical data may have been determined at a previous moment.

[0072] In some embodiments, when forward smoothing is performed on M data in a processed data sequence, starting from the N+1th data among the N+M data, for the i-1th data among the N+M data, the estimated value of the i-1th data and the error covariance matrix are used to determine the predicted value and predicted covariance matrix of the i-th data.

[0073] In other words, starting from the N+1th data, the data can be predicted based on the estimated value of the previous data and the error covariance matrix to determine the predicted value and predicted covariance matrix of the data. The specific formula is as follows:

[0074] m k ′=A k m k-1

[0075]

[0076] Among them A k ,P k ,Q k are the state transfer matrix, error covariance matrix and process noise covariance matrix at the current moment, m k ′ is the predicted value of the data at the current moment, P k ′ is the predicted covariance matrix of the data at the current moment.

[0077] In some embodiments, when forward smoothing is performed on M data in a processed data sequence, the estimated value and error covariance matrix of the i-th data can be determined based on the actual value of the i-th data, the predicted value of the i-th data, and the predicted covariance matrix, until the N+M-th data, to obtain the estimated value and error covariance matrix of each of the M data, where N+1≤i≤N+M.

[0078] In other words, starting from the N+1th data, the predicted value and the predicted covariance matrix can be updated according to the actual value of the i-th data to obtain the estimated value and error covariance matrix of the i-th data. The specific formula is as follows:

[0079]

[0080] m k =m k ′+K k (z k -H k m k ′)

[0081] P k =(IK k H k ) k '

[0082] where z k is the actual value at the current moment (i.e., observed value), H k is the observation matrix at the current moment, K k is the Kalman gain at the current moment, m k is the estimated value at the current moment, P k is the error covariance matrix at the current moment, R k is the observation noise covariance matrix.

[0083] In some embodiments, optionally, forward smoothing processing can be performed on P data, where M≤P≤N+M, that is, when forward smoothing processing is performed on P data, it can include the above-mentioned situation of processing M data, that is, forward smoothing processing can be performed only on newly received data, or forward smoothing processing can be performed on newly received data and part of historical data received at previous moments, that is, when P is greater than M, it can indicate that part of the data that has been forward smoothed is forward smoothed again.

[0084] In some embodiments, when forward smoothing is performed on P data, for the first data among the N+M data, the estimated value of the first data and the error covariance matrix can be determined based on the actual value of the first data, where the actual value may be the specific value of the collected data. For example, when the data sequence is a handwriting pen trajectory sequence, the actual value of the data may be the coordinates of the trajectory point; for another example, when the data sequence is a trend of changes in crowd flow, the actual value of the data may be the value of the crowd flow at a certain point in time, and so on. The actual value of the data is the actual collected data value.

[0085] For example, the estimated value of the first data can be expressed as m1, and the error covariance matrix of the first data can be expressed as P1.

[0086] In some embodiments, when forward smoothing is performed on P data, starting from the second data among the N+M data, for the i-th data among the N+M data, the estimated value of the i-1-th data and the error covariance matrix are used to determine the predicted value and predicted covariance matrix of the i-th data.

[0087] In other words, starting from the second data, the data can be predicted based on the estimated value of the previous data and the error covariance matrix to determine the predicted value and predicted covariance matrix of the data. The specific formula is as follows:

[0088] m k ′=A k m k-1

[0089]

[0090] Among them A k ,P k ,Q k are the state transfer matrix, error covariance matrix and process noise covariance matrix at the current moment, m k ′ is the predicted value of the data at the current moment, P k ′ is the predicted covariance matrix of the data at the current moment.

[0091] In some embodiments, when forward smoothing is performed on P data, the estimated value and error covariance matrix of the i-th data can be determined based on the actual value of the i-th data, the predicted value of the i-th data, and the predicted covariance matrix, until the N+M-th data, to obtain the estimated value and error covariance matrix of each of the N+M data, where 2≤i≤N+M.

[0092] In other words, starting from the second data, the predicted value and the predicted covariance matrix can be updated according to the actual value of the i-th data to obtain the estimated value and error covariance matrix of the i-th data. The specific formula is as follows:

[0093]

[0094] m k =m k ′+K k (z k -H k m k ′)

[0095] P k =(IK k H k ) k '

[0096] where z k is the actual value at the current moment (i.e., observed value), H k is the observation matrix at the current moment, K k is the Kalman gain at the current moment, m k is the estimated value at the current moment, P kis the error covariance matrix at the current moment, R k is the observation noise covariance matrix.

[0097] Step 202: Based on the estimated values ​​of at least M data and the error covariance matrix, reverse smoothing is performed on K data in the data sequence to be processed to obtain smoothed values ​​of the K data.

[0098] In some embodiments, the estimated value of the N+Mth data can be used as the smoothed value of the N+Mth data. For example, the N+Mth data can be the last data acquired at the current moment, and the N+Mth data can be the first data processed during reverse smoothing.

[0099] In some embodiments, starting from the N+M-1th data, for the jth data among the N+M-1 data, the smoothed value of the jth data is determined using the estimated value and error covariance matrix of the jth data and the smoothed value of the j+1th data, until the smoothed value of the N+MKth data is confirmed, and the smoothed values ​​of K data are obtained, where 1≤j≤N+M-1.

[0100] In other words, when the data is reversely smoothed, it can be processed in reverse order starting from the last received data, starting from the N+M-1th data, and the smoothed value of the currently processed data can be determined based on the estimated value and error covariance matrix of the currently processed data and the smoothed value of the next data. The specific formula is as follows:

[0101]

[0102] In other words, when reverse smoothing is performed on data, reverse smoothing can be performed on K data, where K is less than or equal to N+M, indicating that reverse smoothing can be performed on only part of the data, thereby reducing the amount of data to be processed.

[0103] Step 203, concatenate the historical values ​​of N+MK data and the smoothed values ​​of K data to obtain a target data sequence.

[0104] In some embodiments, after the above-mentioned reverse processing of K data, the smoothing values ​​of the K data at the current moment can be obtained. For example, when K is greater than M and less than N+M, it can represent the determination of the smoothing value of all data received at the current moment, as well as the determination of the smoothing value of some data received at the previous moment at the current moment.

[0105] In some embodiments, N+MK data may have historical smoothed values, such as smoothed values ​​of N+MK data determined at a previous moment before the current moment. The historical smoothed values ​​of N+MK data may be concatenated with the smoothed values ​​of K data at the current moment to obtain a target data sequence.

[0106] In summary, the above-mentioned embodiments of the present application can obtain the target data sequence by performing forward smoothing on the data and reverse smoothing on part of the data, and splicing the smoothed value with the historical value. This can reduce the amount of reverse smoothing processing and reduce the computational overhead. It can improve the computational efficiency while taking into account smoothness and meet the needs of online smoothing.

[0107] Figure 3 A flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 3 As shown, based on Figure 3 In the illustrated embodiment, the method comprises the following steps.

[0108] Step 301, when K=M, historical values ​​of N+MK data and smoothed values ​​of K data are concatenated to obtain a target data sequence.

[0109] In some embodiments, when K=M, it means that only the data received at the current moment is reverse smoothed. At this time, N+MK is N, which means that there are historical values ​​of N historical data and smoothed values ​​of M data. The historical values ​​of N+MK data and the smoothed values ​​of K data are spliced, that is, the historical values ​​of N data and the smoothed values ​​of M data are spliced ​​to obtain the target data sequence.

[0110] Step 302, when M<K<N+M, use the smoothed values ​​of the N+M-K+1th data to the Nth data to replace the historical values ​​of the N+M-K+1th data to the Nth data to obtain the target data sequence.

[0111] In some embodiments, when M<K<N+M, it means that reverse smoothing processing is performed on the M newly received data at the current moment, and reverse processing is performed on the KM historical data at the previous moment. At this time, the historical values ​​of the KM historical data at the previous moment can be replaced by the smoothing values ​​determined at the current moment, and the smoothing values ​​of the N+M-K+1th data to the Nth data are used to replace the historical values ​​of the N+M-K+1th data to the Nth data. At this time, the historical values ​​of the data that have not been reversely smoothed can be spliced ​​with the smoothing values ​​of the data that have been reversely smoothed, that is, the historical values ​​of N+MK data and the smoothing values ​​of K data are spliced ​​to obtain the target data sequence.

[0112] In summary, the above embodiments of the present disclosure can concatenate historical values ​​and smoothed values ​​to obtain a target data sequence, thereby achieving smoothing of the data sequence. By performing reverse smoothing on part of the data, the amount of calculation can be reduced, and the calculation efficiency can be improved while taking into account smoothness.

[0113] The technical solution of the present disclosure is further described in detail below in conjunction with specific application examples.

[0114] The following is an online fast smoothing time series data processing method provided by an embodiment of the present disclosure. Compared with other smoothing methods, this method can effectively remove noise and make the trajectory smoother; the infinite order filter smoothes all trajectory information up to the current moment without losing information; and it can smooth trajectories of any shape.

[0115] Compared with Kalman filtering and RTS smoothing, this method solves the following problems: if only forward smoothing is used, the trajectory smoothing effect is worse than reverse smoothing; if reverse smoothing is used, the entire trajectory needs to be updated in the reverse state, which results in a large online calculation time overhead and does not meet the real-time requirements; as the number of coordinate points in the trajectory increases, the time consumed by reverse smoothing also gradually increases; taking into account both smoothness and computational efficiency, the requirements for online fast smoothing of time series data can be met.

[0116] Assume that online smoothing of time series data is performed, the current time is T, and the previous time T-1 has an observation sequence O1, O2, ..., O n , then the current time interval (T-1 to T) obtains i observations O n+1 , O n+2 , ..., O n+i , it is necessary to perform online smoothing, that is, calculate the smoothing values ​​S1, S2, ..., S of n+i data n+i .

[0117] For forward smoothing (such as Kalman filtering), as new time series data is acquired, the most recent observations can be obtained in real time to update the state. At the current time T, only i forward recursions are needed to obtain m n+1 , m n+2 , ..., m n+i That's it.

[0118] As for RTS smoothing, the smoothing process is: after completing n+i forward recursions from the initial time 1 to the time T, the smoothing process is completed after n+i backward recursions from the time T.

[0119] For the last moment, the state estimate m obtained by forward recursion is k and the covariance matrix P k This is the initial state estimate of the backward recursive process With the covariance matrix Right now The actual points that are not smoothed by the future trajectory are recorded as blank smoothing points.

[0120] In actual online smoothing, if the entire trajectory needs to be smoothed each time, it will result in a lot of overhead. Assume that a trajectory has N points, and N1, N2, ..., N are updated at each time interval. m points (N1+N2+…,N m =N)). Online calculation requires N forward recursions and N1+(N1+N2)+…+(N1+N2+…,N m ) times of backward recursion.

[0121] The complete contents of this example method are as follows.

[0122] The core idea of ​​this scheme is to use a list to store the smoothed trajectory up to the current moment, combining forward smoothing with reverse smoothing, first using the newly added observation points within the time interval to update the state and perform forward smoothing; then reverse smoothing the nearest N coordinate points, and overwriting and saving the smoothed results of the coordinate points with existing smoothed values.

[0123] Each time, we use the newly input i points and perform i forward recursions to obtain the state estimate m of the current i points. n+1 ,…,m n+i and the covariance matrix P n+1 ,…,P n+i , and then estimate the state of the last i+1 point m n ,…,m n+i and the covariance matrix P n ,…,P n+i As the initial state estimate of the backward recursion process, perform i backward recursions to obtain the smoothed values ​​of the past i points (and use the current state estimate as the blank smoothed value S at the current moment n+i .

[0124] The historical smoothing points use the previous smoothing results and do not update. In this way, each prediction only requires N T forward recursion and N T For the trajectory of N points, the online calculation requires N forward recursions and N backward recursions.

[0125] If only the newly added points (and the last blank point obtained last time) are smoothed each time, and the smoothed results are concatenated, the smoothness and uniformity of the generated data will be poor (e.g. Figure 4 ).

[0126] By increasing the number of single smoothing points, the smoothness and uniformity of the smoothed trajectory can be improved. Figure 5, smoothing multiple points at a time, the smoothing effect is better, and the data points are more evenly distributed. If the smoothing result of a previous point is recalculated, it is overwritten and updated. If k points are smoothed this time (k>i), the state estimate m of the last k+1 points is n+i -k,…,m n+i and the covariance matrix P n+i -k,…,P n+i As the initial state estimate of the backward recursive process, perform k backward recursions to obtain the smoothed values ​​of the past k points (and use the current state estimate as the blank smoothed value S at the current moment n+i . For S in list S n+i-k , …, S n The value of is overwritten and updated.

[0127] However, smoothing multiple points at a time in online calculation will bring greater computational overhead. Online calculation requires N forward recursions and N1+max(k,N2)+…+max(k,N m ) times of backward recursion.

[0128] In summary, the time complexity of reverse smoothing of the original RTS smoothing method is O(N 2 ), the time complexity of a single smoothing without overlap (smoothing only the newly added points) is O(N), and the time complexity of a single smoothing of k points is O(kN). You can customize the single smoothing length as needed.

[0129] In summary, the above examples disclosed in the present invention can smooth the data with good smoothing effect, and can obtain a smooth and uniform time series; it can process time series of any type and different lengths; it has a fast calculation speed and can meet the needs of online smoothing; it can flexibly adjust the amount of data for each smoothing, so as to achieve different smoothing effects and time costs, so as to be suitable for different scenario requirements.

[0130] Figure 6 FIG. 6 is a schematic diagram of a data processing device 600 provided in an embodiment of the present disclosure. Figure 6 As shown, the device includes: an acquisition module 610, used to acquire a data sequence to be processed, the data sequence to be processed includes M data corresponding to the current moment and N data corresponding to the previous moment before the current moment, where M and N are positive integers; a processing module 620, used to perform forward smoothing processing on the M data in the data sequence to be processed, and perform reverse smoothing processing on the K data in the data sequence to be processed to obtain a target data sequence, where M≤K<N+M.

[0131] In some embodiments, the processing module 620 can also be used to perform forward smoothing processing on M data in the processed data sequence to obtain estimated values ​​and an error covariance matrix of the M data; based on the estimated values ​​and the error covariance matrix of at least M data, perform reverse smoothing processing on K data in the processed data sequence to obtain smoothed values ​​of the K data; and concatenate the historical values ​​of N+MK data and the smoothed values ​​of the K data to obtain a target data sequence.

[0132] In some embodiments, the processing module 620 can also be used to start from the N+1th data among the N+M data, and for the i-th data among the N+M data, use the estimated value of the i-1th data and the error covariance matrix to determine the predicted value and the predicted covariance matrix of the i-th data; based on the actual value of the i-th data, the predicted value of the i-th data and the predicted covariance matrix, determine the estimated value and the error covariance matrix of the i-th data, until the N+Mth data, to obtain the estimated value and the error covariance matrix of each of the M data, where N+1≤i≤N+M.

[0133] In some embodiments, the processing module 620 can also be used to use the estimated value of the N+Mth data as the smoothed value of the N+Mth data; starting from the N+M-1th data, for the jth data in the N+M-1 data, use the estimated value and error covariance matrix of the jth data and the smoothed value of the j+1th data to determine the smoothed value of the jth data, until the smoothed value of the N+MKth data is confirmed, to obtain the smoothed values ​​of K data, where 1≤j≤N+M-1.

[0134] In some embodiments, the processing module 620 can also be used to, when K=M, concatenate the historical values ​​of N+MK data and the smoothed values ​​of K data to obtain a target data sequence; when M<K<N+M, use the smoothed values ​​of the N+M-K+1th data to the Nth data to replace the historical values ​​of the N+M-K+1th data to the Nth data to obtain the target data sequence.

[0135] In some embodiments, the value of K is preset based on empirical data, or is determined or acquired based on an application scenario of the data sequence to be processed.

[0136] In summary, the above data processing device can perform smoothing on the data, can reduce the amount of data for reverse smoothing, can reduce the computational overhead, can take into account both efficiency and smoothness, and can meet the needs of online smoothing.

[0137] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0138] Figure 7 is a block diagram of an electronic device 700 for implementing the above method according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0139] Reference Figure 7 , the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .

[0140] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.

[0141] The memory 704 is configured to store various types of data to support operations on the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0142] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.

[0143] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0144] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0145] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0146] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0147] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0148] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0149] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by a processor 720 of an electronic device 700 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0150] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the above embodiments of the present disclosure.

[0151] An embodiment of the present disclosure further proposes a communication system, which includes a terminal and a network device. The terminal is used to implement the method described in the embodiment of the first aspect of the present disclosure, and the network device can be used to implement the method described in the embodiment of the second aspect of the present disclosure.

[0152] In some embodiments, the above communication system further includes a console, which can send modification instructions to the terminal, control the filtering information adopted by the terminal, and so on.

[0153] Figure 8 FIG. 8 is a schematic diagram of a chip 800 for implementing the above method according to an exemplary embodiment. Figure 8The chip 800 includes a communication interface 801 and at least one processor 802. The communication interface 801 is used to receive signals input into the chip 800 or signals output from the above chip 800. The processor 802 communicates with the communication interface 801 and implements the method described in the above embodiment of the present disclosure through logic circuits or executing code instructions.

[0154] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure 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 data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0155] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any at least one embodiment or example in a suitable manner.

[0156] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0157] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection having at least one wiring (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0158] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0159] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0160] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0161] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A data processing method, characterized in that: The method comprises: Obtain a sequence of data to be processed, the sequence of data to be processed comprising M data corresponding to a current moment and N data corresponding to a previous moment before the current moment, where M and N are positive integers; Forward smoothing is performed on M data in the data sequence to be processed, and reverse smoothing is performed on K data in the data sequence to be processed to obtain a target data sequence, wherein M≤K<N+M.

2. The method according to claim 1, characterized in that The performing forward smoothing processing on the M data in the data sequence to be processed and performing reverse smoothing processing on the K data in the data sequence to be processed comprises: Performing forward smoothing processing on M data in the data sequence to be processed to obtain estimated values ​​and an error covariance matrix of the M data; Based on the estimated values ​​of at least the M data and the error covariance matrix, performing reverse smoothing processing on K data in the to-be-processed data sequence to obtain smoothed values ​​of the K data; The historical values ​​of N+MK data and the smoothed values ​​of the K data are concatenated to obtain the target data sequence.

3. The method according to claim 2, characterized in that The forward smoothing process is performed on the M data in the data sequence to be processed to obtain the estimated value and error covariance matrix of the M data, including: Starting from the N+1th data among the N+M data, for the i-th data among the N+M data, using the estimated value and the error covariance matrix of the i-1th data, determine the predicted value and the predicted covariance matrix of the i-th data; Based on the actual value of the i-th data, the predicted value of the i-th data and the predicted covariance matrix, the estimated value and error covariance matrix of the i-th data are determined, until the N+M-th data, to obtain the estimated value and error covariance matrix of each of the M data, where N+1≤i≤N+M.

4. The method according to claim 2, characterized in that: The performing reverse smoothing processing on K data in the to-be-processed data sequence based on the estimated values ​​and the error covariance matrix of at least the M data to obtain smoothed values ​​of the K data includes: Using the estimated value of the N+Mth data as the smoothed value of the N+Mth data; Starting from the N+M-1th data, for the jth data among the N+M-1 data, use the estimated value and error covariance matrix of the jth data and the smoothed value of the j+1th data to determine the smoothed value of the jth data, until the smoothed value of the N+MKth data is confirmed, to obtain the smoothed values ​​of the K data, where 1≤j≤N+M-1.

5. The method according to any one of claims 2 to 4, characterized in that The step of concatenating the historical values ​​of N+MK data and the smoothed values ​​of the K data to obtain the target data sequence includes: In the case of K=M, historical values ​​of N+MK data and smoothed values ​​of the K data are concatenated to obtain the target data sequence; When M<K<N+M, the smoothed values ​​of the N+M-K+1th data to the Nth data are used to replace the historical values ​​of the N+M-K+1th data to the Nth data to obtain the target data sequence.

6. The method according to claim 1, characterized in that The value of K is preset based on empirical data, or is determined or acquired based on an application scenario of the data sequence to be processed.

7. A data processing device, comprising: An acquisition module, used to acquire a sequence of data to be processed, wherein the sequence of data to be processed includes M data corresponding to a current moment and N data corresponding to a previous moment before the current moment, wherein M and N are positive integers; The processing module is used to perform forward smoothing processing on M data in the data sequence to be processed, and perform reverse smoothing processing on K data in the data sequence to be processed to obtain a target data sequence, wherein M≤K<N+M.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

10. A chip, characterized in that: It includes at least one processor and a communication interface; the communication interface is used to receive a signal input to the chip or a signal output from the chip, and the processor communicates with the communication interface and implements the method as described in any one of claims 1 to 6 through a logic circuit or executing code instructions.