Vehicle indoor environment entering detection method, electronic device and storage medium

CN116202514BActive Publication Date: 2026-10-30HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111447613.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2026-10-30
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

但是,由于天气原因或时间原因,例如,阴天、雨天或者晚上,光强检测会将室外环境误判为室内环境,识别车辆是否进入室内环境的准确率较低

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116202514B_ABST
    Figure CN116202514B_ABST
Patent Text Reader

Abstract

The embodiment of the application relates to the terminal technical field, and provides a vehicle indoor environment detection method, an electronic device and a storage medium. An electronic device is placed in a vehicle, and the electronic device comprises an accelerometer, a magnetometer and a communication card. The electronic device utilizes the accelerometer to perform ramp detection and gate entry detection, and obtains a first detection result and a second detection result respectively; the electronic device utilizes the magnetometer to perform geomagnetic signal detection and obtains a third detection result; and the electronic device utilizes the communication card to perform cellular signal detection and obtains a fourth detection result. The vehicle indoor environment detection method comprises the following steps: obtaining a plurality of detection results according to a detection period, and determining whether the vehicle enters an indoor environment according to the at least two detection results. The accelerometer, the magnetometer and the communication card are utilized to perform detection respectively, and the at least two detection results are utilized to comprehensively judge, so that the accuracy of identifying whether the vehicle enters the indoor environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a method for detecting a vehicle entering an indoor environment, an electronic device, and a storage medium. Background Technology

[0002] Typically, when a person enters an indoor environment from outdoors, they initiate certain behavioral patterns, such as working, shopping, or exercising. If a person's electronic devices can recognize their entry into the indoor environment and launch corresponding applications and display relevant notifications, it can provide users with more convenient, intelligent, and environmentally integrated services and experiences. The technology for recognizing whether someone has entered an indoor environment is also known as indoor-outdoor detection (IOD) technology.

[0003] Among these, people sitting in vehicles entering indoor environments is a very common application scenario.

[0004] Currently, a light sensor can be installed on the vehicle to detect the real-time light intensity of the environment and determine whether the vehicle has entered an indoor environment. However, due to weather conditions or time of day, such as cloudy days, rainy days, or nighttime, light intensity detection may misjudge outdoor environments as indoor environments, resulting in a low accuracy rate in identifying whether a vehicle has entered an indoor environment. Summary of the Invention

[0005] This application provides a method, electronic device, and storage medium for detecting when a vehicle enters an indoor environment, which improves the accuracy of identifying whether a vehicle has entered an indoor environment.

[0006] In a first aspect, embodiments of this application provide a method for detecting a vehicle entering an indoor environment, applied to an electronic device placed inside the vehicle. The method includes: acquiring multiple detection results according to a detection cycle, the multiple detection results including at least two of a first detection result, a second detection result, a third detection result, and a fourth detection result; the first detection result is a result determined by the electronic device using accelerometer data to indicate whether the vehicle has entered the ramp at the entrance of the indoor environment; the second detection result is a result determined by the electronic device using accelerometer data to indicate whether the vehicle has passed through the barrier gate at the entrance of the indoor environment; the third detection result is a result determined by the electronic device using magnetometer data to indicate whether the vehicle has entered the indoor environment; and the fourth detection result is a result determined by the electronic device using cellular signal strength data to indicate whether the vehicle has entered the indoor environment; and determining whether the vehicle has entered the indoor environment based on the multiple detection results.

[0007] The vehicle entry detection method provided in the first aspect utilizes electronic devices placed inside the vehicle to detect whether the vehicle has entered an indoor environment. Based on the scenario where vehicles typically need to traverse ramps and / or gates when entering an indoor environment, accelerometers are used for ramp detection and / or gate entry detection, based on the vehicle's driving behavior on the ramp and through the gate. Simultaneously, a magnetometer is used for geomagnetic signal detection, and a communication card is used for cellular signal detection. The vehicle's entry into the indoor environment is determined by comprehensively considering at least two of the detection results from ramp detection, gate entry detection, geomagnetic signal detection, or cellular signal detection. By avoiding over-reliance on light intensity detection using optical sensors and instead relying on accelerometers, magnetometers, or communication cards based on the actual driving scenario of the vehicle entering the indoor environment, the accuracy of determining whether a vehicle has entered an indoor environment is improved. Furthermore, by avoiding the use of GPS, detection power consumption is reduced, and the system load is lessened.

[0008] In one possible implementation, determining whether a vehicle has entered an indoor environment based on multiple detection results includes: if at least N of the multiple detection results indicate that the vehicle has entered an indoor environment, then the vehicle is determined to have entered an indoor environment; N is greater than or equal to 2 and less than or equal to 4.

[0009] In this implementation, if at least two of the detection results from ramp detection, gate entry detection, geomagnetic signal detection, and cellular signal detection indicate that the vehicle has entered the indoor environment, then the vehicle is finally determined to have entered the indoor environment. This improves the accuracy of determining whether a vehicle has entered the indoor environment and reduces the system load.

[0010] In one possible implementation, the multiple detection results also include a fifth detection result, which is determined by the electronic device using data from the light sensor to indicate whether the vehicle has entered an indoor environment.

[0011] In this implementation, the detection results of light intensity detection can also be referenced to determine whether the vehicle has entered an indoor environment, further improving the accuracy of determining whether the vehicle has entered an indoor environment.

[0012] In one possible implementation, the method for detecting a vehicle entering an indoor environment further includes: if it is determined from multiple detection results that the vehicle has entered an indoor environment, sending a notification message to the vehicle; the notification message is used to instruct the vehicle to enter the indoor environment.

[0013] In this implementation, when the electronic devices located inside the vehicle determine that the vehicle has entered an indoor environment, they can notify the vehicle to activate an indoor-appropriate behavior mode, such as turning on the indoor navigation system. This can provide users with more convenient, intelligent, and environmentally-integrated services and experiences, thereby enhancing the user experience.

[0014] In one possible implementation, obtaining the first detection result includes: obtaining the triaxial readings of the accelerometer according to a first cycle; converting the triaxial readings of the accelerometer into target triaxial readings in the vehicle's vehicle coordinate system; determining the vehicle tilt angle based on the target triaxial readings; if the vehicle tilt angle is greater than a preset angle, the first detection result indicates that the vehicle is entering the ramp at the entrance of the indoor environment.

[0015] In this implementation, based on the actual driving scenario where vehicles typically need to traverse ramps to enter indoor environments, accelerometers are used to detect ramps based on the vehicle's behavior on the ramp, determining whether the vehicle has entered the indoor environment. This improves the accuracy of determining whether a vehicle has entered an indoor environment compared to light intensity detection.

[0016] In one possible implementation, if it is determined that the vehicle tilt angle is greater than a preset angle, the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment, including: if it is determined that the vehicle tilt angles corresponding to multiple three-axis readings within a first time period are all greater than the preset angle, the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment; wherein, the first time period includes multiple first cycles.

[0017] In this implementation, if the tilt angles of multiple vehicles within the first time period are all greater than the preset angle, it indicates that the vehicles are all on an ascending or descending ramp within the first time period, which can confirm that the vehicles have entered the indoor environment, further improving the accuracy of determining whether a vehicle has entered the ramp at the entrance of the indoor environment.

[0018] In one possible implementation, obtaining the second detection result includes: acquiring multiple readings on the first target axis of the accelerometer within a second time period according to a second cycle; wherein the second time period includes multiple second cycles; if the numerical trend of the multiple readings is first decreasing, then remaining flat, and then increasing, then the second detection result indicates that the vehicle has passed through the barrier gate at the entrance of the indoor environment.

[0019] In this implementation, based on the actual driving scenario where vehicles typically need to pass through a barrier gate when entering an indoor environment, an accelerometer is used to detect whether a vehicle has passed through the barrier gate at the entrance of the indoor environment, i.e., whether the vehicle has entered the indoor environment. This method improves the accuracy of determining whether a vehicle has entered the indoor environment compared to light intensity detection.

[0020] In one possible implementation, the first target axis is parallel to the vehicle's direction of travel.

[0021] In this implementation, multiple readings on an axis parallel to the vehicle's direction of travel on the accelerometer are used for gate entry detection, which further improves the accuracy of determining whether a vehicle has passed through the gate at the entrance of the indoor environment.

[0022] In one possible implementation, obtaining the third detection result includes: acquiring multiple triaxial readings of the magnetometer within a third time period according to a third cycle; wherein the third time period includes multiple third cycles, and the triaxial readings of the magnetometer include readings on the three axes of the magnetometer; acquiring multiple target readings among the multiple triaxial readings, and determining a standard score for each target reading; if the number of target readings with a standard score greater than a preset value is greater than a preset number, then the third detection result indicates that the vehicle has entered an indoor environment.

[0023] In this implementation, based on the actual driving scenario of a vehicle entering an indoor environment, which typically has an outer structure made of cement and steel reinforcement, the magnetic field of the Earth can be distorted by these structures. Therefore, geomagnetic signals can be detected using data from a magnetometer to determine whether a vehicle has entered an indoor environment. This method improves the accuracy of determining whether a vehicle has entered an indoor environment compared to light intensity detection.

[0024] In one possible implementation, the target reading is any one of the following: the reading of a second target axis on the magnetometer; the second target axis being one axis of the magnetometer; the readings of at least two axes on the magnetometer; or a normalized value determined based on the three-axis readings of the magnetometer.

[0025] In one possible implementation, the second target axis is an axis in the horizontal direction.

[0026] In one possible implementation, obtaining the fourth detection result includes: obtaining signal strength values ​​of multiple cells within a fourth time period according to a fourth cycle; wherein the fourth time period includes multiple fourth cycles, and the multiple cells include the serving cell of the electronic device and the neighboring cells of the serving cell; processing the signal strength values ​​within the fourth time period using a clustering algorithm to obtain two clustering results; if the first clustering result includes the signal strength values ​​corresponding to the last X fourth cycles within the fourth time period, then the fourth detection result indicates that the vehicle has entered the indoor environment; wherein the two clustering results include the first clustering result and the second clustering result, and X is 1 or 2.

[0027] In this implementation, based on the actual driving scenario of a vehicle entering an indoor environment, the indoor environment typically has an external building structure. The obstruction caused by the building structure can lead to sudden changes in the intensity of the cellular signal detected by electronic devices. Therefore, cellular signal detection can be used to determine whether a vehicle has entered an indoor environment. This method improves the accuracy of determining whether a vehicle has entered an indoor environment compared to light intensity detection.

[0028] In one possible implementation, before processing the signal strength values ​​in the fourth time period using a clustering algorithm, the method further includes: determining that no cell reselection occurred in the fourth time period; determining that multiple signal strength values ​​of each cell in the fourth time period show a decreasing trend; and determining that the number of cells in X fourth periods is the same as the number of cells in other fourth periods besides X fourth periods in the fourth time period.

