A data down-sampling method, apparatus, device and medium

By using an adaptive data downsampling method, the problem of balancing compression error and compression ratio in AR smart swimming goggles is solved, achieving efficient storage and transmission of data processing in AR smart swimming goggles.

CN116126816BActive Publication Date: 2026-04-28LIGHTIN INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LIGHTIN INC
Filing Date
2022-12-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies in AR smart swimming goggles struggle to simultaneously reduce compression errors and compression ratios, leading to a burden on the storage and transmission of data in embedded devices.

Method used

An adaptive data downsampling method is adopted. By acquiring inertial sensor data, dividing the window and assigning multiple preset downsampling frequencies, the actual downsampling frequency is determined based on the spectrum vector, thus avoiding the use of the same sampling period for different frequency components.

Benefits of technology

This technology enables the reduction of compression errors and compression ratios in AR smart swimming goggles, thereby reducing data storage and transmission pressure and improving the accuracy and efficiency of data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126816B_ABST
    Figure CN116126816B_ABST
Patent Text Reader

Abstract

The application discloses a data downsampling method and device, equipment and medium, and relates to the technical field of data processing. The method is applied to AR intelligent swimming glasses provided with an inertial sensor, and comprises the following steps: acquiring swimming data collected by the inertial sensor and dividing the swimming data to obtain divided data, obtaining window data after window division, and assigning a preset downsampling frequency to each window data. At this time, the same sampling period is avoided, and the compression error and the compression ratio are avoided from being increased. The score of the window data is determined according to the preset downsampling frequency, and the maximum value corresponding to the downsampling frequency in all scores is extracted as an actual downsampling frequency, so that the swimming data is downsampled according to the actual downsampling frequency. Since the values of the compression error and the compression ratio depend on the sampling frequency, assigning multiple preset downsampling frequencies to the window data can simultaneously consider reducing the compression error and reducing the compression ratio, and thus a suitable actual sampling frequency for the data downsampling operation is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data downsampling method, apparatus, device and medium. Background Technology

[0002] AR smart swimming goggles are equipped with a 6-axis inertial measurement unit (IMU). To obtain timely and accurate motion status, the inertial sensor can be configured with a high frame rate; for example, the IMU can be configured up to 1000Hz, and its 6-axis data can transmit 6000 data points per second. The transmission and processing of large amounts of data is a burden on embedded devices. To alleviate this burden, one approach is to configure a lower frame rate, but this inevitably results in the loss of motion details reflected in the data. Another approach is to first compress the data, using downsampling to obtain a portion of the data; then, linear interpolation is performed to restore the data. The average absolute value of the difference between the downsampled and restored data and the original data is called the compression error; the ratio of the size of the downsampled data to the size of the original data is called the compression ratio. Compression error and compression ratio are two important indicators in the downsampling process, and they are inversely related. When swimming while wearing AR smart goggles, the high-frequency data from the IMU (Installation Unit) is used to determine turns, stroke counts, and swimming stroke parameters. The large amount of data presents a significant challenge to the storage and transmission of the microcontroller unit (MCU). Therefore, downsampling can be used to process the data and obtain a smaller, more useful dataset. However, using only one downsampling frequency in a complete swimming dataset results in different frequency components being downsampled with the same sampling period. This means that both rapidly changing and slowly changing phases of the data are sampled using the same sampling period, leading to increased compression error and compression ratio. To reduce compression error, a higher sampling frequency is typically used; to achieve a lower compression ratio, a lower sampling frequency is needed. Therefore, achieving both low compression error and a low compression ratio is a challenging problem.

[0003] Given the aforementioned problems, finding a way to simultaneously reduce compression error and compression ratio, thereby obtaining a suitable sampling frequency when performing downsampling operations on data, is a problem that those skilled in the art strive to solve. Summary of the Invention

[0004] The purpose of this application is to provide a data downsampling method, apparatus, device, and medium that simultaneously considers reducing compression error and reducing compression ratio, thereby obtaining a suitable sampling period when performing downsampling operations on data.

[0005] To address the aforementioned technical problems, this application provides a data downsampling method applied to AR smart swimming goggles equipped with an inertial sensor, comprising:

[0006] Acquire swimming data collected by inertial sensors;

