Sensor signal smoothing method and device

By combining Kalman filters with online machine learning, the state transition matrix of the Kalman filter is updated, solving the problem of rapid noise removal from sensor signals and improving the accuracy and real-time performance of sensor signal applications.

CN120873375APending Publication Date: 2025-10-31HITACHI LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410535710.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing technologies struggle to quickly and effectively filter out noise signals from sensor signals, impacting the accuracy and real-time performance of subsequent applications.

Method used

By combining Kalman filters with online machine learning, and by setting up state and feature spaces, the state transition matrix of the Kalman filter is updated using an online learning model, thus achieving rapid smoothing of noisy signals.

Benefits of technology

It enables rapid filtering of sensor signal noise, improving the performance of subsequent applications, such as quickly capturing user actions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873375A_ABST
    Figure CN120873375A_ABST
Patent Text Reader

Abstract

The invention provides a smoothing method and device for a sensor signal, and relates to the technical field of data processing. According to the smoothing method of the sensor signal provided by the embodiment of the invention, the change of the signal is captured in time by means of online machine learning, and the state transition matrix of the Kalman filter is updated in time by using the latest parameters of the online machine learning model, so that the smoothing of the noise signal can be quickly realized based on the updated Kalman filter. Based on the method, the effect of subsequent application based on the sensor signal can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data analysis and processing technology, specifically to a method and apparatus for smoothing sensor signals. Background Technology

[0002] With the widespread use of smartphones and wearable devices (such as smartwatches), accelerometer sensors have become ubiquitous. Accelerometer signal acquisition has become easy and widely applied, from simply counting steps and tracking drones to identifying worker behavior in factories. Currently, related technologies also offer solutions based on accelerometer signals for vehicle load estimation, warehouse worker order picking, and packing behavior recognition. However, sensor signals (such as accelerometer signals) are susceptible to noise from equipment, environment, and body tremors, affecting the effectiveness of subsequent applications.

[0003] Kalman filtering is an algorithm that uses the state equations of a linear system to make an optimal estimate of the system state using the system's input and output observation data. Since the observation data includes the effects of noise and interference in the system, the optimal estimation can also be regarded as a filtering process.

[0004] Data filtering is a data processing technique used to remove noise and restore accurate data. Kalman filtering, when the measurement variance is known, can estimate the state of a dynamic system from a series of data containing measurement noise. Currently, Kalman filtering is commonly used for aircraft or missile tracking. Due to real-time requirements, it is often simply used to process acceleration signals and then combined with information from other types of sensors to achieve positioning or tracking. For smoothing acceleration signals, in real-time step counting scenarios, a method is used to fuse three-axis acceleration signals and then average the N most recent fused signals to remove glitches. However, these methods cannot quickly filter out noise signals, and therefore struggle to quickly and accurately identify the user's actual actions. Summary of the Invention

[0005] At least one embodiment of this application provides a method and apparatus for smoothing sensor signals, which can quickly filter out noise signals in sensor signals and improve the effect of subsequent applications based on sensor signals.

[0006] According to a first aspect of this application, at least one embodiment provides a method for smoothing sensor signals, comprising:

[0007] A state space for a Kalman filter is defined, along with a signal transformation function to convert the sensor signal to the state space. A feature space for machine learning is defined, along with a feature generation function to convert the sensor signal to the features space. An online learning algorithm for training an online learning model is defined based on the feature space. The Kalman filter is used to smooth the sensor signal.

[0008] Receive sensor signals and determine the first sampling time corresponding to the currently received sensor signal; use the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time; and use the feature generation function to generate a second feature at the first sampling time based on the sensor signal at the first sampling time.

[0009] Using the first feature from the previous sampling time as the input feature and the second feature from the first sampling time as the target, the online learning model is trained using the online learning algorithm to obtain the updated model parameters; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter;

[0010] The state transition matrix of the Kalman filter is updated using the updated model parameters from the online learning model to obtain the updated Kalman filter.

[0011] The state at the first sampling time is processed using the updated Kalman filter to obtain a smoothed sensor signal at the first sampling time; and a first feature at the first sampling time is generated based on the smoothed sensor signal at the first sampling time using the feature generation function.

[0012] Optionally, after determining the first sampling time corresponding to the currently received sensor signal, the method further includes:

[0013] The sensor signal at the first sampling time is subjected to signal integrity and / or timing validity checks. Only after the checks are passed are the steps performed: using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

[0014] Optionally, the timing validity check includes:

[0015] Determine whether the first sampling time is the desired sampling time, wherein the desired sampling time is the next sampling time corresponding to the sampling time of the most recently received sensor signal;