[0029] In one possible implementation, obtaining the fifth detection result includes: obtaining multiple light intensity values ​​detected by the light sensor within a fifth time period according to a fifth cycle; wherein the fifth time period includes multiple fifth cycles; determining the light intensity mean and light intensity variance of the multiple light intensity values; if the light intensity variance is greater than or equal to a preset light intensity variance threshold, and the light intensity value corresponding to the last fifth cycle within the fifth time period is less than the light intensity mean, then the fifth detection result indicates that the vehicle has entered an indoor environment.

[0030] In one possible implementation, before acquiring multiple light intensity values ​​detected by the light sensor within the fifth time period, the method further includes: determining that the current time is during daytime; and determining that the current weather is not cloudy or rainy.

[0031] Secondly, embodiments of this application provide a detection device for a vehicle entering an indoor environment, applied to an electronic device placed in the vehicle. The device includes: an acquisition module, used to acquire multiple detection results according to a detection cycle, the multiple detection results including at least two of a first detection result, a second detection result, a third detection result, and a fourth detection result; the first detection result is determined by the electronic device using accelerometer data to indicate whether the vehicle has entered the ramp at the entrance of the indoor environment; the second detection result is determined by the electronic device using accelerometer data to indicate whether the vehicle has passed through the barrier gate at the entrance of the indoor environment; the third detection result is determined by the electronic device using magnetometer data to indicate whether the vehicle has entered the indoor environment; and the fourth detection result is determined by the electronic device using cellular signal strength data to indicate whether the vehicle has entered the indoor environment; and a processing module, used to determine whether the vehicle has entered the indoor environment based on the multiple detection results.

[0032] In one possible implementation, the processing module is used to: determine that the vehicle has entered the indoor environment if at least N of the multiple detection results indicate that the vehicle has entered the indoor environment; N is greater than or equal to 2 and less than or equal to 4.

[0033] In one possible implementation, the multiple detection results also include a fifth detection result, which is determined by the electronic device using data from the light sensor to indicate whether the vehicle has entered an indoor environment.

[0034] One possible implementation also includes a sending module, which is used to: if it is determined from multiple detection results that the vehicle has entered the indoor environment, send a notification message to the vehicle; the notification message is used to instruct the vehicle to enter the indoor environment.

[0035] In one possible implementation, the acquisition module includes a first acquisition unit, which is used to: acquire the triaxial readings of the accelerometer according to a first cycle; convert the triaxial readings of the accelerometer into target triaxial readings in the vehicle's coordinate system; determine the vehicle tilt angle based on the target triaxial readings; and if the vehicle tilt angle is greater than a preset angle, the first detection result indicates that the vehicle is entering the ramp at the entrance of the indoor environment.

[0036] In one possible implementation, the first acquisition unit is used to: if it is determined that the vehicle tilt angles corresponding to multiple triaxial readings within a first time period are all greater than a preset angle, then the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment; wherein, the first time period includes multiple first cycles.

[0037] In one possible implementation, the acquisition module includes a second acquisition unit, which is used to: acquire multiple readings on the first target axis of the accelerometer within a second time period according to a second cycle; wherein the second time period includes multiple second cycles; if the numerical trend of the multiple readings is first decreasing, then remaining flat, and then increasing, then the second detection result indicates that the vehicle has passed through the barrier gate at the entrance of the indoor environment.

[0038] In one possible implementation, the first target axis is parallel to the vehicle's direction of travel.

[0039] In one possible implementation, the acquisition module includes a third acquisition unit, which is used to: acquire multiple triaxial readings of the magnetometer within a third time period according to a third cycle; wherein the third time period includes multiple third cycles, and the triaxial readings of the magnetometer include readings on the three axes of the magnetometer; acquire multiple target readings among the multiple triaxial readings, and determine a standard score value for each target reading value; if the number of target readings with a standard score value greater than a preset value is greater than a preset number, then the third detection result indicates that the vehicle has entered the indoor environment.

[0040] In one possible implementation, the target reading is any one of the following: the reading of a second target axis on the magnetometer; the second target axis being one axis of the magnetometer; the readings of at least two axes on the magnetometer; or a normalized value determined based on the three-axis readings of the magnetometer.

[0041] In one possible implementation, the second target axis is an axis in the horizontal direction.

[0042] In one possible implementation, the acquisition module includes a fourth acquisition unit, which is used to: acquire signal strength values ​​of multiple cells within a fourth time period according to a fourth cycle; wherein the fourth time period includes multiple fourth cycles, and the multiple cells include the serving cell of the electronic device and the neighboring cells of the serving cell; process the signal strength values ​​within the fourth time period using a clustering algorithm to obtain two clustering results; if the first clustering result includes the signal strength values ​​corresponding to the last X fourth cycles within the fourth time period, then the fourth detection result indicates that the vehicle has entered the indoor environment; wherein the two clustering results include the first clustering result and the second clustering result, and X is 1 or 2.

[0043] In one possible implementation, the first acquisition unit is further configured to: determine that no cell reselection occurred in the fourth time period before processing the signal strength values ​​in the fourth time period using a clustering algorithm; determine that multiple signal strength values ​​of each cell in the fourth time period show a decreasing trend; and determine that the number of cells in X fourth periods is the same as the number of cells in other fourth periods besides X fourth periods in the fourth time period.

[0044] In one possible implementation, the acquisition module includes a fifth acquisition unit, which is used to: acquire multiple light intensity values ​​detected by the light sensor within a fifth time period according to a fifth cycle; wherein the fifth time period includes multiple fifth cycles; determine the light intensity mean and light intensity variance of the multiple light intensity values; if the light intensity variance is greater than or equal to a preset light intensity variance threshold, and the light intensity value corresponding to the last fifth cycle within the fifth time period is less than the light intensity mean, then the fifth detection result indicates that the vehicle has entered an indoor environment.

[0045] In one possible implementation, the fifth acquisition unit is further configured to determine that the current time is during daytime before acquiring multiple light intensity values ​​detected by the light sensor within the fifth time period; and to determine that the current weather is not cloudy or rainy.

[0046] Thirdly, an electronic device is provided, including a processor for coupling with a memory, reading instructions from the memory, and causing the electronic device to perform the method provided in the first aspect according to the instructions.

[0047] Fourthly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer or processor, implement the method provided in the first aspect.

[0048] Fifthly, a program product is provided, the program product comprising a computer program stored in a readable storage medium, wherein at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to implement the method provided in the first aspect. Attached Figure Description

[0049] Figures 1A to 1G This is a set of application scenario diagrams applicable to the embodiments of this application;

[0050] Figures 2A-2B A set of schematic diagrams showing the placement of electronic devices in a vehicle according to embodiments of this application;

[0051] Figure 3 A schematic diagram of an interface for setting up IOD detection for an electronic device provided in an embodiment of this application;

[0052] Figures 4A-4B A set of schematic diagrams of the interfaces of the electronic device provided in the embodiments of this application;

[0053] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0054] Figure 6 A flowchart illustrating the ramp detection process for the electronic device provided in this application embodiment;

[0055] Figures 7A-7B A set of schematic diagrams illustrating the mobile phone coordinate system provided in the embodiments of this application;

[0056] Figure 8 A schematic diagram of a vehicle coordinate system provided in an embodiment of this application;

[0057] Figure 9 A flowchart illustrating the gate entry detection process for the electronic equipment provided in this application embodiment;

[0058] Figures 10A-10B A set of trend graphs showing multiple readings of an accelerometer on a target axis, provided in an embodiment of this application;

[0059] Figure 11 A flowchart illustrating the detection of geomagnetic signals by an electronic device using a magnetometer, as provided in an embodiment of this application.

[0060] Figure 12 A schematic diagram illustrating the change in the reading of the magnetometer provided in an embodiment of this application;

[0061] Figure 13 A flowchart illustrating cellular signal detection for an electronic device provided in this application embodiment;

[0062] Figure 14 A schematic diagram illustrating the signal strength of multiple cellular cells detected by an electronic device according to an embodiment of this application;

[0063] Figures 15A-15B A set of schematic diagrams illustrating how an electronic device provided in this application clusters the signal strength of multiple cellular cells;

[0064] Figure 16 A flowchart illustrating light intensity detection for the electronic device provided in this application embodiment;

[0065] Figure 17 A flowchart illustrating a method for detecting a vehicle entering an indoor environment, as provided in an embodiment of this application;

[0066] Figure 18 A schematic diagram illustrating a detection result of a vehicle entering an indoor environment, provided in an embodiment of this application.

[0067] Figure 19 This is a schematic diagram of a vehicle entering an indoor environment detection device provided in an embodiment of this application. Detailed Implementation

[0068] The embodiments of this application are described below with reference to the accompanying drawings.

[0069] The vehicle entry detection method provided in this application is used to determine whether a vehicle has entered an indoor environment. This application does not limit the indoor environment. For ease of explanation, an indoor parking lot is used as an example.

[0070] For example, in combination Figures 1A to 1G The application scenarios applicable to the embodiments of this application are described, but... Figures 1A to 1G This application does not limit the application scenario. Optionally, a barrier gate is installed at the entrance of the indoor parking lot to manage vehicles entering the parking lot. This application embodiment does not limit the name of the barrier gate; for example, it can also be called a gate, a barrier, or a vehicle stop. Optionally, the indoor parking lot has an ascending or descending ramp, which may or may not have a turn, or may have at least one turn. This application embodiment does not limit the angle of the ascending or descending ramp; relevant specifications for the inclination angle of building ramps can be referenced.

[0071] Optional, in one example, such as Figure 1AAs shown, an entrance gate 102 is provided at the entrance of the indoor parking lot 101. The parking spaces in the indoor parking lot 101 are located below the entrance, and the indoor parking lot 101 has a descending ramp 103. The process of a vehicle 100 entering the indoor parking lot 101 is as follows: the vehicle 100 slows down and stops at the gate 102, pauses briefly, passes through the gate 102, accelerates and enters the descending ramp 103, and then drives on the level ground of the indoor parking lot 101.

[0072] Optionally, in another example, such as Figure 1B As shown. Figure 1B and Figure 1A The difference is: in Figure 1B In the middle, the distance between the starting point of the downhill ramp 103 of the barrier gate 102 and the indoor parking lot 101 is relatively long.