[0007] Divide the swimming data into segments and obtain the segmented data after multiple segments;

[0008] The data is divided into windows to obtain multiple window data, wherein the number of window data is no greater than the number of data segments.

[0009] Assign multiple preset downsampling frequencies to each window of data;

[0010] The score of the window data is determined based on the preset downsampling frequency, and the downsampling frequency corresponding to the maximum value among all scores is extracted as the actual downsampling frequency, so as to facilitate downsampling of the swimming data according to the actual downsampling frequency.

[0011] Preferably, the data is divided into windows to obtain multiple window data, including:

[0012] Based on the principle of discrete Fourier transform, the spectrum vector corresponding to the partitioned data is determined;

[0013] Get all the partitioned data contained in the current window and the spectrum vectors corresponding to all the partitioned data in the current window;

[0014] The spectrum vector of the current window is determined based on the spectrum vector corresponding to the partitioned data;

[0015] The data is divided into multiple windows based on the spectrum vector of the current window and the spectrum vector of the next segment of data.

[0016] Preferably, after dividing the data into windows based on the spectrum vector of the current window and the spectrum vector corresponding to the next segment of data, before obtaining multiple window data, the method further includes:

[0017] The difference is obtained by subtracting the spectrum vector of the current window from the spectrum vector of the next segment of data.

[0018] Determine whether the difference exceeds the distance threshold representing the distance between spectral vectors;

[0019] If so, then determine that the spectrum vector corresponding to the next segment of data does not belong to the current window;

[0020] If not, then determine that the spectrum vector corresponding to the next segment of data belongs to the current window.

[0021] Preferably, after determining that the spectrum vector corresponding to the next segment of data does not belong to the current window, the method further includes:

[0022] Update the spectrum vector of the next window in the current window to the spectrum vector corresponding to the next segment of data.

[0023] Preferably, after determining that the spectrum vector corresponding to the next segment of data belongs to the current window, the method further includes:

[0024] Update the spectrum vector of the current window, where the updated spectrum vector of the current window includes the spectrum vector corresponding to the next segment of data.

[0025] Preferably, determining the spectrum vector of the current window based on the spectrum vector corresponding to the partitioned data includes:

[0026] Take the average value of the spectrum vectors corresponding to all the partitioned data, and set the average value as the spectrum vector of the current window.

[0027] Preferably, the division of swimming data includes:

[0028] Swimming data is divided into preset lengths.

[0029] To address the aforementioned technical problems, this application also provides a data downsampling device for use in AR smart swimming goggles equipped with an inertial sensor, comprising:

[0030] The first acquisition module is used to acquire swimming data collected by the inertial sensor;

[0031] The first segmentation module is used to segment the swimming data and obtain segmented data after multiple segments;

[0032] The first window partitioning module is used to partition the partitioned data into multiple window data, wherein the number of window data is no greater than the number of partitioned data;

[0033] The assignment module is used to assign multiple preset downsampling frequencies to each window of data;

[0034] The determination and extraction module is used to determine the score of the window data according to the preset downsampling frequency, and extract the downsampling frequency corresponding to the maximum value among all scores as the actual downsampling frequency, so as to facilitate downsampling of swimming data according to the actual downsampling frequency.

[0035] In addition, the device also includes the following modules:

[0036] The data is divided into windows, resulting in multiple window data sets, including:

[0037] The first determining module is used to determine the spectrum vector corresponding to the partitioned data based on the principle of discrete Fourier transform.

[0038] The second acquisition module is used to acquire all the partitioned data contained in the current window and the spectrum vectors corresponding to all the partitioned data in the current window.

[0039] The second determining module is used to determine the spectrum vector of the current window based on the spectrum vector corresponding to the partitioned data;

[0040] The second window partitioning module is used to partition the data into multiple windows based on the spectrum vector of the current window and the spectrum vector of the next segment of data.

[0041] Preferably, after dividing the data into windows based on the spectrum vector of the current window and the spectrum vector corresponding to the next segment of data, before obtaining multiple window data, the method further includes:

[0042] The difference module is used to calculate the difference between the spectrum vector of the current window and the spectrum vector corresponding to the next segment of data.

[0043] The judgment module is used to determine whether the difference exceeds the distance threshold representing the distance between spectral vectors;