[0016] If the first sampling time is earlier than the desired sampling time, the currently received sensor signal is discarded;

[0017] If the first sampling time is equal to the desired sampling time, the process proceeds to the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0018] If the first sampling time is later than the desired sampling time, the currently received sensor signal is buffered and the system continues to wait to receive the sensor signal at the desired sampling time. Alternatively, the system directly proceeds to the steps of using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

[0019] Optionally, the first feature and the second feature include at least one of the following features: time features, periodic features, geographical features, and trend features corresponding to the sensor signal.

[0020] Optionally, the online learning model is a linear function-based model, and training the online learning model includes:

[0021] The parameters of the linear function are learned using stochastic gradient descent, thus obtaining the model parameters of the online learning model.

[0022] Optionally, the online learning model is a model based on a nonlinear function, and training the online learning model includes:

[0023] When the nonlinear function contains a higher power term of the first characteristic, the higher power term is taken as a state term in the state space, and the value of the higher power term is pre-calculated through the signal conversion function;

[0024] or,

[0025] The nonlinear function is transformed into a polynomial using Taylor expansion, and only the partial derivatives of a finite order are retained to obtain a linear function. The parameters of the linear function are then learned using stochastic gradient descent to obtain the model parameters of the online learning model.

[0026] According to a second aspect of this application, at least one embodiment provides a smoothing device for sensor signals, comprising:

[0027] The configuration module is used to configure the state space of the Kalman filter and the signal conversion function for converting the sensor signal to the state space; configure the feature space for machine learning and the feature generation function for converting the sensor signal to the feature space; and configure an online learning algorithm for training an online learning model based on the feature space; wherein the Kalman filter is used to smooth the sensor signal.

[0028] The receiving module is used to receive sensor signals and determine the first sampling time corresponding to the currently received sensor signal;

[0029] The first conversion module is used to convert the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and to generate a second feature at the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0030] The training module is used to take the first feature from the previous sampling time as the input feature, take the second feature from the first sampling time as the target, and train the online learning model using the online learning algorithm to obtain the updated model parameters of the online learning model; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter;

[0031] The update module is used to update the state transition matrix of the Kalman filter using the updated model parameters of the online learning model, so as to obtain the updated Kalman filter;

[0032] A smoothing module is used to process the state at the first sampling time using the updated Kalman filter to obtain the smoothed sensor signal at the first sampling time.

[0033] The second conversion module is used to generate a first feature at the first sampling time based on the smoothed sensor signal at the first sampling time using the feature generation function.

[0034] Optionally, the above-mentioned device further includes:

[0035] The verification module is used to perform signal integrity and / or timing validity checks on the sensor signal at the first sampling time. Only after the check is passed will the first conversion module be triggered to perform the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0036] Optionally, the timing validity check includes:

[0037] Determine whether the first sampling time is the desired sampling time, wherein the desired sampling time is the next sampling time corresponding to the sampling time of the most recently received sensor signal;

[0038] If the first sampling time is earlier than the desired sampling time, the currently received sensor signal is discarded;

[0039] If the first sampling time is equal to the desired sampling time, the process proceeds to the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0040] If the first sampling time is later than the desired sampling time, the currently received sensor signal is buffered and the system continues to wait to receive the sensor signal at the desired sampling time. Alternatively, the system directly proceeds to the steps of using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

[0041] According to a third aspect of this application, at least one embodiment provides a sensor signal smoothing device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method as described in any of the first aspects.

[0042] According to a fourth aspect of this application, at least one embodiment provides a computer-readable storage medium storing a program that, when executed by a processor, implements the steps of the method as described in any of the first aspects.

[0043] According to a fifth aspect of this application, at least one embodiment provides a computer program product including computer instructions that, when executed by a processor, implement the steps of the method as described in any of the first aspects.

[0044] Compared with existing technologies, the sensor signal smoothing method and apparatus provided in this application utilize online machine learning to capture signal changes in a timely manner. By using the latest parameters of the online machine learning model, the state transition matrix of the Kalman filter is updated in a timely manner, achieving rapid updating of the Kalman filter parameters. This allows for rapid smoothing of noise signals based on the updated Kalman filter. Based on the above method, this application can improve the effectiveness of subsequent applications based on sensor signals. Attached Figure Description

[0045] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0046] Figure 1 This is a schematic diagram of the structure of an application system for a sensor signal smoothing method according to an embodiment of this application;

[0047] Figure 2 This is a flowchart illustrating a method for smoothing sensor signals according to an embodiment of this application.