[0073] Optionally, in yet another example, such as Figure 1C As shown. Figure 1C and Figures 1A-1B The difference lies in the location of the barrier gate 102. Figures 1A-1B In the indoor parking lot 101, a barrier gate 102 is installed at the entrance; Figure 1C In this system, the barrier gate 102 is located behind the descending ramp 103 of the indoor parking lot 101. The process of a vehicle 100 entering the indoor parking lot 101 is as follows: after passing the descending ramp 103, the vehicle 100 enters the horizontal ground of the indoor parking lot 101, slows down and stops at the barrier gate 102, pauses briefly, passes through the barrier gate 102, and accelerates to continue driving on the horizontal ground of the indoor parking lot 101.

[0074] Optionally, in yet another example, such as Figure 1D As shown. Figure 1D and Figures 1A to 1C The difference is: in Figures 1A to 1C In the indoor parking lot 101, there is a descending ramp 103; Figure 1D In the indoor parking lot 101, there is an ascending ramp 104.

[0075] Optionally, in yet another example, such as Figure 1E As shown. Figure 1E and Figure 1D The similarities are that the indoor parking lot 101 has an ascending ramp 104 and a barrier gate 102. Figure 1E and Figure 1D The difference is: in Figure 1D In the indoor parking lot 101, a barrier gate 102 is installed at the entrance; while... Figure 1E In the middle, the barrier gate 102 is located behind the ramp 104 of the indoor parking lot 101.

[0076] Optionally, in yet another example, such as Figure 1F As shown. Figure 1F and Figures 1D to 1E The similarity is that: Figures 1D to 1E In the indoor parking lot 101, there is an ascending ramp 104 and a barrier gate 102; Figure 1F In the indoor parking lot 101, there is an ascending ramp 104, but no barrier gate 102. The process of a vehicle 100 entering the indoor parking lot 101 is as follows: after passing through the ascending ramp 104, the vehicle 100 enters the horizontal ground of the indoor parking lot 101 and continues to drive.

[0077] Optionally, in yet another example, such as Figure 1G As shown. Figure 1G and Figures 1A to 1F The difference is: in Figure 1G Indoor parking lot 101 does not have a ramp. Figure 1G In the indoor parking lot 101, a barrier gate 102 is installed at the entrance. The process of a vehicle 100 entering the indoor parking lot 101 is as follows: the vehicle 100 slows down and stops at the barrier gate 102, pauses briefly, passes through the barrier gate 102, accelerates and enters the indoor parking lot 101 and continues driving.

[0078] For detecting vehicles entering indoor environments, one approach in related technologies is to use a light sensor on the vehicle to detect the real-time light intensity of the environment to determine whether the vehicle has entered an indoor environment. This light sensor can be a light sensor installed in the vehicle itself or an electronic device with a light sensor placed inside the vehicle. However, due to weather conditions or time of day, light intensity detection may misjudge outdoor environments as indoor environments, resulting in low accuracy in identifying whether a vehicle has entered an indoor environment. For example, on cloudy or rainy days, outdoor light is poor, and a vehicle located outdoors may be mistakenly identified as being indoors. Similarly, during the evening hours, a vehicle located outdoors may also be mistakenly identified as being indoors.

[0079] In another implementation, the strength of the GPS signal is obtained through the vehicle's Global Positioning System (GPS) module, and the strength of the GPS signal is used to determine whether the vehicle has entered an indoor environment. The GPS module can be a GPS module installed in the vehicle itself, a GPS device placed inside the vehicle, or an electronic device with GPS functionality placed inside the vehicle. However, GPS detection consumes a significant amount of power, increasing the system load.

[0080] This application provides a method for detecting a vehicle entering an indoor environment, utilizing electronic devices placed inside the vehicle to detect whether the vehicle has entered the indoor environment. The electronic devices include an accelerometer, a magnetometer, and a communication card for cellular communication. Optionally, the communication card includes, but is not limited to, at least one of the following: a subscriber identity module (SIM) card, a micro SIM card, a nano SIM card, etc. The vehicle entry detection method provided in this application is based on the scenario where a vehicle typically needs to pass through a ramp and / or a barrier gate when entering an indoor environment. Based on the vehicle's driving behavior on the ramp and its behavior when passing through the barrier gate, the accelerometer is used to achieve ramp detection and / or barrier gate entry detection. Simultaneously, a magnetometer is used to detect geomagnetic signals, and a communication card is used to detect cellular signals. The vehicle's entry into the indoor environment is comprehensively determined by combining the detection results of at least one of the ramp detection, barrier gate entry detection, geomagnetic signal detection, or cellular signal detection. By avoiding over-reliance on light intensity detection using optical sensors and instead relying on accelerometers, magnetometers, or communication cards based on the actual driving scenario of a vehicle entering an indoor environment, the accuracy of determining whether a vehicle has entered an indoor environment is improved. Furthermore, by avoiding the use of GPS, detection power consumption is reduced, lessening the system load.

[0081] Optionally, the electronic device may also include a light sensor for light intensity detection. The vehicle entry detection method provided in this application, based on at least one of the detection results from ramp detection, gate entry detection, geomagnetic signal detection, or cellular signal detection, can also refer to the light intensity detection result to determine whether a vehicle has entered an indoor environment, further improving the accuracy of determining whether a vehicle has entered an indoor environment.

[0082] It should be noted that the embodiments of this application do not limit the name and type of electronic device. For example, electronic devices are also called terminals, terminal devices, user devices, or mobile terminals. Currently, some examples of electronic devices include: mobile phones, tablet computers, PDAs, wearable devices, etc.

[0083] For ease of explanation, this application uses a mobile phone as an example of an electronic device.

[0084] It should be noted that the embodiments of this application do not limit the placement position or orientation of electronic devices inside the vehicle.

[0085] For example, in one implementation, such as Figure 2AAs shown, a bracket 201 is provided in the vehicle for fixing the electronic device 200. Accordingly, the electronic device 200 is placed in the bracket 201. Optionally, when the electronic device 200 is placed in the bracket 201, IOD detection can be automatically triggered to determine whether the vehicle has entered an indoor environment.

[0086] For example, in another implementation, such as Figure 2B As shown, the electronic device 200 can be placed on the storage platform to the right of the driver's seat.

[0087] in, Figure 2A and Figure 2B This is merely an example and does not impose any restrictions on the placement or orientation of electronic devices within a vehicle.

[0088] It should be noted that the embodiments of this application do not limit the method by which the electronic device initiates IOD detection to determine whether the vehicle has entered the indoor environment.

[0089] Optionally, in one implementation, for example Figure 2A As shown, when the electronic device 200 is placed in the bracket 201, it can automatically trigger the IOD detection to determine whether the vehicle has entered the indoor environment.

[0090] Optionally, in another implementation, the user can manually initiate IOD detection of the electronic device. This application does not limit the method by which the user initiates IOD detection of the electronic device, and may include, but is not limited to, any of the following: user touch operations on a relevant interface, user gesture operations on the display screen of the electronic device, user operations on physical buttons on the electronic device, user input of voice control commands through the microphone of the electronic device, or user input of image control commands through the camera of the electronic device.

[0091] For example, Figure 3 This is a schematic diagram of an interface for setting up IOD detection in an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device currently displays a settings interface 30, which includes an IOD detection switch control 31. Optionally, the interface 30 may also include prompts to guide the user on whether to enable IOD detection. For example, the prompts may include "After enabling, you can determine whether to enter an indoor environment." The user can operate the switch control 31 to determine whether the electronic device has enabled IOD detection based on the display status of the switch control 31. For example, as... Figure 3 As shown, the current display status of the switch control 31 indicates that the electronic device has enabled IOD detection.

[0092] Optionally, in this embodiment, when the electronic device determines that the vehicle has entered an indoor environment, the electronic device can automatically trigger the execution of relevant operations. For example, activating the indoor navigation system.

[0093] Optionally, in this embodiment, when the electronic device determines that the vehicle has entered an indoor environment, it can output a prompt message to the user to notify the user and enable the user to perform subsequent operations, thereby improving the user experience. For example, the user can launch relevant applications on the electronic device, including but not limited to: indoor navigation systems, shopping apps, etc. This embodiment does not limit the manner in which the electronic device outputs the prompt message. For example, the prompt message can be voice information or information displayed on a relevant interface. Optionally, the information displayed on the relevant interface can include, but is not limited to, at least one of the following: text, images, videos, or animations.

[0094] For example, in one example, such as Figure 4A As shown, the electronic device currently displays the interface 40 of a navigation application. Interface 40 includes a map 41 and navigation information. For example, the navigation information includes "Current location: XX Mall. Destination: XX Mall". When the electronic device determines that it has entered an indoor environment, a pop-up window 42 appears in interface 40, which includes a vehicle icon and prompt information, such as "Enter the underground parking garage".

[0095] For example, in another example, when an electronic device determines that it has entered an indoor environment, a notification message can be displayed in the system's notification bar. Figure 4B As shown, the electronic device currently displays interface 45, which is a notification bar that slides down. Interface 45 displays WLAN controls, Bluetooth controls, mobile data controls, mute controls, and audio switching controls. Interface 45 also includes a message box 46, which displays the message "Vehicle enters underground parking garage," indicating that the vehicle has entered the indoor environment.

[0096] Optionally, in this embodiment, when the electronic device determines that the vehicle has entered an indoor environment, it can send a notification message to the vehicle, instructing the vehicle to enter the indoor environment. Correspondingly, the vehicle receives the notification message sent by the electronic device. Optionally, the vehicle can output a prompt message to the user based on the notification message to notify the user so that the user can perform subsequent operations, thereby improving the user experience. This embodiment does not limit the method by which the vehicle outputs the prompt message. For example, the prompt message can be voice information or information displayed on the vehicle's display screen. Optionally, the displayed information can include, but is not limited to, at least one of the following: text, images, videos, or animations.

[0097] The electronic device involved in the embodiments of this application is described below. Please refer to... Figure 5 , Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0098] Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor module 180, a camera 193, a display screen 194, and a SIM card interface 195, etc. The sensor module 180 may include a gyroscope sensor 180B, a magnetic sensor 180D, an accelerometer sensor 180E, a proximity sensor 180F, a proximity light sensor 180G, an ambient light sensor 180L, etc.

[0099] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0100] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0101] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0102] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a universal serial bus (USB) interface, etc.

[0103] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0104] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0105] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0106] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0107] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), New Radio Access Technology (NR), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0108] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0109] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0110] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0111] The magnetic sensor 180D may include a magnetometer. A magnetometer, also known as a magnetic sensor, is used to measure the strength and direction of the Earth's magnetic field. The Earth's magnetic field refers to the natural magnetic phenomenon present within the Earth. The Earth can be considered a magnetic dipole, with one pole near the geographic North Pole and the other near the geographic South Pole. The imaginary straight line passing through these two magnetic poles (the magnetic axis) is tilted at approximately 11.3 degrees to the Earth's axis of rotation. Typically, the magnetometer has three axes, corresponding to the three axes of electronic devices (i.e., the x, y, and z axes). The orientation of the electronic device in a vehicle is related to the magnetometer reading.