[0044] If so, the third determination module is triggered to determine whether the spectrum vector corresponding to the next segment of data does not belong to the current window;

[0045] If not, the fourth determination module is triggered to determine whether the spectrum vector corresponding to the next segment of data belongs to the current window.

[0046] Preferably, after determining that the spectrum vector corresponding to the next segment of data does not belong to the current window, the method further includes:

[0047] The first update module is used to update the spectrum vector of the next window of the current window to the spectrum vector corresponding to the next segment of data.

[0048] Preferably, after determining that the spectrum vector corresponding to the next segment of data belongs to the current window, the method further includes:

[0049] The second update module is used to update the spectrum vector of the current window, wherein the updated spectrum vector of the current window includes the spectrum vector corresponding to the next segment of data.

[0050] Preferably, determining the spectrum vector of the current window based on the spectrum vector corresponding to the partitioned data includes:

[0051] The averaging module is used to average the spectrum vectors corresponding to all the partitioned data and set the average value as the spectrum vector of the current window.

[0052] Preferably, the division of swimming data includes:

[0053] The second segmentation module is used to segment swimming data into preset lengths.

[0054] To address the aforementioned technical problems, this application also provides a data downsampling device, comprising:

[0055] Memory, used to store computer programs;

[0056] A processor is used to direct computer programs to implement the steps of data downsampling methods.

[0057] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements all the steps of the aforementioned data downsampling method.

[0058] This application provides a data downsampling method applied to AR smart swimming goggles equipped with an inertial sensor. The method includes: acquiring swimming data collected by the inertial sensor; dividing the swimming data into multiple segments; dividing the segmented data into windows to obtain multiple window data, wherein the number of window data is no greater than the number of segments; assigning multiple preset downsampling frequencies to each window data segment, thus avoiding sampling with the same sampling period for both rapid and slow data changes, further preventing increased compression error and compression ratio; determining the score of the window data based on the preset downsampling frequencies, and extracting the downsampling frequency corresponding to the maximum value among all scores as the actual downsampling frequency, so as to facilitate downsampling of the swimming data according to the actual downsampling frequency. Since the values ​​of compression error and compression ratio depend on the sampling frequency, assigning multiple preset downsampling frequencies to each window data segment simultaneously considers reducing compression error and compression ratio, thereby obtaining a suitable sampling frequency for downsampling the data.

[0059] This application also provides a data downsampling device, equipment, and medium, with the same effect as above. Attached Figure Description

[0060] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is a flowchart of a data downsampling method provided in an embodiment of this application;

[0062] Figure 2 This is a structural diagram of a data downsampling device provided in an embodiment of this application;

[0063] Figure 3 This is a structural diagram of a data downsampling device provided in an embodiment of this application;

[0064] Figure 4 This is a schematic diagram of window scoring provided in an embodiment of this application;

[0065] Figure 5 This is a schematic diagram of window data sampling error provided in an embodiment of this application;

[0066] Figure 6 This is a schematic diagram of the window data compression ratio provided in an embodiment of this application. Detailed Implementation

[0067] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0068] The core of this application is to provide a data downsampling method, apparatus, device, and medium that can simultaneously consider reducing compression error and reducing compression ratio, thereby obtaining a suitable sampling period when performing downsampling operations on data.

[0069] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0070] Figure 1 This is a flowchart of a data downsampling method provided in an embodiment of this application, as shown below. Figure 1 As shown, this data downsampling method is applied to AR smart swimming goggles equipped with inertial sensors, including:

[0071] S10: Acquire swimming data collected by the inertial sensor;

[0072] The swimming data consists of swimming data from any one axis of a 6-axis inertial sensor, with the length of the swimming data for that axis denoted as N. A desired mean absolute error after downsampling recovery is set, and this mean absolute error is denoted as e. thre .

[0073] S11: Divide the swimming data and obtain the divided data after multiple segments;

[0074] It should be noted that the swimming data is divided into segments of a preset length, denoted as L. This will divide the swimming data into w segments, as shown in the following formula:

[0075]

[0076] Then, the partitioned data after multiple segment divisions can be represented as: N1, N2, ..., N w .

[0077] S12: Divide the partitioned data into windows to obtain multiple window data;