[0048] Figure 3 This is an example flowchart of a timing validity check in an embodiment of this application;

[0049] Figure 4 This is a flowchart illustrating an implementation example of a sensor signal smoothing method according to an embodiment of this application.

[0050] Figure 5 This is a schematic diagram of a sensor signal smoothing device according to an embodiment of this application;

[0051] Figure 6 This is another schematic diagram of the sensor signal smoothing device according to an embodiment of this application. Detailed Implementation

[0052] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.

[0053] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. The word "and / or" in the specification and claims indicates at least one of the connected objects.

[0054] In the various embodiments of this application, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0055] The following description provides examples and is not intended to limit the scope, applicability, or configuration set forth in the claims. Changes may be made to the function and arrangement of the elements discussed without departing from the spirit and scope of this disclosure. Various procedures or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with reference to certain examples may be combined in other examples.

[0056] As described in the background section, existing methods struggle to quickly filter out sensor noise signals, making it difficult to accurately and quickly capture real user actions based on sensor signals. This application provides a sensor signal smoothing method that combines online machine learning with Kalman filtering. The former iteratively learns the correct system model from the signal, while the latter rapidly smooths the sensor signal based on the continuously improving model, filtering out noise signals and thus improving the effectiveness of subsequent applications, such as facilitating the rapid capture of user behavior.

[0057] Traditional machine learning, also known as batch machine learning, involves preparing training data before training the machine learning model. The machine learning model can select the optimal processing method based on the distribution or characteristics of all training data, and the optimal model is obtained after training. Online machine learning, on the other hand, typically only requires the current data record (such as a recently received sensor signal) to train the machine learning model. The learning algorithm needs to adjust the model parameters based on this current data record. As more data arrives, the machine learning model is continuously improved.

[0058] Figure 1 This application provides a schematic diagram of an application system for a sensor signal smoothing method according to an embodiment of this application. Taking an accelerometer as an example, the system illustrates the functions to be implemented by each component. Specifically, the system includes:

[0059] 1. Signal acquisition section, which may include acceleration signal acquisition equipment, mainly performs the function of periodically acquiring acceleration signals and periodically sending the acquired signals.

[0060] 2. The communication network section is responsible for the real-time and prepared transmission of the acquired signal data. Of course, if the online smoothing function is directly deployed to the signal acquisition device, this communication network and its corresponding transmission module can be omitted.

[0061] 3. The signal collection and processing server section receives the collected signals, performs online data smoothing, and also enables further applications of the smoothed data.

[0062] Figure 2 This application provides a flowchart of a sensor signal smoothing method according to embodiments, such as... Figure 2 As shown, the method includes:

[0063] Step 21: Set the state space of the Kalman filter and set the signal transformation function to convert the sensor signal to the state of the state space; set the feature space of the machine learning and set the feature generation function to convert the sensor signal to the features of the feature space; set the online learning algorithm for training the online learning model according to the feature space; wherein, the Kalman filter is used to smooth the sensor signal.

[0064] The Kalman filter is an algorithm that uses the state equations of a linear system to make an optimal estimate of the system state using observed input and output data. The state equations of the linear system include the following:

[0065] Prediction equation:

[0066]

[0067] P t ′ =AP t-1 A T +Q

[0068] Update equation:

[0069]

[0070] K t =P t ′ H T HP t ′ H T +R) -1

[0071]

[0072] P t =(IK t H)P t ′

[0073] in:

[0074] and These represent the optimized predicted states at time t-1 and time t, respectively, and are one of the results of filtering;

[0075] This represents the predicted state at time t (unoptimized), which is an intermediate calculation result of the filter;

[0076] P t ′ Represents the error matrix at time t (unoptimized);

[0077] P t This represents the optimized error matrix at time t;

[0078] H represents the observation matrix, which is the transformation matrix from state variables to measurements (observations);

[0079] z t Represents the observed value at time t;

[0080] A represents the state transition matrix of the Kalman filter. In this embodiment, the state transition matrix will be updated using the latest parameters of the online machine learning model.

[0081] B represents the input control matrix;

[0082] Q represents the prediction noise covariance matrix;

[0083] R represents the observation noise covariance matrix;

[0084] y represents the residual matrix;

[0085] K t Indicates the Kalman gain at time t;

[0086] Time t-1 represents the time preceding time t. For example, time t-1 and time t represent two adjacent sampling times.

[0087] This application embodiment predefines the state space {x} of the Kalman filter and initializes the initial parameters of the Kalman filter, specifically including the state transition matrix A, the prediction noise covariance matrix Q, and the error matrix P. Specifically, the above matrices can be initialized based on information such as the nominal accuracy of the sensor; this application embodiment does not impose specific limitations on this.