[0112] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0113] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0114] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a phone call, so as to automatically turn off the screen to save power.

[0115] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0116] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0117] The technical solution of this application will be described in detail below through specific embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0118] The embodiments of this application can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The terms "first", "second", "third", "fourth", etc. (if present) in the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0119] First, the implementation methods of electronic devices for slope detection and gate entry detection using accelerometers, geomagnetic signal detection using magnetometers, cellular signal detection using communication cards, and light intensity detection using optical sensors are explained.

[0120] 1. Use an accelerometer to detect the slope.

[0121] Accelerometers in electronic devices can detect the magnitude of acceleration in various directions (typically three axes). By detecting acceleration, the operating speed, direction, and attitude of the electronic device can be identified.

[0122] In actual driving scenarios where vehicles enter indoor environments, indoor parking lots typically have ascending or descending ramps. Electronic devices can process the accelerometer readings to determine whether the vehicle is driving on a ramp.

[0123] Figure 6 A flowchart illustrating ramp detection for the electronic device provided in this application embodiment. Figure 6 As shown, the electronic device performs slope detection via an accelerometer, which may include:

[0124] S601. The electronic device acquires the three-axis readings of the accelerometer according to the first cycle.

[0125] Optionally, the three axes of the accelerometer are the same as the three axes of the device coordinate system in which the electronic device is located.

[0126] For example, taking a mobile phone as an example, the mobile phone coordinate system is a special moving coordinate system used to describe the movement of the mobile phone. In one example, the mobile phone screen is placed vertically. Figure 7A As shown, the origin of the phone's coordinate system coincides with the center of the phone screen. The width direction of the phone screen is defined as the X-axis, the length direction is defined as the Y-axis, and the positive Z-axis (+Z) is perpendicular to the X and Y axes and points outwards from the phone screen. Optionally, the positive X-axis (+X) can be the direction the phone screen faces to the right, and the negative X-axis (-X) can be the direction the phone screen faces to the left. The positive Y-axis (+Y) can be the direction the phone screen faces upwards, and the negative Y-axis (-Y) can be the direction the phone screen faces downwards. In another example, the phone screen is placed horizontally, as shown... Figure 7B As shown. Figure 7B The mobile phone coordinate system shown is equivalent to... Figure 7A The mobile phone coordinate system shown has been rotated 90 degrees to the left.

[0127] In this embodiment, the value of the first period is not limited. For example, it can be 10 milliseconds. It can be understood that the larger the value of the first period, the lower the frequency of ramp detection and the lower the power consumption of the electronic device; the smaller the value of the first period, the higher the frequency of ramp detection and the higher the accuracy of the electronic device in determining whether to enter the indoor environment.

[0128] S602, The electronic device converts the triaxial readings of the accelerometer into target triaxial readings in the vehicle coordinate system.

[0129] The vehicle coordinate system is a special moving coordinate system used to describe the motion of the vehicle. For example, Figure 8 This is a schematic diagram of a vehicle coordinate system provided in an embodiment of this application. Figure 8 As shown, the origin of the vehicle coordinate system coincides with the vehicle's center of mass. When the vehicle is stationary on a level road, the X-axis of the vehicle coordinate system is parallel to the ground, and its positive direction (+X) points forward. The positive direction of the Y-axis (+Y) points to the driver's left, and the positive direction of the Z-axis (+Z) is perpendicular to the X and Y axes and points upward.

[0130] The device coordinate system and the vehicle coordinate system have a transformation relationship, which is related to the attitude of the electronic device within the vehicle. The electronic device can acquire this transformation relationship and convert the triaxial readings of the accelerometer into target triaxial readings in the vehicle coordinate system.

[0131] Typically, electronic devices are placed within the vehicle in a relatively stable posture, and the device coordinate system and the vehicle coordinate system have a stable transformation relationship. For example, ... Figure 2A As shown, the electronic device 200 is placed in the bracket 201. In this example, the electronic device 200 is placed horizontally, and the mobile phone coordinate system can be found in [reference needed]. Figure 7B .

[0132] S603, the electronic equipment determines the vehicle tilt angle based on the target three-axis readings.

[0133] The vehicle tilt angle indicates the tilt angle of the road the vehicle is currently traveling on. It can be understood that if the vehicle is currently traveling on a level road, the vehicle tilt angle is approximately 0 degrees. If the vehicle is currently traveling on an ascending or descending ramp in an indoor parking lot, the vehicle tilt angle is the tilt angle of that ramp.

[0134] S604. Electronic equipment determines whether the vehicle tilt angle is greater than a preset angle.

[0135] If the vehicle tilt angle is greater than the preset angle, it indicates that the vehicle is traveling on a sloping section of road, which may be an ascending or descending ramp in an indoor parking lot, confirming that the vehicle has entered an indoor environment.

[0136] In this application, the value of the preset angle is not limited. For example, it can be set according to the relevant specifications for the inclination angle of building ramps, such as 5 degrees. Alternatively, machine learning algorithms can be used to obtain the angle of ramps in indoor parking lots to distinguish them from mountain road ramps, thereby improving the accuracy of determining when a vehicle enters an indoor environment.

[0137] Optionally, to improve the accuracy of slope detection by electronic equipment, multiple vehicle tilt angles obtained according to the first cycle within the first time period can be acquired, and the vehicle's position on an ascending or descending slope can be determined based on these tilt angles. Optionally, if multiple vehicle tilt angles within the first time period are all greater than a preset angle, it indicates that the vehicle is on an ascending or descending slope within the first time period, and it can be determined that the vehicle has entered an indoor environment.

[0138] In this embodiment, the value of the first time period is not limited.

[0139] Optionally, before the electronic device in S602 converts the triaxial readings of the accelerometer into target triaxial readings in the vehicle coordinate system, it may also include:

[0140] The electronic device smooths the triaxial readings of the accelerometer to obtain smoothed triaxial readings.

[0141] Accordingly, in S602, the electronic device converts the smoothed triaxial readings into target triaxial readings in the vehicle coordinate system.

[0142] By smoothing the triaxial readings of the accelerometer, the accuracy of the data is improved, which in turn improves the accuracy of the electronic equipment in slope detection.

[0143] 2. Use an accelerometer to detect entry at the barrier gate.

[0144] For real-world driving scenarios involving vehicles entering indoor environments, indoor parking garages typically have barriers at the entrance. When a vehicle passes through the barrier, it decelerates, pauses briefly, and then accelerates again. During deceleration, the accelerometer reading gradually decreases. During the brief pause, the reading remains constant. During acceleration, the reading gradually increases. Electronic equipment processes the accelerometer readings to determine whether the vehicle has passed through the barrier. Optionally, combining geomagnetic signal detection and cellular signal detection can detect entry into a ground-floor indoor parking garage.

[0145] Figure 9 This is a flowchart illustrating the gate entry detection process for the electronic equipment provided in this application embodiment. Figure 9 As shown, the electronic device performs gate entry detection via an accelerometer, which may include:

[0146] S901, The electronic device acquires the triaxial readings of the accelerometer according to the second cycle.

[0147] In this embodiment, the value of the second period is not limited. For example, the value can be 10 milliseconds.

[0148] S902. For multiple accelerometer readings on the target axis within the second time period, the electronic device determines whether the trend of the multiple readings is first decreasing, then remaining constant, and then increasing. The second time period is the time period preceding the current moment, with the current moment being the latest.

[0149] The target axis is the axis parallel to the vehicle body. For example, in Figure 2A The placement of the electronic device 200 shown is for reference. Figure 7B The device coordinate system shown can be the target axis, which can be the Z-axis of the device coordinate system.

[0150] The numerical change trends of multiple readings include, but are not limited to, any of the following: numerical increase, numerical decrease, numerical increase followed by decrease, numerical decrease followed by increase, numerical increase followed by stagnation followed by decrease, or numerical decrease followed by stagnation followed by increase. Among these, a numerical increase trend includes any of the following: numerical values ​​increase sequentially or numerical values ​​fluctuate and increase. Sequential increase means that the value at the next moment is greater than the value at the previous moment. Fluctuating increase means that a small number of adjacent moments are allowed to fluctuate in value, i.e., the value at the next moment is less than or equal to the value at the previous moment, but the overall trend of multiple values ​​is a gradual increase. Similarly, a numerical decrease trend includes any of the following: numerical values ​​decrease sequentially or numerical values ​​fluctuate and decrease. A numerical increase followed by decrease can be divided into two parts: numerical increase and numerical decrease, with the overall trend showing an inverted V-shaped curve. Similarly, a numerical decrease followed by increase shows an overall V-shaped curve. A numerical increase followed by stagnation followed by decrease, compared to a numerical increase followed by decrease, includes an intermediate stagnation process, resulting in an inverted U-shaped curve. Similarly, a numerical decrease followed by stagnation followed by increase shows an overall U-shaped curve. In this application embodiment, the number of accelerometer readings included in each change stage is not limited.

[0151] In this embodiment, the value of the second time period is not limited. The duration of the second time period can be N times the second period, where N is an integer greater than 1. Therefore, the second time period can include N accelerometer readings within the second period. To improve the accuracy of determining the numerical trend of multiple readings, the value of the second period can be relatively small, while the value of the second time period can be relatively large, ensuring a large number of multiple values.

[0152] S903. If multiple readings first decrease, then remain the same, and then increase, the electronic equipment determines that the vehicle has passed through the barrier gate and entered the indoor environment.

[0153] The following example illustrates this.

[0154] In one example, see Figure 1A In the scenario shown, vehicle 100 first passes through barrier gate 102, then descends ramp 103 to enter indoor parking lot 101. (As...) Figure 10A As shown, the horizontal axis represents time in milliseconds (ms), with a second period of 10ms and a second time interval of 50ms. The first dashed line represents the position of vehicle 100 at the barrier gate 102, and the second dashed line represents vehicle 100 passing through barrier gate 102 and entering the descending ramp 103. It can be seen that between the first and second dashed lines, the multiple readings of the accelerometer on the target axis exhibit a trend of first decreasing, then leveling off, and then increasing, forming a U-shaped curve, characteristic of a typical vehicle passing through a barrier gate. The electronic device can acquire multiple readings within multiple second time intervals, determine the changing trend of these readings within each second time interval, and thus determine whether the vehicle has passed through the barrier gate. For example, if the current time is 160ms, the electronic device acquires five readings between 110ms and 160ms, determining that the trend is not one of decreasing, leveling off, and then increasing. If the current time is updated to 170ms, the electronic device acquires five more readings between 120ms and 170ms, again determining that the trend is not one of decreasing, leveling off, and then increasing. And so on. The current time is updated to 190ms. The electronic equipment acquires 5 readings between 140ms and 190ms and determines that the trend is first decreasing, then remaining flat, and then increasing. This indicates that the vehicle has passed through the barrier gate.

