Method for identifying a state of a vehicle and related product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2026-08-11
AI Technical Summary
但是在实践中发现,由于卫星定位技术的功耗较高,电子设备通常无法长时间地开启卫星定位,而是采用间歇检测的方式,进而导致电子设备识别乘坐交通工具状态的准确率较低
[0015]本申请实施例中,电子设备可以包括加速度传感器和气压计,其中:电子设备可以通过加速度传感器采集电子设备的第一加速度,及通过气压计采集电子设备的第一气压信息;并根据第一加速度和第一气压信息得到状态识别结果,状态识别结果用于指示电子设备是否处于乘坐交通工具状态。可见,本申请实施例公开的乘坐交通工具的状态识别方法采用功耗低的加速度传感器和气压计采集的,第一加速度和第一气压信息来确定电子设备是否处于乘坐交通工具状态;需要说明的是,由于加速度传感器和气压计的功耗低,对此可以长时间的开启进行数据采集,使得采集的第一加速度和第一气压信息可以持续地更新,从而提高了得到的状态识别结果的准确率,进而提高了电子设备识别乘坐交通工具的状态的准确率。
Smart Images

Figure CN122544843A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of positioning technology, specifically to a method for recognizing the status of a vehicle and related products. Background Technology
[0002] Currently, the positioning of electronic devices mainly relies on satellite positioning technology (such as BeiDou satellite positioning and Global Positioning System). However, in practice, it has been found that due to the high power consumption of satellite positioning technology, electronic devices usually cannot keep satellite positioning on for extended periods, instead using intermittent detection. This results in a low accuracy rate for electronic devices in recognizing the status of vehicles they are using. Summary of the Invention
[0003] This application discloses a method for recognizing the status of a vehicle and related products, which can improve the accuracy of electronic devices in recognizing the status of a vehicle.
[0004] The first aspect of this application discloses a method for recognizing the status of a vehicle, applied to an electronic device, the electronic device including an accelerometer and a barometer, the method comprising:
[0005] The first acceleration of the electronic device is acquired by the accelerometer, and the first air pressure information of the electronic device is acquired by the barometer.
[0006] Based on the first acceleration and the first air pressure information, a state recognition result is obtained, which is used to indicate whether the electronic device is in the state of riding a vehicle.
[0007] A second aspect of this application discloses a status recognition device for a vehicle, applied to an electronic device, the electronic device including an accelerometer and a barometer, the device comprising:
[0008] The acquisition unit is used to acquire the first acceleration of the electronic device through the accelerometer and the first air pressure information of the electronic device through the barometer.
[0009] The first identification unit is used to obtain a state identification result based on the first acceleration and the first air pressure information, and the state identification result is used to indicate whether the electronic device is in the state of riding a vehicle.
[0010] The third aspect of this application discloses an electronic device, including: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the status recognition method for riding in a vehicle disclosed in the first aspect of this application.
[0011] The fourth aspect of this application discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the state recognition method for riding a vehicle disclosed in the first aspect of this application.
[0012] The fifth aspect of this application discloses a computer program product that, when run on a computer, causes the computer to perform some or all of the steps of any method of the first aspect of this application.
[0013] The sixth aspect of this application discloses an application publishing platform for publishing computer program products, wherein when the computer program products are run on a computer, the computer performs some or all of the steps of any one of the methods of the first aspect of this application.
[0014] Compared with related technologies, the embodiments of this application have the following beneficial effects:
[0015] In this embodiment, the electronic device may include an accelerometer and a barometer. The electronic device can acquire a first acceleration using the accelerometer and first air pressure information using the barometer. A state recognition result is obtained based on the first acceleration and first air pressure information, and this result indicates whether the electronic device is in a state of riding in a vehicle. Therefore, the vehicle riding state recognition method disclosed in this embodiment uses a low-power accelerometer and barometer to acquire the first acceleration and first air pressure information to determine whether the electronic device is in a vehicle riding state. It should be noted that because the accelerometer and barometer have low power consumption, they can be turned on for extended periods to acquire data, allowing the acquired first acceleration and first air pressure information to be continuously updated, thereby improving the accuracy of the obtained state recognition result and thus improving the accuracy of the electronic device in recognizing the vehicle riding state. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the 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.
[0017] Figure 1 This is a schematic diagram of an application scenario disclosed in an embodiment of this application;
[0018] Figure 2 This is a flowchart illustrating a method for recognizing the status of a vehicle used in an embodiment of this application.
[0019] Figure 3 This is a flowchart illustrating another method for recognizing the status of a vehicle used in an embodiment of this application.
[0020] Figure 4 This is a schematic diagram of a method process disclosed in an embodiment of this application;
[0021] Figure 5 This is a schematic diagram of another method flow disclosed in an embodiment of this application;
[0022] Figure 6 This is a flowchart illustrating another method for recognizing the status of a vehicle used in this application, as disclosed in an embodiment of the present application.
[0023] Figure 7 This is a schematic diagram of another method process disclosed in an embodiment of this application;
[0024] Figure 8 This is a schematic diagram of another method process disclosed in an embodiment of this application;
[0025] Figure 9 This is a schematic diagram of the structure of a vehicle status recognition device disclosed in an embodiment of this application;
[0026] Figure 10 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. Detailed Implementation
[0027] 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 skilled in the art without creative effort are within the scope of protection of this application.
[0028] It should be noted that the terms "first," "second," "third," and "fourth," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order. The terms "comprising" and "having," and any variations thereof, in the embodiments of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0029] This application discloses a method for recognizing the status of a vehicle and related products, which can improve the accuracy of electronic devices in recognizing the status of a vehicle.
[0030] The technical solution of this application will be described in detail below with reference to specific embodiments.
[0031] To more clearly describe the method disclosed in the embodiments of this application, the application scenarios applicable to this method are first introduced. Optionally, this method can be applied to various electronic devices including accelerometers and barometers, including but not limited to: wearable devices such as smartwatches and smart bracelets, or portable electronic devices such as mobile phones and tablets, etc., without limitation.
[0032] The accelerometer can include triaxial accelerometers (ACC), six-axis accelerometers, etc., without limitation. Triaxial accelerometers can collect acceleration information of electronic devices in three directions: X, Y, and Z; while six-axis accelerometers can collect acceleration information in more directions, without limitation.
[0033] A barometer is an instrument used to measure atmospheric pressure. In this embodiment, the barometer can be used to measure the atmospheric pressure around electronic equipment. Optionally, the barometer may include a digital barometer, an aneroid barometer, etc., and is not limited thereto.
[0034] For example, please refer to Figure 1 , Figure 1 This is a schematic diagram of an application scenario disclosed in an embodiment of this application. Optionally, this method can be applied to a wearable device 110 worn by user 100, allowing user 100 to monitor the status of their vehicle through the wearable device 110.
[0035] In related technologies, identifying whether a user is in transit is crucial for recording user travel routes, analyzing daily commuting times, and understanding user lifestyle patterns and time allocation. Given the maturity of satellite positioning technology, it is commonly used to identify whether a user is in transit.
[0036] However, in practice, it has been found that due to the high power consumption of satellite positioning technology, electronic devices usually cannot turn on satellite positioning for a long time, but instead use intermittent detection, which leads to a low accuracy rate in electronic devices recognizing the status of vehicles.
[0037] Based on this, embodiments of this application provide a method for recognizing the state of a vehicle being used, and related products, to solve the technical problems in the related art. Optionally, this method can be applied to the electronic device described above. Optionally, the electronic device can collect a first acceleration of the electronic device through an accelerometer and a first air pressure information of the electronic device through a barometer; and obtain a state recognition result based on the first acceleration and the first air pressure information, which is used to indicate whether the electronic device is in a vehicle-using state. It can be seen that the vehicle-using state recognition method disclosed in this application uses a low-power accelerometer and barometer to collect the first acceleration and the first air pressure information to determine whether the electronic device is in a vehicle-using state; it should be noted that, because the accelerometer and barometer have low power consumption, they can be turned on for a long time to collect data, so that the collected first acceleration and first air pressure information can be continuously updated, thereby improving the accuracy of the obtained state recognition result, and thus improving the accuracy of the electronic device in recognizing the state of a vehicle being used.
[0038] Based on this, the following describes the method for recognizing the status of a vehicle and related products disclosed in the embodiments of this application.
[0039] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for recognizing the status of a vehicle used in accordance with an embodiment of this application. Optionally, this method can be applied to the aforementioned electronic device or other executing entities, and is not limited thereto. Optionally, the method may include the following steps:
[0040] 202. The first acceleration of the electronic device is collected by an accelerometer, and the first air pressure information of the electronic device is collected by a barometer.
[0041] In this embodiment of the application, the electronic device can collect the first acceleration of the electronic device through an accelerometer and the first air pressure information of the electronic device through a barometer, respectively, according to a certain data sampling rate.
[0042] Optionally, the data sampling rate can be set by developers based on extensive development experience or according to the actual use case; no restrictions are imposed here.
[0043] In one embodiment, the data sampling rates of the accelerometer and the barometer can be the same or different. Optionally, the data sampling rate corresponding to the accelerometer can be higher than that corresponding to the barometer. It is understood that the atmospheric pressure corresponding to the electronic device usually does not change significantly in a short period of time, so a lower data sampling rate can be used, thereby saving power consumption of the electronic device.
[0044] In this embodiment of the application, the air pressure information may refer to the atmospheric pressure information around the electronic device.
[0045] 204. Based on the first acceleration and first air pressure information, feature extraction is performed to obtain the state recognition result. The state recognition result is used to indicate whether the electronic device is in the state of riding a vehicle.
[0046] In this embodiment, the target feature information can reflect the data features of the first acceleration and first air pressure information collected by the electronic device. The target feature information can be used as input to a target recognition model, which can then perform recognition processing to obtain a state recognition result indicating whether the electronic device is in a state of riding in a vehicle.
[0047] In this embodiment, the feature information extracted by the electronic device from the first acceleration and first air pressure information may include explicit feature information and / or implicit feature information, which is not limited herein. Optionally, the target feature information may be determined based on the extracted explicit feature information and / or implicit feature information.
[0048] Explicit feature information refers to features that can be directly observed and calculated from the data.
[0049] Optionally, the electronic device may extract explicit feature information from the first acceleration and first air pressure information using a first feature extraction method. Optionally, the first feature extraction method may include one or more of the following: downsampling, oversampling, calculating the maximum value, calculating the minimum value, calculating the average value, calculating the standard deviation, calculating the zero-crossing rate, calculating the power spectral density, Fourier transform, wavelet transform, processing with a high-pass filter, or processing with a low-pass filter, without limitation herein.
[0050] Latent features refer to the hidden features extracted from raw data through complex mathematical models or algorithms. These features are not directly observed in the data but are automatically extracted through the model's learning process. Latent features can often better capture the inherent structure and patterns in the data, thereby improving model performance.
[0051] Optionally, the electronic device can extract latent feature information from the first acceleration and first air pressure information using a second feature extraction method. Optionally, the second feature extraction method may include extracting latent feature information through a feature extraction model (e.g., convolutional neural network, generative adversarial network, or autoencoder, etc.), which is not limited here.
[0052] As an alternative implementation, the electronic device can fuse the first acceleration and the first air pressure information to obtain fused data; then the electronic device can extract features from the fused data to obtain target feature information.
[0053] Optionally, the fusion operation for fusing the first acceleration and the first air pressure information may include: synchronizing the data acquisition time, aligning the data acquisition time, etc., which are not limited here.
[0054] In another optional embodiment, the electronic device can extract the feature information corresponding to the first acceleration and the first air pressure information respectively, and fuse the feature information corresponding to the first acceleration and the first air pressure information respectively to obtain the target feature information.
[0055] Optionally, the fusion operation of the electronic device to fuse the feature information corresponding to the first acceleration and the first air pressure information may include feature combination and / or feature splicing, etc., which are not limited here.
[0056] By implementing the above method, the electronic device can fuse the feature information of the first acceleration and the first air pressure in different ways, which improves the flexibility of the method. In addition, the fusion can obtain target feature information with higher information integration, making the subsequent state recognition result determined based on the target feature information more accurate.
[0057] It should be noted that, in the embodiments of this application, whether the electronic device is in the state of riding a means of transportation can refer to whether the person carrying the electronic device is in the state of riding a means of transportation.
[0058] In this embodiment, the target recognition model can be a model used to output a recognition result indicating whether the electronic device is in a state of riding in transportation. Optionally, the target recognition model can be deployed in the local space of the electronic device or on a cloud server, and the electronic device can call the target recognition model by communicating with the cloud server, which is not limited here.
[0059] Optionally, the target recognition module can be obtained by training the model to be trained based on a large amount of sample data. Optionally, the model to be trained can include one or more of the following: Support Vector Machine (SVM), Random Forest, Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM), and Extreme Gradient Boosting (XGBoost).
[0060] Optionally, the model to be trained can be a combination of the various models described above, or a voting method. The voting method refers to treating the prediction results of multiple models as a "vote" and determining the final prediction result based on certain rules and the prediction results of multiple models.
[0061] Optionally, the sample data may include a large amount of acceleration and air pressure information corresponding to sample feature information, as well as the sample state recognition results corresponding to each sample feature information, which are not limited here.
[0062] Optionally, the training process of the target recognition model can be performed by an electronic device or assisted by other electronic devices, without limitation.
[0063] In one alternative embodiment, the electronic device can input target feature information into a trained target recognition model, and then the target recognition model can perform recognition processing based on the target feature information to output a state recognition result.
[0064] Optionally, the status recognition result may include a status of riding in transportation and a status of not riding in transportation, used to indicate whether the electronic device is riding in transportation.
[0065] In some alternative embodiments, the state recognition result can indicate not only whether the electronic device is in a state of riding in a vehicle, but also the type of vehicle corresponding to the vehicle being ridden by the electronic device. Optionally, the type of vehicle corresponding to the vehicle may include one or more of the following: electric vehicle, gasoline vehicle, bus, subway, train, airplane, and ship, without limitation.
[0066] By implementing the above method, the status recognition results can provide the type of transportation the electronic device was using, providing more reference information, thus facilitating users to review the transportation process in more detail and improving the user experience.
[0067] In this embodiment of the application, the electronic device can determine whether it is in a state of riding a vehicle based on the state recognition result.
[0068] In another optional embodiment, the electronic device can acquire multiple first state recognition results output by the target recognition model within the target's historical time period, as well as the currently output second recognition result; and then determine whether the electronic device is in a state of riding a vehicle based on the multiple first state recognition results and the second recognition result.
[0069] In an optional embodiment, if among a plurality of first state recognition results, the proportion of state recognition results indicating that the electronic device is in the state of riding a vehicle is greater than a first proportion threshold, and a second recognition result indicates that the electronic device is in the state of riding a vehicle, then it can be determined that the electronic device is in the state of riding a vehicle.
[0070] If, among multiple first state recognition results, the proportion of state recognition results indicating that the electronic device is in a state of not using transportation is greater than the second proportion threshold, and the second recognition result indicates that the electronic device is in a state of not using transportation, then it is determined that the electronic device is in a state of not using transportation.
[0071] It should be noted that, considering that the state recognition results output by the target recognition model are not entirely accurate, the electronic device can be determined to be in the state of riding in transportation during the target's historical time period if the proportion of state recognition results indicating that the electronic device is in the state of riding in transportation exceeds a certain proportion among multiple first state recognition results.
[0072] For example, assuming that more than 70% of the multiple first state recognition results indicate that the electronic device is in the state of riding in a vehicle, it can be determined that the electronic device was in the state of riding in a vehicle during the target historical time period.
[0073] It should be noted that the first and second proportional thresholds can be set by the developers or users themselves, and are not limited here.
[0074] By implementing the above method, electronic devices can combine the historical state recognition results of the target recognition model with the current state recognition results to determine whether the electronic device is in a state of riding in transportation, thereby improving the accuracy of determining whether the electronic device is in a state of riding in transportation.
[0075] In one optional embodiment, the target historical time period may include multiple sub-historical time periods, and the durations of the multiple sub-historical time periods are different.
[0076] Optionally, the target historical time period may include a first sub-historical time period and a second sub-historical time period, which is not limited here. In an optional embodiment, the first sub-historical time period may include the second sub-historical time period. Optionally, the first sub-historical time period and the second sub-historical time period may be the historical time periods closest to the current time. For example, the first sub-historical time period may be the most recent 30 seconds, and the second sub-historical time period may be the most recent 10 seconds, which is not limited here.
[0077] By implementing the above method, electronic devices can combine the historical state recognition results of the target recognition model in multiple historical time periods with the current state recognition results to determine whether the electronic device is in the state of riding a vehicle, thereby improving the accuracy of determining whether the electronic device is in the state of riding a vehicle.
[0078] As an optional implementation method, the electronic device can obtain the historical travel information corresponding to the electronic device. The historical travel information may include: the historical travel route and the historical travel time period corresponding to the historical travel route.
[0079] Optionally, historical travel information can be determined based on the historical state recognition results of the target recognition model, or it can be provided by the target application; this is not limited here. Optionally, the target application can include: map applications, and / or smart assistants, etc.; this is not limited here.
[0080] It should be noted that map applications can record the historical location and travel routes of electronic devices, so map applications can provide the historical travel information of electronic devices; in addition, since users of electronic devices may be involved in travel-related activities such as querying travel routes, activating public transport cards, and booking air tickets when interacting with smart assistants, smart assistants can also provide the historical travel information of electronic devices.
[0081] For example, an electronic device can determine the user's home location, company location, work and commuting times, and usual subway travel route from home to company based on the user profile provided by the target application. This allows the electronic device to identify the user's home-to-company route as a historical travel route and the commuting time period as the corresponding historical travel time period.
[0082] Furthermore, the electronic device can determine the state analysis result based on historical travel information. The state analysis result is used to indicate whether the electronic device is in the state of taking a vehicle. Then, based on the state analysis result and the state recognition result, it is determined whether the electronic device is in the state of taking a vehicle.
[0083] Optionally, the electronic device can obtain a first weighting coefficient corresponding to the state analysis result and a second weighting coefficient corresponding to the state recognition result, and then perform a weighted average based on the state analysis result, the first weighting coefficient, the state recognition result and the second weighting coefficient to determine whether the electronic device is in the state of riding a vehicle based on the weighted average result.
[0084] The first and second weighting coefficients can be set by the developers based on extensive development experience, and are not limited here. Optionally, the larger the weighting coefficient, the higher the reliability of the corresponding result.
[0085] In one alternative embodiment, there may be multiple historical travel routes, and the historical travel routes may or may not include the route segments in which transportation is used, without limitation.
[0086] Optionally, the way electronic devices determine the status analysis results based on historical travel information may include:
[0087] Obtain the current real-time location and time of the electronic device;
[0088] If the current time matches the historical travel time period corresponding to the target historical travel route, and / or the real-time location of the electronic device is within the target historical travel route, then it is determined whether the target historical travel route includes the route segment of taking a means of transportation, and the target historical travel route is any historical travel route.
[0089] If the historical travel route includes a segment of the route taken by a means of transportation, then the state of the electronic device being in the state of taking a means of transportation is determined as the state analysis result.
[0090] If the historical travel route does not include the route segment where a vehicle was used, then the electronic device being in a state of not using a vehicle is determined as the state analysis result.
[0091] For example, assuming the current time is during the user's work hours, and / or the real-time location of the electronic device is on the work route, and since the work route includes a subway route, the electronic device being in the state of taking transportation can be determined as the state analysis result.
[0092] For example, suppose the current time is when the user has finished dinner, and / or the electronic device is currently on the route between the user's home and the park. Since the user usually walks from home to the park after dinner, the route between the user's home and the park does not include the route segment where the user takes a vehicle. Therefore, the state analysis result can be determined that the electronic device is in a state of not taking a vehicle.
[0093] By implementing the above method, electronic devices can obtain their historical travel information and combine it with the status recognition results output by the target recognition model to determine whether the electronic device is in a state of riding in a vehicle, thus improving the accuracy of the determination.
[0094] By implementing the methods disclosed in the above embodiments, the first acceleration and first air pressure information collected by the low-power accelerometer and barometer can be used to determine whether the electronic device is in a state of riding in a vehicle. It should be noted that, since the accelerometer and barometer have low power consumption, they can be turned on for a long time to collect data, so that the collected first acceleration and first air pressure information can be continuously updated, thereby improving the accuracy of the state recognition result of the target recognition model, and thus improving the accuracy of the electronic device in recognizing the state of riding in a vehicle.
[0095] Please refer to the following: Figure 3 and Figure 4 , Figure 3This is a flowchart illustrating another method for recognizing the status of a vehicle used in an embodiment of this application. Figure 4 This is a schematic flowchart of a method disclosed in an embodiment of this application. Optionally, this method can be applied to the aforementioned electronic device or other execution entities, and is not limited thereto. Optionally, the method may include the following steps:
[0096] 302. The first acceleration of the electronic device is collected by an accelerometer, and the first air pressure information of the electronic device is collected by a barometer.
[0097] 304. Extract features from the first acceleration and first air pressure information to obtain target feature information.
[0098] 306. The target recognition model processes the target feature information to obtain a state recognition result, which is used to indicate whether the electronic device is in the state of riding a vehicle.
[0099] 308. Collect the corresponding second air pressure information of the electronic device through a barometer.
[0100] In this embodiment, the electronic device can collect second air pressure information via a barometer. This second air pressure information may be the same as or different from the first air pressure information; no limitation is made here. In some embodiments, the collected first air pressure information serves as the second air pressure information; in some embodiments, the first and second air pressure information may be collected at different times.
[0101] 310. If the electronic device is determined to be in the target activity scenario based on the second air pressure information, then the electronic device is determined to be in a state where it is not using a means of transportation.
[0102] Please see Figure 4 Optionally, the electronic device can extract the dominant feature information corresponding to the second air pressure information, and then use the dominant feature information corresponding to the second air pressure information to help determine whether the electronic device is in the state of riding a vehicle.
[0103] Optionally, the explicit characteristic information corresponding to the second air pressure information may include air pressure change information. The air pressure change information may include one or more of the following: the unidirectional rate of change of air pressure, the cumulative change of air pressure during the first target duration, and the standard deviation change of air pressure during the second target duration, which are not limited here.
[0104] Optionally, the electronic device can determine the first air pressure change information based on the second air pressure information, and determine whether the electronic device is in the target activity scene based on the first air pressure change information.
[0105] In some embodiments, the target activity scenario may be a scenario easily confused with a transportation scenario. Optionally, the target activity scenario may include one or more of the following: an elevator scenario, a skiing scenario, a cable car scenario, and a swimming scenario, without limitation. In other optional embodiments, the target activity scenario may also be a developer- or user-defined activity scenario, without limitation.
[0106] Furthermore, if the electronic device is determined to be in the target activity scene based on the first air pressure change information, it can be determined that the electronic device is not in a state of not using transportation; if the electronic device is determined not to be in the target activity scene based on the first air pressure change information, it can be determined whether the electronic device is in a state of using transportation based on the state recognition result output by the target recognition model.
[0107] By implementing the above method, if the electronic device can determine that it is in a target activity scene based on the second air pressure information, it can directly determine that the electronic device is not in a vehicle, without the need for subsequent target recognition model recognition process. This improves the speed of determining whether the electronic device is in a vehicle and can save the power consumption of the electronic device.
[0108] Furthermore, considering the differences in air pressure changes in scenarios such as elevators and cable cars compared to traditional modes of transportation like cars and trains, it's important to understand that when an elevator (e.g., a vertical elevator or a passenger elevator) is running at high speed, the electronic equipment inside experiences altitude changes, resulting in significant changes in atmospheric pressure. In contrast, traditional modes of transportation like cars and trains typically travel on roads with minimal altitude changes, leading to relatively small changes in atmospheric pressure. Therefore, implementing the aforementioned method to determine whether electronic equipment is in the target activity scenario based on air pressure change information can improve the accuracy of identifying the target activity scenario.
[0109] As an optional implementation, when the target activity scenario includes one or more scenarios such as cableways, cable cars, and skiing, the electronic device can determine whether it is in the target activity scenario based on the first air pressure change information. This can be achieved by: if the first duration corresponding to the unidirectional rate of change of air pressure is within a first time interval, and the cumulative change of air pressure within the first target duration is within a first change interval, then the electronic device can determine that it is in the target activity scenario. The first duration is the duration during which the unidirectional rate of change of air pressure is continuously within the first change interval.
[0110] Among them, the first time interval, the first target duration, the first change interval, and the first change rate interval can be determined by the developers based on a large number of empirical values of air pressure changes measured in target activity scenarios such as cable cars, skiing, etc., and are not limited here.
[0111] It is understandable that when electronic devices are in scenarios such as cable cars, gondolas, or skiing, the unidirectional rate of change and cumulative change of air pressure will vary significantly due to altitude changes. By implementing the above method, the accuracy of determining whether electronic devices are in target activity scenarios such as cable cars, gondolas, or skiing can be improved by measuring the unidirectional rate of change and cumulative change of air pressure.
[0112] In another optional embodiment, when the target activity scenario includes scenarios such as taking an elevator, the way the electronic device determines whether it is in the target activity scenario based on the first air pressure change information may include: if the unidirectional change rate of air pressure is greater than the first change rate threshold, then it can be determined that the electronic device is in the target activity scenario.
[0113] The first rate of change threshold can be determined by the developers based on a large number of empirical values of air pressure changes measured in elevator scenarios, and is not limited here.
[0114] It is understandable that when riding an elevator, the altitude of electronic devices will change drastically in a short period of time. By implementing the above method, it is possible to determine that the electronic device is in an elevator scenario when the unidirectional rate of change of air pressure of the electronic device changes significantly, thus improving the accuracy of determining the target activity scenario.
[0115] In another optional embodiment, when the target activity scenario includes scenarios such as swimming, the way the electronic device determines whether it is in the target activity scenario based on the first air pressure change information may include: if the standard deviation change of air pressure within the second target duration is greater than the air pressure change threshold, then it can be determined that the electronic device is in the target activity scenario.
[0116] The threshold for air pressure change can be determined by the developers based on a large number of empirical values of air pressure change measured in swimming scenarios, and is not limited here.
[0117] By implementing the methods disclosed in the above embodiments, it is possible to determine whether an electronic device is in a target activity scene based on the air pressure change characteristics of various target activity scenes that are easily confused with the scene of taking a vehicle, thereby improving the accuracy of determining the target activity scene.
[0118] In another alternative embodiment, if it is determined that the electronic device is in an aircraft-riding scenario based on the first air pressure change information corresponding to the second air pressure information, then it can be determined that the electronic device is in a vehicle-riding state.
[0119] Optionally, if the second duration of the unidirectional rate of change of air pressure is within the second time interval, and the cumulative change of air pressure within the fourth target duration is within the second change interval, then the electronic device can determine that the electronic device is in an aircraft riding scenario, and the second duration is the duration during which the unidirectional rate of change of air pressure is continuously within the second change interval.
[0120] The second time interval, the fourth target duration, the first change interval, and the first change rate interval can be determined by the developers based on a large number of empirical values of air pressure changes measured in aircraft scenarios, and are not limited here.
[0121] It should be noted that when electronic devices are in scenarios involving aircraft (e.g., airplane riding, flying car riding, etc.), the vertical speed and distance of movement of the aircraft are greater than in scenarios involving targets such as cable cars or ropeways. Consequently, the unidirectional rate of change and cumulative change in air pressure of the electronic devices will also be greater. Optionally, the second rate of change range can be greater than the first rate of change range, and the second change amount range can be greater than the first change amount range; no limitation is imposed here.
[0122] By implementing the above method, electronic devices can determine whether they are in an aircraft-riding scenario, such as when traveling by plane, by using unidirectional rate of change and cumulative change, thereby further determining whether they are in a mode of transportation, thus improving the flexibility of the method.
[0123] Optionally, if it is determined that the electronic device is in an aircraft-taking scenario, and thus in a vehicle-taking state, the electronic device can collect the corresponding third air pressure information through a barometer; and if the air pressure change direction of the second air pressure change information corresponding to the third air pressure information is opposite to the air pressure change direction of the first air pressure change information, it can be determined that the electronic device exits the aircraft-taking scenario and switches to a non-vehicle-taking state.
[0124] For example, when an aircraft takes off, the air pressure change is usually upward. If the air pressure change of the electronic device is subsequently detected to be downward, it means that the aircraft has descended and landed. This indicates that the electronic device has exited the aircraft passenger scenario and switched to a state of not being on a vehicle.
[0125] In another alternative embodiment, the electronic device may also determine that it is switching to a state of not using transportation if the duration of the detected motion of the electronic device exceeds a first duration threshold.
[0126] It should be noted that users do not move around for extended periods while on an aircraft. Therefore, if an electronic device is detected to be in motion for a prolonged period, it indicates that the aircraft has landed and the user is already walking on land. This confirms that the electronic device has exited the aircraft scenario and switched to a state of not being on a vehicle.
[0127] 312. If it is determined from the second air pressure information that the electronic device is not in the target activity scene, then determine whether the electronic device is in the state of riding a vehicle based on the state recognition result.
[0128] In this embodiment, when the electronic device determines that it is not in the target activity scenario or not in the aircraft scenario based on the second air pressure information, it can determine whether the electronic device is in the state of taking transportation based on the state recognition result output by the target recognition model. This ensures that the electronic device can be determined in a timely manner whether it is in the state of taking transportation, thereby improving the compatibility and flexibility of the method.
[0129] Please refer to it again. Figure 4 Optionally, the electronic device can also determine its motion state based on its acceleration and air pressure information, and then use the motion state of the electronic device to help determine whether the electronic device is in a state of riding in a vehicle.
[0130] In this embodiment of the application, the electronic device can determine whether it is in motion by using acceleration information, air pressure information, angular velocity information or positioning information, etc. This embodiment of the application does not limit the way to determine whether the electronic device is in motion.
[0131] In one alternative embodiment, the electronic device can acquire a second acceleration of the electronic device via an accelerometer and a fourth air pressure information of the electronic device via a barometer.
[0132] If the electronic device is determined to be in motion based on the second acceleration and the fourth air pressure information, then the electronic device is determined to be in a state of not riding in a vehicle; if the electronic device is determined to be not in motion based on the second acceleration and the fourth air pressure information, then the state recognition result can be used to determine whether the electronic device is riding in a vehicle.
[0133] Optionally, the electronic device can determine whether it is in motion based on the second acceleration and the fourth air pressure information using a motion state recognition model or algorithm. It should be noted that motion state recognition models or algorithms are mature technologies, and developers can customize them based on their experience; no limitations are imposed here.
[0134] It should be noted that when a user is in a transportation scenario, they will not move around significantly. If the above method is applied and the electronic device is detected to be in motion, it means that the electronic device is not in a transportation scenario. This can determine that the electronic device is not in a transportation scenario, thus eliminating the need for subsequent target recognition model identification. This improves the speed of determining the transportation status of the electronic device and also saves power consumption of the electronic device.
[0135] In another optional embodiment, if the electronic device determines that it is in a state of riding in transportation based on the state recognition result output by the target recognition model, and if the duration of a third target in motion detected by the electronic device exceeds a second duration threshold, then the electronic device can be determined to switch to a state of not riding in transportation. The second duration threshold can be set by the developers based on extensive development experience and is not limited here.
[0136] As mentioned earlier, when a user is in a transportation scenario, they will not move around much. However, if an electronic device is detected to be in motion for an extended period of time while the user is in a transportation scenario, it indicates that the user has left the transportation. This confirms that the electronic device has switched to a state where the user is not in a transportation scenario.
[0137] Please refer to it again. Figure 4 Optionally, the electronic device can use the explicit feature information collected by the positioning module (e.g., the movement information of the electronic device) to help determine whether the electronic device is in a state of riding in a vehicle.
[0138] In one optional embodiment, the electronic device can obtain its movement information through a positioning module; if the movement information is greater than a first movement threshold, it can be determined that the electronic device is in a state of riding a vehicle; if the movement information is not greater than the first movement threshold but greater than a second movement threshold, it is determined whether the electronic device is in a state of riding a vehicle based on the state recognition result; if the movement information is not greater than the second movement threshold, it is determined that the electronic device is in a state of not riding a vehicle; wherein, the first movement threshold may be greater than the second movement threshold.
[0139] Optionally, the positioning module may include a satellite positioning module and / or a network positioning module, which is not limited here. It should be noted that the satellite positioning module can obtain the movement information of the electronic device through satellite positioning technology; the network positioning module can determine the relative position information between the electronic device and the network access point (e.g., a base station or a WIFI hotspot) based on the transmitted and received network signals, and then determine the movement information of the electronic device based on the relative position information, which is not limited here.
[0140] Optionally, the mobility information may include the mobility speed of the electronic device, the first mobility threshold includes a first speed threshold, the second mobility threshold includes a second speed threshold, and the first speed threshold is greater than the second speed threshold.
[0141] Optionally, the movement speed may include GPS (Global Positioning System) speed, or movement speed obtained through other means, which is not limited here. Among them, GPS speed refers to the speed calculated through GPS positioning technology.
[0142] For example, if the moving speed of the electronic device is greater than the first speed threshold, it means that the electronic device is currently in a high-speed moving state, and the electronic device is likely on a vehicle. Therefore, it can be determined that the electronic device is in a state of riding in a vehicle. If the moving speed of the electronic device is not greater than the second speed threshold, it means that the electronic device is currently in a low-speed moving state or a stationary state, and the electronic device is likely not on a vehicle. Therefore, it can be determined that the electronic device is in a state of not riding in a vehicle.
[0143] Furthermore, if the moving speed of the electronic device is not greater than the first speed threshold but greater than the second speed threshold, it is difficult to accurately determine whether the electronic device is in a state of riding in a vehicle based on the moving speed. In this case, the state recognition result output by the target recognition model can be used to determine whether the electronic device is in a state of riding in a vehicle.
[0144] In another alternative embodiment, the motion information may include the amount of motion change of the electronic device, the first motion threshold may include a first change threshold, the second motion threshold may include a second change threshold, and the first change threshold is greater than the second change threshold.
[0145] Optionally, the amount of movement change of the electronic device can be determined based on the network signals transmitted and received by the network positioning module of the electronic device, or based on the change in the relative position between the electronic device and the network access point, without limitation.
[0146] For example, assuming that the relative distance between the electronic device and the target base station at the first moment is determined to be A meters and the included angle is a degrees based on network information; and the relative distance between the electronic device and the target base station at the second moment is B meters and the included angle is b degrees, then the electronic device can determine the distance it moves between the first moment and the second moment using the triangulation method. The moving distance is the change in the movement of the electronic device.
[0147] Similar to the movement speed described above, electronic devices can determine whether they are moving at high speed, low speed, or in between based on the amount of change in their movement. This allows them to determine whether they are in a state of riding in a vehicle, which will not be elaborated upon here.
[0148] By implementing the above method, electronic devices can determine whether they are in a high-speed, low-speed, or somewhere in between state based on their movement information. If the device is in a high-speed state, it can be directly determined that it is using a vehicle; if it is in a low-speed state, it can be determined that it is not using a vehicle. This eliminates the need for subsequent target recognition model identification, thus improving the speed of determining the vehicle's status and saving power. Furthermore, if the device is in a state between high-speed and low-speed, the status recognition result can be combined to determine whether it is using a vehicle, improving the method's compatibility and flexibility.
[0149] In some embodiments, when the state recognition result corresponds to the state of being in a vehicle, the user's state, such as whether or not they are in a vehicle, can be further determined through positioning functions, such as GPS positioning.
[0150] In one optional embodiment, when it is determined that the electronic device is in a state of riding in a vehicle, the electronic device can obtain the movement information of the electronic device through the positioning module; and then determine whether the electronic device is in a state of riding in a vehicle based on the movement information of the electronic device using the method described above.
[0151] It should be noted that, due to the high power consumption of the positioning module, it is generally not necessary to turn it on to save power and improve the battery life of the electronic device. However, when the electronic device changes its status as a passenger vehicle, the positioning module can be turned on to collect the movement information of the electronic device in order to more accurately determine whether the status of the electronic device as a passenger vehicle has actually changed, thereby improving the accuracy of determining the status of the electronic device as a passenger vehicle.
[0152] Please refer to it again. Figure 4The electronic device can extract explicit and implicit feature information from the data collected by the positioning module, and fuse the explicit and implicit feature information corresponding to the positioning data with the feature information corresponding to the acceleration, air pressure, angular velocity and magnetic field information introduced above, and input the fused feature information into the target recognition model for processing, so as to improve the accuracy of the state recognition results output by the target recognition model.
[0153] Please refer to it again. Figure 4 Electronic devices can use angular velocity sensors (e.g., gyroscopes) to collect angular velocity information and magnetometers to collect magnetic field information. Based on these angular velocity and magnetic field information, electronic devices can be used to help determine whether they are in a state of riding in a vehicle.
[0154] Optionally, the electronic device can extract the feature information of angular velocity and magnetic field information separately, and fuse the feature information corresponding to angular velocity, magnetic field information, first acceleration and first air pressure information to obtain second target feature information. The target recognition model can then process the second target feature information to obtain the state recognition result. No limitation is made here.
[0155] By implementing the above method, electronic devices can combine data such as angular velocity and magnetic field information as input to the target recognition model, thereby improving the accuracy of the state recognition results in indicating whether the electronic device is in the state of riding in a vehicle.
[0156] To more clearly describe the method for recognizing the status of a vehicle used in accordance with the embodiments of this application, the following will be combined with... Figure 5 To explain, Figure 5 This is a schematic diagram of another method flow disclosed in an embodiment of this application. Wherein:
[0157] 502. The electronic device is not in a state of being in a vehicle.
[0158] 504. The electronic device can collect the corresponding second air pressure information of the electronic device, and if it is determined from the second air pressure information that the electronic device is in the target activity scene, then it is determined that the electronic device is in a non-transportation state; if it is determined from the second air pressure information that the electronic device is not in the target activity scene, then step 506 is executed.
[0159] 506. The electronic device collects the second acceleration information and the fourth air pressure information of the electronic device, and determines whether the electronic device is in motion based on the second acceleration information and the fourth air pressure information, and determines whether the electronic device is in a state of riding a vehicle based on whether the electronic device is in motion.
[0160] Optionally, after performing step 506, the electronic device may choose to perform step 508 to improve the accuracy of determining whether the electronic device is in a state of riding in a vehicle; or it may directly perform step 510 to save power consumption of the electronic device.
[0161] 508. Electronic devices can collect target sensor data and use this data to help determine whether the electronic device is in a state of riding in a vehicle. The target sensor data may include one or more of the following: moving speed, change in movement, angular velocity, and magnetic field information.
[0162] 510. Obtain the state recognition result output by the target recognition model. If the state recognition result determines that the electronic device is in the state of riding a vehicle, then proceed to step 512.
[0163] 512. The electronic device is in the state of being in a vehicle.
[0164] 514. If the duration of the third target when the electronic device is in motion is greater than the second duration threshold, then the electronic device can be switched to a state where it is not in motion. If the duration of the third target when the electronic device is not in motion is greater than the second duration threshold, then step 516 can be executed.
[0165] 516. Obtain the movement information of the electronic device. If the movement information is greater than the first movement threshold, it can be determined that the electronic device is still in the state of riding a vehicle.
[0166] 518. Obtain the state recognition result output by the target recognition model. If the state recognition result determines that the electronic device is not in a state of riding a vehicle, then proceed to step 502.
[0167] Implementing the methods disclosed in the above embodiments allows for the use of low-power accelerometers and barometers to collect first acceleration and first air pressure information to determine whether an electronic device is in a state of being in a vehicle. It should be noted that because the accelerometer and barometer have low power consumption, they can be turned on for extended periods to collect data, allowing the collected first acceleration and first air pressure information to be continuously updated. This improves the accuracy of the state recognition results of the target recognition model, thereby improving the accuracy of the electronic device in recognizing the state of being in a vehicle. Furthermore, if the electronic device determines that it is in a target activity scenario based on the second air pressure information, it can directly determine that the electronic device is not in a vehicle state, without further... The subsequent target recognition model identification process is required, which improves the speed of determining whether an electronic device is in a state of being in a vehicle and can save the power consumption of the electronic device. In addition, considering that the air pressure changes in scenarios such as elevators and cable cars are different from those in traditional vehicles such as cars and trains, for example, electronic devices experience altitude changes during elevator rides, which will cause significant changes in atmospheric pressure, while traditional vehicles such as cars and trains usually travel on the road with little altitude change, so the atmospheric pressure changes are not significant. Therefore, implementing the above method to determine whether an electronic device is in a target activity scenario through air pressure change information can improve the accuracy of determining the target activity scenario.
[0168] Furthermore, the system can determine whether an electronic device is in a target activity scenario based on the air pressure change characteristics of various target activity scenarios that are easily confused with transportation scenarios, thereby improving the accuracy of target activity scenario determination. Also, if the electronic device is detected to be in motion, it indicates that the device is not in a transportation scenario, thus eliminating the need for subsequent target recognition model identification, which improves the speed of determining the transportation status of the electronic device and saves power consumption. Additionally, the system can determine whether the electronic device is in a high-speed, low-speed, or a combination of both states based on its movement information. If the device is in a high-speed movement state, it can be directly determined to be in a transportation scenario; if it is in a low-speed movement state, it can be determined to be in a non-transportation scenario, eliminating the need for subsequent target recognition model identification, further improving the speed of determining the transportation status of the electronic device and saving power consumption.
[0169] Please see Figure 6 , Figure 6This is a flowchart illustrating another method for recognizing the status of a vehicle used in accordance with an embodiment of this application. Optionally, this method can be applied to the aforementioned electronic device or other executing entities, and is not limited thereto. Optionally, the method may include the following steps:
[0170] 602. In the first identification mode, the first acceleration of the electronic device is collected by an accelerometer and the first air pressure information of the electronic device is collected by a barometer according to the first data sampling rate.
[0171] In this embodiment, the electronic device can switch to a first identification mode, in which the electronic device can collect data according to a first data sampling rate. Optionally, the first data sampling rate can be less than a data sampling rate threshold, which can be set by developers based on extensive development experience and is not limited here.
[0172] It should be noted that, under normal circumstances, electronic devices do not frequently switch between modes of transportation and do not need to frequently determine their current mode of transportation. Therefore, electronic devices can use a low sampling rate (first data sampling rate) to collect data, thereby saving power consumption and improving battery life.
[0173] 604. Extract features from the first acceleration and first air pressure information to obtain target feature information.
[0174] 606. The target recognition model processes the target feature information to obtain the state recognition result, which is used to indicate whether the electronic device is in the state of riding a vehicle.
[0175] As an optional embodiment, the electronic device can acquire multiple state recognition results within a target time period to obtain a first state sequence; then, the first state sequence can be divided according to a target window, and the state indicated by the most frequent state recognition result within each target window can be used as the window state corresponding to each target window; then, a second state sequence can be determined based on multiple window states, and the second state sequence is used to characterize the activity of the electronic device within the target time period.
[0176] Optionally, the electronic device may output a second state sequence for user reference, or the second state sequence may be used as reference data for target functions within the electronic device. Optionally, target functions may include: travel trajectory analysis, commuting time analysis, lifestyle and time allocation analysis, health functions, and task planning functions, etc., without limitation.
[0177] Optionally, the target time period can include historical time periods. The duration of the target time period can be set by the developers or users according to their needs; typical values can include one day, three days, or one week, etc., and are not limited here.
[0178] It should be noted that target recognition models typically output a state recognition result at regular intervals (e.g., 1 second, 10 seconds, etc., without limitation here). However, the state recognition results output by the target recognition model are not absolutely accurate. Therefore, during a period when the electronic device is actually in a "riding in a vehicle" state, the first state sequence determined by the state recognition results output by the target recognition model might be: "Seconds 1-3 are in a 'riding in a vehicle' state, seconds 4-6 are in a 'not riding in a vehicle' state, seconds 7-15 are in a 'riding in a vehicle' state..."
[0179] Understandably, electronic devices typically "ride" a mode of transportation for a fixed duration, such as 5 or 10 minutes, and do not frequently switch between the "riding" and "not riding" states. Therefore, the electronic device can divide the first state sequence according to target windows, and use the state indicated by the most frequent state recognition result within each target window as the corresponding window state.
[0180] For example, suppose the first state sequence includes: "Seconds 1-3 are in the state of using transportation, seconds 4-6 are in the state of not using transportation, seconds 7-15 are in the state of using transportation...". Assuming the target window length is 5 minutes, and the frequency of being in the state of using transportation is highest within the first target window's 5 minutes, then "being in the state of using transportation" can be used as the window state of the first target window. This allows "seconds 4-6 being in the state of not using transportation" to be adjusted to "being in the state of using transportation," achieving a smoother state transition. Subsequent target windows can be processed similarly.
[0181] By implementing the above method, the electronic device can smooth the states in the first state sequence through the target window to eliminate the impact of the incorrect recognition results of the target recognition model, thereby improving the accuracy of the subsequently determined second state sequence.
[0182] Optionally, the length of the target window can be set by developers based on extensive development experience, and is not limited here. Optionally, the length of the target window can be adjusted according to the application scenario and data characteristics, and can also be determined based on the state type. For example, since the duration of a user's transportation ride is usually greater than a ride duration threshold (e.g., 5 minutes, 10 minutes), the window length of the target window for determining the transportation ride status can be greater than or equal to the ride duration threshold. As another example, the duration of a user's movement is usually greater than a movement duration threshold (e.g., 2 minutes, 3 minutes), and the window length of the target window for determining the movement status can be greater than or equal to the movement duration threshold, and is not limited here.
[0183] In one optional embodiment, the target window may include a first window and a second window, wherein the window length of the second window is different from the window length of the first window. Optionally, the electronic device may divide the first state sequence using the first window and take the state indicated by the most frequent state recognition result in each first window as the first window state of the corresponding first window to obtain a third state sequence;
[0184] The third state sequence can then be divided using a second window, and the state indicated by the most frequent state recognition result in each second window can be used as the second window state of the corresponding second window to obtain the second state sequence.
[0185] For example, assuming the first window has a window length of 5 minutes, the electronic device can first process the first state sequence with the first window with a window length of 5 minutes to obtain the third state sequence, and then process the third state sequence with the second window with a window length of 2 minutes to obtain the second state sequence.
[0186] By implementing the above method, the electronic device can smooth the first state sequence through multiple target windows of different window lengths, thereby improving the accuracy of the subsequently obtained second state sequence.
[0187] In one optional embodiment, the electronic device can determine that there is an abnormal window state among the plurality of window states, and correct the abnormal window state; then determine a second state sequence based on the corrected plurality of window states.
[0188] By implementing the above method, abnormal window states can be corrected to further improve the accuracy of the subsequent second state sequence.
[0189] Optionally, the electronic device may determine that there is an abnormal window state among the multiple window states and correct the abnormal window state in the following ways: if the window state of the first target window is different from the window states of the previous target window and the next target window, and the window states of the previous target window and the next target window are the same, then the window state of the first target window is determined to be an abnormal window state; then the electronic device may modify the window state of the first target window to the window state of the previous target window and / or the next target window.
[0190] For example, assuming the window state of the first target window is "movement state", the window state of the second target window is "taking a vehicle state", and the window state of the third target window is "movement state", then the window state of the second target window can be changed from "taking a vehicle state" to "movement state".
[0191] By implementing the above method, the electronic device can merge the corresponding window states of adjacent target windows to eliminate brief window state transitions, thereby improving the accuracy of the subsequent second state sequence.
[0192] In some alternative embodiments, abnormal window states may include: multiple window states in which the state of riding in a vehicle and the state of motion alternate, and the duration of the alternation is longer than the window duration of the target window; and / or multiple window states in which different vehicle types alternate, the duration of the alternation is longer than the window duration of the target window, and the state of motion is not included.
[0193] As mentioned earlier, electronic devices typically remain in motion or while in use for a certain period of time and do not frequently switch between these states. Therefore, if multiple target windows exhibit prolonged alternation of window states, these alternating window states can be identified as abnormal window states.
[0194] Optionally, the electronic device may correct the abnormal window state based on the movement information of the electronic device; and / or adjust the window length of the target window, and re-execute the step of dividing the first state sequence based on the adjusted target window.
[0195] In one optional embodiment, the abnormal window state may include a "transportation-taking state" and a "no-transportation-taking state". Optionally, the electronic device may acquire target movement information for the abnormal time period corresponding to the abnormal window state. If the target movement information is greater than a third movement threshold, the "no-transportation-taking state" can be corrected to "transportation-taking state"; if the target movement information is not greater than the third movement threshold, the "transportation-taking state" can be corrected to "no-transportation-taking state". Optionally, the third movement threshold may be a movement threshold corresponding to the vehicle movement situation, and is not limited thereto.
[0196] Optionally, "not using transportation" can include "stationary state". It should be noted that if the target movement information is greater than the third movement threshold, it means that the electronic device is moving at high speed, and it is highly likely to be in "using transportation" state. In this case, "stationary state" can be corrected to "using transportation" state. Conversely, if the target movement information is not greater than the third movement threshold, it means that the electronic device is not in transportation. In this case, "using transportation" state can be corrected to "stationary state".
[0197] In another optional embodiment, the "not using transportation state" may include the "cycling state". Optionally, the electronic device may determine whether there is a transition state during the alternation between the "using transportation state" and the "cycling state"; if so, it indicates that the switching between the "using transportation state" and the "cycling state" is normal, and no state correction is required. Optionally, the transition state may include "walking state" and / or "running state", etc., which are not limited here.
[0198] If it does not exist, the electronic device can obtain the target movement information of the abnormal time period corresponding to the abnormal window state. If the target movement information is greater than the third movement threshold, the "cycling state" can be corrected to the "transportation state"; if the target movement information is not greater than the third movement threshold, the "transportation state" can be corrected to the "cycling state".
[0199] In another optional embodiment, considering that the speed in the "cycling state" may be greater than or equal to the speed in the "transportation state," there may be situations where it is impossible to determine whether the electronic device is in the "transportation state" or the "cycling state" based on the target movement information and the third movement threshold. Optionally, the electronic device can adjust the window length of the target window and re-execute the step of dividing the first state sequence based on the adjusted target window to eliminate abnormal window states through the "state smoothing" method described above.
[0200] In one alternative embodiment, it should be noted that when a user switches between different types of transportation, there are usually transitional states such as "walking state" and / or "running state".
[0201] In response, if the abnormal window state includes: alternating appearances of different modes of transportation, with the alternation lasting longer than the target window's duration, and excluding multiple window states in transitional states, it indicates that the user has not changed modes of transportation but is on the same mode of transportation. Therefore, the electronic device can optionally adjust the target window's length and re-execute the step of dividing the first state sequence based on the adjusted target window. This smooths the alternating window states of different modes of transportation to window states corresponding to the same mode of transportation through the "state smoothing" method described earlier.
[0202] By implementing the above method, electronic devices can correct for alternating abnormal window states, thereby improving the accuracy of the subsequent second state sequence.
[0203] 608. When the mode switching conditions are met, control the electronic device to switch from the first identification mode to the second identification mode, and collect the first acceleration of the electronic device through the accelerometer and the first air pressure information of the electronic device through the barometer according to the second data sampling rate, wherein the second data sampling rate is greater than the first data sampling rate.
[0204] Optionally, the switching conditions may include: the electronic device switching from a state of riding in transportation to a state of not riding in transportation, and / or, switching from a state of not riding in transportation to a state of riding in transportation.
[0205] It should be noted that when an electronic device switches between different modes of transportation, in order to more accurately determine whether the switch has actually occurred, the electronic device can switch to a second recognition mode to increase its data sampling rate. Understandably, a higher data sampling rate means more data is collected, resulting in more reference data for determining whether the electronic device is in a transportation-using state, thus improving the accuracy of this determination.
[0206] By implementing the above method, electronic devices can increase their data sampling rate when switching conditions are met, thereby improving the accuracy of determining whether the electronic device is in a state of riding in a vehicle.
[0207] In some alternative embodiments, the electronic device can also switch from a first recognition mode to a second recognition mode upon receiving a switching command. Optionally, the switching command can be a user-input command. By implementing the above method, the user can actively switch the recognition mode of the electronic device, thereby improving the controllability and flexibility of the method.
[0208] In one optional embodiment, after the electronic device switches from a first identification mode to a second identification mode, it can collect target sensor data through the target sensor at a second data sampling rate. Optionally, the target sensor data includes one or more of the following: moving speed, change in movement, angular velocity, and magnetic field information; furthermore, the electronic device can determine whether it is in a state of riding in a vehicle based on the target sensor data.
[0209] It should be noted that the previous text has already introduced how to determine whether an electronic device is in a vehicle state based on target sensor data such as moving speed, change in movement, angular velocity, and magnetic field information, so it will not be repeated here.
[0210] In some embodiments, after enabling the second recognition mode, the sampling rate of acceleration and / or air pressure can be increased, and the acquisition of one or more types of data, including angular velocity data, magnetometer data, positioning data, and network data, can be enabled. For example, after enabling the high-precision mode, the sampling rate of acceleration and air pressure can be increased, and the acquisition of angular velocity data, magnetometer data, positioning data, and network data can be enabled.
[0211] By implementing the above method, when the electronic device switches to the second recognition mode, in addition to collecting the first acceleration and first air pressure information, it can also collect target sensor information and use the target sensor information to help determine whether the electronic device is in a state of riding in a vehicle, thereby improving the accuracy of determining whether the electronic device is in a state of riding in a vehicle.
[0212] In an optional embodiment, if it is determined, based on target sensor data and state recognition results, that the state of the vehicle corresponding to the electronic device has changed, and the duration of the electronic device remaining in the changed state is greater than a third duration threshold, the electronic device can be controlled to switch from the second recognition mode to the first recognition mode.
[0213] It should be noted that if the state of the transportation vehicle corresponding to the electronic device changes, and the duration of the electronic device remaining in the changed state exceeds the third duration threshold, it indicates that the electronic device has stably remained in the changed state, such as stably being in the transportation vehicle state or stably not being in the transportation vehicle state. Subsequently, the electronic device typically will not frequently switch between transportation vehicle states. In this case, the electronic device can switch to the first recognition mode to reduce the data sampling rate and the steps involved in determining whether the electronic device is in the transportation vehicle state using target sensor data, thereby saving power consumption and improving battery life. To more clearly illustrate the embodiments of this application, the following is combined with... Figure 7 and Figure 8 Some optional embodiments are described.
[0214] Please see Figure 7 , Figure 7 This is a schematic diagram of another method flow disclosed in an embodiment of this application. Wherein:
[0215] 702. The electronic device is in a state of not being in a vehicle.
[0216] 704. The electronic device can switch to the first recognition mode and identify whether the electronic device is in the state of riding a vehicle based on the first recognition mode.
[0217] 706. Based on the first state identification result of the target historical time period and the current second state identification result, determine whether the electronic device is in the state of riding a vehicle; if yes, proceed to step 708; if no, proceed to step 704.
[0218] 708. Switch to the second recognition mode and identify whether the electronic device is in the state of riding a vehicle based on the second recognition mode.
[0219] 710. Does the proportion of the electronic device being in a vehicle mode exceed the third proportion threshold? If yes, proceed to step 712; if no, proceed to step 704.
[0220] 712. The output electronic device is in the state of being in a vehicle.
[0221] 714. Does the duration of the electronic device being in the mode of using a vehicle exceed the third duration threshold? If yes, proceed to step 716; if no, repeat step 714.
[0222] 716. Switch to the first recognition mode.
[0223] Please see Figure 8 , Figure 8 This is a schematic diagram of another method flow disclosed in an embodiment of this application. Wherein:
[0224] 802. The electronic device is in the state of being in a vehicle.
[0225] 804. The electronic device can switch to the first recognition mode and identify whether the electronic device is in the state of riding a vehicle based on the first recognition mode.
[0226] 806. Based on the first state identification result of the target historical time period and the current second state identification result, determine whether the electronic device is in a state of not using transportation; if yes, proceed to step 808; if no, proceed to step 804.
[0227] 808. Switch to the second recognition mode and identify whether the electronic device is in the state of riding in a vehicle based on the second recognition mode.
[0228] 810. Is the proportion of the electronic device in the state of riding in a vehicle less than the fourth proportion threshold? If yes, proceed to step 812; if no, proceed to step 804.
[0229] 812. The output electronic device is in a state of not using a vehicle.
[0230] 814. Does the duration of time the electronic device has been in a state of not using transportation exceed the fourth duration threshold? If yes, proceed to step 816; if no, repeat step 814.
[0231] 816. Switch to the first recognition mode.
[0232] In some embodiments, the target historical time period may include a first sub-historical time period and a second sub-historical time period, which is not limited herein. In an optional embodiment, the first sub-historical time period may include the second sub-historical time period. Optionally, the first and second sub-historical time periods may be the historical time periods closest to the current time. Optionally, the first sub-historical time period may be longer than the second sub-historical time period. For example, the first sub-historical time period may be the most recent 30 seconds, and the second sub-historical time period may be the most recent 10 seconds, which is not limited herein.
[0233] For example, in the case of not using transportation, a first and second sub-historical time period are set, such as two duration thresholds: TH3TL1 and TH3TS1, where TH3TL1 is longer than TH3TS1, for example, TH3TL1 = 120s and TH3TS1 = 30s. If the proportion of the model output indicating the use of transportation within the TH3TL1 duration is greater than TH3P1, and the proportion of the model output indicating the use of transportation within the TH3TS1 duration is greater than TH3P2, and the current model output is the use of transportation, then the result is considered reliable, and a second recognition mode, such as high-precision mode, is activated.
[0234] For example, in the second recognition mode, when the proportion of the recognition result in the state of taking transportation within the most recent TH3T1 is greater than the threshold TH3P3, the state of taking transportation is output, or a dialog box pops up to ask the user whether they have actually entered the state of taking transportation.
[0235] Once the state of taking a vehicle is entered, if the proportion of the time spent in the state of taking a vehicle within the most recent TH3T2 is greater than the threshold TH3P4, it indicates that the state of taking a vehicle has been stably entered, and the second recognition mode is exited (such as entering the first recognition mode).
[0236] For example, when the user is in a state of using transportation, two time thresholds are set: TH3TL2 and TH3TS2, with TH3TL2 being longer than TH3TS2. For instance, TH3TL1 = 120s and TH3TS1 = 30s. If the proportion of the model output indicating a state of using transportation within the TH3TL1 time limit is less than TH3P5, and the proportion of the model output indicating a state of using transportation within the TH3TS1 time limit is less than TH3P6, and the current model output indicates a state of not using transportation, then the result is considered reliable, and a second recognition mode, such as high-precision mode, is activated.
[0237] In the second recognition mode, if the proportion of vehicles in the most recent TH3T3 is less than the threshold TH3P7, the non-vehicle status will be output, or a dialog box will pop up asking the user whether they have truly exited the vehicle status.
[0238] If the proportion of vehicles in the recent TH3T4 period is less than the threshold TH3P4 after exiting the vehicle-riding state, it indicates that the vehicle-riding state has been stably exited and the second recognition mode has been exited.
[0239] Implementing the methods disclosed in the above embodiments allows for the use of low-power accelerometers and barometers to collect first acceleration and first air pressure information to determine whether an electronic device is in a state of being in a vehicle. It should be noted that because the accelerometer and barometer have low power consumption, they can be turned on for extended periods to collect data, allowing the collected first acceleration and first air pressure information to be continuously updated. This improves the accuracy of the state recognition results identified by the target recognition model, thereby improving the accuracy of the electronic device in recognizing the state of being in a vehicle. Furthermore, the states in the first state sequence can be smoothed using a target window to eliminate errors caused by the target recognition model. The impact of the identification results improves the accuracy of the subsequently determined second state sequence; the first state sequence can be smoothed using multiple target windows of different lengths to improve the accuracy of the subsequently obtained second state sequence; abnormal window states can be corrected to further improve the accuracy of the subsequently obtained second state sequence; the corresponding window states of adjacent target windows can be merged to eliminate brief window state jumps, thereby improving the accuracy of the subsequently obtained second state sequence; and alternating abnormal window states can be corrected to improve the accuracy of the subsequently obtained second state sequence.
[0240] Furthermore, a low initial data sampling rate can be used to collect data, thereby saving power consumption of electronic devices and improving their battery life; and, when switching conditions are met, the data sampling rate of electronic devices can be increased to improve the accuracy of determining whether an electronic device is in a state of riding in a vehicle.
[0241] In one embodiment, when the electronic device is in a first identification mode, it can collect sensor data according to a first data sampling rate corresponding to the first identification mode. The sensor data includes, but is not limited to, one or more of the following: air pressure information, acceleration, movement speed, change in movement, angular velocity, and magnetic field information of the electronic device described above; these are not limited here.
[0242] Furthermore, electronic devices can determine their corresponding state recognition results based on sensor data.
[0243] It should be noted that the way electronic devices determine their corresponding state recognition results based on sensor data is not limited to the method of recognition through target recognition models described above.
[0244] When the mode switching conditions are met, the electronic device can switch from the first recognition mode to the second recognition mode; wherein the second data sampling rate corresponding to the second recognition mode is greater than the first data sampling rate corresponding to the first recognition mode.
[0245] Furthermore, electronic devices can identify whether they are in a state of riding in a vehicle based on the second recognition mode.
[0246] It should be noted that the mode switching conditions and the second recognition mode have been introduced earlier and will not be repeated here.
[0247] By implementing the above method, the electronic device can normally be in a first identification mode with a low data sampling rate to save power consumption; and, when the switching conditions are met, it can switch to a second identification mode to increase the data sampling rate of the electronic device, thereby improving the accuracy of determining whether the electronic device is in a state of riding in a vehicle.
[0248] In one optional embodiment, the electronic device can acquire multiple state recognition results of the electronic device within a target time period to obtain a first state sequence.
[0249] The methods for obtaining state recognition results include, but are not limited to, the method of recognition through target recognition models described above.
[0250] Furthermore, the electronic device can divide the first state sequence according to the target window, and take the state indicated by the most frequent state recognition result in each target window as the window state corresponding to each target window;
[0251] Furthermore, the electronic device can determine a second state sequence based on multiple window states, and the second state sequence is used to characterize the activity of the electronic device within the target time period.
[0252] By implementing the above methods, electronic devices can statistically analyze their activity within a target time period, providing feedback to users or serving as reference data for target functions such as travel trajectory analysis and commuting time analysis, thereby improving the user experience.
[0253] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a vehicle status recognition device disclosed in an embodiment of this application. Optionally, this device can be applied to the aforementioned electronic device or other execution entities, which are not limited herein. Optionally, the device may include a first acquisition unit 902, a first extraction unit 904, and a first recognition unit 906, wherein:
[0254] The first acquisition unit 902 is used to acquire the first acceleration of the electronic device through an accelerometer and to acquire the first air pressure information of the electronic device through a barometer.
[0255] The first extraction unit 904 is used to extract features from the first acceleration and the first air pressure information to obtain target feature information;
[0256] The first identification unit 906 is used to process target feature information through a target identification model to obtain a state identification result, which is used to indicate whether the electronic device is in the state of riding a vehicle.
[0257] Implementing the above-described device, the electronic device may include an accelerometer and a barometer. The electronic device can acquire a first acceleration from the accelerometer and first air pressure from the barometer. Feature extraction is performed on the first acceleration and first air pressure information to obtain target feature information. The electronic device can then process the target feature information using a target recognition model to obtain a state recognition result, which indicates whether the electronic device is in a state of riding in a vehicle. Therefore, the vehicle riding state recognition method disclosed in this application uses a low-power accelerometer and barometer to acquire first acceleration and first air pressure information to determine whether the electronic device is in a state of riding in a vehicle. It should be noted that because the accelerometer and barometer have low power consumption, they can be turned on for extended periods to acquire data, allowing the acquired first acceleration and first air pressure information to be continuously updated. This improves the accuracy of the state recognition result identified by the target recognition model, thereby improving the accuracy of the electronic device in recognizing the state of riding in a vehicle.
[0258] As an optional embodiment, the state recognition result is also used to indicate the type of vehicle corresponding to the vehicle the electronic device is traveling in.
[0259] By implementing the above-mentioned device, the status recognition results can provide the type of transportation that the electronic device is using, providing more reference information, thereby facilitating users to review the process of using transportation in more detail and improving the user experience.
[0260] As an optional embodiment, the first extraction unit 904 is further configured to fuse the first acceleration and the first air pressure information to obtain fused data, and to extract features from the fused data to obtain target feature information; or, to extract feature information corresponding to the first acceleration and the first air pressure information respectively, and to fuse the feature information corresponding to the first acceleration and the first air pressure information respectively to obtain target feature information.
[0261] By implementing the above-mentioned device, the electronic device can fuse the feature information of the first acceleration and the first air pressure information in different ways, which improves the flexibility of the method. In addition, the fusion can obtain target feature information with higher information integration, making the subsequent state recognition result determined based on the target feature information more accurate.
[0262] As an optional embodiment, Figure 9The illustrated device may further include a second identification unit (not shown), wherein:
[0263] The second identification unit is used to collect the corresponding second air pressure information of the electronic device through a barometer; and if it is determined that the electronic device is in the target activity scene based on the second air pressure information, then the electronic device is determined to be in a state of not riding a vehicle; and if it is determined that the electronic device is not in the target activity scene based on the second air pressure information, then the electronic device is determined to be in a state of riding a vehicle based on the state identification result.
[0264] By implementing the above device, the electronic device can determine that it is not in a vehicle if it is in a target activity scene based on the second air pressure information, without needing to go through the subsequent target recognition model recognition process. This improves the speed of determining whether the electronic device is in a vehicle and can save the power consumption of the electronic device.
[0265] As an optional embodiment, Figure 9 The apparatus shown may also include a determination unit (not shown), wherein:
[0266] The judgment unit is used to determine first pressure change information based on the second pressure information after acquiring the corresponding second pressure information of the electronic device through a barometer. The first pressure change information includes one or more of the following: the unidirectional change rate of pressure, the cumulative change of pressure within a first target duration, and the standard deviation change of pressure within a second target duration; and to determine whether the electronic device is in a target activity scenario based on the first pressure change information.
[0267] Implementing the above device takes into account the differences in air pressure changes in scenarios such as elevators and cable cars compared to traditional modes of transportation like cars and trains. For example, electronic devices experience altitude changes during elevator rides, resulting in significant changes in atmospheric pressure. In contrast, traditional modes of transportation like cars and trains typically travel on roads with minimal altitude changes, leading to relatively small atmospheric pressure variations. Therefore, implementing the above method to determine whether electronic devices are in the target activity scenario based on air pressure change information can improve the accuracy of identifying the target activity scenario.
[0268] As an optional embodiment, the determining unit is further configured to determine that the electronic device is in a target activity scenario when the unidirectional rate of change of air pressure is within a first time interval for a first duration, and the cumulative change in air pressure within a first target duration is within a first change range; wherein the first duration is the duration during which the unidirectional rate of change of air pressure is continuously within the first change range; or,
[0269] If the rate of change of air pressure in one direction is greater than the first rate of change threshold, then the electronic device is determined to be in the target activity scenario; or,
[0270] If the standard deviation of the air pressure change within the second target time period is greater than the air pressure change threshold, then the electronic device is determined to be in the target activity scenario.
[0271] By implementing the above-mentioned device, it is possible to determine whether an electronic device is in a target activity scene based on the air pressure change characteristics of various target activity scenes that are easily confused with the scene of taking a vehicle, thereby improving the accuracy of determining the target activity scene.
[0272] As an optional embodiment, Figure 9 The device shown may further include a fourth identification unit and a fifth identification unit (not shown), wherein:
[0273] The fourth identification unit is used to determine that the electronic device is in a mode of transportation if the electronic device is in a scenario of taking an aircraft based on the first air pressure change information corresponding to the second air pressure information.
[0274] The fifth identification unit is used to collect the corresponding third air pressure information of the electronic device through a barometer after determining that the electronic device is in the state of riding in a vehicle; and if the air pressure change direction of the second air pressure change information corresponding to the third air pressure information is opposite to the air pressure change direction of the first air pressure change information, or if the duration of the electronic device being in motion is detected to be greater than a first duration threshold, then the electronic device is determined to switch to the state of not riding in a vehicle.
[0275] By implementing the above-mentioned device, electronic devices can determine whether they are in a flight scenario, such as when traveling by airplane, by measuring the unidirectional rate of change and the cumulative amount of change. This further determines whether the electronic devices are in a state of using public transportation, thus improving the flexibility of the method.
[0276] As an optional embodiment, Figure 9 The illustrated device may also include a sixth identification unit (not shown), wherein:
[0277] The sixth identification unit is used to acquire a second acceleration of the electronic device through an accelerometer and a fourth air pressure information of the electronic device through a barometer; and if it is determined that the electronic device is in motion based on the second acceleration and the fourth air pressure information, then the electronic device is determined to be in a state of not riding a vehicle; and if it is determined that the electronic device is not in motion based on the second acceleration and the fourth air pressure information, then the electronic device is determined to be in a state of riding a vehicle based on the state identification result.
[0278] By implementing the above device, if the electronic device is detected to be in motion, it indicates that the electronic device is not in a scenario of riding in a vehicle. It can be determined that the electronic device is in a scenario of not riding in a vehicle, thus eliminating the need for subsequent target recognition model identification processes. This improves the speed of determining the vehicle status of the electronic device and also saves power consumption of the electronic device.
[0279] As an optional embodiment, Figure 9 The apparatus shown may further include a first determining unit (not shown), wherein:
[0280] The first determining unit is configured to determine that the electronic device is switching to a non-transportation state if, when the electronic device is determined to be in a state of riding in a vehicle based on the state recognition result, the duration of a third target detected in the electronic device being in motion is greater than a second duration threshold.
[0281] By implementing the above device, if the electronic device is detected to be in motion for an extended period of time while the user is in a vehicle, it indicates that the user has left the vehicle. This allows the electronic device to switch to a state where the user is not in a vehicle, thus improving the intelligence and flexibility of the method.
[0282] As an optional embodiment, the electronic device also includes a positioning module; Figure 9 The apparatus shown may further include a second determining unit (not shown), wherein:
[0283] The second determining unit is configured to acquire the movement information of the electronic device through the positioning module; and if the movement information is greater than a first movement threshold, determine that the electronic device is in a state of riding a vehicle; and if the movement information is not greater than the first movement threshold but greater than a second movement threshold, determine whether the electronic device is in a state of riding a vehicle based on the state recognition result; and if the movement information is not greater than the second movement threshold, determine that the electronic device is in a state of not riding a vehicle.
[0284] As an optional embodiment, the motion information includes the moving speed of the electronic device, a first motion threshold includes a first speed threshold, a second motion threshold includes a second speed threshold, and the first speed threshold is greater than the second speed threshold; and / or,
[0285] The mobility information includes the amount of movement change of the electronic device, the first mobility threshold includes a first change threshold, the second mobility threshold includes a second change threshold, and the first change threshold is greater than the second change threshold.
[0286] By implementing the above-described device, the electronic device can determine whether it is in a high-speed, low-speed, or somewhere in between state based on its movement information. If the device is in a high-speed movement state, it can be directly determined that it is in a vehicle-riding state; if it is in a low-speed movement state, it can be determined that it is not in a vehicle-riding state. This eliminates the need for subsequent target recognition model identification, thus improving the speed of determining the vehicle-riding state and saving power. Furthermore, if the device is in a state between high-speed and low-speed movement, the state recognition result can be combined to determine whether the device is in a vehicle-riding state, improving the compatibility and flexibility of the method.
[0287] As an optional embodiment, Figure 9 The apparatus shown may further include a third determining unit (not shown), wherein:
[0288] The third determining unit is used to acquire multiple first state recognition results output by the target recognition model within the target's historical time period, as well as the currently output second recognition result; and, based on the multiple first state recognition results and the second recognition result, to determine whether the electronic device is in the state of riding a vehicle.
[0289] By implementing the above device, the electronic device can combine the historical state recognition results of the target recognition model with the current state recognition results to determine whether the electronic device is in the state of riding in transportation, thereby improving the accuracy of determining whether the electronic device is in the state of riding in transportation.
[0290] As an optional embodiment, the third determining unit is further configured to determine that the electronic device is in a state of taking transportation if, among a plurality of first state recognition results, the proportion of state recognition results indicating that the electronic device is in a state of taking transportation is greater than a first proportion threshold, and the second recognition result indicates that the electronic device is in a state of taking transportation; and if, among a plurality of first state recognition results, the proportion of state recognition results indicating that the electronic device is in a state of not taking transportation is greater than a second proportion threshold, and the second recognition result indicates that the electronic device is in a state of not taking transportation, then determine that the electronic device is in a state of not taking transportation.
[0291] When implementing the above device, considering that the state recognition results output by the target recognition model may not be completely accurate, a proportional threshold method can be used to indicate the state of riding in transportation when the state recognition results exceed a certain proportional threshold, thus determining the state of riding in transportation of the electronic device within the target's historical time period, thereby improving the flexibility and compatibility of the method.
[0292] As an optional embodiment, the target historical time period includes multiple sub-historical time periods, each with a different duration.
[0293] By implementing the above device, electronic devices can combine the historical state recognition results of the target recognition model in multiple historical time periods with the current state recognition results to determine whether the electronic device is in the state of riding a vehicle, thereby improving the accuracy of determining whether the electronic device is in the state of riding a vehicle.
[0294] As an optional embodiment, the first acquisition unit 902 is further configured to, in the case of being in the first identification mode, acquire the first acceleration of the electronic device through an accelerometer and acquire the first air pressure information of the electronic device through a barometer according to the first data sampling rate;
[0295] as well as, Figure 9 The illustrated device may further include a first switching unit (not shown), wherein:
[0296] The first switching unit is used to control the electronic device to switch from the first identification mode to the second identification mode when the mode switching conditions are met, and to collect the first acceleration of the electronic device through the accelerometer and the first air pressure information of the electronic device through the barometer according to the second data sampling rate, wherein the second data sampling rate is greater than the first data sampling rate.
[0297] By implementing the above-mentioned device, data can be collected using a low sampling rate first data sampling rate to save power consumption of electronic devices and thus improve battery life; and, when switching conditions are met, the data sampling rate of electronic devices can be increased to improve the accuracy of determining whether electronic devices are in a state of riding in a vehicle.
[0298] As an optional embodiment, Figure 9 The apparatus shown may further include a fourth determining unit (not shown), wherein:
[0299] The fourth determining unit is used to, after controlling the electronic device to switch from the first identification mode to the second identification mode, collect target sensor data through the target sensor according to the second data sampling rate. The target sensor data includes one or more of the following: moving speed, amount of movement change, angular velocity, and magnetic field information; and, based on the target sensor data, determine whether the electronic device is in a state of riding in a vehicle.
[0300] By implementing the above device, when the electronic device switches to the second recognition mode, in addition to collecting the first acceleration and first air pressure information, it can also collect target sensor information and use the target sensor information to help determine whether the electronic device is in a state of riding in a vehicle, thereby improving the accuracy of determining whether the electronic device is in a state of riding in a vehicle.
[0301] As an optional embodiment, Figure 9 The illustrated device may further include a second switching unit (not shown), wherein:
[0302] The second switching unit is used to control the electronic device to switch from the second recognition mode to the first recognition mode when it is determined, based on the target sensor data and the state recognition result, that the state of the vehicle corresponding to the electronic device has changed, and the duration of the electronic device in the changed state is greater than a third duration threshold.
[0303] By implementing the above device, when it is determined that the electronic device is stably in the switched state, the electronic device can be controlled to switch to the first recognition mode, thereby reducing the data sampling rate and reducing the steps of using target sensor data to assist in determining whether the electronic device is in the state of riding in a vehicle, thus saving the power consumption of the electronic device and improving the battery life of the electronic device.
[0304] As an optional embodiment, the switching conditions include: the electronic device switching from a state of riding in transportation to a state of not riding in transportation, and / or, switching from a state of not riding in transportation to a state of riding in transportation.
[0305] By implementing the above device, when the electronic device switches to the mode of transportation, it can trigger a switch to the second recognition mode, so as to more accurately determine whether the electronic device has actually switched to the mode of transportation.
[0306] As an optional embodiment, Figure 9 The apparatus shown may further include a fifth determining unit (not shown), wherein:
[0307] The fifth determining unit is used to obtain multiple state recognition results of the electronic device within a target time period after processing the target feature information through the target recognition model to obtain the state recognition result, thereby obtaining a first state sequence; and to divide the first state sequence according to the target window, and to take the state indicated by the most frequent state recognition result in each target window as the window state corresponding to each target window; and to determine a second state sequence based on the multiple window states, wherein the second state sequence is used to characterize the activity of the electronic device within the target time period.
[0308] By implementing the above-described device, the electronic device can smooth the states in the first state sequence through the target window, thereby eliminating the impact of erroneous recognition results caused by the target recognition model and improving the accuracy of the subsequently determined second state sequence.
[0309] As an optional embodiment, the target window includes a first window and a second window, wherein the window length of the second window is different from that of the first window; the fifth determining unit is further configured to divide the first state sequence through the first window, and take the state indicated by the most frequent state recognition result in each first window as the first window state of the corresponding first window to obtain a third state sequence; and to divide the third state sequence through the second window, and take the state indicated by the most frequent state recognition result in each second window as the second window state of the corresponding second window to obtain a second state sequence.
[0310] By implementing the above-described device, the electronic device can smooth the first state sequence through multiple target windows of different window lengths, thereby improving the accuracy of the subsequently obtained second state sequence.
[0311] As an optional embodiment, the fifth determining unit is further configured to determine an abnormal window state among the multiple window states, and correct the abnormal window state; and to determine a second state sequence based on the corrected multiple window states.
[0312] By implementing the above-mentioned device, the abnormal window state can be corrected, thereby further improving the accuracy of the subsequent second state sequence.
[0313] As an optional embodiment, the fifth determining unit is further configured to determine the window state of the first target window as an abnormal window state when the window state of the first target window is different from the window states of the previous target window and the next target window, and the window states of the previous target window and the next target window are the same; and to modify the window state of the first target window to the window state of the previous target window and / or the next target window.
[0314] By implementing the above-described device, the electronic device can merge the corresponding window states of adjacent target windows to eliminate brief window state transitions, thereby improving the accuracy of the subsequently obtained second state sequence.
[0315] As an optional embodiment, abnormal window states include: multiple window states where the states of being in a vehicle and being in motion alternate, and the duration of this alternation is longer than the window duration of the target window; and / or,
[0316] Different modes of transportation appear alternately, with the duration of each alternation exceeding the window duration of the target window, and excluding multiple window states in transition states.
[0317] As an optional embodiment, the fifth determining unit is further configured to correct the abnormal window state based on the movement information of the electronic device; and / or adjust the window length of the target window, and perform the step of dividing the first state sequence according to the adjusted target window.
[0318] By implementing the above-described device, the electronic device can correct for alternating abnormal window states, thereby improving the accuracy of the subsequently obtained second state sequence.
[0319] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. For example... Figure 10 As shown, the electronic device may include:
[0320] Memory 1001 storing executable program code;
[0321] Processor 1002 coupled to memory 1001;
[0322] The processor 1002 calls the executable program code stored in the memory 1001 to execute the status recognition method for riding in a vehicle disclosed in the above embodiments.
[0323] This application discloses a computer-readable storage medium storing a computer program that causes a computer to execute the status recognition method for riding in a means of transportation disclosed in the above embodiments.
[0324] This application also discloses an application publishing platform, which is used to publish computer program products. When the computer program products are run on a computer, the computer performs some or all of the steps of the methods described in the above method embodiments.
[0325] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0326] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0327] The above provides a detailed description of the method for recognizing the status of a vehicle and related products disclosed in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for recognizing the state of a vehicle, characterized in that, Applied to an electronic device, the electronic device including an accelerometer and a barometer, the method includes: The first acceleration of the electronic device is acquired by the accelerometer, and the first air pressure information of the electronic device is acquired by the barometer. Based on the first acceleration and the first air pressure information, a state recognition result is obtained, which is used to indicate whether the electronic device is in the state of riding a vehicle.
2. The method of claim 1, wherein, The process of obtaining the state recognition result based on the first acceleration and the first air pressure information includes: Feature extraction is performed on the first acceleration and the first air pressure information to obtain target feature information; The target recognition model processes the target feature information to obtain the state recognition result.
3. The method of claim 2, wherein, The method further includes: Obtain multiple first-state recognition results output by the target recognition model within the target's historical time period, as well as the currently output second recognition result; Based on the multiple first state recognition results and the second recognition result, it is determined whether the electronic device is in the state of riding a vehicle.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The corresponding second air pressure information of the electronic device is collected by the barometer; If the electronic device is determined to be in the target activity scenario based on the second air pressure information, then the electronic device is determined to be in a state where it is not using a means of transportation. If it is determined from the second air pressure information that the electronic device is not in the target activity scenario, then it is determined from the state recognition result whether the electronic device is in the state of riding a vehicle.
5. The method of claim 4, wherein, After acquiring the corresponding second air pressure information of the electronic device through the barometer, the method further includes: The first pressure change information is determined based on the second pressure information. The first pressure change information includes one or more of the following: the unidirectional change rate of pressure, the cumulative change of pressure within the first target duration, and the standard deviation change of pressure within the second target duration. Based on the first air pressure change information, it is determined whether the electronic device is in the target activity scenario.
6. The method of claim 4, wherein, The method further includes: If the electronic device is determined to be in an aircraft-riding scenario based on the first air pressure change information corresponding to the second air pressure information, then the electronic device is determined to be in a vehicle-riding state. And / or, after determining that the electronic device is in a state of riding in a vehicle, the method further includes: The corresponding third air pressure information of the electronic device is collected by the barometer; If the direction of pressure change of the second pressure change information corresponding to the third pressure information is opposite to the direction of pressure change of the first pressure change information, or if the duration of the electronic device being in motion is detected to be greater than the first duration threshold, then it is determined that the electronic device has switched to a state of not using transportation.
7. The method according to any one of claims 1 to 3, characterized in that, The method further includes: If the electronic device is in motion, then it is determined that the electronic device is in a state of not using a means of transportation; If the electronic device is not in motion, then the state recognition result determines whether the electronic device is in a state of riding in a vehicle.
8. The method according to any one of claims 1 to 3, characterized in that, The method further includes: If the electronic device is determined to be in a state of riding in a vehicle based on the state recognition result, and if the duration of a third target detected in the movement state of the electronic device is greater than a second duration threshold, then the electronic device is determined to switch to a state of not riding in a vehicle.
9. The method according to any one of claims 1 to 3, characterized in that, The electronic device further includes a positioning module, and the method further includes: The positioning module acquires the movement information of the electronic device; If the movement information is greater than the first movement threshold, then it is determined that the electronic device is in the state of riding a vehicle. If the movement information is not greater than the first movement threshold but greater than the second movement threshold, then it is determined whether the electronic device is in the state of riding a vehicle based on the state recognition result. If the movement information is not greater than the second movement threshold, then it is determined that the electronic device is in a state of not using transportation.
10. The method according to any one of claims 1 to 3, characterized in that, The step of acquiring the first acceleration of the electronic device through the accelerometer and acquiring the first air pressure information of the electronic device through the barometer includes: In the first identification mode, the first acceleration of the electronic device is collected by the accelerometer according to the first data sampling rate, and the first air pressure information of the electronic device is collected by the barometer. When the mode switching conditions are met, the electronic device is controlled to switch from the first identification mode to the second identification mode, and the first acceleration of the electronic device is collected by the accelerometer and the first air pressure information of the electronic device is collected by the barometer according to the second data sampling rate, wherein the second data sampling rate is greater than the first data sampling rate.
11. The method of claim 10, wherein, After controlling the electronic device to switch from the first identification mode to the second identification mode, the method further includes: According to the second data sampling rate, target sensor data is collected by the target sensor, and the target sensor data includes one or more of the following: moving speed, amount of movement change, angular velocity, and magnetic field information; Based on the target sensor data, determine whether the electronic device is in a state of riding in a vehicle.
12. The method of claim 11, wherein, The method further includes: If, based on the target sensor data and the state recognition result, it is determined that the state of the vehicle being ridden by the electronic device has changed, and the duration of the electronic device remaining in the changed state is greater than a third duration threshold, then the electronic device is controlled to switch from the second recognition mode to the first recognition mode.
13. The method of claim 10, wherein, The mode switching conditions include: the electronic device switching from a state of riding in transportation to a state of not riding in transportation, and / or switching from a state of not riding in transportation to a state of riding in transportation.
14. The method according to any one of claims 1 to 3, characterized in that, After obtaining the state recognition result based on the first acceleration and the first air pressure information, the method further includes: Obtain multiple state recognition results of the electronic device within a target time period to obtain a first state sequence; The first state sequence is divided according to the target window, and the state indicated by the most frequent state recognition result in each target window is taken as the window state corresponding to each target window. A second state sequence is determined based on multiple window states, the second state sequence being used to characterize the activity of the electronic device within the target time period.
15. The method of claim 14, wherein, The target window includes a first window and a second window, wherein the window length of the second window is different from that of the first window; the step of dividing the first state sequence according to the target window and taking the state indicated by the most frequent state recognition result in each target window as the window state corresponding to each target window includes: The first state sequence is divided by a first window, and the state indicated by the most frequent state recognition result in each first window is taken as the first window state of the corresponding first window to obtain the third state sequence. The third state sequence is divided by a second window, and the state indicated by the most frequent state recognition result in each second window is taken as the second window state of the corresponding second window to obtain the second state sequence.
16. The method of claim 14, wherein, Determining the second state sequence based on multiple window states includes: Identify abnormal window states among the multiple window states and correct the abnormal window states; The second state sequence is determined based on the corrected multiple window states.
17. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain the historical travel information corresponding to the electronic device, the historical travel information including: historical travel route, and the historical travel time period corresponding to the historical travel route; The status analysis result is determined based on the historical travel information, and the status analysis result is used to indicate whether the electronic device is in the state of taking a means of transportation; Based on the state analysis results and the state recognition results, it is determined whether the electronic device is in a state of riding in a vehicle.
18. A state recognition device for a ride vehicle, characterized by, Applied to electronic devices, the electronic devices including accelerometers and barometers, the device includes: The first acquisition unit is used to acquire the first acceleration of the electronic device through the accelerometer and the first air pressure information of the electronic device through the barometer. The first identification unit is used to obtain a state identification result based on the first acceleration and the first air pressure information, and the state identification result is used to indicate whether the electronic device is in the state of riding a vehicle.
19. An electronic device, comprising: The method includes a memory storing executable program code and a processor coupled to the memory; wherein the processor invokes the executable program code stored in the memory to perform the method as described in any one of claims 1 to 17.
20. A computer-readable storage medium storing a computer program, wherein the computer program comprises instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1-19. When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 17.