[0088] This application embodiment also pre-sets a signal conversion function to convert the sensor signal into the state of the state space based on the relationship between the sensor signal and the state. in, Indicates sensor signal, This represents the state of the Kalman filter. For example, the transfer function F can be set according to physical laws or experience. Furthermore, embodiments of this application also pre-machine a feature space and set a feature generation function to convert the sensor signal into features of said feature space. Typically, the features of the feature space include, but are not limited to, one or more of the following: time features, periodic features, geographical features, trend features, etc., corresponding to the sensor signals. The definition of G can generally be given based on experience; for example, the feature generation function can be defined based on the functional or mathematical relationship between the sensor signals and the features. Embodiments of this application can also set up an online learning algorithm for training the online learning model based on the feature space and experience.

[0089] Step 22: Receive sensor signals and determine the first sampling time corresponding to the currently received sensor signals; use the signal conversion function to convert the sensor signals at the first sampling time into the state at the first sampling time; and use the feature generation function to generate a second feature at the first sampling time based on the sensor signals at the first sampling time.

[0090] Here, in this embodiment of the application, sensor signals are received periodically, for example, through a communication network. As one embodiment, the sensor signal may specifically be a triaxial acceleration signal. Of course, the sensor signal may also be other signals, such as speed, temperature, humidity, etc., and this embodiment of the application does not specifically limit them.

[0091] Typically, the received sensor signal includes the signal acquisition time (which can be a timestamp or other form). Assuming the sampling time corresponding to the currently received sensor signal is the first sampling time, this embodiment utilizes the signal conversion function set in step 21 to convert the sensor signal at the first sampling time into the state at the first sampling time. Furthermore, it utilizes the feature generation function to convert the sensor signal at the first sampling time into a second feature at the first sampling time.

[0092] Step 23: Using the first feature from the previous sampling time as the input feature and the second feature from the first sampling time as the target, train the online learning model using the online learning algorithm to obtain the updated model parameters of the online learning model; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter.

[0093] Here, an online learning model is trained and updated using an online machine learning algorithm. In this embodiment, the features required for machine learning are predetermined, and the parameters of the online machine learning algorithm are initialized. Then, the first feature from the previous sampling time is used... As input features, the second feature at the first sampling time The online learning model is trained using the online learning algorithm, serving as the output target of the online learning model.

[0094] Specifically, the first feature (such as ) is to use the feature generation function G to smooth the sensor signal (such as The result is obtained by conversion, i.e. The smoothed sensor signal The Kalman filter is used to process the sensor signal. The result is obtained after smoothing. Optionally, the first feature may include one or more of the following: time features, periodic features, geographical features, and trend features corresponding to the sensor signal.

[0095] The second feature (e.g.) ) is to use the feature generation function G to process sensor signals (such as The state obtained by the transformation is, i.e. Optionally, the second feature may also include one or more of the following: time features, periodic features, geographical features, and trend features.

[0096] Thus, in this embodiment of the application, the first feature of the previous time step among two adjacent sampling times is used as the input feature of the model, and the second feature of the next time step among two adjacent sampling times is used as the output target of the model. The model is trained and updated online to obtain the updated model parameters of the online learning model.

[0097] Step 24: Update the state transition matrix of the Kalman filter using the updated model parameters from the online learning model to obtain the updated Kalman filter.

[0098] Here, in this embodiment of the application, the state transition matrix A of the Kalman filter is updated using the updated model parameters, thereby capturing signal changes in a timely manner with the help of online machine learning. By using the latest parameters of the online machine learning model, the state transition matrix of the Kalman filter is updated in a timely manner, and the smoothing of noise signals can be achieved quickly based on the updated Kalman filter.

[0099] Step 25: Using the updated Kalman filter, perform calculations on the state at the first sampling time to obtain the smoothed sensor signal at the first sampling time; and using the feature generation function, generate a first feature at the first sampling time based on the smoothed sensor signal at the first sampling time.

[0100] Here, the updated Kalman filter is used to process the state at the first sampling time. Specifically, the state at the first sampling time can be used as the input to the prediction equation of the Kalman filter (e.g., ...). By calculating the above prediction equation and update equation, the smoothed sensor signal at the first sampling time is obtained, thus achieving rapid smoothing of the noise signal.

[0101] Through the above steps, this embodiment of the application can capture signal changes in a timely manner by leveraging online machine learning. By utilizing the latest parameters of the online machine learning model, the state transition matrix A of the Kalman filter is updated promptly, achieving rapid parameter updates for the Kalman filter. This, in turn, allows for rapid smoothing of noise signals based on the updated Kalman filter. Based on the above method, this embodiment of the application can improve the effectiveness of subsequent applications based on sensor signals.

[0102] In step 25 above, the embodiments of this application may also utilize the feature generation function to transform the smoothed sensor signal at the first sampling time to obtain the first feature at the first sampling time for use in subsequent machine learning.

[0103] In step 22 above, after receiving the sensor signal, this embodiment of the application may further perform signal integrity and / or timing validity checks on the sensor signal at the first sampling time. Only after the checks are passed will the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating the second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0104] Specifically, the signal integrity check can be to detect whether the sensor contains the expected content. The timing validity check specifically determines whether the first sampling time is the expected sampling time, which is the next sampling time after the sampling time corresponding to the most recently received sensor signal. Typically, the expected sampling time and the sampling time corresponding to the most recently received sensor signal are spaced one sampling period apart.