[0078] Where the number of window data d is no greater than the number of partition data w, i.e., d≤w; in this case, multiple window data can be represented as: M1, M2, …, M d .

[0079] Simultaneously, the data is divided into windows, resulting in multiple window data sets, including:

[0080] Based on the Discrete Fourier Transform (DFT) principle, the spectrum vector corresponding to the partitioned data is determined;

[0081] Get all the partitioned data contained in the current window and the spectrum vectors corresponding to all the partitioned data in the current window;

[0082] The spectrum vector of the current window is determined based on the spectrum vector corresponding to the partitioned data;

[0083] The data is divided into multiple windows based on the spectrum vector of the current window and the spectrum vector of the next segment of data.

[0084] It should be noted that the average value of the spectral vectors corresponding to the partitioned data is taken, and this average value is set as the spectral vector of the current window. The spectral vector is generally a one-sided spectral vector. Specifically, the above steps can be understood as: partitioning the data N1, N2, ..., N... w Perform Discrete Fourier Transform on each of the segments to obtain the spectrum vectors v1, v2, ..., v of the current window. w Let v be one of the spectrum vectors. i When the length of the data segment is n, the corresponding spectrum vector after the DFT operation is v. i It should be noted that the formula for DFT is:

[0085]

[0086] Among them, y n Y represents discrete sampled data, j represents the imaginary unit, and Y represents the discrete sampled data. k This represents the result of the Fourier transform.

[0087] The sampling frequency is then denoted as f. s Then, at this point, the frequency resolution Δf can be determined using the formula... It is determined that when N is odd, the length of the spectrum vector is... And the spectrum vector v i It is expressed as follows:

[0088]

[0089] Among them, w1 and w2 are non-zero weight coefficients.

[0090] This process, after dividing the data into windows based on the spectrum vector of the current window and the spectrum vector corresponding to the next segment of data, and before obtaining multiple window data, also includes:

[0091] The difference is obtained by subtracting the spectrum vector of the current window from the spectrum vector of the next segment of data.

[0092] Determine whether the difference exceeds the distance threshold representing the distance between spectral vectors;

[0093] If so, then determine that the spectrum vector corresponding to the next segment of data does not belong to the current window; at the same time, update the spectrum vector of the next window of the current window to the spectrum vector corresponding to the next segment of data.

[0094] If not, then determine that the spectrum vector corresponding to the next segment of data belongs to the current window. At the same time, update the spectrum vector of the current window, where the updated spectrum vector of the current window includes the spectrum vector corresponding to the next segment of data.

[0095] Assume the current window M k The spectrum vector is denoted as v k At this time, the current window M k The included partitioned data is represented as {N} i N i+1 ,…,N j The corresponding spectrum vector is denoted as {v}. i ,v i+1 ,…,v j}, then at this time, the current window M k Spectrum vector v k Represented as Next segment of data N j+1 The corresponding spectrum vector v j+1 Then, at this point, calculate the current window M. k Spectrum vector v k And the next segment of data N j+1 The corresponding spectrum vector v j+1 The difference n_value is given by the following formula:

[0096] n_value = norm(v k -vj+1 )

[0097] At this point, the distance threshold representing the distance between spectral vectors is denoted as n. thre When n_value ≤ n thre At that time, determine the partitioning of data N. j+1 Belongs to the current window M k Update the current window M k Spectrum vector v k for When n_value>n thre At that time, determine the partitioning of data N. j+1 Not belonging to the current window M k Update the current window M k Spectrum vector v k For v k+1 =v j+1 .

[0098] S13: Assign multiple preset downsampling frequencies to each window of data;

[0099] Window data M1, M2, ..., M d The corresponding multiple preset downsampling frequencies f1, f2, ..., f d Each window of data is downsampled, and then linear interpolation is performed using the downsampled data to recover the data, which are R1, R2, ..., R d The obtained mean absolute error is e1, e2, ..., e d , where e i =mean(abs(R) i -M i ),i∈{1,2,…,d}, and M i The selectable downsampling frequency is in, For M i The length of the data in the file.

[0100] S14: Determine the score of the window data according to the preset downsampling frequency, and extract the downsampling frequency corresponding to the maximum value among all scores as the actual downsampling frequency;

[0101] This allows for downsampling of swimming data based on the actual downsampling frequency.

