Single-step data axial calibration method, device and medium
By dividing single-step data into dynamic and static phases and using a dynamic time warping algorithm to match acceleration and gyroscope data, the problem of inconsistent coordinate axis directions in walking state data during indoor positioning was solved, enabling fast and convenient coordinate axis calibration and improving data utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-09
- Publication Date
- 2026-04-10
AI Technical Summary
In indoor positioning, the coordinate axes of walking data are inconsistent due to data collection environment and individual differences. When there is a lack of collected information and relevant data, effective coordinate axis calibration cannot be performed, resulting in low data utilization.
By dividing single-step data into dynamic and static phases, and using a dynamic time warping algorithm to match acceleration and gyroscope data, the vertical, coronal, and sagittal axes of single-step data are determined, thus achieving coordinate axis calibration.
Data axis calibration can be performed quickly and conveniently without relying on data, improving the availability and ease of use of step data.
Smart Images

Figure CN116608854B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of indoor positioning, and more particularly to a single-step data axial calibration method, device and medium. BACKGROUND
[0002] In the research of indoor positioning, it is often necessary to collect and obtain various step state data, such as acceleration speed, gyroscope data, etc., that is, a test person carries a wearable collection device to perform walking motion, and the collection device collects walking state data during the motion process.
[0003] However, due to different data collection environments, different wearing methods of collection devices, or different individual behavior differences of test persons during the motion process, etc., different walking state data collected will often have different coordinate axis directions (relative to the human body direction); for example, when collecting walking state data of a pedestrian walking using an inertial measurement unit, usually, a sensor module is fixed on the heel, ankle or waist, etc. Due to different fixed body parts or fixed directions, the data collected by the sensors fixed on different parts or in different directions will often have different coordinate axis directions, that is, the collected data will have different collection coordinate axis directions; for example, when the sensor is fixed on the heel, the X axis of the sensor collects the walking state data of the pedestrian's foot in the forward and backward direction, and the Y axis collects the walking state data of the foot in the left and right direction. Therefore, before each walking state data is used, it is usually necessary to preprocess the data, including converting the collected walking state data to a unified coordinate axis; and before converting the coordinate axis of the walking state data, it is necessary to first calibrate the coordinate information of the walking state data, that is, to determine the coordinate axis direction (relative to the human body direction) of the walking state data, and to calibrate the positive / negative direction of the corresponding coordinate axis.
[0004] At present, when calibrating the coordinate axis of the walking state data and the positive / negative direction of the coordinate axis, it is often necessary to rely on collection information and related materials such as data collection situation description or data set introduction; if the necessary collection information and related materials are missing, the above-mentioned preprocessing cannot be performed on the data, resulting in the collected walking state data being unable to be utilized, and further resulting in a decrease in the utilization rate of the data.
[0005] Therefore, for walking state data lacking collection information and related materials, how to realize data coordinate axis calibration and coordinate axis positive / negative direction calibration has become a technical problem to be solved in the field. SUMMARY
[0006] In view of the above existing problems in the prior art, the purpose of the present application is to provide a walking state data acquisition method, device and medium, which is used to solve the problem that the effective walking data matching the standard walking template cannot be directly obtained in the existing walking state acquisition process, so that the efficiency or abnormal rate of data acquisition cannot be obtained in time.
[0007] To achieve the above object and other related objects, the present application provides, in a first aspect, a single-step data axial calibration method, comprising: dividing the time sequence of single-step data into a dynamic phase and a static phase; wherein the single-step data comprises each-axis acceleration data and each-axis gyroscope data; obtaining each first calibration data based on the each-axis acceleration data of the sampling points in the dynamic phase, and obtaining each second calibration data based on the each-axis gyroscope data of the sampling points in the static data segment; obtaining acceleration vertical axis template data of the static phase, matching the acceleration vertical axis template data and each of the first calibration data to obtain the first matching distance difference between the acceleration vertical axis template data and each of the first calibration data; extracting the minimum first matching distance difference from each first matching distance difference, and determining the vertical axis of the single-step data based on the first calibration data information corresponding to the minimum first matching distance difference; obtaining gyroscope coronal axis template data of the dynamic phase, matching the gyroscope coronal axis template data and each of the second calibration data to obtain the second matching distance difference between the gyroscope coronal axis template data and each of the second calibration data; extracting the minimum second matching distance difference from each second matching distance difference, and determining the coronal axis of the single-step data based on the second calibration data information corresponding to the minimum second matching distance difference; and determining the sagittal axis of the single-step data based on the vertical axis and the coronal axis of the single-step data.
[0008] In an embodiment of the present application, the time sequence of single-step data is divided into a dynamic phase and a static phase, comprising: obtaining the acceleration module value of each sampling point in the single-step data; determining the static phase cutoff point of the single-step data, so that the acceleration module value information corresponding to the data segment from the starting point of the single-step data to the static phase cutoff point satisfies the acceleration module value determination condition of the static phase; and the time sequence between the starting point and the static phase cutoff point is taken as the static phase of the single-step data; determining the dynamic phase in the single-step data based on the time sequence of the static phase.
[0009] In an embodiment of the present application, the method for obtaining the static phase end point of the single step data comprises: obtaining a data segment between a start point and a current sampling point of the single step data as a current data segment; obtaining a total variance of acceleration module values corresponding to the current data segment, and detecting whether the total variance of acceleration module values is greater than a variance threshold value; if yes, taking the current sampling point as the single static phase end point; if no, updating the current sampling point to a next sampling point of the current sampling point; and repeating the above process until exiting.
[0010] In an embodiment of the present application, the method for obtaining each first to-be-calibrated data based on the axis acceleration data of the sampling point in the dynamic phase comprises: extracting the axis acceleration data of the sampling point in the dynamic phase; performing an inversion process on the axis acceleration data to obtain inverted axis acceleration data; and setting the axis acceleration data and the inverted axis acceleration data as the first to-be-calibrated data.
[0011] In an embodiment of the present application, the method for obtaining each second to-be-calibrated data based on the axis gyroscope data of the sampling point in the static data segment comprises: extracting the axis gyroscope data of the sampling point in the static phase; performing an inversion process on the axis gyroscope data to obtain inverted axis gyroscope data; and setting the axis gyroscope data and the inverted axis gyroscope data as the second to-be-calibrated data.
[0012] In an embodiment of the present application, the method for matching the acceleration vertical axis template data and each first to-be-calibrated data comprises: based on the acceleration vertical axis template data, using a dynamic time warping algorithm to match the acceleration vertical axis template data and each first to-be-calibrated data.
[0013] In an embodiment of the present application, the method for matching the gyroscope coronal axis template data and each second to-be-calibrated data comprises: based on the gyroscope coronal axis template data, using a dynamic time warping algorithm to match the gyroscope coronal axis template data and each second to-be-calibrated data.
[0014] In an embodiment of the present application, after the vertical axis of the single-step data is determined based on the first to-be-calibrated data information corresponding to the minimum first matching distance difference, the walking state data collection method further comprises: obtaining the data mean of the first to-be-calibrated data corresponding to the minimum first matching distance difference; determining the positive direction of the vertical axis of the single-step data based on the comparison result between the data mean of the first to-be-calibrated data and a preset acceleration threshold; and after the coronal axis of the single-step data is determined based on the second to-be-calibrated data information corresponding to the minimum second matching distance difference, the walking state data collection method further comprises: obtaining the data mean of the second to-be-calibrated data corresponding to the minimum second matching distance difference; determining the positive direction of the coronal axis of the single-step data based on the comparison result between the data mean of the second to-be-calibrated data and a preset gyroscope threshold.
[0015] In an embodiment of the present application, the single-step data axis calibration method further comprises: detecting whether the minimum first matching distance difference is greater than a preset first matching distance difference threshold, and if yes, performing coordinate axis calibration on the single-step data; and / or detecting whether the minimum second matching distance difference is greater than a preset second matching distance difference threshold, and if yes, performing coordinate axis calibration on the single-step data.
[0016] In a second aspect, the present application further provides an electronic device, comprising: a memory, a processor and a communicator; wherein the memory is used to store computer instructions; the processor runs the computer instructions to realize the single-step data axis calibration method as described above.
[0017] In a fourth aspect, the present application further provides a computer storage medium, which stores a computer program, and the computer program is executed by a processor to realize the single-step data axis calibration method as described above.
[0018] As described above, the single-step data axis calibration method, device and medium provided by the present application can determine the vertical axis of the single-step data by matching the acceleration vertical axis template in the static phase and the axis acceleration data in the single-step data, and can determine the coronal axis of the single-step data by matching the gyroscope coronal axis template in the dynamic phase and the axis gyroscope data in the single-step data, and further can determine the sagittal axis of the single-step data, so that for the single-step data whose coordinate axis information is unknown, the calibration of the data coordinate axis can be quickly and conveniently realized without relying on the description of the data information, and the availability and convenience of the step data are greatly improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 The vertical axis, coronal axis and sagittal axis distribution schematic diagram of the walking motion space coordinate system in an embodiment of the present application;
[0020] Figure 2 The flowchart of the single-step data axial calibration method in an embodiment of the present application is shown in the figure;
[0021] Figure 3 The flowchart of the single-step data vertical axis calibration process in an embodiment of the present application is shown in the figure (taking the first data to be calibrated sta_acc_x as an example);
[0022] Figure 4 The flowchart of the single-step data coordinate axis calibration in an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0023] The embodiments of the present application are described below in detail with specific examples. Those skilled in the art can easily understand other advantages and effects of the present application from the disclosure. The present application can also be implemented or applied in different specific embodiments, and various modifications or changes can be made to the details in the specification without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0024] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner, and only the components related to the present application are shown in the diagrams, not the number, shape and size of the components when actually implemented. The actual implementation of each component may be a random change, and the component layout pattern may be more complex.
[0025] To solve the technical problems existing in the prior art, an axial calibration method for walking state data is provided in an embodiment of the present application, which is used to realize coordinate axis calibration of single-step data.
[0026] The single-step data is the motion state information collected by a collection device (such as an inertial measurement unit) during the walking motion of a single step, including walking acceleration data and walking gyroscope data; the walking acceleration data includes axis acceleration data, and the walking gyroscope data includes axis gyroscope data; the coordinate axis system of the acceleration data is the same as the coordinate axis system set inside the corresponding collection device, and similarly, the coordinate axis system of the gyroscope data is the same as the coordinate axis system set inside the corresponding collection device.
[0027] In this embodiment, the walking motion space coordinate system includes a vertical axis, a sagittal axis and a coronal axis. Please refer to Figure 1 , which shows the distribution of the vertical axis, the coronal axis and the sagittal axis in the walking motion space coordinate system; as Figure 1As shown, the vertical axis is a long axis that runs through the human body in the vertical direction and is perpendicular to the horizontal plane; the sagittal axis is a horizontal axis that runs through the human body in the anterior-posterior direction and is perpendicular to the coronal plane; the coronal axis is a horizontal axis that runs through the human body in the lateral direction and is perpendicular to the sagittal plane.
[0028] Please see Figure 2 The diagram shows a flowchart of the single-step data axial calibration method in this embodiment.
[0029] like Figure 2 As shown, the method includes the following steps:
[0030] S100, the acquisition timing of single-step data is divided into dynamic stage and static stage; wherein, the single-step data includes acceleration data of each axis and gyroscope data of each axis;
[0031] The static phase refers to the walking phase in which the instep briefly contacts the ground and remains relatively still during the walking exercise; the dynamic phase refers to the walking phase from when the instep is lifted off the ground until it contacts the ground again during the walking exercise.
[0032] In this embodiment, the coordinate axis system corresponding to the acceleration data and gyroscope data in the single-step data is the same, that is, the vertical axis direction of the acceleration is the same as the vertical axis direction of the gyroscope, the sagittal axis direction of the acceleration is the same as the sagittal axis direction of the gyroscope, and the coronal axis direction of the acceleration is the same as the coronal axis direction of the gyroscope.
[0033] In this embodiment, the implementation method of dividing the acquisition time sequence of single-step data into dynamic and static stages includes:
[0034] Obtain the acceleration magnitude values of each sampling point in the single-step data;
[0035] In the single-step data, a static phase cutoff point is obtained so that the acceleration modulus information of the data segment from the start point of the single-step data to the static phase cutoff point satisfies the acceleration modulus determination condition of the static phase; then the timing sequence located between the start point and the static phase cutoff point is taken as the timing sequence of the static phase of the single-step data; that is, the data segment located between the start point and the static phase cutoff point is taken as the static phase data segment of the single-step data.
[0036] Specifically, a data segment between a starting point and a current sampling point in the single-step data is obtained as a current data segment; a total variance of an acceleration module value corresponding to the current data segment is obtained; it is detected whether the total variance of the acceleration module value is greater than a variance threshold value; if yes, the current sampling point is taken as a single-static-phase cutoff point, and the current data segment is taken as static-phase data of the single-step data; if no, the current sampling point is updated to a sampling point after the current sampling point; the process is repeated until exiting, so as to obtain a static-phase data segment in the single-step data and take a data collection time sequence corresponding to the static-phase data segment as a time sequence of a static phase.
[0037] Based on the time sequence of the static phase, a dynamic phase in the single-step data is determined.
[0038] Specifically, after the time sequence of the static phase is determined, other time sequences in the single-step data are taken as time sequences of a dynamic phase; that is, after the static-phase data segment is determined, other data segments in the single-step data are taken as dynamic-phase data segments, and data collection time sequences corresponding to the dynamic-phase data segments are taken as time sequences of a dynamic phase.
[0039] S200, based on each-axis acceleration data of a sampling point in the dynamic phase, each first to-be-calibrated data is obtained, and based on each-axis gyroscope data of a sampling point in the static data segment, each second to-be-calibrated data is obtained.
[0040] In a specific embodiment, based on a time sequence range of the dynamic phase, each-axis acceleration data of each sampling point in the dynamic phase is extracted, which is {sta_acc_x, sta_acc_y, sta_acc_z}, and each-axis acceleration data is set as first to-be-calibrated data; and based on a time sequence range of the static phase, three-axis gyroscope data of each sampling point in the static phase is extracted, which is {sdym_gyro_x, dym_gyro_y, dym_gyro_z}; and each gyroscope data is set as second to-be-calibrated data.
[0041] In another embodiment, the axial acceleration data of the sampling point in the dynamic stage is extracted; the axial acceleration data is inverted to obtain inverted axial acceleration data; the axial acceleration data and the inverted axial acceleration data are set as first calibration data; the axial gyroscope data of the sampling point in the static stage is extracted; the axial gyroscope data is inverted to obtain inverted axial gyroscope data; the axial gyroscope data and the inverted axial gyroscope data are set as second calibration data, so as to improve the detection rate of the axial acceleration axial calibration result and improve the accuracy of the calibration result, and avoid problems such as that the axial acceleration cannot be axially calibrated or the calibration result is incorrect due to reverse collection (the actual collection direction of the acceleration data and the collection direction of the acceleration template data are opposite).
[0042] That is, the three-axis acceleration data of the sampling point in the dynamic stage time sequence [sta_beg, sta_end] is extracted, which is:
[0043] {sta_acc_x, sta_acc_y, sta_acc_z}
[0044] sta_acc_x is the first axis acceleration to be calibrated; sta_acc_y is the second axis acceleration to be calibrated; and sta_acc_z is the third axis acceleration to be calibrated.
[0045] The three-axis acceleration data is inverted respectively to obtain inverted three-axis acceleration data, which is:
[0046] sta_acc_x_neg = sta_acc_x * (-1) (1)
[0047] sta_acc_y_neg = sta_acc_y * (-1) (2)
[0048] sta_acc_z_neg = sta_acc_z * (-1) (3)
[0049] sta_acc_x_neg is the first inverted axis acceleration; sta_acc_y_neg is the second inverted axis acceleration; and sta_acc_z_neg is the third inverted axis acceleration.
[0050] sta_acc_x, sta_acc_y, sta_acc_z, sta_acc_x_neg, sta_acc_y_neg, and sta_acc_z_neg are set as first calibration data.
[0051] and extract tri-axial gyroscope data of sampling points in the static phase time sequence [dym_beg, dym_end] as follows:
[0052] {sdym_gyro_x, dym_gyro_y, dym_gyro_z}
[0053] wherein sdym_gyro_x is the first axis acceleration to be calibrated; dym_gyro_y is the second axis acceleration to be calibrated; and dym_gyro_z is the third axis acceleration to be calibrated;
[0054] respectively, to obtain negated tri-axial gyroscope data as follows:
[0055] dym_gyro_x_neg = dym_gyro_x * (-1) (4)
[0056] dym_gyro_y_neg = dym_gyro_y * (-1) (5)
[0057] dym_gyro_z_neg = dym_gyro_z * (-1) (6)
[0058] dym_gyro_x, dym_gyro_y, dym_gyro_z, dym_gyro_x_neg, dym_gyro_y_neg and dym_gyro_z_neg are set as the second calibration data.
[0059] S300, acceleration vertical axis template data of the static phase is obtained, the acceleration vertical axis template data is matched with the first calibration data, a first matching distance difference between the acceleration vertical axis template data and the first calibration data is obtained, the smallest first matching distance difference in each first matching distance difference is extracted, a vertical axis of the single step data is determined based on the first calibration data corresponding to the smallest first matching distance difference, gyroscope coronal axis template data of the dynamic phase is obtained, the gyroscope coronal axis template data is matched with the second calibration data, a second matching distance difference between the gyroscope coronal axis template data and the second calibration data is obtained, the smallest second matching distance difference in each second matching distance difference is extracted, and a coronal axis of the single step data is determined based on the second calibration data corresponding to the smallest second matching distance difference.
[0060] The acceleration vertical axis template data of the static phase is a distribution feature of standard acceleration data located in a single step static phase; and the gyroscope coronal axis template data of the dynamic phase is a distribution feature of standard gyroscope data located in a single step dynamic phase.
[0061] In a specific embodiment, when the step S300 is executed, it includes: based on the acceleration vertical axis template data, using a dynamic time warping algorithm to match each of the first to-be-calibrated data and the acceleration vertical axis template data, to obtain a first matching distance difference between each of the first to-be-calibrated data and the acceleration vertical axis template data; taking the smallest first matching distance difference in each first matching distance difference as the smallest first matching distance difference, and then determining the axis where the first to-be-calibrated data corresponding to the smallest first matching distance difference is located as the vertical axis of the single step data.
[0062] In addition, based on the gyroscope coronal axis template data, using a dynamic time warping algorithm to match each of the second to-be-calibrated data and the gyroscope coronal axis template data, to obtain a second matching distance difference between each of the second to-be-calibrated data and the gyroscope coronal axis template data; taking the smallest second matching distance difference in each second matching distance difference as the smallest second matching distance difference, and then determining the axis where the second to-be-calibrated data corresponding to the smallest second matching distance difference is located as the coronal axis of the single step data.
[0063] The first matching distance difference is the closeness of the feature similarity between the acceleration vertical axis template data and each of the first to-be-calibrated data when feature matching is performed therebetween; the greater the matching distance difference is, the greater the feature difference between them is, and vice versa; the second matching distance difference is the closeness of the feature similarity between the gyroscope coronal axis template data and each of the second to-be-calibrated data when feature matching is performed therebetween; the greater the matching distance difference is, the greater the feature difference between them is, and vice versa.
[0064] In a specific embodiment, as shown in Figure 3 The vertical axis calibration process of the single step data includes, for example, the first to-be-calibrated data sta_acc_x, the following steps.
[0065] S301, based on the acceleration vertical axis template data tplt and the first to-be-calibrated data sta_acc_x, using the Euclidean distance method to calculate the acceleration distance matrix d n,m , which is:
[0066]
[0067] sta_acc_x nis the n th data sampling point in the first to-be-calibrated data sta_acc_x; tplt m is the m th template sampling point in the acceleration vertical axis template data, and M is the total number of template sampling points;
[0068] S302, based on the acceleration distance matrix d n,m , a distance cumulative matrix C is obtained according to a dynamic programming method N,M is:
[0069]
[0070] wherein, C i,j is each element in the cumulative distance matrix C N,M , that is, the start point in the sta_acc_x to the i th data sampling point sta_acc_x i and the start point in the acceleration vertical axis template data to the j th template sampling point tplt m after matching, the minimum value of the sum of the distances of the matching points.
[0071] S303, determining the minimum distance cumulative value in the distance cumulative matrix C N,M as the first matching distance difference between the acceleration vertical axis template data tplt and the first to-be-calibrated data sta_acc_x.
[0072] Specifically, in the last row of the distance cumulative matrix C N,M , the minimum value in the row is selected, that is, the minimum distance cumulative value in the distance cumulative matrix C N,M .
[0073] By using the above steps S301 to S303, the acceleration vertical axis template data tplt and other first to-be-calibrated data are matched, and the first matching distance difference between the acceleration vertical axis template data and the other first to-be-calibrated data is obtained respectively.
[0074] The sizes of the first matching distance differences are compared, the axis direction in which the first to-be-calibrated data corresponding to the minimum first matching distance difference is located is determined as the vertical axis of the single-step data, and the acceleration data corresponding to the minimum first matching distance difference is determined as the vertical axis acceleration data.
[0075] respectively, to obtain a first matching distance difference between tplt and sta_acc_y, tplt and sta_acc_z, tplt and sta_acc_x_neg, tplt and sta_acc_y_neg, and tplt and sta_acc_z_neg respectively; if the first matching distance difference between tplt and sta_acc_z is the smallest, then sta_acc_z is determined as the vertical axis acceleration data, and the axis direction where sta_acc_z is located is determined as the vertical axis of the single step data.
[0076] Similarly, the gyroscope coronal axis template data and each of the second to be calibrated data are matched by using the dynamic time warping algorithm, and the implementation process is the same as that of matching the acceleration vertical axis template data and each of the first to be calibrated data by using the dynamic time warping algorithm, which will not be described herein again.
[0077] A second matching distance difference between the gyroscope coronal axis template data and each of the second to be calibrated data is obtained, and the sizes of each second matching distance difference are compared, and the axis direction where the second to be calibrated data corresponding to the smallest second matching distance difference is located is determined as the coronal axis of the single step data, that is, the gyroscope data corresponding to the smallest second matching distance difference is determined as the coronal axis gyroscope data.
[0078] S400, determining the sagittal axis of the single step data based on the vertical axis and the coronal axis of the single step data.
[0079] Since the coordinate axis systems of the acceleration data and the gyroscope data in the single step data are the same, after the axis direction of the vertical axis acceleration is determined, the gyroscope data in the same axis direction is determined as the vertical axis gyroscope data; based on the axis direction of the calibrated vertical axis gyroscope data and the axis direction of the coronal axis gyroscope data, the sagittal axis gyroscope data is determined from the remaining uncalibrated gyroscope data according to the right-hand rule, and the axis direction of the sagittal axis gyroscope data is the sagittal axis of the single step data.
[0080] Optionally, the single step data axis calibration method, when performing step S300, further comprises:
[0081] obtaining the data mean of the first to be calibrated data corresponding to the smallest first matching distance difference; and determining the positive direction of the vertical axis of the single step data based on the data mean of the first to be calibrated data.
[0082] and obtaining a data mean of the second to-be-calibrated data corresponding to the minimum second matching distance difference; determining a positive direction of a coronal axis of single-step data based on the data mean of the second to-be-calibrated data.
[0083] Specifically, after determining the minimum first matching distance difference, the first to-be-calibrated data corresponding to the minimum first matching distance difference is set as acc_sel_axis.
[0084] The acceleration mean acc_mean of the corresponding first to-be-calibrated data acc_sel_axis is calculated as follows:
[0085]
[0086] wherein, acc i Each acceleration sampling point in acc_sel_axis.
[0087] It is detected whether the acceleration mean acc_mean is greater than or equal to a preset acceleration threshold. If yes, the axis direction in which the corresponding first to-be-calibrated data is located is determined as a positive direction of a perpendicular axis of single-step data. If no, the axis direction in which the corresponding first to-be-calibrated data is located is determined as a negative direction of the perpendicular axis of single-step data.
[0088] Optionally, the acceleration threshold is 0.
[0089] It is to be noted that when the first to-be-calibrated data acc_sel_axis corresponding to the minimum first matching distance difference is inverted acceleration data, the above-mentioned perpendicular axis positive and negative direction determination method is inverted, that is, when the corresponding acceleration mean acc_mean is greater than or equal to a preset acceleration threshold, the axis direction in which the corresponding first to-be-calibrated data is located is determined as a negative direction of a perpendicular axis of single-step data; when the corresponding acceleration mean acc_mean is less than the preset acceleration threshold, the axis direction in which the corresponding first to-be-calibrated data is located is determined as a positive direction of the perpendicular axis of single-step data.
[0090] Similarly, after determining the minimum second matching distance difference, the second to-be-calibrated data corresponding to the minimum second matching distance difference is set as gyro_sel_axis.
[0091] The acceleration mean gyro_mean of the second to-be-calibrated data gyro_sel_axis corresponding to the minimum second matching distance difference is calculated as follows:
[0092]
[0093] wherein, gyro iSample points of each gyroscope in gyro_sel_axis.
[0094] Detect whether the gyroscope mean gyro_mean is greater than or equal to a preset gyroscope threshold value, if yes, determine the axis direction of the corresponding second calibration data as the positive direction of the coronal axis of the single-step data; if no, determine the axis direction of the corresponding second calibration data as the negative direction of the coronal axis of the single-step data.
[0095] Optionally, the gyroscope threshold value is 0.
[0096] It should be noted that when the second calibration data gyro_sel_axis corresponding to the minimum second matching distance difference is the negated gyroscope data, the determination method of the positive and negative directions of the coronal axis is negated after determination, that is, when the gyroscope mean gyro_mean corresponding thereto is greater than or equal to a preset gyroscope threshold value, the axis direction of the corresponding second calibration data is determined as the negative direction of the coronal axis of the single-step data; when the gyroscope mean gyro_mean corresponding thereto is less than the preset gyroscope threshold value, the axis direction of the corresponding second calibration data is determined as the positive direction of the coronal axis of the single-step data.
[0097] To solve the technical problems in the prior art, the application further provides a single-step data axis calibration method in another embodiment.
[0098] In this embodiment, the single-step data axis calibration method is compared with Figure 2 The method shown, after step S400, further includes:
[0099] S500, detecting whether the minimum first matching distance difference is greater than a preset first matching distance difference threshold value, if yes, performing coordinate axis calibration on the single-step data; and / or detecting whether the minimum second matching distance difference is greater than a preset second matching distance difference threshold value, if yes, performing coordinate axis calibration on the single-step data.
[0100] When it is detected that the minimum first matching distance difference is greater than the preset first matching distance difference threshold value, and / or the minimum second matching distance difference is greater than the preset second matching distance difference threshold value, it indicates that there is a deviation between the coordinate axis direction of the single-step data in actual collection and the preset coordinate axis direction.
[0101] In this embodiment, the coordinate axis calibration on the single-step data includes:
[0102] Based on the gyro data, the acceleration data and the gravity acceleration of each axis in the static stage, a direction estimation matrix of each sampling point in the static stage is obtained; and based on the corresponding direction estimation matrix, the axis calibration is performed on the acceleration data and the gyro data of each sampling point in the single-step data.
[0103] The direction estimation matrix is a conversion matrix for converting the internal coordinate system of the sensor to the walking motion space coordinate system.
[0104] Specifically, as shown in Figure 4 The axis calibration is performed on the acceleration data and the gyro data of each sampling point in the single-step data, and the step includes:
[0105] S501, the average value of the gyro data of each axis in the static stage in the single-step data is obtained as the static bias of the gyro data;
[0106] That is
[0107]
[0108]
[0109]
[0110]
[0111] gyro_x j , gyro_y j , gyro_z j is the gyro data of each axis of each sampling point in the static stage; [sta beg , sta_end] is the start and end points of the static stage; N is the number of sampling points in the static stage; gyro_x_mean, gyro_y_mean, gyro_z_mean are the average values of the gyro data of each axis in the static stage; is the static bias of the gyro data.
[0112] S502, based on the static bias of the gyro data, the axis calibration is performed on the gyro data of each sampling point in the single-step data to obtain the corrected gyro data of each sampling point;
[0113] Specifically, based on the static bias of the gyro data, the static error in the gyro data of each axis is removed; that is:
[0114]
[0115]
[0116]
[0117] wherein is the three-axis gyroscope data of each sampling point at each time t, is the three-axis gyroscope data of each sampling point at each time t after removing static error.
[0118] S503, obtaining the average of each axis acceleration data of each sampling point in the static phase; based on the average of each axis acceleration data and the gravitational acceleration, initializing the angle matrix in the static phase to obtain the initialized angle matrix;
[0119] Specifically, the average of each axis acceleration data of each sampling point in the static phase is obtained, which is:
[0120]
[0121]
[0122]
[0123] wherein, is the average of the vertical axis acceleration data; is the average of the coronal axis acceleration data; is the average of the sagittal axis acceleration data.
[0124] Based on the average of each axis acceleration data and the gravitational acceleration, the initialized angle matrix is obtained, which is:
[0125]
[0126] wherein,
[0127]
[0128] φ y = 0 (25)
[0129] wherein, φ p is the simulated pitch angle, φ r is the simulated roll angle, and φ y is the simulated yaw angle.
[0130] S504, based on the corrected each axis gyroscope data of each sampling point, constructing the angular velocity symmetric matrix of each sampling point;
[0131] is:
[0132]
[0133] wherein, Ω tis the angular velocity symmetric matrix of each sampling point; ω x , ω y , ω z is the three-axis gyroscope data of each sampling point.
[0134] S505, based on the angular velocity symmetric matrix, and the initialized angle matrix, the direction estimation matrix of each sampling point is obtained;
[0135] Specifically, based on the direction estimation matrix of the last sampling point and the angular velocity symmetric matrix of the current sampling point, the direction estimation matrix of the current sampling point is obtained, which is:
[0136] C t =C t-1 *(2*I 3*3 +Ω t *ts) / (2*I 3*3 -Ω t *ts) (27)
[0137] Wherein, C t-1 is the direction estimation matrix of the last time; C t is the current direction estimation matrix; I 3*3 is the unit matrix, Ω t is the angular velocity symmetric matrix of the current sampling point, and ts is the time interval between each sampling point.
[0138] It should be noted that for the initial sampling point (the first sampling point), the corresponding direction estimation matrix is the initialized angle matrix, that is, C0.
[0139] S506, based on the direction estimation matrix of the current sampling point, the coordinate axis calibration is performed on the acceleration data of each axis of the current sampling point.
[0140] is
[0141]
[0142] Wherein, acc_n t is the calibrated acceleration data of each axis of the current sampling point; acc t is the acceleration data of each axis of the current sampling point before calibration; C t is the current direction estimation matrix; C t-1 is the direction estimation matrix of the last time; I 3*3 is the unit matrix, Ω t is the angular velocity symmetric matrix, and ts is the time interval between each sampling point.
[0143] To solve the technical problems existing in the prior art, the present application further provides an electronic device for realizing single-step data coordinate axis calibration in an embodiment.
[0144] The electronic device comprises a processor, a communicator and a memory; wherein the memory is used to store computer instructions; the processor runs the computer instructions to realize the steps of the single-step data axial calibration method; the communicator is used to establish a connection with one or more acquisition devices to realize interaction. Figure 1 The electronic device comprises a processor, a communicator and a memory; wherein the memory is used to store computer instructions; the processor runs the computer instructions to realize the steps of the single-step data axial calibration method; the communicator is used to establish a connection with one or more acquisition devices to realize interaction.
[0145] In some embodiments, the number of memories in the data terminal device can be one or more, the number of processors can be one or more, and the number of communicators can be one or more.
[0146] The memory can comprise a random access memory (RAM) and a non-volatile memory such as at least one disk memory. The memory stores an operating system and operation instructions, executable modules or data structures, or subsets or extended sets thereof, wherein the operation instructions can comprise various operation instructions for realizing various operations. The operating system can comprise various system programs for realizing various basic services and processing hardware-based tasks.
[0147] The processor can be a general-purpose processor including a central processing unit (CPU), a network processor (NP) and the like; and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0148] The communicator preferably adopts a communication port.
[0149] In some specific applications, the various components of the electronic device are coupled together through a bus system, wherein the bus system can comprise a data bus, a power bus, a control bus and a status signal bus and the like in addition to the data bus.
[0150] In an embodiment of the present application, the present application further provides a computer readable storage medium having a computer program stored thereon, wherein the program is called by a processor to realize the steps of the single-step data axial calibration method. Figure 1 The electronic device comprises a processor, a communicator and a memory; wherein the memory is used to store computer instructions; the processor runs the computer instructions to realize the steps of the single-step data axial calibration method; the communicator is used to establish a connection with one or more acquisition devices to realize interaction.
[0151] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operations to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0152] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operations to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0153] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operations to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0154] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operations to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0155] In summary, the single-step data axial calibration method, device and medium provided by the application can determine the vertical axis of single-step data by matching the acceleration vertical axis template data in the static phase and the axis acceleration data in the single-step data, and can determine the coronal axis of single-step data by matching the gyroscope coronal axis template data in the dynamic phase and the axis gyroscope data in the single-step data, and further can determine the sagittal axis of single-step data, so that for single-step data with different or unknown coordinate axis systems, the calibration of data coordinate axes can be quickly and conveniently realized, without relying on the description of data information, thereby improving the availability and convenience of use of the step data; and by dividing the single-step data into static and dynamic phases, and matching different step data in the corresponding phase with obvious characteristics, the accuracy of the matching result can be improved; in addition, by comparing the minimum matching distance difference obtained after matching with the threshold value, when the minimum matching distance difference is greater than the threshold value, the coordinate axis of the step data is calibrated, thereby further improving the availability of the step data.
[0156] The above embodiments only exemplarily illustrate the principles and effects of the application, and are not used to limit the application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the application. Therefore, all equivalent modifications or changes completed by those skilled in the art without departing from the spirit and technical thought disclosed by the application should be covered by the claims of the application.
Claims
1. A single-step data axial calibration method, characterized in that, The method comprises the following steps: dividing the time sequence of single-step data into a dynamic stage and a static stage, wherein the single-step data comprises axis acceleration data and axis gyroscope data; obtaining first calibration data based on the axis acceleration data of the sampling points in the dynamic stage, and obtaining second calibration data based on the axis gyroscope data of the sampling points in the static stage; obtaining acceleration vertical axis template data of the static stage, matching the acceleration vertical axis template data with the first calibration data to obtain a first matching distance difference between the acceleration vertical axis template data and the first calibration data, extracting a minimum first matching distance difference from the first matching distance differences, determining the vertical axis of the single-step data based on the first calibration data information corresponding to the minimum first matching distance difference, obtaining gyroscope coronal axis template data of the dynamic stage, matching the gyroscope coronal axis template data with the second calibration data to obtain a second matching distance difference between the gyroscope coronal axis template data and the second calibration data, and extracting a minimum second matching distance difference from the second matching distance differences, and determining the coronal axis of the single-step data based on the second calibration data information corresponding to the minimum second matching distance difference; determining the sagittal axis of the single-step data based on the vertical axis and the coronal axis of the single-step data.
2. The single step data axial calibration method of claim 1, wherein, The method of dividing the time sequence of single-step data into a dynamic stage and a static stage comprises the following steps: obtaining the acceleration module value of each sampling point in the single-step data; determining the static stage cutoff point of the single-step data, so that the acceleration module value information corresponding to the data segment between the starting point of the single-step data and the static stage cutoff point satisfies the acceleration module value determination condition of the static stage; and regarding the time sequence between the starting point and the static stage cutoff point as the static stage of the single-step data; determining the time sequence of the dynamic stage in the single-step data based on the time sequence of the static stage.
3. The single step data axial calibration method of claim 2, wherein, The implementation manner of obtaining the static stage cutoff point of the single-step data comprises the following steps: obtaining the data segment between the starting point of the single-step data and the current sampling point as a current data segment; obtaining the total variance of the acceleration module value corresponding to the current data segment, and detecting whether the total variance of the acceleration module value is greater than a variance threshold value; if yes, regarding the current sampling point as the static stage cutoff point; and if no, updating the current sampling point to the next sampling point of the current sampling point and re-executing the above steps.
4. The single step data axial calibration method of claim 1, wherein, The method of obtaining the first calibration data based on the axis acceleration data of the sampling points in the dynamic stage comprises the following steps: extracting the axis acceleration data of the sampling points in the dynamic stage; performing inversion processing on the axis acceleration data to obtain inverted axis acceleration data; and regarding the axis acceleration data and the inverted axis acceleration data as the first calibration data.
5. The single step data axial calibration method of claim 1, wherein, The method of obtaining the second calibration data based on the axis gyroscope data of the sampling points in the static stage comprises the following steps: extracting the axis gyroscope data of the sampling points in the static stage; The each-axis gyroscope data is negated to obtain negated each-axis gyroscope data; and The each-axis gyroscope data and the negated each-axis gyroscope data are set as second calibration data.
6. The single step data axial calibration method of claim 1, wherein, The matching of the acceleration vertical axis template data and each first calibration data comprises: Based on the acceleration vertical axis template data, a dynamic time warping algorithm is used to match the acceleration vertical axis template data and each first calibration data.
7. The single step data axial calibration method of claim 1, wherein, The matching of the gyroscope coronal axis template data and each second calibration data comprises: Based on the gyroscope coronal axis template data, a dynamic time warping algorithm is used to match the gyroscope coronal axis template data and each second calibration data.
8. The single step data axial calibration method of claim 1, wherein, After determining the vertical axis of the single-step data based on the first calibration data information corresponding to the minimum first matching distance difference, the single-step data axial calibration method further comprises: Obtaining the data mean of the first calibration data corresponding to the minimum first matching distance difference; determining the positive direction of the vertical axis of the single-step data based on the comparison result between the data mean of the first calibration data and a preset acceleration threshold value; and After determining the coronal axis of the single-step data based on the second calibration data information corresponding to the minimum second matching distance difference, the single-step data axial calibration method further comprises: Obtaining the data mean of the second calibration data corresponding to the minimum second matching distance difference; determining the positive direction of the coronal axis of the single-step data based on the comparison result between the data mean of the second calibration data and a preset gyroscope threshold value.
9. The single step data axial calibration method of claim 1, wherein, Further comprising: Detecting whether the minimum first matching distance difference is greater than a preset first matching distance difference threshold value, and if so, performing coordinate axis calibration on the single-step data; And / or detecting whether the minimum second matching distance difference is greater than a preset second matching distance difference threshold value, and if so, performing coordinate axis calibration on the single-step data.
10. An electronic device, comprising: Comprise: A memory, a processor and a communicator; wherein the memory is used to store computer instructions; the processor runs the computer instructions to realize the single-step data axial calibration method according to any one of claims 1 to 9.
11. A computer storage medium storing a computer program, the computer program comprising instructions, which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 10. The computer program is executed by the processor to realize the single-step data axial calibration method according to any one of claims 1 to 9.