[0105] If the first sampling time is earlier than the desired sampling time, the currently received sensor signal is discarded;

[0106] If the first sampling time is equal to the desired sampling time, the process proceeds to the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0107] If the first sampling time is later than the desired sampling time, the currently received sensor signal is buffered and the system continues to wait to receive the sensor signal at the desired sampling time. Alternatively, the system directly proceeds to the steps of using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

[0108] Figure 3 Taking acceleration signals acquired by an accelerometer as an example, this paper provides a sample workflow for timing validity checking. The process involves checking whether the received signal data contains complete three-dimensional acceleration signals and sampling count information; if any are missing, the signal data is discarded, and the smoothing process ends.

[0109] If the received sample count information is complete (3D acceleration signal and sample count information), then further examine the received sample count information τ. t Compare this to the latest sample count τ (i.e., the current time) recorded locally:

[0110] If τ tIf -τ≤0, meaning the sampling time of the received signal is earlier than the expected sampling time, then the currently received signal data is discarded, and the smoothing process ends.

[0111] If τ t -τ>1, meaning the sampling time of the received signal is later than the expected sampling time. If the real-time requirements of the signal processing system are not high and a suitable waiting time is allowed, the received signal data is returned to the data buffer, and the process ends smoothly. If waiting is not possible, proceed to the next step.

[0112] If the check passes, update the latest sampling count τ = τ in the local record. t Then, proceed with the subsequent processing.

[0113] Figure 4 An implementation example flow of a sensor signal smoothing method according to an embodiment of this application is provided. In this example, the first feature only includes a smoothing state, and the second feature only includes a state. Specifically, this example includes two parts:

[0114] 1. The parameter data initialization section mainly includes three functions:

[0115] (1) The state space definition {x} of the Kalman filter (KF) and the signal transformation function from the input sensor signal to the state. in This includes the state of the target system. The definition of F is generally given based on physical laws or experience. Additionally, the features required for machine learning are defined, thus forming the feature generation function from sensor signals to features. in This includes feature values ​​used for online training of machine learning models. The definition of G is generally given empirically.

[0116] (2) Based on information such as the sensor's nominal accuracy, initialize the relevant KF parameters, and,

[0117] (3) Initialization of parameters for the online machine learning algorithm. Assuming the state of the Kalman filter is defined as vector X, the online machine learning algorithm initializes the parameters as follows: As input, with With this as the goal, machine learning is performed and parameters are adjusted. Here, t represents time, and t+1 is one time unit later than t. This indicates the input sensor signal. The result after smoothing.

[0118] 2. The online operation section implements the following functions:

[0119] (1) Signal preprocessing process as follows Figure 3As shown, the main focus is on checking the validity of the signal to ensure the validity of the received signal, including signal integrity checks and timing validity checks. This example requires the input signal... It includes two parts: one is the sampling time information, and the other is the three-dimensional acceleration signal collected by the accelerometer.

[0120] (2) Each input signal Calculate its corresponding state

[0121] (3) with As feature input, To achieve the goal, select an online machine learning algorithm that meets the input and output requirements, train the online learning model online, and obtain the updated model parameter matrix M.

[0122] (4) Update the state transition function matrix of KF with the algorithm parameter matrix M.

[0123] (5) Run the Kalman filter on the updated parameters to process the signal. Smoothing is performed to obtain the smoothed signal. And output (the numerical value of the position of the black dot in the figure is obtained through the Kalman filter).

[0124] (6) Calculate the new first feature based on the smoothed signal. In preparation for smoothing the next signal use.