[0102] The scoring formula for window data is as follows:

[0103] S=α*ε*ρ+(1-α)*100*(1-σ)

[0104] Where α is the mixing factor, ε is the expected mean absolute error minus the mean absolute error after downsampling in this window, ρ is the scaling factor, and σ is the compression ratio of the data in this window, with a size equal to f. i .

[0105] Current window M k Using sampling frequency f i Downsampling and linear interpolation are performed to recover the data. Calculate the mean absolute error We get ε = e thre -e k As a standard setting, α can be set to 0.8 and ρ to 1. This will be done sequentially in... Determine the score of the window data And extract the downsampling frequency f corresponding to the maximum value among all scores. i This serves as the actual downsampling frequency, allowing for the downsampling of swimming data based on the actual downsampling frequency.

[0106] This application provides a data downsampling method applied to AR smart swimming goggles equipped with an inertial sensor. The method includes: acquiring swimming data collected by the inertial sensor; dividing the swimming data into multiple segments; dividing the segmented data into windows to obtain multiple window data, wherein the number of window data is no greater than the number of segments; assigning multiple preset downsampling frequencies to each window data segment, thus avoiding sampling with the same sampling period for both rapid and slow data changes, further preventing increased compression error and compression ratio; determining the score of the window data based on the preset downsampling frequencies, and extracting the downsampling frequency corresponding to the maximum value among all scores as the actual downsampling frequency, so as to facilitate downsampling of the swimming data according to the actual downsampling frequency. Since the values ​​of compression error and compression ratio depend on the sampling frequency, assigning multiple preset downsampling frequencies to each window data segment simultaneously considers reducing compression error and compression ratio, thereby obtaining a suitable sampling frequency for downsampling the data.

[0107] The downsampling frequency with the highest score for each window is selected as the downsampling frequency for that window. Meanwhile, adaptive downsampling has a smaller error than traditional downsampling, and is closer to the original data, indicating lower data distortion. Furthermore, it has a lower compression ratio, saving less data, meaning that using less data to recover the original data reduces the pressure on data storage.

[0108] Therefore, the data downsampling method mentioned in this application is an adaptive data downsampling method. It obtains multi-segment data; divides the segmented data into windows to obtain multiple window data; assigns multiple preset downsampling frequencies to each window data; determines the score of the window data based on the preset downsampling frequencies; and extracts the downsampling frequency corresponding to the maximum value among all scores as the actual downsampling frequency, so as to facilitate downsampling of swimming data according to the actual downsampling frequency. Therefore, this invention simultaneously considers compression error and compression ratio, and can configure the weights of compression error and compression ratio separately according to different downsampling purposes to obtain the desired compression error, desired compression ratio, or a balance between compression ratio and compression error.

[0109] In the above embodiments, the data downsampling method has been described in detail. This application also provides embodiments corresponding to the data downsampling device. It should be noted that this application describes the embodiments of the device from two perspectives: one is based on the functional modules, and the other is based on the hardware.

[0110] Figure 2 This is a structural diagram of a data downsampling device provided in an embodiment of this application, as shown below. Figure 2 As shown, this application also provides a data downsampling device for use in AR smart swimming goggles equipped with an inertial sensor, comprising:

[0111] The first acquisition module 20 is used to acquire swimming data collected by the inertial sensor;

[0112] The first segmentation module 21 is used to segment the swimming data and obtain segmented data after multiple segments;

[0113] The first window partitioning module 22 is used to partition the partitioned data into multiple window data, wherein the number of window data is no greater than the number of partitioned data;

[0114] Assignment module 23 is used to assign multiple preset downsampling frequencies to each window of data;

[0115] The determination and extraction module 24 is used to determine the score of the window data according to the preset downsampling frequency, and extract the downsampling frequency corresponding to the maximum value among all scores as the actual downsampling frequency, so as to facilitate downsampling of the swimming data according to the actual downsampling frequency.

[0116] In addition, the device also includes the following modules:

[0117] The data is divided into windows, resulting in multiple window data sets, including:

[0118] The first determining module is used to determine the spectrum vector corresponding to the partitioned data based on the principle of discrete Fourier transform.

[0119] The second acquisition module is used to acquire all the partitioned data contained in the current window and the spectrum vectors corresponding to all the partitioned data in the current window.