[0155] See another example. Figure 1C In the scenario shown, vehicle 100 first passes through a descending ramp 103, and then enters the indoor parking lot 101 through a barrier gate 102. (As...) Figure 10B As shown, the second period is 1 second. The first dashed line represents the position of the vehicle traveling from the descending ramp 103 to the gate 102. The second dashed line represents the vehicle 100 passing through the gate 102. It can be seen that between the first and second dashed lines, the multiple readings of the accelerometer on the target axis show a trend of first decreasing, then leveling off, and then increasing, presenting a U-shaped curve.

[0156] 3. Detect geomagnetic signals using a magnetometer

[0157] Magnetometers in electronic devices can detect the intensity and direction of geomagnetic signals. Typically, a magnetometer has three axes, corresponding to the three axes of the electronic device's coordinate system. The magnetometer's three-axis readings are related to the electronic device's orientation within the vehicle. An example is provided below to illustrate this.

[0158] In one example, such as Figure 2A As shown, the electronic device 200 is placed horizontally in the bracket 201. The mobile phone coordinate system can be found in [reference needed]. Figure 7BThe X-axis is the vertical direction, while the Y-axis and Z-axis are the horizontal directions. Generally, the architectural structure of the indoor environment changes less in the vertical direction and more in the horizontal direction. Therefore, the change in magnetic force in the X-axis direction is usually less than the change in magnetic force in the Y-axis and Z-axis directions.

[0159] In another example, assuming the electronic device is placed vertically in a bracket inside the vehicle, the phone's coordinate system can be seen from... Figure 7A The Y-axis is vertical, while the X and Z axes are horizontal. Similarly, the change in magnetic force along the Y-axis is usually smaller than the changes in magnetic force along the X and Z axes.

[0160] In real-world driving scenarios where vehicles enter indoor environments, these environments typically have an external structure made of concrete and reinforced steel. This structure distorts the Earth's magnetic field. When a vehicle enters an indoor environment from outdoors, the three-axis readings of a magnetometer will change significantly. Therefore, electronic devices can process these magnetometer readings to determine whether a vehicle has entered an indoor environment.

[0161] Figure 11 This is a flowchart illustrating the geomagnetic signal detection process performed by an electronic device using a magnetometer, as provided in an embodiment of this application. Figure 11 As shown, the electronic device detects geomagnetic signals via a magnetometer, and may include:

[0162] S1101. The electronic device acquires the three-axis readings of the magnetometer according to the third cycle.

[0163] In this embodiment, the value of the third period is not limited. For example, the value can be 10 milliseconds.

[0164] S1102. For multiple readings of the magnetometer within the third time period, the electronic device acquires a standard score for each magnetometer reading. The third time period is the time period preceding the current moment, with the current moment being the latest.

[0165] In this embodiment, the value of the third time period is not limited. The duration of the third time period can be N times the third cycle, where N is an integer greater than 1. Therefore, the third time period can include N magnetometer readings within the third cycle. For example, suppose the third cycle is 10ms and the third time period is 2s. For each axis of the magnetometer, the third time period includes a total of 200 magnetometer readings (2s / 10ms).

[0166] The following example illustrates the standard score (z-score or zscore).

[0167] The standard score of the magnetometer reading is zscore = (magnetometer reading - mean) / standard deviation. Here, the mean is the average of the readings within the third time period, and the standard deviation is the standard deviation of the readings within the third time period.

[0168] Suppose that the third time period includes 7 readings, specifically {25, 28, 31, 34, 37, 40, 43}.

[0169] Therefore, the average of the multiple readings in the third time period is: (25+28+31+34+37+40+43) / 7=34.

[0170] The variance corresponding to the third time period is:

[0171] [(25-34)^2+(28-34)^2+(31-34)^2+(34-34)^2+(37-34)^2+(40-34)^2+(43-34)^2] / 7=36.

[0172] The standard deviation corresponding to the third time period is:

[0173] Therefore, the standard scores for each magnetometer reading during the third time period are as follows:

[0174] (25-34) / 6=-1.5,(28-34) / 6=-1,(31-34) / 6=-0.5,(34-34) / 6=0,(37-34) / 6=0.5,(40-34) / 6=1,(43-34) / 6=1.5。

[0175] S1103. If the number of magnetometer readings with standard scores greater than the preset value during the third time period is greater than the preset number, the electronic device determines that the vehicle has entered the indoor environment.

[0176] In this embodiment, the preset value and preset number are not limited. For example, the preset value can be 2.2. The preset value can be 20. Optionally, the preset number can be related to the direction of the magnetometer reading. For example, for... Figure 7A The coordinate system shown has the Y-axis perpendicular to the ground, and the X and Z axes parallel to the ground. Generally, changes in the reinforcing steel or concrete structure occur less in the direction perpendicular to the ground, and more in the direction parallel to the ground. Therefore, the preset number of elements corresponding to the Y-axis can be 20, and the preset number of elements corresponding to the X and Z axes can be 40.

[0177] Optionally, in one implementation of S1102, the multiple readings of the magnetometer within the third time period can be statistically analyzed separately for each axis of the magnetometer. That is, for each axis of the magnetometer, multiple readings on that axis within the third time period are obtained, and a standard score value for each magnetometer reading value is calculated based on the multiple readings on that axis. Correspondingly, in S1103, for each axis of the magnetometer, it is determined that the number of magnetometer readings with a standard score value greater than a preset value within the third time period is greater than a preset number. Finally, based on the judgment results of the three axes of the magnetometer, it is determined whether the vehicle has entered the indoor environment. Optionally, in one implementation, if one of the three axes of the magnetometer meets the condition, it is determined that the vehicle has entered the indoor environment. Optionally, in another implementation, if two of the three axes of the magnetometer meet the condition, it is determined that the vehicle has entered the indoor environment. Optionally, in yet another implementation, if each of the three axes of the magnetometer meets the condition, it is determined that the vehicle has entered the indoor environment. The preset number of axes corresponding to the three axes of the magnetometer can be the same or different.

[0178] Optionally, in another implementation of S1102, multiple readings of the magnetometer on the target axis can be acquired within a third time period, and a standard score value for each magnetometer reading can be calculated based on these multiple readings. Correspondingly, in S1103, if the number of magnetometer readings with standard scores greater than a preset value within the third time period is greater than a preset number, the electronic device determines that the vehicle has entered the indoor environment. Optionally, the target axis can be a horizontal axis. For example, for... Figure 7A The device coordinate system shown can have the target axis as the X-axis and / or Z-axis.

[0179] Optionally, in another implementation of S1102, each reading within the third time period can be a normalized value of the magnetometer's three-axis readings within the third cycle. For example, assuming the magnetometer's three-axis readings are represented as mx, my, and mz, the normalized value of the magnetometer's three-axis readings is represented as... This implementation method can be applied to scenarios where the attitude of electronic devices inside a vehicle is unknown.

[0180] The following example illustrates the change in magnetometer readings when a vehicle enters an indoor environment.

[0181] For example, Figure 12 This is a schematic diagram illustrating the change in the reading of the magnetometer provided in an embodiment of this application. For example... Figure 12 As shown, the horizontal axis represents time, in milliseconds (ms). The first dashed line represents the time it takes for the vehicle to enter the indoor environment. It is evident that the magnetometer reading increases significantly after the vehicle enters the indoor environment.

[0182] 4. Cellular signal detection via communication card

[0183] Cellular networks are also known as mobile networks. With the development of communication technology, cellular networks have evolved from 2G to 5G. This application does not limit the communication technology used in cellular networks. For example, it includes, but is not limited to, at least one of the following: GSM, GPRS, CDMA, WCDMA, TD-SCDMA, LTE, NR, etc.

[0184] In real-world driving scenarios where a vehicle enters an indoor environment, the indoor environment is typically surrounded by building structures. The obstruction caused by these structures can lead to sudden changes in the strength of cellular signals detected by electronic devices, often a sudden decrease. Therefore, electronic devices can determine whether a vehicle has entered an indoor environment based on these changes in cellular signal strength.

[0185] Figure 13 This is a flowchart illustrating cellular signal detection for the electronic device provided in an embodiment of this application. Figure 13 As shown, the electronic device performing cellular signal detection may include:

[0186] S1301. The electronic device acquires the signal strength values ​​of multiple cells according to the fourth cycle.

[0187] The multiple cellular units include the serving cell of the electronic device and the neighboring cells of the serving cell. Optionally, the neighboring cells of the serving cell may include at least one of the following: intra-system co-frequency neighboring cells, intra-system inter-frequency neighboring cells, or inter-system neighboring cells.

[0188] In this embodiment, the value of the fourth period is not limited. For example, it can be 2 seconds.

[0189] S1302. For the signal strength values ​​of multiple cells within the fourth time period, the electronic device uses a clustering algorithm to obtain two clustering results. The fourth time period is the time period preceding the current time, with the current time being the latest.

[0190] In this embodiment, the value of the fourth time period is not limited. For example, it can be 14 seconds. The duration of the fourth time period can be N times the fourth cycle, where N is an integer greater than 1. Therefore, the fourth time period can include signal strength values ​​of multiple cells within the fourth cycle (N). Assuming there are K cells, the fourth time period includes a total of N*K signal strength values.

[0191] For example, Figure 14 This is a schematic diagram illustrating the signal strength of multiple cellular cells detected by an electronic device provided in an embodiment of this application. For example... Figure 14As shown, there are 7 cells, labeled C1 to C7. The fourth time period is from 1 minute to 1 minute and 14 seconds, totaling 14 seconds. The fourth cycle is 2 seconds, and the current time is 1 minute and 14 seconds. Within the fourth time period, each cell includes 7 signal strength values. Taking cell C1 as an example, the 7 signal strength values ​​for cell C1 within the fourth time period are: -55dBm, -58dBm, -60dBm, -77dBm, -87dBm, -93dBm, and -99dBm. The fourth time period includes a total of 7*7=49 signal strength values.

[0192] Optionally, for a given cell, the signal strength value detected by the electronic device for that cell typically decreases gradually until the signal strength is too low to be measured.

[0193] Optionally, for a given cell, if a value from a certain fourth period is missing among the N signal strength values ​​included in the fourth time period, the signal strength value from the previous fourth period can be used to fill the gap. For example... Figure 14 As shown, for cell C5, assuming the signal strength value at the gray grid (i.e., the 4th fourth cycle) is missing, it can be filled with the signal strength value of the previous fourth cycle (i.e., the 3rd fourth cycle), specifically -92dBm.