[0125] In this embodiment of the application, the online learning model can be a model based on a linear function. In this case, step 23 above, training the online learning model specifically includes: learning the parameters of the linear function through stochastic gradient descent to obtain the model parameters of the online learning model.

[0126] In this embodiment of the application, the online learning model can also be a model based on a nonlinear function. In this case, step 23 above, training the online learning model, includes:

[0127] When the nonlinear function contains a higher power term of the first characteristic, the higher power term is taken as a state term in the state space, and the value of the higher power term is pre-calculated through the signal conversion function;

[0128] or,

[0129] The nonlinear function is transformed into a polynomial using Taylor expansion, retaining only a finite number of partial derivatives (e.g., retaining some partial derivatives, specifically, first-order and second-order partial derivatives) to obtain a linear function. The parameters of this linear function are then learned using stochastic gradient descent to obtain the model parameters of the online learning model. Of course, if higher accuracy is required, more partial derivatives can be retained, for example, third-order partial derivatives.

[0130] Please refer to Figure 5 One structure of the sensor signal smoothing device provided in this application embodiment includes:

[0131] Setting module 51 is used to set the state space of the Kalman filter and set a signal conversion function to convert the sensor signal to the state space; set the feature space of the machine learning and set a feature generation function to convert the sensor signal to the feature space; and set an online learning algorithm for training an online learning model based on the feature space; wherein the Kalman filter is used to smooth the sensor signal;

[0132] The receiving module 52 is used to receive sensor signals and determine the first sampling time corresponding to the currently received sensor signal;

[0133] The first conversion module 53 is used to convert the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and to generate a second feature at the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0134] Training module 54 is used to take the first feature of the previous sampling time as the input feature, take the second feature of the first sampling time as the target, and train the online learning model using the online learning algorithm to obtain the updated model parameters of the online learning model; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter;

[0135] Update module 55 is used to update the state transition matrix of the Kalman filter using the updated model parameters of the online learning model, so as to obtain the updated Kalman filter;

[0136] Smoothing module 56 is used to perform calculations on the state at the first sampling time using the updated Kalman filter to obtain the smoothed sensor signal at the first sampling time.

[0137] The second conversion module 57 is used to generate a first feature at the first sampling time based on the smoothed sensor signal at the first sampling time using the feature generation function.

[0138] Through the above modules, the embodiments of this application can quickly smooth noise signals in sensor signals and improve the effect of subsequent applications based on sensor signals.

[0139] Optionally, the above-mentioned device further includes:

[0140] The verification module is used to perform signal integrity and / or timing validity checks on the sensor signal at the first sampling time. Only after the check is passed will the first conversion module be triggered to perform the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0141] Optionally, the timing validity check includes:

[0142] Determine whether the first sampling time is the desired sampling time, wherein the desired sampling time is the next sampling time corresponding to the sampling time of the most recently received sensor signal;

[0143] If the first sampling time is earlier than the desired sampling time, the currently received sensor signal is discarded;

[0144] If the first sampling time is equal to the desired sampling time, the process proceeds to the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

[0145] If the first sampling time is later than the desired sampling time, the currently received sensor signal is buffered and the system continues to wait to receive the sensor signal at the desired sampling time. Alternatively, the system directly proceeds to the steps of using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

[0146] Optionally, the first feature and the second feature include at least one of the following features: time feature, periodic feature, geographical feature, and trend feature.

[0147] Optionally, the online learning model is a linear function-based model, and the training module is further used to learn the parameters of the linear function through stochastic gradient descent to obtain the model parameters of the online learning model.

[0148] Optionally, the online learning model is a model based on a nonlinear function, and the training module is further used for:

[0149] When the nonlinear function contains a higher power term of the first characteristic, the higher power term is taken as a state term in the state space, and the value of the higher power term is pre-calculated through the signal conversion function;

[0150] or,

[0151] The nonlinear function is transformed into a polynomial using Taylor expansion, and only the partial derivatives of a finite order are retained to obtain a linear function. The parameters of the linear function are then learned using stochastic gradient descent to obtain the model parameters of the online learning model.

[0152] It should be noted that the systems provided in the above embodiments are devices corresponding to the above-described sensor signal smoothing method. The implementation methods in the above embodiments are all applicable to the embodiments of this device and can achieve the same technical effect. The device provided in this application can implement all the method steps implemented in the above method embodiments and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.

[0153] Please refer to Figure 6 The present application provides a schematic diagram of another sensor signal smoothing device, which includes: a processor 601, a transceiver 602, a memory 603, a user interface 604, and a bus interface.