[0120] The second determining module is used to determine the spectrum vector of the current window based on the spectrum vector corresponding to the partitioned data;

[0121] The second window partitioning module is used to partition the data into multiple windows based on the spectrum vector of the current window and the spectrum vector of the next segment of data.

[0122] Preferably, after dividing the data into windows based on the spectrum vector of the current window and the spectrum vector corresponding to the next segment of data, before obtaining multiple window data, the method further includes:

[0123] The difference module is used to calculate the difference between the spectrum vector of the current window and the spectrum vector corresponding to the next segment of data.

[0124] The judgment module is used to determine whether the difference exceeds the distance threshold representing the distance between spectral vectors;

[0125] If so, the third determination module is triggered to determine whether the spectrum vector corresponding to the next segment of data does not belong to the current window;

[0126] If not, the fourth determination module is triggered to determine whether the spectrum vector corresponding to the next segment of data belongs to the current window.

[0127] Preferably, after determining that the spectrum vector corresponding to the next segment of data does not belong to the current window, the method further includes:

[0128] The first update module is used to update the spectrum vector of the next window of the current window to the spectrum vector corresponding to the next segment of data.

[0129] Preferably, after determining that the spectrum vector corresponding to the next segment of data belongs to the current window, the method further includes:

[0130] The second update module is used to update the spectrum vector of the current window, wherein the updated spectrum vector of the current window includes the spectrum vector corresponding to the next segment of data.

[0131] Preferably, determining the spectrum vector of the current window based on the spectrum vector corresponding to the partitioned data includes:

[0132] The averaging module is used to average the spectrum vectors corresponding to all the partitioned data and set the average value as the spectrum vector of the current window.

[0133] Preferably, the division of swimming data includes:

[0134] The second segmentation module is used to segment swimming data into preset lengths.

[0135] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0136] Figure 3 This is a structural diagram of a data downsampling device provided in an embodiment of this application, as shown below. Figure 3 As shown, the data downsampling device provided in this application, including AR smart swimming goggles equipped with an inertial sensor, comprises:

[0137] Memory 30 is used to store computer programs;

[0138] The processor 31 is used to implement the steps of the data downsampling method mentioned in the above embodiments when executing a computer program.

[0139] The data downsampling device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0140] The processor 31 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 31 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 31 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 31 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 31 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0141] The memory 30 may include one or more computer-readable storage media, which may be non-transitory. The memory 30 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 30 is used to store at least the following computer program, which, after being loaded and executed by the processor 31, is capable of implementing the relevant steps of the data downsampling method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 30 may also include an operating system and data, and the storage method may be temporary or permanent storage. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, the data downsampling method.

[0142] In some embodiments, the data downsampling device may further include a display screen, input / output interfaces, a communication interface, a power supply, and a communication bus.

[0143] Those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the data downsampling device and may include more or fewer components than illustrated.

[0144] The data downsampling device provided in this application includes a memory 30 and a processor 31. When the processor 31 executes the program stored in the memory 30, it can implement the data downsampling method.

[0145] Figure 4 This is a schematic diagram of window scoring provided in an embodiment of this application. Figure 5 This is a schematic diagram of window data sampling error provided in an embodiment of this application. Figure 6 This is a schematic diagram of the window data compression ratio provided in the embodiments of this application, combined with Figures 4 to 6 Compared to existing downsampling methods, the downsampling method proposed in this application yields a higher window score, smaller window data sampling error (closer to the original data), and a lower window data compression ratio (saving less data). This application selects the downsampling frequency with the highest score for each window as the downsampling frequency for that window, resulting in lower window data distortion and a smaller compression ratio. This demonstrates that using less data to recover the original data reduces the pressure on data storage.