[0194] Optionally, for a given cell, if the signal strength in a certain fourth period within the fourth time time is very low and cannot be detected, it can be filled with a preset minimum signal strength, for example, -140dBm. (Example provided). Figure 14 As shown, for cell C7, assuming the signal strength values ​​at the gray squares (i.e., the 6th and 7th fourth cycles) are very low, they can be filled with -140dBm.

[0195] In this step, a clustering algorithm is used to divide the signal strength values ​​of multiple cells within the fourth time period into two categories. Assume that each cell within the fourth time period includes N signal strength values ​​across N fourth periods. One clustering result includes the signal strength values ​​of multiple cells across M fourth periods out of the N fourth periods, and the other clustering result includes the signal strength values ​​of multiple cells across all other fourth periods outside of the M fourth periods. This embodiment does not provide a detailed explanation of the principle of the clustering algorithm; existing algorithms can be used. Optionally, the clustering algorithm can be the K-means clustering algorithm.

[0196] For example, in one example, such as Figure 15AAs shown, one clustering result includes the signal strength values ​​of cells C1 to C7 within the first four fourth cycles (i.e., the first 8 seconds), totaling 4*7 = 28 signal strength values; another clustering result includes the signal strength values ​​of cells C1 to C7 within the last three fourth cycles (i.e., the last 6 seconds), totaling 3*7 = 21 signal strength values. In another example, as... Figure 15B As shown, one clustering result includes the signal strength values ​​of cells C1 to C7 within the first 6 fourth cycles (i.e., the first 12 seconds), totaling 6*7=42 signal strength values; the other clustering result includes the signal strength values ​​of cells C1 to C7 within the last fourth cycle (i.e., the last 2 seconds), totaling 7 signal strength values.

[0197] S1303. If one of the two clustering results includes the signal strength values ​​of multiple cells within the last X fourth periods of the fourth time period, then the electronic device determines that the vehicle has entered the indoor environment.

[0198] Optional, X is 1 or 2.

[0199] Specifically, a clustering algorithm is used to divide all signal strength values ​​within the fourth period into two categories. If one of the clustering results includes the last one or the last two signal strength values ​​from the fourth period, it indicates a sudden change in the cellular signal strength, suggesting a change in the wireless signal environment of the vehicle, such as moving from an outdoor environment to an indoor environment.

[0200] Optionally, before S1302, if the electronic device determines that at least one of the following conditions has occurred, then S1302 is not executed.

[0201] The first scenario: The electronic device undergoes cell reselection during the fourth time period.

[0202] The second scenario: During the fourth time period, the signal strength of at least one cell gradually increases.

[0203] The third scenario: The number of cells in the last X fourth cycles within the fourth time period is different from the number of cells in the remaining fourth cycles.

[0204] In the first scenario, cell reselection refers to the phenomenon where an electronic device uses a cell reselection mechanism to reselect a serving cell, resulting in a change of serving cell. If cell reselection occurs during the fourth time period, the multiple cells in S1301 will change as a whole due to the change of serving cell. When using a clustering algorithm, the cells before and after reselection may be divided into two clusters. If cell reselection occurs during the last X fourth periods of the fourth time period, the last X fourth periods are divided into one cluster. However, this clustering result is due to cell reselection, not due to a sudden change in cellular signal. Therefore, S1302 is not executed when cell reselection occurs, improving the accuracy of the electronic device in determining whether a vehicle has entered an indoor environment based on cellular signals.

[0205] In the second scenario, the gradually increasing signal strength of at least one cell indicates that the vehicle may have entered a strong signal area, which is not a characteristic of a vehicle entering an indoor environment. Typically, due to the obstruction of buildings in indoor environments, the signal strength of cells gradually decreases, especially at the entrance to an indoor environment, where the signal strength usually drops abruptly. In some scenarios, although femtocells are deployed indoors, they are usually located far from the entrance to enhance signal coverage in deeper areas of the indoor environment. Therefore, when the cell signal gradually increases, S1302 is not executed, improving the accuracy of the electronic device in determining whether a vehicle has entered an indoor environment based on the cell signal. In this embodiment, the number of cells with gradually increasing signal strength is not limited.

[0206] In the third scenario, when the number of cells in the last X fourth cycles within the fourth time period differs from the number of cells in the remaining fourth cycles, the clustering algorithm might group the last X fourth cycles into a single cluster. However, this clustering result is not due to a sudden change in the cell signal, but rather to a sudden change in the number of cells. Therefore, S1302 will not be executed, improving the accuracy of the electronic device in determining whether a vehicle has entered an indoor environment based on cell signals. Optionally, to further improve the accuracy of determining whether a vehicle has entered an indoor environment, the number of cells can be an average value. For example, if the fourth cycle is 2 seconds, the fourth time period is 14 seconds, and X = 1, then the number of cells in the remaining fourth cycles can be the average number of cells in the previous 12 seconds.

[0207] 5. Light intensity detection using a light sensor.

[0208] In real-world driving scenarios where vehicles enter indoor environments, these environments are typically surrounded by building structures. The obstruction from these structures causes differences in light intensity between the outside and inside of the vehicle. Therefore, electronic devices can determine whether a vehicle has entered an indoor environment based on changes in the light intensity inside the vehicle.

[0209] Figure 16 This is a flowchart illustrating light intensity detection for the electronic device provided in this application embodiment. Figure 16 As shown, an electronic device that detects light intensity using a light sensor may include:

[0210] S1601. The electronic device acquires the light intensity value detected by the light sensor according to the fifth cycle.

[0211] In this embodiment, the value of the fifth period is not limited. For example, the value can be 1 second.

[0212] S1602. For multiple light intensity values ​​within the fifth time period, the electronic device acquires the mean and variance of the light intensity values ​​within the fifth time period. The fifth time period refers to the time period preceding the current moment, with the current moment being the latest.

[0213] In this embodiment, the value of the fifth time period is not limited. The duration of the fifth time period can be N times the fifth period, where N is an integer greater than 1. Therefore, the fifth time period includes N light intensity values ​​detected by the light sensor within the fifth period. For example, suppose the fifth period is 1 second and the fifth time period is 20 seconds. The fifth time period includes 20 light intensity values, totaling 20 seconds / 1 second.

[0214] Specifically, the fifth time period includes multiple light intensity values. The mean light intensity of the fifth time period reflects the average light intensity within that period. Variance indicates the average degree of deviation of each data point in a sequence from its mean. The variance of the light intensity in the fifth time period indicates the average degree of deviation of multiple light intensity values ​​from the mean light intensity within that period. It can be understood that the larger the variance of the light intensity in the fifth time period, the greater the fluctuation in light intensity values.

[0215] The following example illustrates the mean and variance of light intensity.

[0216] Assume the fifth cycle is 1 second, the fifth time interval is 7 seconds, and the fifth time interval includes 7 light intensity values. For example, the 7 light intensity values ​​are {25, 28, 31, 34, 37, 40, 43}.

[0217] Therefore, the average light intensity of multiple light intensity values ​​in the fifth time period is: (25+28+31+34+37+40+43) / 7=34.

[0218] The light intensity variance corresponding to the fifth time period is:

[0219] [(25-34)^2+(28-34)^2+(31-34)^2+(34-34)^2+(37-34)^2+(40-34)^2+(43-34)^2] / 7=36.

[0220] S1603. If the light intensity variance is greater than or equal to the preset light intensity variance threshold, and the light intensity value of the last fifth cycle within the fifth time period is less than the average light intensity, then the electronic device determines that the vehicle has entered the indoor environment.

[0221] In this embodiment of the application, the value of the preset light intensity variance threshold is not limited, for example, 800 Lux.

[0222] Specifically, if the light intensity variance in the fifth time period is greater than or equal to the preset light intensity variance threshold, it indicates that the light intensity value fluctuates significantly within the fifth time period, suggesting a large fluctuation in the light intensity of the environment in which the electronic device is located. For example, this could be due to a change in light intensity from indoors to outdoors or vice versa. If the last light intensity value in the fifth time period is less than the average light intensity value for that period, it indicates a decrease in light intensity, which confirms that the vehicle has entered an indoor environment.

[0223] Optionally, if the light intensity variance is less than the preset light intensity variance threshold, but for multiple consecutive fifth time periods, the light intensity variance of each fifth time period is less than the preset light intensity variance threshold, the difference between the light intensity variance of each fifth time period and the light intensity variance threshold is less than the preset difference, and the light intensity value of the last fifth cycle within each fifth time period is less than the light intensity average, then the electronic device determines that the vehicle has entered the indoor environment.

[0224] In this embodiment of the application, the number of consecutive fifth time periods and the value of the preset difference are not limited.

[0225] In this implementation, assuming the fifth cycle is 1 second, if for several consecutive seconds the variance of the last second is consistently close to the light intensity variance threshold, and the light intensity of the last second is always less than the average light intensity, it can be determined that the vehicle has entered an indoor environment.

[0226] Optionally, before S1602, if the electronic device determines that at least one of the following conditions has occurred, then S1602 is not executed.

[0227] The first scenario: It is determined that the current time is nighttime.

[0228] The second scenario: Obtain weather information and determine whether the current weather is cloudy or rainy based on the weather information.

[0229] The third scenario: It is determined that the electronic device is already in an indoor environment.

[0230] Specifically, on cloudy days, rainy days, or at night, because outdoor light intensity is also low and the difference between outdoor and indoor light intensity is not significant, light intensity detection by electronic devices is not suitable for cloudy days, rainy days, or nighttime to improve the accuracy of determining whether a vehicle has entered an indoor environment. The nighttime period corresponds to the daytime period; this application embodiment does not limit the duration of the nighttime and daytime periods. For example, the nighttime period includes 8 PM to 5 AM, and the daytime period includes 8 AM to 6 PM.

[0231] Optionally, to improve the accuracy of electronic devices in determining whether a vehicle has entered an indoor environment, the electronic devices can be placed near a window inside the vehicle.

[0232] Based on the aforementioned electronic devices for slope detection, gate entry detection, geomagnetic signal detection, cellular signal detection, and light intensity detection, another embodiment of this application provides a method for detecting vehicles entering an indoor environment.

[0233] Figure 17 This is a flowchart illustrating a method for detecting a vehicle entering an indoor environment, as provided in this embodiment. The method for detecting a vehicle entering an indoor environment, as provided in this embodiment, is executed by an electronic device. The electronic device is placed inside the vehicle. Figure 17 As shown, the vehicle entry detection method provided in this embodiment may include:

[0234] S1701. The electronic device acquires multiple detection results at the current moment according to the detection cycle. Among them, the multiple detection results include at least two of the first detection result, the second detection result, the third detection result, and the fourth detection result.