[0154] In this embodiment of the application, the device further includes a program stored on memory 603 and executable on processor 601.

[0155] The transceiver 602 is used to send and receive data under the control of the processor;

[0156] The processor 601 is configured to read the computer program in the memory and perform the following operations:

[0157] A state space for a Kalman filter is defined, along with a signal transformation function to convert the sensor signal to the state space. A feature space for machine learning is defined, along with a feature generation function to convert the sensor signal to the features space. An online learning algorithm for training an online learning model is defined based on the feature space. The Kalman filter is used to smooth the sensor signal.

[0158] Receive sensor signals and determine the first sampling time corresponding to the currently received sensor signal; use the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time; and use the feature generation function to generate a second feature at the first sampling time based on the sensor signal at the first sampling time.

[0159] Using the first feature from the previous sampling time as the input feature and the second feature from the first sampling time as the target, the online learning model is trained using the online learning algorithm to obtain the updated model parameters; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter;

[0160] The state transition matrix of the Kalman filter is updated using the updated model parameters from the online learning model to obtain the updated Kalman filter.

[0161] The updated Kalman filter is used to process the state at the first sampling time to obtain the smoothed sensor signal at the first sampling time; and the feature generation function is used to generate a first feature at the first sampling time based on the smoothed sensor signal at the first sampling time.

[0162] Understandably, in the embodiments of this application, when the computer program is executed by the processor 601, it can implement the various processes of the above-described sensor signal smoothing method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0163] exist Figure 6In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 601) and memory (memory 603). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 602 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different user equipment, the user interface 604 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0164] The processor 601 is responsible for managing the bus architecture and general processing, while the memory 603 can store the data used by the processor 601 when performing operations.

[0165] It should be noted that the device in this embodiment corresponds to the smoothing method for the sensor signal described above. The implementation methods in the above embodiments are all applicable to the embodiments of this device and can achieve the same technical effect. In this device, the transceiver 602 and the memory 603, as well as the transceiver 602 and the processor 601, can be connected via a bus interface. The functions of the processor 601 can also be implemented by the transceiver 602, and vice versa. It should be noted that the device provided in this application embodiment can implement all the method steps implemented in the above method embodiments and achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiments will not be described in detail here.

[0166] In some embodiments of this application, a computer-readable storage medium is also provided, on which a program is stored, which, when executed by a processor, performs the following steps:

[0167] A state space for a Kalman filter is defined, along with a signal transformation function to convert the sensor signal to the state space. A feature space for machine learning is defined, along with a feature generation function to convert the sensor signal to the features space. An online learning algorithm for training an online learning model is defined based on the feature space. The Kalman filter is used to smooth the sensor signal.

[0168] Receive sensor signals and determine the first sampling time corresponding to the currently received sensor signal; use the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time; and use the feature generation function to generate a second feature at the first sampling time based on the sensor signal at the first sampling time.

[0169] Using the first feature from the previous sampling time as the input feature and the second feature from the first sampling time as the target, the online learning model is trained using the online learning algorithm to obtain the updated model parameters; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter;

[0170] The state transition matrix of the Kalman filter is updated using the updated model parameters from the online learning model to obtain the updated Kalman filter.

[0171] The updated Kalman filter is used to process the state at the first sampling time to obtain the smoothed sensor signal at the first sampling time; and the feature generation function is used to generate a first feature at the first sampling time based on the smoothed sensor signal at the first sampling time.

[0172] When executed by the processor, this program can implement all the methods of smoothing sensor signals described above and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0173] This application also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, they implement the various processes of the above-described sensor signal smoothing method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0174] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0175] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0176] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0177] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0178] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0179] If the aforementioned functions are implemented as software functional units 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 this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0180] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for smoothing sensor signals, characterized in that, include: A state space for a Kalman filter is defined, along with a signal transformation function to convert the sensor signal to the state space. A feature space for machine learning is defined, along with a feature generation function to convert the sensor signal to the features space. An online learning algorithm for training an online learning model is defined based on the feature space. The Kalman filter is used to smooth the sensor signal. Receive sensor signals and determine the first sampling time corresponding to the currently received sensor signal; use the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time; and use the feature generation function to generate a second feature at the first sampling time based on the sensor signal at the first sampling time. Using the first feature from the previous sampling time as the input feature and the second feature from the first sampling time as the target, the online learning model is trained using the online learning algorithm to obtain the updated model parameters; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter; The state transition matrix of the Kalman filter is updated using the updated model parameters from the online learning model to obtain the updated Kalman filter. The updated Kalman filter is used to process the state at the first sampling time to obtain the smoothed sensor signal at the first sampling time; and the feature generation function is used to generate a first feature at the first sampling time based on the smoothed sensor signal at the first sampling time.