[0146] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0147] It is understood that if the methods in the above embodiments 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 all or part 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 executes all or part of the steps of the methods 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, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0148] The foregoing has provided a detailed description of a data downsampling method, apparatus, device, and medium provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0149] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A data downsampling method, characterized in that, AR smart swimming goggles equipped with inertial sensors include: Acquire swimming data collected by inertial sensors; The swimming data is divided into segments, resulting in multiple segments of segmented data. The partitioned data is divided into windows to obtain multiple window data, wherein the number of window data is no greater than the number of partitioned data; Each window of data is assigned multiple preset downsampling frequencies; The score of the window data is determined according to the preset downsampling frequency, and the downsampling frequency corresponding to the maximum value among all the scores is extracted as the actual downsampling frequency, so as to facilitate downsampling of the swimming data according to the actual downsampling frequency; The step of dividing the partitioned data into multiple window data includes: Based on the principle of discrete Fourier transform, the spectrum vector corresponding to the partitioned data is determined; Obtain all the partitioned data contained in the current window and the spectrum vectors corresponding to all the partitioned data in the current window; The spectrum vector of the current window is determined based on the spectrum vector corresponding to the partitioned data; The partitioned data is divided into multiple window data based on the spectrum vector of the current window and the spectrum vector corresponding to the next segment of partitioned data. The scoring formula for window data is: ; in, As a mixing factor, The mean absolute error is the difference between the expected mean absolute error and the mean absolute error after downsampling within this window. As a scaling factor, The compression ratio of the window data is equal to the preset downsampling frequency.

2. The data downsampling method according to claim 1, characterized in that, After dividing the partitioned data into windows based on the spectrum vector of the current window and the spectrum vector corresponding to the next segment of partitioned data, and before obtaining multiple window data, the method further includes: The difference is obtained by subtracting the spectrum vector of the current window from the spectrum vector corresponding to the next segment of the data. Determine whether the difference exceeds a distance threshold representing the distance between the spectral vectors; If so, then determine that the spectrum vector corresponding to the next segment of data does not belong to the current window; If not, then the spectrum vector corresponding to the next segment of data is determined to belong to the current window.

3. The data downsampling method according to claim 2, characterized in that, After determining that the spectrum vector corresponding to the next segment of the partitioned data does not belong to the current window, the method further includes: Update the spectrum vector of the next window of the current window to the spectrum vector corresponding to the next segment of the data.

4. The data downsampling method according to claim 2, characterized in that, After determining that the spectrum vector corresponding to the next segment of the data belongs to the current window, the method further includes: Update the spectrum vector of the current window, wherein the updated spectrum vector of the current window includes the spectrum vector corresponding to the next segment of the data.

5. The data downsampling method according to claim 1, characterized in that, Determining the spectrum vector of the current window based on the spectrum vector corresponding to the partitioned data includes: Take the average value of the spectrum vectors corresponding to all the partitioned data, and set the average value as the spectrum vector of the current window.

6. The data downsampling method according to claim 1, characterized in that, The segmentation of the swimming data includes: The swimming data is divided into segments of a preset length.

7. A data downsampling device, characterized in that, AR smart swimming goggles equipped with inertial sensors include: The first acquisition module is used to acquire swimming data collected by the inertial sensor; The first segmentation module is used to segment the swimming data and obtain segmented data after multiple segments; The first window partitioning module is used to partition the partitioned data into multiple window data, wherein the number of window data is not greater than the number of partitioned data; The assignment module is used to assign multiple preset downsampling frequencies to each of the window data; The determination and extraction module is used to determine the score of the window data according to the preset downsampling frequency, and extract the downsampling frequency corresponding to the maximum value among all the scores as the actual downsampling frequency, so as to facilitate downsampling of the swimming data according to the actual downsampling frequency; The data downsampling device further includes: The first determining module is used to determine the spectrum vector corresponding to the partitioned data based on the principle of discrete Fourier transform. The second acquisition module is used to acquire all the partitioned data contained in the current window and the spectrum vectors corresponding to all the partitioned data in the current window. The second determining module is used to determine the spectrum vector of the current window based on the spectrum vector corresponding to the partitioned data; The second window partitioning module is used to partition the partitioned data into multiple windows based on the spectrum vector of the current window and the spectrum vector corresponding to the next segment of partitioned data. The scoring formula for window data is: ; in, As a mixing factor, The mean absolute error is the difference between the expected mean absolute error and the mean absolute error after downsampling within this window. As a scaling factor, The compression ratio of the window data is equal to the preset downsampling frequency.

8. A data downsampling device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data downsampling method as described in any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data downsampling method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Swimming data statistical method, device, equipment and medium

    CN114896568A

  • Method, device and equipment for determining swim turn-around time and medium

    CN115155044A