Pedometer method and system for wireless earphone detection and wireless earphone
By establishing a three-dimensional coordinate system on wireless headphones and performing acceleration integral and vector conversion, the problem of inaccurate step counting of smart wearable devices is solved, and a higher precision step counting is achieved.
Patent Information
- Application Number
- CN202411570569.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2044-11-06
AI Technical Summary
Existing smart wearable devices are prone to misjudgment due to vibrations or difficulty in adapting to different walking postures and pace speeds when calculating, resulting in inaccurate step counting.
Using the step counting method of wireless headphone detection, a three-dimensional coordinate system with the center of the headphone as the coordinate origin, accelerating data is collected for integral calculation, a vector is constructed and converted to a Cartesian coordinate system, and a step counting is performed using the total vector to compare with the preset threshold.
It improves the accuracy and reliability of step counting, reduces the phenomenon of step counting caused by head movement, and significantly improves the step counting accuracy.
Smart Images

Figure CN119691315B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of step detection, and in particular to a step counting method and system for wireless earphone detection, and a wireless earphone. Background Art
[0002] In recent years, with the widespread adoption of smart electronic devices, smartwatches and smart earphones have become a widespread part of people's daily lives. As personal smart devices, their diverse functions cater to diverse needs, with step counting being a particularly popular feature.
[0003] In the existing technology, most smart wearable devices are equipped with accelerometers to detect the user's movement patterns. These devices analyze acceleration data to identify specific patterns in the gait cycle and thus count the number of steps. Accelerometers can sense dynamic acceleration changes in the body, such as walking, running and other activities. However, despite these technologies, smart wearable devices still have some shortcomings in step counting. For example, when driving or riding a bicycle, the accelerometer may mistakenly identify vibrations as walking, thereby miscounting the number of steps. In addition, different people have different walking postures and paces, and the device may find it difficult to accurately adapt to each person's unique gait, resulting in inaccurate step counting.
[0004] In summary, the existing step counting technology still has the problem of inaccurate step counting and misrecording of steps. Summary of the Invention
[0005] The present invention provides a pedometer method and system for wireless earphone detection, and a wireless earphone, which can improve the accuracy and reliability of step counting to meet users' high-precision requirements for step counting functions.
[0006] In a first aspect, in order to solve the above technical problems, the present invention provides a step counting method for wireless headset detection, comprising:
[0007] Establish a three-dimensional coordinate system with the transmitter at the center of the headset as the coordinate origin; wherein the x-axis and y-axis of the three-dimensional coordinate system are perpendicular to the axis of the headset, and the z-axis points to the top of the headset;
[0008] Collecting acceleration data of the earphone, and performing a first integration and a second integration on the acceleration data to obtain velocity data and initial displacement data;
[0009] Calculating the rotation angle data of the earphone according to the speed data;
[0010] constructing a first x vector, a first y vector, and a first z vector according to the rotation angle data and the initial displacement data, and converting the first x vector, the first y vector, and the first z vector to a Cartesian coordinate system to obtain a second x vector, a second y vector, and a second z vector;
[0011] The second x vector, the second y vector, and the second z vector are summed to obtain a total vector, and the total vector is compared with a preset threshold. When the total vector is greater than the preset threshold, displacement data is generated and a step count is performed.
[0012] Preferably, collecting acceleration data of the earphone and performing a first integral calculation and a second integral calculation to obtain velocity data includes:
[0013] The first integral is calculated using the following formula:
[0014]
[0015]
[0016] Where, is the acceleration data in the x-axis direction, is the acceleration data in the y-axis direction, is the speed data in the x-axis direction, is the speed data in the y-axis direction;
[0017] The speed data includes speed data in the x-axis direction and speed data in the y-axis direction.
[0018] Preferably, the collecting acceleration data of the earphone and performing a first integral calculation and a second integral calculation to obtain initial displacement data includes:
[0019] The second integral is calculated using the following formula:
[0020]
[0021] Where, is the acceleration data in the z-axis direction, is the displacement data in the z-axis direction;
[0022] The displacement data in the z-axis direction is used as initial displacement data.
[0023] Preferably, calculating the rotation angle data of the earphone according to the speed data includes:
[0024] The rotation angle data of the headset is calculated using the following formula:
[0025]
[0026]
[0027] Where, is the speed data in the x-axis direction, is the speed data in the y-axis direction, is the distance from the acceleration sensor to the rotation axis, is the integration time interval, is the rotation angle in the x-axis direction, is the rotation angle in the y-axis direction;
[0028] The rotation angle data includes the rotation angle in the x-axis direction and the rotation angle in the y-axis direction.
[0029] Preferably, constructing a first x vector, a first y vector, and a first z vector according to the rotation angle data and the initial displacement data includes:
[0030] Construct a first x-vector according to the rotation angle data; wherein the first x-vector is expressed as:
[0031]
[0032] in, is the rotation angle in the x-axis direction;
[0033] Construct a first y vector according to the rotation angle data; wherein the first y vector is expressed as:
[0034]
[0035] in, is the rotation angle in the y-axis direction;
[0036] A first z vector is constructed according to the initial displacement data; wherein the first z vector is expressed as:
[0037]
[0038] in, is the displacement data in the z-axis direction.
[0039] Preferably, converting the first x vector, the first y vector and the first z vector into a Cartesian coordinate system to obtain a second x vector, a second y vector and a second z vector comprises:
[0040] The first x-vector, the first y-vector, and the first z-vector are transformed into a Cartesian coordinate system using the following formula:
[0041]
[0042] Where, is the transformation matrix.
[0043] Preferably, when the total vector is greater than the preset threshold, displacement data is generated and step counting is performed, including:
[0044] Integrating the velocity data to obtain an x-axis displacement;
[0045] Calculating the number of steps according to the initial displacement data and the x-axis displacement;
[0046] The number of steps is calculated using the following formula:
[0047]
[0048] Where, is the x-axis displacement, is the initial displacement data, i.e. the z-axis displacement, is the preset stride length, is the number of steps.
[0049] Preferably, the method further comprises: summing the second x vector, the second y vector, and the second z vector to obtain a total vector, comparing the total vector with a preset threshold value, and generating total displacement data and performing a step counting when the total vector is greater than the preset threshold value;
[0050] Integrating the velocity data to obtain x-axis displacement and y-axis displacement;
[0051] Determine whether the x-axis displacement, the y-axis displacement and the initial displacement data exceed a preset displacement threshold. If so, trigger a pulse interrupt signal, use the x-axis displacement and the initial displacement data as displacement data, and perform a step count; if not, continue to collect acceleration data.
[0052] In a second aspect, the present invention provides a pedometer system for wireless earphone detection, comprising:
[0053] A coordinate establishment module is used to establish a three-dimensional coordinate system with the transmitter at the center of the headset as the coordinate origin;
[0054] The integral calculation module is used to collect the acceleration data of the earphone and perform the first integral and the second integral on the acceleration data to obtain the velocity data and the initial displacement data.
[0055] A data calculation module is used to calculate the rotation angle data of the headset based on the speed data
[0056] A coordinate conversion module is used to construct a first x vector, a first y vector and a first z vector according to the rotation angle data and the initial displacement data, and convert the first x vector, the first y vector and the first z vector into a Cartesian coordinate system to obtain a second x vector, a second y vector and a second z vector
[0057] The step counting module is used to sum the second x vector, the second y vector and the second z vector to obtain a total vector, and compare the total vector with a preset threshold value. When the total vector is greater than the preset threshold value, total displacement data is generated and a step counting is performed.
[0058] In a third aspect, the present invention also provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the pedometer detection method for wireless headphones as described above is implemented.
[0059] In a fourth aspect, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned pedometer detection methods for wireless headphones.
[0060] In a fifth aspect, the present invention further provides a wireless headset, comprising a pedometer system for wireless headset detection as described in any one of the above.
[0061] Compared with the prior art, the present invention has the following beneficial effects: an embodiment of the present invention provides a pedometer method, system, and wireless headset for wireless headset detection. The method includes: establishing a three-dimensional coordinate system with a transmitter at the center of the headset as the coordinate origin; wherein the x-axis and y-axis of the three-dimensional coordinate system are perpendicular to the axis of the headset, and the z-axis points to the top of the headset; collecting acceleration data of the headset, and performing a first integral and a second integral on the acceleration data to obtain velocity data and initial displacement data; calculating the rotation angle data of the headset based on the velocity data; constructing a first x-vector, a first y-vector, and a first z-vector based on the rotation angle data and the initial displacement data, and converting the first x-vector, the first y-vector, and the first z-vector into a Cartesian coordinate system to obtain a second x-vector, a second y-vector, and a second z-vector; summing the second x-vector, the second y-vector, and the second z-vector to obtain a total vector, and comparing the total vector with a preset threshold value. When the total vector is greater than the preset threshold value, displacement data is generated, and a pedometer is counted.
[0062] The method described in this paper calculates the headphone's velocity, rotation angle, and initial displacement through multiple integrations of acceleration data and vector transformation, enabling effective step count inference. Furthermore, the use of three-dimensional coordinate transformation and total vector calculation filters out noise and false movements, reduces miscounting caused by head movement, and significantly improves step counting accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 1 is a flow chart of a step counting method for wireless headset detection provided by the first embodiment of the present invention;
[0064] Figure 2 2 is a schematic structural diagram of a pedometer system for wireless earphone detection provided in a second embodiment of the present invention. DETAILED DESCRIPTION
[0065] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0066] Reference Figure 1 The first embodiment of the present invention provides a step counting method for wireless headset detection, comprising the following steps:
[0067] S11, establish a three-dimensional coordinate system with the transmitter at the center of the earphone as the coordinate origin; wherein the x-axis and y-axis of the three-dimensional coordinate system are perpendicular to the axial direction of the earphone, and the z-axis points to the top of the earphone.
[0068] S12: Collect acceleration data of the earphone, and perform a first integration and a second integration on the acceleration data to obtain velocity data and initial displacement data.
[0069] S13: Calculate the rotation angle data of the earphone according to the speed data.
[0070] S14: construct a first x vector, a first y vector, and a first z vector based on the rotation angle data and the initial displacement data, and convert the first x vector, the first y vector, and the first z vector into a Cartesian coordinate system to obtain a second x vector, a second y vector, and a second z vector.
[0071] S15: Sum the second x vector, the second y vector, and the second z vector to obtain a total vector, and compare the total vector with a preset threshold. When the total vector is greater than the preset threshold, displacement data is generated and a step count is performed.
[0072] It's worth noting that pedometers refer to the process of measuring and recording the number of steps people take. This statistical method relies on sensors and algorithms to detect and count a user's walking or running pace. Pedometers are widely used and are commonly found in various smart wearable devices, such as smartwatches, wristbands, and wireless earbuds. They track daily activity levels and help users understand their exercise status, calorie consumption, and health status.
[0073] To facilitate understanding of the present invention, some preferred embodiments of the present invention are further described below.
[0074] In step S11 , a three-dimensional coordinate system is established with the transmitter at the center of the earphone as the coordinate origin.
[0075] Preferably, the x-axis and y-axis of the three-dimensional coordinate system are perpendicular to the axial direction of the earphone, and the z-axis points to the top of the earphone.
[0076] Specifically, the system selects the transmitter at the center of the headset as the origin of the three-dimensional coordinate system to construct a spatial coordinate system. This coordinate system can define the reference frame of the headset movement, so that the headset can use this coordinate system as a reference when detecting movement to capture the user's displacement and rotation in different directions. Among them, the x-axis and y-axis of the coordinate system are perpendicular to the axis of the headset, and are used to sense the horizontal movement and rotation of the headset. The z-axis points to the top of the headset and is used to capture the vertical movement of the headset. This axial division method ensures that the system can accurately identify the movement trajectory of the headset in three-dimensional space, which facilitates the accurate calculation of subsequent steps.
[0077] It is worth noting that by establishing this three-dimensional coordinate system, the system can quantify the movement of the earphones to specific coordinate axes, which provides a clear directional reference for acceleration data collection, velocity and displacement calculations in subsequent steps. Compared with simple linear acceleration detection, the establishment of this three-dimensional coordinate system increases the flexibility of the system in identifying movement and can comprehensively detect the multi-axis movement of the earphones, thereby improving the data precision and accuracy during the step counting process. At the same time, after the coordinate system is established, the system can more easily identify acceleration changes in different directions, and integrate these acceleration data in subsequent steps (such as S12 and S13) to accurately obtain velocity and displacement data.
[0078] In step S12, acceleration data of the earphone is collected, and a first integration and a second integration are performed on the acceleration data to obtain velocity data and initial displacement data.
[0079] Optionally, collecting acceleration data of the earphone and performing a first integral calculation and a second integral calculation to obtain velocity data includes:
[0080] The first integral is calculated using the following formula:
[0081]
[0082]
[0083] Where, is the acceleration data in the x-axis direction, is the acceleration data in the y-axis direction, is the speed data in the x-axis direction, is the speed data in the y-axis direction;
[0084] The speed data includes speed data in the x-axis direction and speed data in the y-axis direction.
[0085] Optionally, collecting acceleration data of the earphone and performing a first integral calculation and a second integral calculation to obtain initial displacement data includes:
[0086] The second integral is calculated using the following formula:
[0087]
[0088] Where, is the acceleration data in the z-axis direction, is the displacement data in the z-axis direction;
[0089] The displacement data in the z-axis direction is used as initial displacement data.
[0090] Specifically, in the wireless headphone pedometer method of the present invention, acceleration data is collected using an accelerometer built into the headphone. The accelerometer can sense changes in the headphone's acceleration in three-dimensional space (the x, y, and z axes), thereby providing real-time data on the headphone's movement. The accelerometer is a three-axis accelerometer capable of sensing the headphone's acceleration in the x, y, and z directions. The acceleration data in each direction represents the instantaneous acceleration of the headphone along that direction. Commonly used accelerometers in smart wearable devices include MEMS (micro-electromechanical systems) sensors, which are suitable for integration into small devices such as headphones due to their small size and low energy consumption.
[0091] It's worth noting that to eliminate ambient noise or subtle vibrations from non-active earphones, the system filters the acceleration data. This filtering method, such as low-pass filtering or Kalman filtering, removes high-frequency noise while retaining the effective acceleration changes associated with activities like walking and running.
[0092] After collecting the acceleration data, the system will perform a first integration on it to calculate the speed data of the headset. and The x-axis and y-axis acceleration data are represented by the x-axis and y-axis velocity data by integrating them. This integral calculation accumulates the acceleration over time and calculates the instantaneous velocity of the earphones in different directions, indicating the change in velocity of the earphones during movement.
[0093] Specifically, the purpose of the second integral calculation is to calculate the displacement data of the earphone in the z-axis direction, which is called the initial displacement data. Here, represents the acceleration data in the z-axis direction. It is integrated twice to obtain the velocity first, and then the displacement is obtained after the second integration, that is, the displacement data in the z-axis direction. This displacement data (that is, the initial displacement of the z-axis) is the displacement of the earphone in the vertical direction, which reflects the fluctuation of the earphone in the vertical direction when walking or running. The z-axis displacement data plays an important role in step detection. It can help the system determine whether the earphone has undergone sufficient vertical displacement, thereby distinguishing between the actual movement of the steps and the slight shaking of the head. This is particularly important for reducing the rate of miscounting steps and ensuring the accuracy of step statistics.
[0094] In step S13, the rotation angle data of the earphone is calculated according to the speed data.
[0095] Preferably, calculating the rotation angle data of the earphone according to the speed data includes:
[0096] The rotation angle data of the headset is calculated using the following formula:
[0097]
[0098]
[0099] Where, is the speed data in the x-axis direction, is the speed data in the y-axis direction, is the distance from the acceleration sensor to the rotation axis, is the integration time interval, is the rotation angle in the x-axis direction, is the rotation angle in the y-axis direction;
[0100] The rotation angle data includes the rotation angle in the x-axis direction and the rotation angle in the y-axis direction.
[0101] Specifically, in S13, the system uses the speed data obtained in step S12 to further calculate the rotation angle data of the headset. Specifically, the system calculates the rotation angle of the headset in the x-axis and y-axis directions. Through this calculation, the system can determine the rotation angle of the headset in the x-axis and y-axis directions, thereby obtaining rotation information of the headset in different axis directions.
[0102] It is worth noting that the calculation of rotational data enables the system to identify the rotation or tilt state of the headset during exercise. For example, when the user turns their head or shakes the headset at a small angle, the system recognizes these movements by the change in rotation angle and distinguishes them in the subsequent step calculation. Rotational data helps the system distinguish between the actual footstep movement of the headset and the slight rotation of the head, thereby avoiding miscounting some invalid head movements as steps. For example, when the head shakes slightly but does not actually walk, the system can use rotational data to avoid miscounting steps.
[0103] Specifically, step S13 directly utilizes the velocity data obtained in step S12, ensuring further calculation of the headphone's motion velocity within the three-dimensional coordinate system. After calculating the rotation angle in step S13, the system constructs the first set of x, y, and z vectors based on this rotation data (step S14). These vectors reflect the headphone's rotation and displacement, providing accurate directional information for the subsequent coordinate transformation and displacement calculations. In S15, the system uses these vectors to calculate the total vector, which is constructed based on the rotation data provided in step S13. By calculating the rotation angle, the system ensures that the total vector calculation more accurately reflects the actual motion of the headphone, improving the accuracy of step counting.
[0104] In the present invention, the system calculates the rotation angle of the earphones in the x-axis and y-axis directions to determine whether the earphones have reached a motion state that can trigger pedometer. Specifically, the rotation angle is a key indicator used to determine whether the earphones have moved with a sufficient amplitude, thereby deciding whether to include the action in the step count. The rotation angle, as a criterion for judging the effectiveness of steps, can filter out some low-amplitude, non-walking movements, so that the system can avoid misjudging small movements such as head shaking as steps when recording steps. This filtering mechanism allows the system to pay more attention to significant step movements and improves the reliability of the step counting data. When the rotation angle is greater than the threshold, it indicates that the earphones have undergone relatively obvious movement, which is consistent with the user's step movement. By controlling the rotation angle, the system can better capture movements that meet the characteristics of the step, thereby effectively improving the accuracy of the step counting.
[0105] In step S14, a first x vector, a first y vector, and a first z vector are constructed according to the rotation angle data and the initial displacement data, and the first x vector, the first y vector, and the first z vector are converted to a Cartesian coordinate system to obtain a second x vector, a second y vector, and a second z vector.
[0106] Optionally, constructing a first x vector, a first y vector, and a first z vector according to the rotation angle data and the initial displacement data includes:
[0107] Construct a first x-vector according to the rotation angle data; wherein the first x-vector is expressed as:
[0108]
[0109] in, is the rotation angle in the x-axis direction;
[0110] Construct a first y vector according to the rotation angle data; wherein the first y vector is expressed as:
[0111]
[0112] in, is the rotation angle in the y-axis direction;
[0113] A first z vector is constructed according to the initial displacement data; wherein the first z vector is expressed as:
[0114]
[0115] in, is the displacement data in the z-axis direction.
[0116] Optionally, converting the first x vector, the first y vector, and the first z vector into a Cartesian coordinate system to obtain a second x vector, a second y vector, and a second z vector includes:
[0117] The first x-vector, the first y-vector, and the first z-vector are transformed into a Cartesian coordinate system using the following formula:
[0118]
[0119] Where, is the transformation matrix.
[0120] Specifically, the system uses the headphone's rotational data and initial displacement data to construct a first set of x, y, and z vectors. The process for constructing this set of vectors is as follows: The system vectorizes the rotational data in the x and y directions, constructing the first x vector and the first y vector, respectively, which reflect the horizontal rotational motion of the headphone. The system vectorizes the initial z-axis displacement data obtained in step S12, constructing the first z vector. The z vector represents the vertical displacement of the headphone, providing a characteristic of the headphone's up and down motion.
[0121] It's worth noting that this set of x, y, and z vectors represents the complete motion of the headset in its local coordinate system, including its rotation and displacement characteristics in all directions. The purpose of constructing this set of vectors is to prepare for the subsequent coordinate transformation, allowing the system to process the headset's three-dimensional motion information in a unified coordinate system.
[0122] Next, the first set of x, y, and z vectors is converted to a Cartesian coordinate system, resulting in a second set of x, y, and z vectors. The system uses a transformation matrix to transform the first set of vectors (i.e., the x, y, and z vectors in the headset's native coordinate system) into a global Cartesian coordinate system. This second set of x, y, and z vectors represents the headset's motion in standard space, allowing the headset's rotational and displacement characteristics to be calculated and analyzed in a more universal coordinate system.
[0123] Specifically, the Cartesian coordinate system, proposed by French mathematician René Descartes, is used to describe the position of points in space. It locates a point by defining mutually perpendicular coordinate axes in space. In the pedometer method of the present invention, the Cartesian coordinate system is used to standardize the motion data from the earphones. The system converts the displacement and rotation vectors measured by the earphones in their own coordinate system into a standard Cartesian coordinate system, aligning all motion data for calculation and interpretation, thereby more accurately calculating total displacement and step count.
[0124] In this invention, the primary purpose of coordinate transformation is to convert the motion information of the earphones in their own coordinate system into standardized motion data in global coordinates. This allows the system to uniformly determine the motion characteristics of the earphones, avoiding errors caused by differences in earphone position or angle. The results of the second set of vectors serve as the basis for the subsequent total vector calculation for step count determination. Using a unified coordinate system, the system can globally accumulate and sum the earphones' motion, facilitating the determination of valid steps.
[0125] In step S15, the second x vector, the second y vector and the second z vector are summed to obtain a total vector, and the total vector is compared with a preset threshold value. When the total vector is greater than the preset threshold value, displacement data is generated and a step count is performed.
[0126] Optionally, when the total vector is greater than the preset threshold, generating displacement data and performing a step count includes:
[0127] Integrating the velocity data to obtain an x-axis displacement;
[0128] Calculating the number of steps according to the initial displacement data and the x-axis displacement;
[0129] The number of steps is calculated using the following formula:
[0130]
[0131] Where, is the x-axis displacement, is the initial displacement data, i.e. the z-axis displacement, is the preset stride length, is the number of steps.
[0132] Specifically, the two optional embodiments are key steps in step count determination and abnormal motion filtering, which directly affect the accuracy and effectiveness of step counting, ensuring that the system only records valid steps and filters out false steps and abnormal motions.
[0133] First, the system sums the second set of x, y, and z vectors obtained in the previous step (i.e., the headphone motion vectors expressed in a Cartesian coordinate system) to obtain a total vector. This total vector represents the overall motion of the headphone in three-dimensional space and comprehensively reflects the movement of the headphone in all directions.
[0134] Next, the total vector value is compared with a preset threshold. When the total vector exceeds the threshold, the system deems the earphones to have experienced significant movement, meaning the amount of movement has reached the standard for a "valid step." Once the threshold is met, the system generates displacement data and records a step.
[0135] Preferably, the number of steps is calculated as follows: the system first integrates the velocity data in the x-axis direction to obtain the x-axis displacement. Through integration, the system converts the velocity data into displacement data, which represents the movement of the earphones in the x-axis direction. When calculating the number of steps, the system not only uses the x-axis displacement, but also combines the initial displacement data, that is, the displacement in the z-axis direction. These data are used together to determine the displacement characteristics of the earphones during walking. The formula calculates the number of steps by adding the displacement in the x-axis and z-axis directions and dividing it by the stride length L.
[0136] The stride length L in the formula is a preset constant representing the system's assumed distance covered with each step. Specifically, stride length can be determined by estimating the user's height. Generally, stride length can be estimated based on the user's height, as there is a certain proportional relationship between height and stride length. Alternatively, stride length can be estimated using dynamic data during actual exercise, based on real-time adjustments to dynamic motion data. For example, actual stride length can be inferred by analyzing the user's speed and cadence over a period of time. Stride length can also be estimated based on peak acceleration. Acceleration exhibits periodic peaks with each stride. Based on the spacing between these peaks (i.e., the time difference between peaks) and exercise intensity, the system can infer the user's stride length. In summary, by pre-setting the stride length, earphone displacement can be directly converted into step counts, improving step counting accuracy.
[0137] Optionally, the summing the second x vector, the second y vector, and the second z vector to obtain a total vector, and comparing the total vector with a preset threshold value; when the total vector is greater than the preset threshold value, generating total displacement data and performing a step count, further includes:
[0138] Integrating the velocity data to obtain x-axis displacement and y-axis displacement;
[0139] Determine whether the x-axis displacement, the y-axis displacement and the initial displacement data exceed a preset displacement threshold. If so, trigger a pulse interrupt signal, use the x-axis displacement and the initial displacement data as displacement data, and perform a step count; if not, continue to collect acceleration data.
[0140] It's worth noting that a pulse interrupt is a signal trigger mechanism used to mark and count steps. Specifically, the pulse interrupt signal triggers step counting when motion that meets step characteristics is detected, ensuring that the system only counts valid motion. The pulse interrupt serves as a trigger signal, marking valid steps during the step count determination process. Once the system detects that displacement in the x-, y-, and z-axis directions exceeds preset thresholds, it generates a pulse interrupt signal. This signal indicates that the system has confirmed that the current motion meets the step criteria and can therefore count steps. In the present invention, the pulse interrupt signal helps prevent the system from counting steps when small or invalid motion is detected. Since the pulse interrupt is triggered only when all displacement thresholds are met, this mechanism can filter out non-step motion, such as minor head movements or other low-amplitude movements, thereby improving step counting accuracy. The pulse interrupt signal adds a safeguard to the pedometer system. Through this trigger signal, the system can effectively prevent false step counts caused by low-amplitude vibrations and minor shakes. In different sports scenarios (such as walking, running, going up and down stairs, etc.), the pulse interruption signal can help the system determine the real step movement without recording unexpected, non-step vibrations.
[0141] Specifically, the calculation and judgment of x- and y-axis displacement, the detection of initial displacement data, and the triggering of pulse signals and step counting combine to form an effective abnormal motion filtering mechanism. It's worth noting that when counting steps, the system not only uses the total vector threshold as a judgment, but also further evaluates the x-, y-, and initial z-axis displacement data. Specifically, the system checks whether the x- and y-axis displacements reach a preset threshold. This check ensures sufficient horizontal movement of the headset to avoid misjudgments caused by minor head movements or other non-step movements during walking or running. Initial z-axis displacement data also plays a role in the judgment. Initial z-axis displacement data primarily reflects the vertical movement of the headset, helping to capture the up-and-down movement characteristics of a step (such as leg lift and stepping), further ensuring accurate step counting. The system considers a "valid step" only when the x-, y-, and initial z-axis displacements simultaneously exceed their respective preset thresholds. This multiple threshold evaluation is intended to filter out invalid movements that don't conform to step characteristics. For example, a slight shake of the head or a small side-to-side movement may produce some displacement, but it's not enough to meet the stride length requirement and therefore shouldn't be counted as a step. By making multiple judgments about displacement in various directions, the system can effectively distinguish valid steps from abnormal movements, preventing invalid movements from being mistakenly counted as steps.
[0142] Specifically, once the x-axis displacement, y-axis displacement, and initial z-axis displacement all exceed preset thresholds, the system triggers a pulse interrupt signal, indicating that the movement meets the step characteristics. After the pulse signal is triggered, the system records the movement as a step and includes it in the step count. If the threshold is not met, the pulse signal is not triggered, and the system continues to collect new acceleration data until the conditions are met.
[0143] In a preferred embodiment, the calculated x-axis displacement, y-axis displacement, and initial z-axis displacement can also be used to determine the position of the left and right earphones. Once these displacements are obtained, this data can be further used to determine the movement trends of the earphones in different directions, thereby identifying the relative positions of the earphones, that is, the specific positional relationship between the left and right earphones. By determining the positions of the left and right ears, the earphones can accurately understand the user's current direction of movement. For example, if the left earphone is located above the user's left side or behind the user's right side, the system can use this positional information to assist in determining whether the user is walking, turning, or performing other actions. Accurate direction identification helps avoid step counting errors caused by changes in earphone position (such as when the user turns their head or changes direction), thereby improving the system's directional perception capabilities.
[0144] Exemplarily, after obtaining the displacement of the three axes, the conditional judgment steps for determining the position of the earphone are described in detail as follows:
[0145] Set the x-axis displacement, y-axis displacement, and initial z-axis displacement to sumX, sumY, and sumZ, respectively. Condition 1: When sumX, sumY, and sumZ are all greater than 0, and sumY is greater than sumX and sumZ: Position determination: The system determines that the left earphone is above the user's left side and the right earphone is behind the user's right side.
[0146] Condition 2: When the values of sumX, sumY, and sumZ are all greater than 0, and sumX is greater than sumY and sumZ: Position judgment: The system determines that the left earphone is located in front of the user's right side and the right earphone is located behind the user's left side.
[0147] Condition 3: When the values of sumX, sumY, and sumZ are all greater than 0, and sumZ is greater than sumX and sumY: Position judgment: The system determines that the left earphone is located behind the user's left side, and the right earphone is located in front of the user's right side.
[0148] Condition 4: When the values of sumX, sumY, and sumZ are all less than 0, and sumX is greater than sumY and sumZ: Position judgment: The system determines that the left earphone is located in front of the user's right side and the right earphone is located behind the user's left side.
[0149] Condition 5: When the absolute values of sumX, sumY and sumZ are all less than a preset value; Position judgment: The system determines that the left earphone is located in the left ear and the right earphone is located in the right ear (ie, the standard wearing position).
[0150] The system can use this location information to help determine whether the user is walking, turning, or performing other actions. By using headphone position determination, the system can adapt to more complex motion scenarios. For example, if a user changes direction (such as turning left or right) while walking, the system can use the real-time headphone position status to determine the user's direction change, avoiding mistaking turning movements for steps.
[0151] In general, the step counting operation in step S15 is triggered by two methods to ensure the accuracy of step counting. These two methods include: comparing the total vector with a preset threshold. When the total vector exceeds the preset motion threshold, the system preliminarily deems the earphones to have undergone valid movement, meeting the characteristics of a step; and judging the displacement of each axis against multiple thresholds. In addition to judging the total vector, the system further performs independent threshold judgments on the displacement of the earphones in the x-axis, y-axis, and z-axis directions. Only when the displacement in each of these three directions exceeds the respective preset thresholds, triggering a pulse interrupt, does the system finally confirm that the movement is a valid step. The threshold judgment based on the total vector is a preliminary screening, while the multiple displacement judgment is a more refined judgment, ensuring that only movements that meet the conditions in all directions are considered valid steps.
[0152] The following describes the working process of the present invention using a relatively common scenario as an example. The working process is as follows:
[0153] A user wears a pair of wireless earphones and prepares to go for a walk outdoors. The earphones activate the pedometer function, and as the user walks, the earphone system automatically detects the user's exercise status and records the number of steps.
[0154] When the headset is powered on, the system first establishes a three-dimensional coordinate system at the center transmitter of the headset, with the x- and y-axes perpendicular to the axis of the headset and the z-axis pointing toward the top of the headset. This coordinate system provides a motion reference, enabling the headset to sense movement in different directions.
[0155] As the user walks, the accelerometer in the headset collects real-time acceleration data in the x, y, and z directions. This data reflects the user's dynamic motion characteristics during walking, including the rise and fall of their steps, forward movement, and swaying.
[0156] The system performs a first integration on the real-time acceleration data to obtain velocity data, which represents the instantaneous velocity of the headset in different directions.
[0157] The system then performs a second integration of the velocity data to obtain initial displacement data, particularly in the z-axis direction. This data reflects the displacement characteristics of the earphones during walking and helps the system identify the effectiveness of your steps.
[0158] The system calculates the headset's x- and y-axis rotation angles based on the velocity data.
[0159] The system uses the previously calculated rotation angle and displacement data to construct the first set of x, y, and z vectors. This vector set is transformed into a Cartesian coordinate system using the transformation matrix to obtain the second set of x, y, and z vectors.
[0160] The system sums the second set of x, y, and z vectors to obtain a total vector as the overall movement of the headset in three-dimensional space.
[0161] The system compares the total vector with a preset threshold. If the total vector exceeds the threshold, the system determines that the earphones have undergone significant movement and generates displacement data, recording a step.
[0162] Before determining the number of steps, the system further checks whether the displacement in the x, y, and z directions exceeds the respective preset thresholds to confirm that the movement meets the step characteristics.
[0163] Once the displacement in all directions reaches the threshold, the system triggers a pulse interrupt signal to confirm that the movement is a valid step and start counting the steps. If it is not met, the acceleration data will continue to be collected until the conditions are met.
[0164] After the above two judgments, the system records a valid step. If the user continues walking, the system will continue to run the above steps and continue to record the number of steps.
[0165] Through this process, the earphones can achieve high-precision step counting in common walking scenarios, adapt to changes in various motion states, and provide users with accurate step records.
[0166] In summary, the present invention provides a pedometer method for wireless headset detection, including: establishing a three-dimensional coordinate system with the transmitter at the center of the headset as the coordinate origin; wherein the x-axis and y-axis of the three-dimensional coordinate system are perpendicular to the axial direction of the headset, and the z-axis points to the top of the headset; collecting acceleration data of the headset, and performing a first integral and a second integral on the acceleration data to obtain velocity data and initial displacement data; calculating the rotation angle data of the headset based on the velocity data; constructing a first x-vector, a first y-vector and a first z-vector based on the rotation angle data and the initial displacement data, and converting the first x-vector, the first y-vector and the first z-vector to a Cartesian coordinate system to obtain a second x-vector, a second y-vector and a second z-vector; summing the second x-vector, the second y-vector and the second z-vector to obtain a total vector, and comparing the total vector with a preset threshold value; when the total vector is greater than the preset threshold value, generating displacement data, and performing a pedometer step.
[0167] The method described in this paper calculates the headphone's velocity, rotation angle, and initial displacement through multiple integrations of acceleration data and vector transformation, enabling effective step count inference. Furthermore, the use of three-dimensional coordinate transformation and total vector calculation filters out noise and false movements, reduces miscounting caused by head movement, and significantly improves step counting accuracy.
[0168] Reference Figure 2 A second embodiment of the present invention provides a pedometer system for wireless earphone detection, comprising:
[0169] A coordinate establishment module is used to establish a three-dimensional coordinate system with the transmitter at the center of the headset as the coordinate origin;
[0170] The integral calculation module is used to collect the acceleration data of the earphone and perform the first integral and the second integral on the acceleration data to obtain the velocity data and the initial displacement data.
[0171] A data calculation module is used to calculate the rotation angle data of the headset based on the speed data
[0172] A coordinate conversion module is used to construct a first x vector, a first y vector and a first z vector according to the rotation angle data and the initial displacement data, and convert the first x vector, the first y vector and the first z vector into a Cartesian coordinate system to obtain a second x vector, a second y vector and a second z vector
[0173] The step counting module is used to sum the second x vector, the second y vector and the second z vector to obtain a total vector, and compare the total vector with a preset threshold value. When the total vector is greater than the preset threshold value, total displacement data is generated and a step counting is performed.
[0174] In an optional implementation, the integral calculation module is specifically configured to:
[0175] The first integral is calculated using the following formula:
[0176]
[0177]
[0178] Where, is the acceleration data in the x-axis direction, is the acceleration data in the y-axis direction, is the speed data in the x-axis direction, is the speed data in the y-axis direction;
[0179] The speed data includes speed data in the x-axis direction and speed data in the y-axis direction.
[0180] In an optional implementation, the integral calculation module is specifically configured to:
[0181] The second integral is calculated using the following formula:
[0182]
[0183] Where, is the acceleration data in the z-axis direction, is the displacement data in the z-axis direction;
[0184] The displacement data in the z-axis direction is used as initial displacement data.
[0185] In an optional implementation, the data calculation module is specifically configured to:
[0186] The rotation angle data of the headset is calculated using the following formula:
[0187]
[0188]
[0189] Where, is the speed data in the x-axis direction, is the speed data in the y-axis direction, is the distance from the acceleration sensor to the rotation axis, is the integration time interval, is the rotation angle in the x-axis direction, is the rotation angle in the y-axis direction;
[0190] The rotation angle data includes the rotation angle in the x-axis direction and the rotation angle in the y-axis direction.
[0191] In an optional implementation, the coordinate conversion module is specifically configured to:
[0192] Construct a first x-vector according to the rotation angle data; wherein the first x-vector is expressed as:
[0193]
[0194] in, is the rotation angle in the x-axis direction;
[0195] Construct a first y vector according to the rotation angle data; wherein the first y vector is expressed as:
[0196]
[0197] in, is the rotation angle in the y-axis direction;
[0198] A first z vector is constructed according to the initial displacement data; wherein the first z vector is expressed as:
[0199]
[0200] in, is the displacement data in the z-axis direction.
[0201] In an optional implementation, the coordinate conversion module is specifically configured to:
[0202] The first x-vector, the first y-vector, and the first z-vector are transformed into a Cartesian coordinate system using the following formula:
[0203]
[0204] Where, is the transformation matrix.
[0205] In an optional implementation, the step counting module is specifically configured to:
[0206] Integrating the velocity data to obtain an x-axis displacement;
[0207] Calculating the number of steps according to the initial displacement data and the x-axis displacement;
[0208] The number of steps is calculated using the following formula:
[0209]
[0210] Where, is the x-axis displacement, is the initial displacement data, i.e. the z-axis displacement, is the preset stride length, is the number of steps.
[0211] In an optional implementation, the step counting module is specifically configured to:
[0212] Integrating the velocity data to obtain x-axis displacement and y-axis displacement;
[0213] Determine whether the x-axis displacement, the y-axis displacement and the initial displacement data exceed a preset displacement threshold. If so, trigger a pulse interrupt signal, use the x-axis displacement and the initial displacement data as displacement data, and perform a step count; if not, continue to collect acceleration data.
[0214] It should be noted that the pedometer system for wireless headset detection provided in an embodiment of the present invention is used to execute all the process steps of the pedometer method for wireless headset detection in the above embodiment. The working principles and beneficial effects of the two correspond one to one, so they will not be repeated here.
[0215] An embodiment of the present invention further provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a pedometer method program for wireless headset detection. When the processor executes the computer program, the steps in each of the above-mentioned embodiments of the pedometer method for wireless headset detection are implemented, such as Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are realized, such as the step counting module.
[0216] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0217] The electronic device may be a computing device such as a desktop computer, notebook, PDA, or smart tablet. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will appreciate that the aforementioned components are merely examples of electronic devices and do not constitute a limitation of the electronic device. The electronic device may include more or fewer components than those described above, or a combination of certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, and the like.
[0218] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor. The processor is the control center of the electronic device and connects various parts of the entire electronic device using various interfaces and lines.
[0219] The memory can be used to store the computer programs and / or modules. The processor implements the various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and accessing the data stored in the memory. The memory may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). Furthermore, the memory may include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0220] If the module / unit integrated into the electronic device is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the process steps in the above-mentioned method embodiments by using a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content of the computer-readable medium can be appropriately increased or decreased based on the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, based on legislation and patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0221] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.
[0222] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A step counting method for wireless earphone detection, characterized in that: include: Establish a three-dimensional coordinate system with the transmitter at the center of the headset as the coordinate origin; wherein the x-axis and y-axis of the three-dimensional coordinate system are perpendicular to the axis of the headset, and the z-axis points to the top of the headset; Collecting acceleration data of the earphone, and performing a first integration and a second integration on the acceleration data to obtain velocity data and initial displacement data; Calculating the rotation angle data of the earphone according to the speed data; constructing a first x vector, a first y vector, and a first z vector according to the rotation angle data and the initial displacement data, and converting the first x vector, the first y vector, and the first z vector to a Cartesian coordinate system to obtain a second x vector, a second y vector, and a second z vector; Summing the second x-vector, the second y-vector, and the second z-vector to obtain a total vector, and comparing the total vector with a preset threshold value; when the total vector is greater than the preset threshold value, generating displacement data and performing a step count; The step of constructing a first x-vector, a first y-vector, and a first z-vector according to the rotation angle data and the initial displacement data includes: Construct a first x-vector according to the rotation angle data; wherein the first x-vector is expressed as: in, is the rotation angle in the x-axis direction; Construct a first y vector according to the rotation angle data; wherein the first y vector is expressed as: in, is the rotation angle in the y-axis direction; A first z vector is constructed according to the initial displacement data; wherein the first z vector is expressed as: in, is the displacement data in the z-axis direction.
2. The pedometer method for wireless headset detection according to claim 1, characterized in that: The collecting of acceleration data of the earphone and performing a first integral calculation and a second integral calculation to obtain velocity data includes: The first integral is calculated using the following formula: Where, is the acceleration data in the x-axis direction, is the acceleration data in the y-axis direction, is the speed data in the x-axis direction, is the speed data in the y-axis direction; The speed data includes speed data in the x-axis direction and speed data in the y-axis direction.
3. The pedometer method for wireless headset detection according to claim 1, characterized in that: The collecting of the acceleration data of the earphone and performing a first integral calculation and a second integral calculation to obtain the initial displacement data includes: The second integral is calculated using the following formula: Where, is the acceleration data in the z-axis direction, is the displacement data in the z-axis direction; The displacement data in the z-axis direction is used as initial displacement data.
4. The pedometer method for wireless headset detection according to claim 1, characterized in that: Calculating the rotation angle data of the earphone according to the speed data includes: The rotation angle data of the headset is calculated using the following formula: Where, is the speed data in the x-axis direction, is the speed data in the y-axis direction, is the distance from the acceleration sensor to the rotation axis, is the integration time interval, is the rotation angle in the x-axis direction, is the rotation angle in the y-axis direction; The rotation angle data includes the rotation angle in the x-axis direction and the rotation angle in the y-axis direction.
5. The pedometer method for wireless headset detection according to claim 1, characterized in that: The converting the first x vector, the first y vector, and the first z vector into a Cartesian coordinate system to obtain a second x vector, a second y vector, and a second z vector includes: The first x-vector, the first y-vector, and the first z-vector are transformed into a Cartesian coordinate system using the following formula: Where, is the transformation matrix.
6. The pedometer method for wireless headset detection according to claim 1, characterized in that: When the total vector is greater than the preset threshold, displacement data is generated and step counting is performed, including: Integrating the velocity data to obtain an x-axis displacement; Calculating the number of steps according to the initial displacement data and the x-axis displacement; The number of steps is calculated using the following formula: Where, is the x-axis displacement, is the initial displacement data, i.e. the z-axis displacement, is the preset stride length, is the number of steps.
7. The pedometer method for wireless headset detection according to claim 1, characterized in that: The method further includes: summing the second x vector, the second y vector, and the second z vector to obtain a total vector, comparing the total vector with a preset threshold, and generating total displacement data when the total vector is greater than the preset threshold, and performing a step count. Integrating the velocity data to obtain x-axis displacement and y-axis displacement; Determine whether the x-axis displacement, the y-axis displacement and the initial displacement data exceed a preset displacement threshold. If so, trigger a pulse interrupt signal, use the x-axis displacement and the initial displacement data as displacement data, and perform a step count; if not, continue to collect acceleration data.
8. A pedometer system for wireless earphone detection, characterized in that: A step counting method for implementing wireless headset detection according to any one of claims 1 to 7, comprising: A coordinate establishment module is used to establish a three-dimensional coordinate system with the transmitter at the center of the headset as the coordinate origin; an integral calculation module, configured to collect acceleration data of the earphone and perform a first integral and a second integral on the acceleration data to obtain velocity data and initial displacement data; a data calculation module, configured to calculate the rotation angle data of the earphone according to the speed data; a coordinate conversion module, configured to construct a first x vector, a first y vector, and a first z vector based on the rotation angle data and the initial displacement data, and convert the first x vector, the first y vector, and the first z vector into a Cartesian coordinate system to obtain a second x vector, a second y vector, and a second z vector; The step counting module is used to sum the second x vector, the second y vector and the second z vector to obtain a total vector, and compare the total vector with a preset threshold value. When the total vector is greater than the preset threshold value, total displacement data is generated and a step counting is performed.
9. A wireless headset, characterized in that: The wireless headset includes a pedometer system detected by the wireless headset as claimed in claim 8.
Citation Information
Patent Citations
Wireless headset step counting method, device and equipment, and readable storage medium
CN110201375A
METHOD, PROGRAM AND DEVICE FOR PROVIDING VIRTUAL SPACE
JP6246310B1