2. The method as described in claim 1, characterized in that, After determining the first sampling time corresponding to the currently received sensor signal, the method further includes: The sensor signal at the first sampling time is subjected to signal integrity and / or timing validity checks. Only after the checks are passed are the steps performed: using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

3. The method as described in claim 2, characterized in that, The timing validity check includes: Determine whether the first sampling time is the desired sampling time, wherein the desired sampling time is the next sampling time corresponding to the sampling time of the most recently received sensor signal; If the first sampling time is earlier than the desired sampling time, the currently received sensor signal is discarded; If the first sampling time is equal to the desired sampling time, the process proceeds to the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function. If the first sampling time is later than the desired sampling time, the currently received sensor signal is buffered and the system continues to wait to receive the sensor signal at the desired sampling time. Alternatively, the system directly proceeds to the steps of using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

4. The method as described in claim 1, characterized in that, The first feature and the second feature include at least one of the following features: time features, periodic features, geographical features, and trend features corresponding to the sensor signal.

5. The method as described in claim 1, characterized in that, The online learning model is a linear function-based model, and training the online learning model includes: The parameters of the linear function are learned using stochastic gradient descent, thus obtaining the model parameters of the online learning model.

6. The method as described in claim 1, characterized in that, The online learning model is a model based on a nonlinear function, and training the online learning model includes: When the nonlinear function contains a higher power term of the first characteristic, the higher power term is taken as a state term in the state space, and the value of the higher power term is pre-calculated through the signal conversion function; or, The nonlinear function is transformed into a polynomial using Taylor expansion, and only the partial derivatives of a finite order are retained to obtain a linear function. The parameters of the linear function are then learned using stochastic gradient descent to obtain the model parameters of the online learning model.

7. A smoothing device for sensor signals, characterized in that, include: The configuration module is used to configure the state space of the Kalman filter and the signal conversion function for converting the sensor signal to the state space; configure the feature space for machine learning and the feature generation function for converting the sensor signal to the feature space; and configure an online learning algorithm for training an online learning model based on the feature space; wherein the Kalman filter is used to smooth the sensor signal. The receiving module is used to receive sensor signals and determine the first sampling time corresponding to the currently received sensor signal; The first conversion module is used to convert the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and to generate a second feature at the first sampling time based on the sensor signal at the first sampling time using the feature generation function. The training module is used to take the first feature from the previous sampling time as the input feature, take the second feature from the first sampling time as the target, and train the online learning model using the online learning algorithm to obtain the updated model parameters of the online learning model; wherein, the previous sampling time is the sampling time corresponding to the most recently received sensor signal before the first sampling time, the first feature is obtained by transforming the smoothed sensor signal using the feature generation function, and the smoothed sensor signal is obtained by smoothing the sensor signal using the Kalman filter; The update module is used to update the state transition matrix of the Kalman filter using the updated model parameters of the online learning model, so as to obtain the updated Kalman filter; The smoothing module is used to process the state at the first sampling time using the updated Kalman filter to obtain the smoothed sensor signal at the first sampling time. The second conversion module is used to generate a first feature at the first sampling time based on the smoothed sensor signal at the first sampling time using the feature generation function.

8. The apparatus as claimed in claim 7, characterized in that, Also includes: The verification module is used to perform signal integrity and / or timing validity checks on the sensor signal at the first sampling time. Only after the check is passed will the first conversion module be triggered to perform the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function.

9. The apparatus as claimed in claim 8, characterized in that, The timing validity check includes: Determine whether the first sampling time is the desired sampling time, wherein the desired sampling time is the next sampling time corresponding to the sampling time of the most recently received sensor signal; If the first sampling time is earlier than the desired sampling time, the currently received sensor signal is discarded; If the first sampling time is equal to the desired sampling time, the process proceeds to the steps of converting the sensor signal at the first sampling time into the state at the first sampling time using the signal conversion function, and generating a second feature of the first sampling time based on the sensor signal at the first sampling time using the feature generation function. If the first sampling time is later than the desired sampling time, the currently received sensor signal is buffered and the system continues to wait to receive the sensor signal at the desired sampling time. Alternatively, the system directly proceeds to the steps of using the signal conversion function to convert the sensor signal at the first sampling time into the state at the first sampling time, and using the feature generation function to generate a second feature of the first sampling time based on the sensor signal at the first sampling time.

10. A computer program product, characterized in that, Includes computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 6.