[0235] The first detection result is determined by the electronic device using accelerometer data to indicate whether a vehicle has entered the ramp at the entrance of the indoor environment; the second detection result is determined by the electronic device using accelerometer data to indicate whether a vehicle has passed through the barrier gate at the entrance of the indoor environment; the third detection result is determined by the electronic device using magnetometer data to indicate whether a vehicle has entered the indoor environment; and the fourth detection result is determined by the electronic device based on cellular signal strength data to indicate whether a vehicle has entered the indoor environment. For obtaining the first detection result, please refer to the above-mentioned implementation method of ramp detection using accelerometer; for obtaining the second detection result, please refer to the above-mentioned implementation method of barrier gate entry detection using accelerometer; for obtaining the third detection result, please refer to the above-mentioned implementation method of geomagnetic signal detection using magnetometer; and for obtaining the fourth detection result, please refer to the above-mentioned implementation method of cellular signal detection using communication card. These details will not be elaborated upon here.

[0236] Optionally, in one implementation, the electronic device can perform at least two of the following: ramp detection, gate entry detection, geomagnetic signal detection, and cellular signal detection, and acquire corresponding detection results, with multiple detection results including the at least two detection results. For example, in one implementation, the electronic device can perform ramp detection and gate entry detection, acquire a first detection result and a second detection result, with multiple detection results including the first detection result and the second detection result. In another implementation, the electronic device can perform ramp detection, gate entry detection, and geomagnetic signal detection, acquire a first detection result, a second detection result, and a third detection result, with multiple detection results including the first detection result, the second detection result, and the third detection result.

[0237] Optionally, in another implementation, the electronic device can perform at least M types of detection, including ramp detection, gate entry detection, geomagnetic signal detection, and cellular signal detection, and acquire N detection results from the M types of detection, where multiple detection results include the N detection results. M and N are both positive integers greater than 1, and N is less than or equal to M. For example, in one implementation, M = 3, N = 2, the electronic device can perform ramp detection, gate entry detection, and geomagnetic signal detection, and acquire a first detection result, a second detection result, and a third detection result, where multiple detection results include the first detection result and the second detection result. In another implementation, M = 4, N = 3, the electronic device can perform ramp detection, gate entry detection, geomagnetic signal detection, and cellular signal detection, and acquire a first detection result, a second detection result, a third detection result, and a fourth detection result, where multiple detection results include the first detection result, the second detection result, and the third detection result, or include the first detection result, the second detection result, and the fourth detection result.

[0238] In this embodiment, the value of the detection period is not limited; for example, it can be 1 second. Optionally, the value of the detection period can refer to the values ​​of the first to fifth periods and / or the first to fifth time periods mentioned above.

[0239] The current time is the detection time determined according to the detection cycle, also known as the current detection time. For example, if the detection cycle is 1 second, the detection time can be 2 minutes 20 seconds, 2 minutes 21 seconds, 2 minutes 22 seconds, and so on.

[0240] Optionally, a detection time period can be preset. The first to fourth detection results at the current moment can include the first to fourth detection results within the detection time period. For example, if the detection time period is 20 seconds and the current moment is 2 minutes and 20 seconds, the first to fourth detection results at the current moment can include the first to fourth detection results within the 20 seconds from 2 minutes 0 seconds to 2 minutes 20 seconds.

[0241] S1702. Determine whether the vehicle has entered an indoor environment based on multiple test results.

[0242] As can be seen, the vehicle entry detection method provided in this embodiment utilizes electronic devices placed inside the vehicle to detect whether the vehicle has entered the indoor environment. These electronic devices include an accelerometer, a magnetometer, and a communication card for cellular communication. Based on the actual scenario of a vehicle entering an indoor environment, the electronic device can perform ramp detection and / or gate entry detection using the accelerometer readings to determine whether the vehicle has entered the ramp and / or passed through the gate at the entrance of the indoor environment. Using the magnetometer readings, the electronic device can detect geomagnetic signals to determine whether there has been a significant change in the geomagnetic signal. Using the communication card, the electronic device can detect cellular signals to determine whether the signal strength detected by the electronic device has suddenly dropped. The vehicle entry detection method provided in this embodiment integrates at least two detection results from ramp detection, gate entry detection, geomagnetic signal detection, and cellular signal detection to determine whether the vehicle has entered the indoor environment, thus improving the accuracy of determining whether a vehicle has entered an indoor environment. Moreover, by avoiding over-reliance on light intensity detection using optical sensors and instead using accelerometers, magnetometers, or communication cards based on the actual driving scenario of a vehicle entering an indoor environment, the accuracy of determining whether a vehicle has entered an indoor environment is further improved. At the same time, by avoiding the use of GPS, detection power consumption is reduced, and system load is lessened.

[0243] Optionally, in S1702, determining whether a vehicle has entered an indoor environment based on multiple detection results may include:

[0244] If at least N out of multiple detection results indicate that the vehicle has entered an indoor environment, then the vehicle is determined to have entered an indoor environment; N is greater than or equal to 2 and less than or equal to 4.

[0245] In this implementation, if at least two of the detection results from ramp detection, gate entry detection, geomagnetic signal detection, and cellular signal detection indicate that the vehicle has entered the indoor environment, then the vehicle is finally determined to have entered the indoor environment. This improves the accuracy of determining whether a vehicle has entered the indoor environment and reduces the system load.

[0246] In this embodiment, the number of at least N detection results is not limited. To improve the accuracy of determining whether a vehicle has entered an indoor environment, the at least N detection results may include at least two of the following: a first detection result, a second detection result, and a third detection result.

[0247] Optionally, prior to S1702, it may also include:

[0248] The electronic device acquires the fifth detection result of the light intensity detection at the current moment according to the detection cycle.

[0249] Accordingly, in S1702, the determination of whether a vehicle has entered an indoor environment is based on multiple test results, including:

[0250] If at least two of the first, second, third, and fourth test results indicate that the vehicle has entered an indoor environment, and the fifth test result indicates that the vehicle has entered an indoor environment, then it is determined that the vehicle has entered an indoor environment.

[0251] In this implementation, in addition to the electronic devices performing ramp detection, gate entry detection, geomagnetic signal detection, and cellular signal detection, the results of light intensity detection are also taken into account, further improving the accuracy of determining whether a vehicle has entered the indoor environment.

[0252] The following example illustrates this.

[0253] Figure 18 This is a schematic diagram illustrating a detection result of a vehicle entering an indoor environment, as provided in an embodiment of this application. Figure 18 In the middle, the horizontal axis represents time, from 13:26 to 13:28.

[0254] Assume the detection cycle is 1 second and the detection period is 20 seconds. That is, the electronic device acquires the first to fifth detection results from the previous 20 seconds every second, and makes a comprehensive judgment based on the first to fifth detection results to determine whether the vehicle has entered the indoor environment.

[0255] Assuming the first cycle is 1 second, the first time interval is 5 seconds, and the preset angle is 5 degrees, the electronic equipment can determine whether, within the past 20 seconds, there has been a situation where the vehicle's tilt angle is greater than 5 degrees for 5 consecutive seconds. The slope detection results can be found in [reference needed]. Figure 18 A solid horizontal line indicates the duration of a vehicle tilt angle greater than 5 degrees.

[0256] Assuming the second period is 10 milliseconds and the second time interval is 10 seconds, the electronic device can determine whether the accelerometer reading exhibits a U-shaped pattern of first decreasing, then leveling off, and then increasing over a consecutive 10-second period within the past 20 seconds, thus determining whether the vehicle has passed through the barrier.

[0257] Assuming the third period is 10 milliseconds and the third time interval is 2 seconds, the electronic device can determine whether, within the past 20 seconds, the magnetometer reading has fluctuated significantly for two consecutive seconds. The geomagnetic signal detection results can be found in [reference needed]. Figure 18 The gray bars in the image indicate significant fluctuations in the geomagnetic signal over a continuous 2-second period.

[0258] Assuming the fourth cycle is 2 seconds and the fourth time interval is 14 seconds, the electronic device can determine whether there has been a sudden drop in cellular signal strength in the last 2 seconds of a continuous 14-second period within the past 20 seconds. Cellular signal detection results can be found in [reference needed]. Figure 18 The vertical line in the middle indicates a sudden drop in cellular signal in the last 2 seconds of a continuous 14-second period.

[0259] Assuming the fifth cycle is 1 second and the fifth time interval is 20 seconds, the electronic device can determine whether there has been a situation where the light intensity variance exceeded a light intensity variance threshold within the past 20 seconds. The light intensity detection results can be found in [reference needed]. Figure 18 The dashed line at the mid-level indicates the duration for which the light intensity variance exceeds the light intensity variance threshold.

[0260] Based on the above test results, the electronic equipment can determine that the vehicle entered the indoor environment at 13:27:21.

[0261] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0262] This application embodiment can divide an electronic device into functional modules based on the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one module. It should be noted that the module division in this application embodiment is illustrative and represents only one logical functional division; other division methods may be used in actual implementation. It should also be noted that the module names in this application embodiment are illustrative, and the names of the modules are not limited in actual implementation.

[0263] For example, Figure 19 This is a schematic diagram of a vehicle entry detection device provided in an embodiment of this application. The vehicle entry detection device provided in this embodiment is used to execute the vehicle entry detection method provided in the method embodiment of this application, and has similar technical principles and effects.

[0264] like Figure 19 As shown, the vehicle entry detection device provided in this embodiment can be applied to electronic devices placed in the vehicle. The device includes:

[0265] The acquisition module 1901 is used to acquire multiple detection results according to a detection cycle. The multiple detection results include at least two of a first detection result, a second detection result, a third detection result, and a fourth detection result. The first detection result is determined by the electronic device using accelerometer data to indicate whether the vehicle has entered the ramp at the entrance of the indoor environment. The second detection result is determined by the electronic device using accelerometer data to indicate whether the vehicle has passed through the barrier gate at the entrance of the indoor environment. The third detection result is determined by the electronic device using magnetometer data to indicate whether the vehicle has entered the indoor environment. The fourth detection result is determined by the electronic device based on cellular signal strength data to indicate whether the vehicle has entered the indoor environment.

[0266] The processing module 1902 is used to determine whether the vehicle has entered an indoor environment based on the multiple detection results.

[0267] Optionally, the processing module 1902 is used for:

[0268] If at least N of the multiple detection results indicate that the vehicle has entered an indoor environment, then it is determined that the vehicle has entered an indoor environment; N is greater than or equal to 2 and less than or equal to 4.

[0269] Optionally, the plurality of detection results may also include a fifth detection result, which is determined by the electronic device using data from a light sensor to indicate whether the vehicle has entered an indoor environment.

[0270] Optionally, it also includes a sending module, which is used for:

[0271] If the vehicle is determined to have entered an indoor environment based on the multiple detection results, a notification message is sent to the vehicle; the notification message is used to instruct the vehicle to enter an indoor environment.

[0272] Optionally, the acquisition module 1901 includes a first acquisition unit, which is used for:

[0273] The three-axis readings of the accelerometer are obtained according to the first cycle;

[0274] The triaxial readings of the accelerometer are converted into target triaxial readings in the vehicle's coordinate system.

[0275] The vehicle tilt angle is determined based on the target triaxial readings;

[0276] If the vehicle tilt angle is greater than a preset angle, the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment.

[0277] Optionally, the first acquisition unit is used for:

[0278] If it is determined that the vehicle tilt angles corresponding to multiple triaxial readings within the first time period are all greater than the preset angle, then the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment; wherein, the first time period includes multiple first cycles.

[0279] Optionally, the acquisition module 1901 includes a second acquisition unit, the second acquisition unit being used for:

[0280] Multiple readings on the first target axis of the accelerometer are acquired according to the second cycle within a second time period; wherein, the second time period includes multiple second cycles;

[0281] If the numerical trend of the multiple readings is first decreasing, then remaining flat, and then increasing, then the second detection result indicates that the vehicle has passed through the barrier gate at the entrance of the indoor environment.

[0282] Optionally, the first target axis is parallel to the vehicle's direction of travel.

[0283] Optionally, the acquisition module 1901 includes a third acquisition unit, the third acquisition unit being used for:

[0284] Multiple triaxial readings of the magnetometer are obtained within a third time period according to the third cycle; wherein, the third time period includes multiple third cycles, and the triaxial readings of the magnetometer include readings on the three axes of the magnetometer;

[0285] Acquire multiple target readings from the plurality of triaxial readings, and determine the standard score value for each target reading;

[0286] If the number of target readings with a standard score greater than a preset value is greater than a preset number among the multiple target readings, then the third detection result indicates that the vehicle has entered an indoor environment.

[0287] Optionally, the target reading value is any one of the following:

[0288] The reading of the second target axis on the magnetometer; the second target axis is one of the axes of the magnetometer;

[0289] The magnetometer has readings on at least two axes;

[0290] The normalized value determined based on the triaxial readings of the magnetometer.

[0291] Optionally, the second target axis is an axis in the horizontal direction.

[0292] Optionally, the acquisition module 1901 includes a fourth acquisition unit, the fourth acquisition unit being used for:

[0293] The signal strength values ​​of multiple cells within a fourth time period are obtained according to the fourth cycle; wherein, the fourth time period includes multiple fourth cycles, and the multiple cells include the serving cell of the electronic device and the neighboring cells of the serving cell;

[0294] Clustering algorithms were used to process the signal strength values ​​within the fourth time period to obtain two clustering results;

[0295] If the first clustering result includes the signal strength values ​​corresponding to the last X fourth cycles within the fourth time period, then the fourth detection result indicates that the vehicle has entered an indoor environment; wherein, the two clustering results include the first clustering result and the second clustering result, and X is 1 or 2.

[0296] Optionally, the first acquisition unit is further configured to:

[0297] Before processing the signal strength values ​​in the fourth time period using a clustering algorithm, it is determined that the electronic device did not undergo cell reselection in the fourth time period; and that multiple signal strength values ​​of each cell in the fourth time period show a decreasing trend; and that the number of cells in the X fourth periods is the same as the number of cells in other fourth periods besides the X fourth periods in the fourth time period.

[0298] Optionally, the acquisition module 1901 includes a fifth acquisition unit, the fifth acquisition unit being used for:

[0299] Multiple light intensity values ​​detected by the optical sensor within a fifth time period are obtained according to the fifth cycle; wherein, the fifth time period includes multiple fifth cycles;

[0300] Determine the mean and variance of the light intensity of the plurality of light intensity values;

[0301] If the light intensity variance is greater than or equal to a preset light intensity variance threshold, and the light intensity value corresponding to the last fifth cycle within the fifth time period is less than the average light intensity, then the fifth detection result indicates that the vehicle has entered an indoor environment.

[0302] Optionally, the fifth acquisition unit is further configured to determine that the current time is during daytime before acquiring multiple light intensity values ​​detected by the light sensor within the fifth time period; and to determine that the current weather is not cloudy or rainy.

[0303] This application provides an electronic device, see [link to relevant documentation] Figure 5The structure is shown. The electronic device may include a processor, which is used to couple with the memory, read instructions from the memory, and cause the electronic device to execute the technical solutions in the above method embodiments according to the instructions. Its implementation principle and technical effects are similar to those in the above related embodiments, and will not be repeated here.

[0304] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the technical solution described in the above method embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here.

[0305] This application provides a computer-readable storage medium storing program instructions. When these program instructions are executed by an electronic device, the electronic device performs the technical solution described in the above embodiments. Its implementation principle and technical effects are similar to the related embodiments described above, and will not be repeated here.

[0306] In summary, the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for detecting a vehicle entering an indoor environment, characterized in that, Applied to an electronic device placed in the vehicle, the method includes: Multiple detection results are obtained according to the detection cycle. The multiple detection results include at least two of the following: a first detection result, a second detection result, a third detection result, and a fourth detection result. The first detection result is determined by the electronic device using accelerometer data to indicate whether the vehicle has entered the ramp at the entrance of the indoor environment. The second detection result is determined by the electronic device using accelerometer data to indicate whether the vehicle has passed through the barrier gate at the entrance of the indoor environment. The third detection result is determined by the electronic device using magnetometer data to indicate whether the vehicle has entered the indoor environment. The fourth detection result is determined by the electronic device based on cellular signal strength data to indicate whether the vehicle has entered the indoor environment. Based on the multiple detection results, determine whether the vehicle has entered an indoor environment; Obtain the first test result, including: The three-axis readings of the accelerometer are obtained according to the first cycle; The triaxial readings of the accelerometer are converted into target triaxial readings in the vehicle's coordinate system. The vehicle tilt angle is determined based on the target triaxial readings; If the vehicle tilt angle is greater than a preset angle, the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment.

2. The method according to claim 1, characterized in that, The step of determining whether the vehicle has entered an indoor environment based on the multiple detection results includes: If at least N of the multiple detection results indicate that the vehicle has entered an indoor environment, then it is determined that the vehicle has entered an indoor environment; N is greater than or equal to 2.

3. The method according to claim 1, characterized in that, The plurality of detection results also includes a fifth detection result, which is determined by the electronic device using data from a light sensor to indicate whether the vehicle has entered an indoor environment.

4. The method according to claim 1, characterized in that, Also includes: If the vehicle is determined to have entered an indoor environment based on the multiple detection results, a notification message is sent to the vehicle. The notification information is used to instruct the vehicle to enter an indoor environment.

5. The method according to claim 1, characterized in that, If the vehicle tilt angle is greater than a preset angle, the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment, including: If it is determined that the vehicle tilt angles corresponding to multiple triaxial readings within the first time period are all greater than the preset angle, then the first detection result indicates that the vehicle enters the ramp at the entrance of the indoor environment; wherein, the first time period includes multiple first cycles.

6. The method according to any one of claims 1-4, characterized in that, Obtain the second detection result, including: Multiple readings on the first target axis of the accelerometer are acquired according to the second cycle within a second time period; wherein, the second time period includes multiple second cycles; If the numerical trend of the multiple readings is first decreasing, then remaining flat, and then increasing, then the second detection result indicates that the vehicle has passed through the barrier gate at the entrance of the indoor environment.

7. The method according to claim 6, characterized in that, The first target axis is parallel to the vehicle's direction of travel.

8. The method according to any one of claims 1-4, characterized in that, Obtain the third detection result, including: Multiple triaxial readings of the magnetometer are obtained within a third time period according to the third cycle; wherein, the third time period includes multiple third cycles, and the triaxial readings of the magnetometer include readings on the three axes of the magnetometer; Acquire multiple target readings from the plurality of triaxial readings, and determine the standard score value for each target reading; If the number of target readings with a standard score greater than a preset value is greater than a preset number among the multiple target readings, then the third detection result indicates that the vehicle has entered an indoor environment.

9. The method according to claim 8, characterized in that, The target reading value is any one of the following: The reading of the second target axis on the magnetometer; the second target axis is one of the axes of the magnetometer; The magnetometer has readings on at least two axes; The normalized value determined based on the triaxial readings of the magnetometer.

10. The method according to claim 9, characterized in that, The second target axis is an axis that is in the horizontal direction.

11. The method according to any one of claims 1-4, characterized in that, Obtain the fourth test result, including: The signal strength values ​​of multiple cells within a fourth time period are obtained according to the fourth cycle; wherein, the fourth time period includes multiple fourth cycles, and the multiple cells include the serving cell of the electronic device and the neighboring cells of the serving cell; Clustering algorithms were used to process the signal strength values ​​within the fourth time period to obtain two clustering results; If the first clustering result includes the signal strength values ​​corresponding to the last X fourth cycles within the fourth time period, then the fourth detection result indicates that the vehicle has entered an indoor environment; wherein, the two clustering results include the first clustering result and the second clustering result, and X is 1 or 2.

12. The method according to claim 11, characterized in that, Before processing the signal strength values ​​within the fourth time period using a clustering algorithm, the process further includes: It is determined that the electronic device did not undergo cell reselection during the fourth time period; and, It was determined that multiple signal strength values ​​for each of the cells showed a decreasing trend during the fourth time period; and, The number of cells within the X fourth periods is determined to be the same as the number of cells within the other fourth periods excluding the X fourth periods in the fourth time period.

13. The method according to claim 3, characterized in that, Obtain the fifth test result, including: Multiple light intensity values ​​detected by the optical sensor within a fifth time period are obtained according to the fifth cycle; wherein, the fifth time period includes multiple fifth cycles; Determine the mean and variance of the light intensity of the plurality of light intensity values; If the light intensity variance is greater than or equal to a preset light intensity variance threshold, and the light intensity value corresponding to the last fifth cycle within the fifth time period is less than the average light intensity, then the fifth detection result indicates that the vehicle has entered an indoor environment.

14. The method according to claim 13, characterized in that, Before acquiring the multiple light intensity values ​​detected by the light sensor within the fifth time period, the method further includes: It is determined that the current time is during daytime; and, Make sure the current weather is not cloudy or rainy.

15. An electronic device, characterized in that, The electronic device includes a processor configured to be coupled to a memory, read instructions from the memory, and cause the electronic device to perform the method of any one of claims 1-14 according to the instructions.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-14.

Citation Information

Patent Citations

  • Augmenting indoor-outdoor detection using side information

    CN107925981A

  • Indoor and outdoor identification method and system, electronic equipment and computer readable medium

    CN113176587A