Positioning method, device, chip structure and storage medium based on Bluetooth transmission

Obtaining navigation data of external navigation devices through Bluetooth transmission solves the problem of reduced positioning accuracy caused by aging of GPS functions of electronic devices, and realizes a convenient and efficient navigation solution, suitable for various electronic devices.

CN117714974BActive Publication Date: 2025-01-10HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311028441.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-14
Publication Date
2025-01-10
Estimated Expiration
2043-08-14

AI Technical Summary

Technical Problem

The GPS hardware of existing electronic devices has decreased positioning accuracy and timeliness after aging, especially in tablet devices with smaller mobile phone screens or no GPS function, making it difficult for users to obtain convenient navigation solutions.

Method used

The positioning method based on Bluetooth transmission is adopted, and navigation data is obtained and transmitted to electronic devices by pairing and connecting with external navigation devices. The location information is displayed using map applications, which simplifies operations and improves positioning accuracy.

Benefits of technology

No additional application downloads are required, reducing power consumption, improving user experience, simplifying operation processes, enhancing GPS functionality of electronic devices, suitable for aging GPS hardware and GPS-free devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714974B_ABST
    Figure CN117714974B_ABST
Patent Text Reader

Abstract

This application provides a positioning method, device, chip structure, and storage medium based on Bluetooth transmission. The positioning method is applied to an electronic device used to acquire navigation data from an external navigation device, including a map application, a Bluetooth module, and a location service module. The method includes: receiving a first operation; in response to the first operation, the Bluetooth module determines a transmission channel for transmitting the first navigation data and registers to monitor the acquisition of the first navigation data, wherein the transmission channel is negotiated with the navigation device; receiving a second operation; in response to the second operation, the Bluetooth module establishes a Bluetooth connection with the navigation device and establishes the transmission channel; the Bluetooth module acquires the first navigation data from the navigation device based on the transmission channel; and the location service module determines the current location data based on the first navigation data and reports the location data to the map application. This method is simple to operate, saves space, reduces power consumption, and improves user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of navigation technology, and in particular to a positioning method, device, chip structure and storage medium based on Bluetooth transmission. Background Art

[0002] With technological advancements, navigation technology in electronic devices is becoming increasingly sophisticated, and positioning is becoming increasingly accurate. Users are becoming increasingly reliant on navigation. However, after two to three years of use, the Global Positioning System (GPS) hardware modules in navigation-enabled electronic devices, such as mobile phones, tend to age, and over-the-air (OTA) updates degrade significantly. This leads to a sharp decline in the accuracy and timeliness of positioning, severely impacting the user experience.

[0003] In other scenarios, such as driving, using a small-screen phone for navigation can be inconvenient to read, even if the phone's navigation is accurate. If a user wants to use a tablet with a larger screen for navigation, but the tablet doesn't have GPS, that won't meet their needs.

[0004] Therefore, there is an urgent need for an external GPS device that is auxiliary, easy to use, and has good compatibility to serve as an extension of the GPS function of electronic devices. Summary of the Invention

[0005] In view of this, the present invention provides a positioning method, device, chip structure and storage medium based on Bluetooth transmission. The method can enhance the GPS capability of electronic devices with no navigation function or weakened navigation function in the prior art, and the operation is simple and convenient.

[0006] Some embodiments of the present application provide a positioning method based on Bluetooth transmission. The present application is introduced from multiple aspects below. The implementation methods and beneficial effects of the following aspects can be referenced to each other.

[0007] In a first aspect, the present invention provides a positioning method based on Bluetooth transmission, which can be applied to an electronic device, wherein the electronic device is used to obtain navigation data from an external navigation device, and the electronic device includes a map application, a Bluetooth module, and a location service module. The method includes:

[0008] receiving a first operation, the first operation being an operation by a user to pair the Bluetooth module with the navigation device via Bluetooth; in response to the first operation, the Bluetooth module of the electronic device determining a transmission channel for transmitting the first navigation data, and registering and monitoring an action of acquiring the first navigation data, wherein the transmission channel is negotiated with the navigation device;

[0009] A second operation is received, where the second operation is an operation of the user opening a map application; in response to the second operation, the Bluetooth module of the electronic device is used to establish a Bluetooth connection with the navigation device and establish a transmission channel, where the transmission channel is used to transmit the first navigation data from the navigation device; the Bluetooth module of the electronic device obtains the first navigation data from the navigation device based on the transmission channel; the location service module of the electronic device determines the current location data based on the first navigation data, and reports the location data to the map application so that the map application displays the location data.

[0010] The positioning method based on Bluetooth transmission according to the embodiment of the present application is not only simple to operate, but also does not require additional application downloads, which can save space. In addition, compared with the solution using Bluetooth navigation applications, reducing the running of one application can reduce power consumption and greatly improve the user experience.

[0011] As an embodiment of the first aspect of the present application, when the Bluetooth module and the navigation device are already paired via Bluetooth, the electronic device receives the second operation again, directly establishes a Bluetooth connection and a transmission channel with the navigation device, obtains the first navigation data based on the transmission channel, and obtains the position data based on the first navigation data. This makes the operation simpler and more convenient.

[0012] As an embodiment of the first aspect of the present application, an electronic device determines current location data based on first navigation data, including: a Bluetooth module obtains the first navigation data and establishes a hardware abstraction layer (HAL) data channel with a location service module; the Bluetooth module transparently transmits the first navigation data to the location service module based on the HAL data channel; the location service module parses the first navigation data and determines the current location data based on the first navigation data. By establishing the HAL data channel, navigation data in HAL format can be transmitted to the location service module without the need for other auxiliary applications.

[0013] As an embodiment of the first aspect of the present application, the Bluetooth module includes a navigation proxy module, the location service module includes a navigation abstraction layer library, the navigation proxy module establishes a HAL data channel with the navigation abstraction layer library, and transparently transmits first navigation data to the navigation abstraction layer library. The HAL data channel can be established through the navigation proxy module and the navigation abstraction layer library to facilitate the non-discriminatory transmission of data and ensure data integrity.

[0014] As an embodiment of the first aspect of the present application, the Bluetooth module further includes a data determination module. The data determination module determines, based on a specific format of the navigation data, that the acquired data is first navigation data, and then transmits the first navigation data to a navigation proxy module, so that the navigation proxy module transparently transmits the first navigation data to a navigation abstraction layer library. This facilitates centralized processing of navigation data in a unified format, and data that is not in a specific format does not need to be sent to the navigation proxy module, thereby avoiding unnecessary data transmission.

[0015] As an embodiment of the first aspect of the present application, the Bluetooth module is a classic Bluetooth module, and the transmission channel includes at least one of the following transmission channels: a logical link control and adaptation protocol L2CAP transmission channel, a host control interface command HCI L2CP ehco transmission channel above L2CAP, a serial port protocol SPP channel, or a Bluetooth hands-free protocol HFP transmission channel.

[0016] As an embodiment of the first aspect of the present application, the Bluetooth module is a low-power Bluetooth module. In response to the second operation, the Bluetooth module of the electronic device is used to establish a Bluetooth connection with the navigation device, including: the electronic device initiates a General Attribute Protocol GATT connection to establish a Bluetooth connection with the navigation device.

[0017] As an embodiment of the first aspect of the present application, an electronic device initiates a GATT connection to establish a Bluetooth connection with a navigation device, including: the electronic device initiates a GATT connection to the navigation device based on an agreed GATT service unique identifier, and establishes a Bluetooth connection with the navigation device after the navigation device determines the unique identifier, ensuring that the transmitted data can accurately reach the intended device.

[0018] As an embodiment of the first aspect of the present application, the method further includes: a navigation chip of the electronic device obtaining second navigation data; the electronic device determining current location data based on the first navigation data and the second navigation data, and reporting the location data to a map application, so that the map application displays the location data. The combined positioning of the two sets of navigation data can effectively improve positioning accuracy.

[0019] As an embodiment of the first aspect of the present application, an electronic device determines current location data based on first navigation data and second navigation data, including: a navigation abstraction layer library respectively obtaining and parsing the first navigation data and the second navigation data, and determining the current location data based on the first navigation data and the second navigation data, to facilitate unified calculation and processing of multiple sets of data.

[0020] As an embodiment of the first aspect of the present application, there are multiple navigation devices, and the electronic device is configured to simultaneously establish Bluetooth connections with the multiple navigation devices to obtain first navigation data from the multiple navigation devices. In specific scenarios, navigation data from multiple navigation devices can be obtained, which provides more accurate positioning than data from a single navigation device. This can also meet specific scenarios, such as when a vehicle is traveling in a relatively remote area and the data from a single navigation device is not accurate enough.

[0021] In a second aspect, the present application also provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the device, and a processor for executing instructions so that the electronic device executes any one of the methods in the technical solution of the first aspect.

[0022] In a third aspect, the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect.

[0023] In a fourth aspect, the present application also provides a chip structure, comprising at least one chip, wherein the at least one chip is used to execute any one of the methods in the technical solution of the first aspect.

[0024] In a fifth aspect, the present application also provides a computer program product comprising instructions, which, when run on an electronic device, enables a processor to execute any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A scene graph for communication and positioning between a mobile phone and a navigator in some embodiments;

[0026] Figure 2 A flowchart illustrating how to implement interaction between various modules in a mobile phone and a navigator based on user operations in some embodiments;

[0027] Figure 3a A diagram illustrating the flow of NMEA data from a navigator to a mobile phone in some embodiments;

[0028] Figure 3b In some embodiments, Figure 3a The corresponding location service architecture diagram;

[0029] Figure 4 A schematic diagram of an operation interface selected for location-based services in some embodiments;

[0030] Figure 5 A schematic diagram of an operation interface for a user to input an instruction to establish a connection with a navigator in some embodiments;

[0031] Figure 6 This is a schematic structural diagram of an electronic device according to an embodiment of the present application;

[0032] Figure 7 A software structure block diagram of an electronic device according to an embodiment of the present application;

[0033] Figure 8 This is a flow chart of an interactive method for positioning based on classic Bluetooth transmission according to an embodiment of the present application;

[0034] Figure 9 This is a flow diagram of NMEA data from a navigator to a mobile phone according to one embodiment of the present application;

[0035] Figure 10 This is a flow chart of an interactive method for positioning based on low-power Bluetooth transmission according to an embodiment of the present application;

[0036] Figure 11 This is a flow diagram of NMEA data from a navigator to a mobile phone according to another embodiment of the present application;

[0037] Figure 12 This is a scenario in which a mobile phone according to an embodiment of the present application has two navigation chips;

[0038] Figure 13 This is a block diagram of a system on chip according to some embodiments of the present application. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.

[0040] To facilitate understanding of the technical solution of the present application, the technical problems of the embodiments of the present application are first explained.

[0041] refer to Figure 1 , Figure 1 Schematic diagram showing the scene of communication and positioning between a mobile phone and a navigator in some embodiments. Figure 1 As shown, in this scene diagram, a mobile phone 10 and a navigator 20 are included. Among them, the navigator can be understood as an external GPS device independent of the mobile phone, and the navigator 20 can perform star search behavior to obtain navigation data sent by satellites and generate NMEA data in the unified format of the National Marine Electronics Association (NMEA). The mobile phone 10 can establish a communication connection with the navigator 20 and obtain navigation data from the navigator 20 to obtain its own location information. Therefore, even if the navigation chip of the mobile phone fails, or the navigation obtained is not accurate enough, the navigator 20 can obtain its own location information and realize the positioning and navigation function. In addition, even electronic devices without navigation chips, such as tablets, can also achieve positioning and navigation, thereby meeting the user's demand for auxiliary external GPS devices.

[0042] To ensure accurate positioning, the mobile phone and the navigator should be kept at a relatively close distance, so the two need a close range communication connection. In some solutions, the two use a Bluetooth connection for communication. However, in some embodiments, if the mobile phone 10 is to communicate with the navigator 20, and the navigation positioning situation is to be displayed in the mobile phone interface, it is necessary to download an auxiliary navigation software in the mobile phone, for example, a Bluetooth navigation application (Bluetooth Global Positioning System application), and realize the communication connection between the mobile phone and the navigator through the Bluetooth navigation application. However, this solution is very complicated in operation. In the following embodiment, the positioning process of this solution is described.

[0043] refer to Figure 2 , Figure 2 FIG. 1 shows a flow chart of implementing the interaction between various modules in a mobile phone and a navigator based on user operations in some embodiments. Figure 2 As shown, the mobile phone includes a settings module (setting apk), a Bluetooth module (Bluetooth apk), a location service module (i.e., location-based service (LBS), also known as mobile positioning service), a map application, and a Bluetooth navigation application. Among them, the Bluetooth navigation application is downloaded before the mobile phone communicates with the external navigation system.

[0044] like Figure 2As shown, in step 1, the user downloads and installs the Bluetooth navigation app through the phone's app store or other website. In step 2, after the Bluetooth navigation app is installed, the user needs to perform several consecutive operations, such as: 1. Open the settings module (settings APK); 2. Find the "version number" and tap it multiple times to enter developer mode; 3. In the developer options menu, select "Simulated location information application"; 4. Select "Bluetooth Navigation App" under Select application. In step 3, the phone is paired with the external navigation device, for example, by searching for the navigation device in the settings app and tapping "pair." Once the navigation device is turned on, i.e., powered on, it automatically pairs with the phone's Bluetooth module. In step 4, before each navigation session, the user needs to open the Bluetooth navigation app on the phone's desktop and follow the prompts in the Bluetooth navigation app's interface to enter the connection instructions with the navigation device. The Bluetooth navigation app receives the user's input, constructs the SPP client, and executes step 5. In step 5, a Bluetooth protocol stack Serial Port Profile (SPP) connection command is initiated to the Bluetooth module. The Bluetooth module receives the command and establishes an SPP connection with the navigation system. After establishing the connection, the navigation system receives satellite signals, obtains data sent by the satellite, and constructs navigation data in NMEA format. In step 6, the navigation system sends NMEA data in a unified format to the Bluetooth module based on the SPP connection. The Bluetooth module calls back the SPP client and sends the NMEA data to the Bluetooth navigation application with an SPP client. The Bluetooth navigation application parses the NMEA data, obtains the current device location information, and executes step 7. In step 7, the Bluetooth navigation application injects the location information into the location service module through the simulated location service provider interface. In step 8, the user uses the map application, that is, opens the map application, and the location service module executes step 9. Step 9 reports the location information to the map application. The user understands their location and navigates based on the location displayed in the map application, completing the navigation-based positioning process.

[0045] In the positioning process described above, steps ①, ②, ③, ④, and ⑧ all require user intervention. These operations are frequent and numerous, resulting in a poor user experience. In particular, in step ②, the currently designed navigation architecture allows for multiple GPS data sources, which can be processed by two location services, or location providers, such as the Original Location Provider and the Mock Location Provider. However, these two location services are mutually exclusive, meaning only one can be selected based on device support.

[0046] refer to Figure 3a and 3b, Figure 3a FIG. 1 shows a flow diagram of NMEA data from a navigation device to a mobile phone in some embodiments; Figure 3b Shown with Figure 3a The corresponding location service architecture diagram. Figure 3a As shown, the mobile phone includes a Bluetooth module, a Bluetooth navigation application, and a location-based service map application. The navigator can search for satellites to obtain and generate NMEA data and transmit it to the mobile phone. This transmission process includes Figure 2 Steps ①-⑥ in the Bluetooth module. After obtaining NMEA data, it is passed to the Bluetooth navigation application. The Bluetooth navigation application includes a simulated location provider. Based on the simulated location provider, the data is transmitted to the location service module and then to the map application. Figure 2 ⑦ in. Combined Figure 3b The architecture diagram shown in the figure includes a location-based service application (LBS app), a location manager (Location Manager), an original location provider, and a simulated location provider. Among them, the location service application can record the location. The simulated location provider includes a Bluetooth navigation agent module, which is used to communicate with the Bluetooth module. Therefore, in the current solution that relies on the Bluetooth navigation application, only the simulated location provider can be selected. The selection process of the simulated location provider can be referred to Figure 2 The description of step ② in the above example is very complicated.

[0047] It should be noted that the simulated location provider may also include other proxy modules, such as the Differential Global Positioning System (DGPS), the corresponding Component Object Model (COM), the WIFI proxy corresponding network, etc., which are not described in this application.

[0048] The following is a diagram of the interface operation Figure 2 The operation process of selecting the Bluetooth navigation application under the simulated location information application in step ② is further explained.

[0049] refer to Figure 4 , Figure 4 Schematic diagram of the operation interface for location service selection in some embodiments is shown. Figure 4 As shown in (a), the user opens the settings interface 410 and clicks the option "About Phone" on the interface 410 to enter the following Figure 4 In the interface 420, find the option "Version Number" and click the version number several times to return to the previous menu and enter the following interface: Figure 4In the system and update interface 430 shown in (c) of FIG. In the interface 430, select "Developer Options" to enter the following Figure 4 In the developer options interface 440 shown in (d) of FIG. In the interface 440, the user clicks “Select simulated location information application”, and the corresponding Figure 2 The simulated location information application in step ② is the simulated location provider. Figure 4 In the example shown in (e), the application selection interface 450 includes an option for a Bluetooth navigation application. The user selects the Bluetooth navigation application, completing the selection process for the simulated location information application. This process is very cumbersome and the user experience is not very good.

[0050] The following is a diagram of the interface operation Figure 2 The process of the user inputting the instruction to establish a connection with the navigator in step ④ is further explained.

[0051] refer to Figure 5 , Figure 5 Schematic diagram of the operation interface in which a user inputs a command to establish a connection with a navigator in some embodiments is shown. Figure 5 As shown in (a), in the desktop interface 510, click the icon of the Bluetooth navigation application to open the Bluetooth navigation application and enter the Figure 5 In the connection interface 520 shown in (b), select the "Connect" option in the interface 520. At this time, the Bluetooth navigation application initiates an SPP connection and finally realizes the SPP connection with the navigator (see Figure 2 After the user clicks the link, the Figure 5 In the interface 530 shown in (b), the connection option is now the "disconnect" option. The user can click "disconnect" to disconnect the navigation device from the mobile phone. This operation process is also relatively cumbersome.

[0052] As can be seen, the user operation process in the above positioning solution is extremely complicated, and the user experience is poor. In addition, since the Bluetooth navigation application needs to be downloaded and installed, it not only takes up the phone's memory, but also consumes power very quickly. When exiting navigation, the Bluetooth navigation application must be manually closed, otherwise the battery will be quickly depleted. Therefore, as an app that relays NMEA data, the Bluetooth navigation application is easily closed by the system, and navigation cannot be performed if it is in progress.

[0053] Based on the above-mentioned problems, the present application provides a positioning method based on Bluetooth transmission, which can be applied to a system composed of a mobile phone and a navigator, wherein when the mobile phone receives the operation of Bluetooth pairing between the user and the navigator (the first operation), for example, the user turns on Bluetooth through the settings, and discovers the surrounding navigators through the Bluetooth discovery function, and selects the navigator after discovery. In response to the operation of Bluetooth pairing with the navigator, the mobile phone negotiates with the navigator through the Bluetooth module to determine the transmission channel for transmitting the first navigation data. After determining the transmission channel, the Bluetooth module registers and monitors the behavior of obtaining navigation data, so that when receiving the user's navigation instructions, it communicates with the navigator to enable the navigator to search for stars, thereby obtaining NMEA data.

[0054] When the mobile phone receives the user's operation to open the map application (second operation), for example, the user clicks on the map application in the mobile phone interface. In response to this operation, the mobile phone establishes a Bluetooth connection with the navigator through the Bluetooth module and establishes a transmission channel. The Bluetooth module obtains NMEA data (first navigation data) from the navigator through the transmission channel. The Bluetooth module can directly process and parse the NMEA data and send it to the location service module. The location service module determines the current location data based on the processed NMEA data and reports the location data to the map application so that the map application displays the location data.

[0055] According to the positioning method based on Bluetooth transmission in the embodiment of the present application, the function of relaying NMEA data is moved to the Bluetooth module (system application), and the NMEA data is directly obtained through the Bluetooth module. The Bluetooth module and the location service module can directly transmit the parsed NMEA data without distinction. In this process, there is no need to download auxiliary navigation software to assist. Not only is the operation simple, but there is no need to download additional applications, which can save space. In addition, compared with the solution of using Bluetooth navigation applications, reducing the operation of one application can reduce power consumption and greatly improve the user experience.

[0056] In the above embodiments, a mobile phone is used as an example of an electronic device. In some embodiments, the electronic device may also be a product with a display interface, such as a tablet computer, a personal computer (PC), a laptop computer, a personal digital assistant (PDA), a vehicle-mounted device, an Internet-connected TV, a wearable device, etc. In addition, the above embodiments are described using a navigator as an example of a navigation device. In some embodiments, the navigation device may be a mobile phone, a tablet computer, a personal computer (PC), a laptop computer, a wearable device, etc., with a navigation function. This application does not impose any special restrictions on the form of the electronic device.

[0057] The positioning method based on Bluetooth transmission according to an embodiment of the present application is described below in conjunction with the specific structure of the electronic device.

[0058] Figure 6 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0059] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0060] In some embodiments, when the processor 110 receives a first operation, the first operation is an operation of the user pairing the Bluetooth module with the navigation device based on Bluetooth. In response to the first operation, the processor 110 determines the transmission channel for transmitting the first navigation data through the Bluetooth module, and registers and monitors the behavior of obtaining the first navigation data. Among them, the transmission channel is negotiated with the navigation device. When the processor 110 receives a second operation, the second operation is an operation of the user opening the map application. In response to the second operation, the processor 110 establishes a Bluetooth connection with the navigation device through the Bluetooth module, and establishes a transmission channel to obtain the first navigation data from the navigation device. The processor 110 determines the current location data based on the first navigation data, and reports the location data to the display screen, and the display screen displays the location data in the corresponding map application interface.

[0061] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0062] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0063] In one embodiment, the display screen 194 displays positioning information in the corresponding interface of the map application according to the control instructions of the processor 110, and during Bluetooth pairing, it can display the discovered navigation devices and connection prompt information when establishing a Bluetooth connection.

[0064] The internal memory 121 can be used to store computer executable program code, and the executable program code includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a Bluetooth application, a map application, a location service program), etc. The data storage area may store data created during the use of the electronic device 100 (such as NMEA data, location information, voice stream data, a phone book, etc.). In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0065] In one embodiment of the present application, instructions for a positioning method based on Bluetooth transmission may be stored in the internal memory 121. The processor 110 uses the instructions for a positioning method based on Bluetooth transmission to enable the electronic device 100 to obtain NMEA data from the navigator when the user opens a map application, and display the positioning information on the display screen 194.

[0066] The touch sensor 180K is also called a "touch device." The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations acting on or near it, for example, a touch operation of clicking an edit box. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, at a different location from the display screen 194.

[0067] In some embodiments, when the user touches the display screen 194 and is regarded as a specific click operation, the processor 110 receives the user's operation of clicking the map application on the display screen 194. In response to the operation, the processor 110 controls the display screen 194 to display the current location information of the mobile phone.

[0068] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. 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 the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0069] In some embodiments, Bluetooth (Bluetooth module) can be connected to a navigation device, such as a navigation system. Furthermore, the processor 110 can obtain NMEA data obtained by the navigation system through the Bluetooth connection. The processor can obtain and parse the NMEA data, calculate the current location information of the navigation system (i.e., electronic device 100) based on the NMEA data, and display the positioning information on the display screen 194.

[0070] 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), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

[0071] In an embodiment of the present application, the processor 110 may obtain NMEA data through GPS, and calculate the location information of the electronic device 100 based on the NMEA data to achieve positioning.

[0072] In some embodiments, the processor 110 may combine NMEA data obtained by its own GPS system with NMEA data obtained from a navigator via a Bluetooth connection, and calculate the current position based on the two sets of NMEA data, thereby improving positioning accuracy.

[0073] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0074] Figure 7 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0075] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries (not shown), the hardware abstraction layer, and the kernel layer.

[0076] The application layer can include a series of application packages.

[0077] like Figure 7 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0078] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0079] like Figure 7 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a location service manager, a Bluetooth manager, and the like.

[0080] Among them, location service management is used to obtain navigation-related data. For example, it can manage location data obtained from the GPS chip of the electronic device 100 itself, or it can manage location data obtained from other devices, determine the geographic location of the device or user based on these location data, and provide various location-related information services.

[0081] Bluetooth management is used to negotiate data transmission methods with other navigation devices with navigation functions and establish Bluetooth connections to obtain NMEA data directly from the navigation devices.

[0082] The view system includes visual controls, such as those that display text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a location image in a map application.

[0083] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0084] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0085] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0086] The system library can include multiple functional modules, such as the surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), Bluetooth navigation agent (HAL), and navigation abstraction layer library (HAL).

[0087] Among them, the Bluetooth navigation agent (HAL) can obtain NMEA format data (NMEA data) relayed from the external navigation device, parse the NMEA data, and encapsulate the parsed data into HAL format non-NMEA data (Non NMEA), i.e., NNMEA data, which can be transmitted at the hardware abstraction layer (HAL). The Bluetooth navigation agent (HAL) is connected to the navigation abstraction layer library (HAL) and can directly send NMMEA data to the navigation abstraction layer library (HAL). It can achieve the transparent transmission of NMMEA data to the navigation abstraction layer library without distinction, ensuring the integrity of the data.

[0088] The Navigation Abstraction Layer (GPS.hal) library, also known as the Global Navigation Satellite System (GNSS) Hal service on Android, is a library such as libGPS.so (hal). The Navigation Abstraction Layer (NAL) library defines various constants and information, including positioning modes and status. It directly connects to the Bluetooth navigation agent (hal) to obtain NMEA data. It can also parse the obtained HAL-formatted data (NNMEA data) and calculate distance based on the parsed data to obtain the current location of the device or user.

[0089] In some embodiments, the navigation abstraction layer library can also directly obtain NMEA data from its own GPS chip and parse the NMEA data. It can also combine the NMEA data relayed from the navigation device to calculate the location information of the electronic device or user, thereby improving the accuracy of positioning.

[0090] According to the embodiments of the present application, by adding a Bluetooth navigation agent (HAL) and a navigation abstraction layer library (HAL), the relayed NMEA data and the NMEA data reported by the electronic device's own GPS chip can be used indiscriminately, thereby simplifying the complexity of the data processing process.

[0091] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0092] A 2D graphics engine is a drawing engine for 2D drawings.

[0093] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0094] The following describes in detail the positioning method based on Bluetooth transmission in the embodiment of the present application in combination with two Bluetooth connection scenarios: classic Bluetooth and low-power Bluetooth. The method provided in the embodiment of the present application can be applied to Figure 6 The hardware structure shown in Figure 7 In an electronic device with the software structure shown, or with more or fewer components than shown, or with a combination of certain components, or with a separation of certain components, or with a different arrangement of components, and similar hardware and software structures.

[0095] For the convenience of description, the following embodiments are all described by taking the electronic device as a mobile phone and the navigation device as a navigator as an example.

[0096] refer to Figure 8 , Figure 8 FIG1 shows a flow chart of the positioning method based on classic Bluetooth transmission according to an embodiment of the present application. Figure 8 As shown, this method is performed by a mobile phone and a navigation system and is applicable to scenarios where the mobile phone's navigation module is insufficient or malfunctioning, requiring the use of an external navigation system for positioning. The mobile phone includes a Bluetooth module, a location services module, and a map application, all of which are built-in system functions. This method includes steps S811-S820.

[0097] S811, pair the mobile phone's Bluetooth module with the navigation system.

[0098] Among them, the Bluetooth module here refers to classic Bluetooth (BT), which generally refers to a module that supports Bluetooth protocols below 4.0 and is generally used for transmission of large amounts of data. The Bluetooth transmission protocols used by the Bluetooth module may include Radio Frequency Communication (RFCOMM), Logical Link Control and Adaptation Protocol (L2CAP), and may also include Service Discovery Protocol (SDP), Serial Port Profile (SPP), Hands-Free Profile (HFP), etc.

[0099] In an embodiment of the present application, the user can use conventional Bluetooth pairing operations, such as turning on Bluetooth from the settings. Bluetooth will automatically search for surrounding devices, such as a navigation system. After the user clicks on the navigation system (the first operation), the mobile phone and the navigation system communicate and authenticate each other to complete the pairing process. This lays the foundation for subsequent connections and data transmission. Once the pairing is successful, when the user navigates for the second or more times, when the mobile phone and the navigation system establish a Bluetooth connection, there is no need to perform the pairing operation. The Bluetooth of the mobile phone and the navigation system is directly turned on, and the two automatically establish a Bluetooth connection, thereby facilitating data transmission.

[0100] S812: The mobile phone negotiates capabilities with the navigator and determines a transmission channel.

[0101] For example, the Bluetooth module negotiates with the navigation system whether it supports the connection of the classic Bluetooth of the external navigation system. If it supports it, the transmission channel is further negotiated. If it does not support it, no subsequent connection operation is performed.

[0102] In some embodiments, after the mobile phone is paired with the navigator, they negotiate a transmission channel based on SDP service discovery. For example, a transmission channel for transmitting NMEA data. In an embodiment of the present application, the Bluetooth protocol of the navigator can be the same as the Bluetooth protocol of the mobile phone. Based on their own capabilities, the two determine the transmission channel for transmitting NMEA, where the transmission channel can be a transmission channel established based on any one of the protocols: L2CAP channel, L2CAP request-response (echo request-response), SPP and HFP. For example, if it is determined to establish an L2CAP channel transmission channel, then during subsequent data transmission, the L2CAP channel protocol is directly used to establish the transmission channel, and NMEA data is transmitted based on the transmission channel.

[0103] In an embodiment of the present application, after the Bluetooth module of the mobile phone negotiates the transmission channel with the navigator, the Bluetooth module will register and monitor the satellite search behavior. In this way, once the Bluetooth module receives the star search instruction, it will initiate a connection with the navigator and notify the navigator to perform star search to obtain navigation data from the satellite.

[0104] S813: The map application receives the navigation operation (second operation) input by the user and initiates a navigation instruction to the location service module.

[0105] For example, when a user clicks on an icon of a map application or an operation of a navigation application in the interface of a mobile phone, the map application obtains the operation instruction and sends a navigation instruction to the location service module.

[0106] S814: The location service module stores the satellite search instruction and sends it to the Bluetooth module.

[0107] Among them, the location service module can not only send star search instructions to the Bluetooth module, but also notify the GPS chip to perform star search when the mobile phone itself has a GPS chip with star search function, thereby obtaining two sets of NMEA data.

[0108] S815: The Bluetooth module initiates a Bluetooth connection to the navigator, and after the navigator receives the connection request, establishes a Bluetooth connection with the Bluetooth module. The Bluetooth connection process can be specifically referred to the Bluetooth connection method of the prior art, and this application will not be described in detail.

[0109] At step S816, the Bluetooth module initiates a transmission channel request for NMEA data transmission to the navigation system to establish the transmission channel. For example, in step S812, the transmission channel determined by the Bluetooth module and the navigation system is an L2CAP channel protocol transmission channel. In this case, the navigation system and the Bluetooth module establish an L2CAP channel protocol transmission channel and transmit the NMEA data (the first navigation data) through the transmission channel.

[0110] In addition, in some embodiments, the HCI L2CP ehcorequest-response on the L2CAP channel can be used to establish a transmission channel and transmit NMEA data. An SPP transmission channel can also be established to transmit NMEA data. When establishing the SPP transmission channel, the Bluetooth module needs to create a new SPP client to communicate with the navigator's SPP server to complete the establishment of the transmission channel. In other embodiments, since NMEA data is in AT command format, it can also be transmitted on the HFP signaling transmission channel.

[0111] In an embodiment of the present application, when the navigator receives a NMEA data transmission channel request initiated by the Bluetooth module, it begins to perform a satellite search to obtain navigation data from satellites, such as the number of satellites, satellite positions, satellite orbits, and the distance between the satellites and the navigator. The navigator obtains this navigation data and encapsulates it into data in the NMEA format unified by GPS navigation devices, namely NMEA data, to achieve a unified data format.

[0112] S817: The Bluetooth module establishes a GPS.hal data channel with the location service module.

[0113] In one embodiment of the present application, the data channel of GPS.hal can be Figure 7 The Bluetooth navigation agent (HAL) and the navigation abstraction layer library (HAL) are used to implement this. The Bluetooth navigation agent (HAL) parses the NMEA data and encapsulates it into non-NMEA data (NNMEA data) in the HAL format that can be transmitted at the HAL layer, thereby ensuring the integrity of the data. The specific implementation process of this channel can refer to the data transmission process implemented by the GPS HAL in the GNSS HAL service on Android in the prior art, and will not be described in detail here.

[0114] At S818, the Bluetooth module injects the NMEA data into the location service module. In other words, the NMEA data can be transparently transmitted to the location service module through the GPS.hal data channel, greatly ensuring the complete data transmission process.

[0115] S819, the location service module merges the data transmitted by the Bluetooth navigation agent.

[0116] In an embodiment of the present application, after obtaining the NNMEA data, the location service module parses the data and calculates the distance between the mobile phone and the satellite based on the parsed data, thereby determining the current location information.

[0117] S820: The location service module reports the current location information to the map application. The user can learn about the current location in the map application interface, achieving a fast positioning process.

[0118] The entire process from S811 to S820 described above describes the first time a user establishes a Bluetooth connection between their phone and the navigation system, including data transfer. If this isn't the first time a Bluetooth connection is established, the user doesn't need to perform the pairing process. Simply tap the map app to locate the device.

[0119] According to the positioning method of the embodiment of the present application, during the entire positioning and navigation process, the user only needs to perform Bluetooth pairing between the mobile phone and the navigation system (the first operation). Thereafter, when navigation is needed, clicking the map application (the second operation) can achieve precise positioning, and the operation process is very simple. In addition, there is no need to download additional applications to assist in positioning, which not only saves space but also avoids the power consumption caused by running downloaded applications, greatly improving the user experience.

[0120] The following describes the positioning method of classic Bluetooth transmission in an embodiment of the present application in conjunction with a data flow diagram between modules in a mobile phone.

[0121] refer to Figure 9 , Figure 9 The following diagram shows the main structure of the mobile phone and navigation system of the embodiment of the present application, as well as the flow of NMEA data from the navigation system to the mobile phone. The following explains the flow of data during the implementation of the solution of the present application and also briefly describes the architecture of the mobile phone and navigation system by combining the flow of data between the navigation system and the mobile phone.

[0122] The mobile phone includes a Bluetooth module, Bluetooth location services and map applications, and a navigator for establishing a Bluetooth connection with the mobile phone.

[0123] like Figure 9 As shown, the flow diagram is mainly divided into five main processes, namely S910-S940.

[0124] At S910, SNMEA data is transmitted from the navigator to the mobile phone. The transmission channel can be a transmission channel established based on any of the protocols, such as L2CAP channel protocol, L2CAP echo request-response, SPP, and HFP. The process of establishing the transmission channel can be referred to in Figure 8 S811-S816 in.

[0125] At S920 , the Bluetooth module of the mobile phone includes a NMEA data identification module. After the Bluetooth module obtains NMEA data based on the transmission channel, it transmits the NMEA data to the NMEA data identification module.

[0126] In an embodiment of the present application, the NMEA data identification module determines the format of the obtained data. If the data format obtained by the NMEA data identification module is NMEA data, the NMEA data is transmitted to the Bluetooth navigation agent module (HAL). Otherwise, the data is processed in the conventional manner of the Bluetooth module without being transmitted to the Bluetooth navigation agent module (HAL), thereby ensuring that the Bluetooth navigation agent module (HAL) transmits NMEA data.

[0127] The Bluetooth navigation agent module (HAL) parses the NMEA data and encapsulates it into NMEA data in HAL format that can be transmitted at the HAL layer, making it easier to pass the data to the navigation abstraction layer library to ensure data integrity.

[0128] At S930, the Bluetooth navigation agent module (hal) transparently transmits the NNMEA data to the navigation abstraction layer library (corresponding to libGPS.so (hal)) based on the channel established with the navigation abstraction layer library. Figure 8 The specific transmission implementation can refer to S818-S820 in Figure 8 Description in S818-S820.

[0129] At S940, the Navigation Abstraction Layer library obtains the NNMEA data and parses it into the corresponding HAL format for Google. Based on the parsed data, it calculates parameters such as the distance between the phone or navigation system and the satellite to obtain the current location information. Finally, the location information is reported to the navigation location provider, location management, and finally to the map application, thus achieving the phone's positioning.

[0130] It should be noted that in some embodiments, the navigation abstraction layer library can also obtain NMEA data (second navigation data) obtained by the mobile phone navigation chip and merge it with the NMEA data obtained by the navigation device, combining the two sets of NMEA data to calculate the current position, thereby improving positioning accuracy.

[0131] The following explains how the positioning method based on Bluetooth transmission according to an embodiment of the present application is implemented in a device utilizing Bluetooth Low Energy (BLE).

[0132] refer to Figure 10 , Figure 10 The figure shows the flow chart of the positioning method based on low-power Bluetooth transmission in the embodiment of the present application. Figure 10 As shown, the method is executed by a mobile phone and a navigation device, wherein the mobile phone includes a Bluetooth module, a location service module and a map application, and these functional modules are all system-provided functions. The method includes S1011-S1020.

[0133] S1011, pairing and connecting the Bluetooth module of the mobile phone with the navigation system.

[0134] Among them, the Bluetooth module here refers to the low-power Bluetooth BLE. The composition of the BLE protocol stack includes the logical link control and adaptation protocol (Logic link control and adaptation protocol, L2CAP), the attribute protocol (Attribute protocol, ATT) and the generic attribute profile layer (Generic attribute profile, GATT), etc. Among them, GATT is based on the concept of attribute and service, by encapsulating data in attributes, that is, Attribute is used to describe data one by one, and each attribute has a unique identifier (UUID), so that when the device broadcasts, other devices can accurately identify these data through the UUID, thereby realizing communication with the specified device. That is, the two devices finally realize the communication between the two devices through the BLE protocol stack. The complete communication process can refer to the BLE communication process in the prior art, and this application will not be described in detail.

[0135] like Figure 10 As shown, when pairing, the GATT service of the navigator must be started first, so that it can be paired with the GATT Client of the Bluetooth module and provide services.

[0136] It should be noted that for the user operations during pairing, please refer to Figure 8 The description of S811 in [1] is not repeated here.

[0137] It should be noted that the negotiation process between the navigator and the Bluetooth module may be the negotiation between the navigator's Bluetooth module and the mobile phone's Bluetooth module. For ease of distinction, the navigator's Bluetooth module is referred to as the navigator in this application.

[0138] S1012: The mobile phone negotiates GATT capabilities with the navigation device and determines the transmission channel.

[0139] After the phone and the navigation system are paired via Bluetooth, the Bluetooth module and the navigation system negotiate based on GATT to determine whether NMEA data can be transmitted. Once transmission is confirmed, the Bluetooth module registers and monitors satellite search behavior. When a search command is received, it notifies the navigation system to search for satellites and prepares to initiate a BLE broadcast.

[0140] S1013, the map application receives the navigation operation (second operation) input by the user and sends a navigation instruction to the location service module. Figure 8 Corresponding to S813 in, please refer to the description in S813.

[0141] S1014, the location service module stores the satellite search instruction and sends it to the Bluetooth module. Figure 8 Corresponding to S814 in, please refer to the description in S814.

[0142] S1015 , the Bluetooth module initiates a GATT Bluetooth connection to the navigator, and establishes the Bluetooth connection when the navigator receives the connection request.

[0143] This process is that the Bluetooth module communicates with the GATT service of the navigation system through the GATT client and establishes a connection. The specific connection process can refer to the process of establishing a Bluetooth connection using low-power Bluetooth in the existing technology and will not be described here.

[0144] S1016: The Bluetooth module establishes an NMEA data transmission channel with the navigation system. Since the ability to transmit NMEA data has been negotiated and confirmed in S1012, the data transmission channel can be directly established after the Bluetooth connection is established.

[0145] S1017, the Bluetooth module and the location service module establish a GPS.hal data channel. Figure 8 For details, please refer to the description in S817, which will not be repeated here.

[0146] S1018, the Bluetooth module injects the NMNEA data into the location service module.

[0147] Specifically, the navigation extraction of the location service module can be used to extract the elephant Layer library (libGPS.so (hal)) received. This step is the same as Figure 8 For details, please refer to the description in S818, which will not be repeated here.

[0148] S1019, the location service module merges the data transmitted by the Bluetooth navigation agent.

[0149] In an embodiment of the present application, after obtaining the NNMEA data, the location service module parses the data and calculates the distance between the mobile phone and the satellite based on the parsed data, thereby determining the current location information.

[0150] S1020: The location service module reports the current location information to the map application. The user can learn about the current location in the map application interface, achieving a fast positioning process.

[0151] The entire process from S1011 to S1020 above describes the first time a user establishes a Bluetooth connection between their phone and the navigation system, including data transfer. If this is not the first time a Bluetooth connection is established, the user does not need to perform the pairing process. Simply tap the map app to locate the device.

[0152] The positioning method according to the embodiment of the present application is not only very simple to operate, but also does not require the download of additional applications to assist in positioning. This not only saves space but also avoids the power consumption caused by running downloaded applications, thereby greatly improving the user experience.

[0153] The following describes the positioning method of low-power Bluetooth transmission in an embodiment of the present application in conjunction with a data flow diagram between modules in a mobile phone.

[0154] refer to Figure 11 , Figure 11 The following diagram shows the main structure of a mobile phone and a navigation system according to another embodiment of the present application, as well as the flow of NMEA data from the navigation system to the mobile phone. The following explains the flow of data during the implementation of the present application and also provides a general description of the architecture of the mobile phone and navigation system by combining the flow of data between the navigation system and the mobile phone.

[0155] The mobile phone includes a Bluetooth module, Bluetooth location services and map applications, and a navigator for establishing a Bluetooth connection with the mobile phone.

[0156] like Figure 11 As shown, the flow diagram is mainly divided into five main processes, namely S1110-S1140.

[0157] At S1110, NMEA data is transmitted from the navigation device to the mobile phone. The transmission channel can be based on various components of the BLE protocol stack, such as the GATT transmission channel established by the L2CAP channel protocol, GATT protocol, ATT protocol, etc. The process of establishing the transmission channel can be referred to Figure 10 S1011-S1016 in.

[0158] At S1120, the Bluetooth module of the mobile phone includes a NMEA data identification module. After the Bluetooth module obtains NMEA data based on the transmission channel, it transmits the NMEA data to the NMEA data identification module. Figure 9 Corresponding to S920 in.

[0159] The NMEA data identification module determines the format of the data received. If the data format is NMEA data, it transmits the NMEA data to the Bluetooth navigation proxy module (HAL). Otherwise, the data is processed in the normal way by the Bluetooth module without being transmitted to the Bluetooth navigation proxy module (HAL), thus ensuring that the Bluetooth navigation proxy module (HAL) transmits NMEA data.

[0160] The Bluetooth navigation agent module (HAL) parses the NMEA data and encapsulates the parsed data into NMEA data in HAL format that can be transmitted at the HAL layer, making it easier to pass the data to the navigation abstraction layer library to ensure data integrity.

[0161] At S1130, the Bluetooth navigation agent module (hal) transparently transmits the NNMEA data to the navigation abstraction layer library (corresponding to libGPS.so (hal)) based on the channel established with the navigation abstraction layer library. Figure 9 The S930 in the corresponding, please refer to Figure 9 Description of S930 in.

[0162] At S1140 , the Navigation Abstraction Layer (NAL) library obtains NMEA data and parses it into the Google HAL format. Based on the parsed data, it calculates parameters such as the distance between the phone or navigation system and the satellite to obtain the current location information. Finally, the location information is reported to the navigation location provider, location management, and finally to the map application, achieving the phone's positioning.

[0163] In other embodiments, when there are multiple navigators connected to the mobile phone via Bluetooth at the same time, the mobile phone can obtain NMEA data from multiple navigators and then calculate the current location information, thereby effectively improving the accuracy of positioning and avoiding the impact of a single navigator data on the accuracy of positioning.

[0164] In some embodiments, the mobile phone may have multiple navigation chips. In this case, the navigation abstraction layer library may simultaneously obtain navigation data from multiple navigation chips and combine them to calculate the distance to obtain more accurate location information.

[0165] refer to Figure 12 , Figure 12 The embodiment of the present application shows a scenario in which the mobile phone has two navigation chips. Figure 9 In S940, add a navigation chip data, or correspond to Figure 11 At S1140 in the process, data of a navigation chip is added. Figure 12As shown. The mobile phone includes two mobile navigation chips, and each navigation chip can correspond to a sub-navigation abstract layer library. For example, mobile navigation chip 1 corresponds to libGPS.so1 (hal), and mobile navigation chip 2 corresponds to libGPS.so2 (hal). The data obtained by the two sub-navigation abstract layer libraries are uniformly transmitted to the parent navigation abstract layer library (libGPS.common.so (hal)). The parent navigation abstract layer library combines the two sub-navigation abstract layer libraries and the NMEA data obtained from the Bluetooth navigation agent (hal) (navigator) to calculate the distance from the mobile phone or navigator to the satellite and obtain the current position of the mobile phone or navigator. Among them, the process of obtaining NMEA data from the Bluetooth navigation agent (hal), that is, from the navigator, can be referred to. Figures 8-11 The acquisition process will not be described here.

[0166] The Bluetooth-based positioning method of the present invention utilizes a newly added Bluetooth navigation agent (HAL) and navigation abstraction layer library (HAL) to seamlessly utilize relayed NMEA data and NMEA data reported by the device's own GPS chip. This simplifies the complexity of the data processing process, simplifies user operations, and improves positioning accuracy. Furthermore, no additional system-specific programs are required to assist in the navigation process, saving space and power consumption, and improving the user experience.

[0167] The present application also provides an electronic device, comprising:

[0168] a memory for storing instructions to be executed by one or more processors of the device, and

[0169] Processor, used to execute the above embodiment combined Figures 8 to 12 The method explained.

[0170] The present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the above-mentioned embodiment. Figures 8 to 12 The method explained.

[0171] The present application also provides a computer program product comprising instructions, which, when executed on an electronic device, enables a processor to execute the above-mentioned embodiments. Figures 8 to 12 The method shown.

[0172] Now refer to Figure 13 , which is a block diagram of a SoC (System on Chip) 1300 according to an embodiment of the present application. Figure 13 In FIG, similar components have the same reference numerals. In addition, the dashed boxes are optional features of more advanced SoCs. Figure 13In the embodiment, SoC 1300 includes: an interconnect unit 1350 coupled to an application processor 1310; a system agent unit 1380; a bus controller unit 1390; an integrated memory controller unit 1340; a set of one or more coprocessors 1320, which may include integrated graphics logic, an image processor, an audio processor, and a video processor; a static random access memory (SRAM) unit 1330; and a direct memory access (DMA) unit 1360. In one embodiment, the coprocessors 1320 include specialized processors, such as a network or communication processor, a compression engine, a general purpose computing on GPU (GPGPU), a high-throughput many integrated core (MIC) processor, or an embedded processor.

[0173] The static random access memory (SRAM) unit 1330 may include one or more computer-readable media for storing data and / or instructions. The computer-readable storage medium may store instructions, specifically, temporary and permanent copies of the instructions. The instructions may include: when executed by at least one unit in the processor, causing the Soc 1500 to perform the method according to the above embodiment, for details, please refer to the above embodiment. Figures 8 to 12 The methods explained will not be repeated here.

[0174] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0175] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0176] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0177] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software or any combination thereof. The disclosed embodiments can also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which can be read and executed by one or more processors. For example, instructions can be distributed over a network or by other computer-readable media. Therefore, machine-readable media can include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to, floppy disks, optical disks, optical disks, compact disc read-only memories (Compact Disc Read Only Memory, CD-ROMs), magneto-optical disks, read-only memories (ROM), random access memories (RAM), erasable programmable read-only memories (EPROM), electrically erasable programmable read-only memories (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the Internet in electrical, optical, acoustic or other forms of propagation signals. Accordingly, machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).

[0178] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.

[0179] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.

[0180] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0181] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application.

Claims

1. A positioning method based on Bluetooth transmission, characterized in that: Applied to an electronic device, the electronic device is used to obtain navigation data from an external navigation device, the navigation data is National Marine Electronics Association NMEA data, the electronic device includes a map application, a Bluetooth module and a location service module, the method includes: receiving a first operation, where the first operation is an operation of a user based on Bluetooth pairing between the Bluetooth module and the navigation device; In response to the first operation, the Bluetooth module of the electronic device determines a transmission channel for transmitting first navigation data, and registers and monitors an action of acquiring the first navigation data, wherein the transmission channel is negotiated with the navigation device; receiving a second operation, where the second operation is an operation of a user opening the map application; In response to the second operation, the Bluetooth module of the electronic device is used to establish a Bluetooth connection with the navigation device and establish the transmission channel, wherein the transmission channel is used to transmit the first navigation data from the navigation device; The Bluetooth module of the electronic device sends a star search instruction to the navigation device based on the transmission channel, where the star search instruction is used to instruct the navigation device to perform a star search behavior to obtain the first navigation data; The Bluetooth module of the electronic device acquires the first navigation data from the navigation device based on the transmission channel; The location service module of the electronic device determines current location data based on the first navigation data, and reports the location data to the map application so that the map application displays the location data.

2. The method according to claim 1, characterized in that When the Bluetooth module and the navigation device have been paired via Bluetooth, the electronic device receives the second operation again, directly establishes a Bluetooth connection and the transmission channel with the navigation device, obtains the first navigation data based on the transmission channel, and obtains the location data based on the first navigation data.

3. The method according to claim 1, characterized in that The electronic device determines current location data based on the first navigation data, including: The Bluetooth module acquires the first navigation data and establishes a hardware abstraction layer HAL data channel with the location service module; The Bluetooth module transparently transmits the first navigation data to the location service module based on the HAL data channel; The location service module parses the first navigation data and determines current location data based on the first navigation data.

4. The method according to claim 3, characterized in that The Bluetooth module includes a navigation agent module, and the location service module includes a navigation abstract layer library. The navigation agent module establishes the hal data channel with the navigation abstraction layer library, and transparently transmits the first navigation data to the navigation abstraction layer library.

5. The method according to claim 4, characterized in that The Bluetooth module also includes a data identification module, The data identification module determines that the acquired data is first navigation data based on the specific format of the navigation data, and then transmits the first navigation data to the navigation agent module, so that the navigation agent module transparently transmits the first navigation data to the navigation abstraction layer library.

6. The method according to any one of claims 1 to 5, characterized in that: The Bluetooth module is a classic Bluetooth module, and the transmission channel includes at least one of the following transmission channels: Logical Link Control and Adaptation Protocol L2CAP transmission channel, Host Control Interface Command HCIL2CP ehco transmission channel on the L2CAP, Serial Port Protocol SPP channel, or Bluetooth Hands-Free Protocol HFP transmission channel.

7. The method according to any one of claims 1 to 5, characterized in that: The Bluetooth module is a low-power Bluetooth module. In response to the second operation, the Bluetooth module of the electronic device is used to establish a Bluetooth connection with the navigation device, including: The electronic device initiates a General Attribute Protocol GATT connection to establish the Bluetooth connection with the navigation device.

8. The method according to claim 7, characterized in that The electronic device initiates a general attribute protocol GATT connection to establish a Bluetooth connection with the navigation device, including: The electronic device initiates a general attribute protocol GATT connection to the navigation device based on the agreed GATT attribute identification code, so as to establish the Bluetooth connection with the navigation device after the navigation device determines the attribute identification code.

9. The method according to claim 4, characterized in that Also includes: second navigation data obtained by the navigation chip of the electronic device; The electronic device determines current location data based on the first navigation data and the second navigation data, and reports the location data to the map application so that the map application displays the location data.

10. The method according to claim 9, characterized in that The electronic device determines current location data based on the first navigation data and the second navigation data, including: The navigation abstraction layer library obtains and parses the first navigation data and the second navigation data respectively, and determines the current position data based on the first navigation data and the second navigation data.

11. The method according to claim 1, characterized in that There are multiple navigation devices, and the electronic device is used to establish Bluetooth connections with the multiple navigation devices at the same time to obtain the first navigation data from the multiple navigation devices.

12. An electronic device, characterized in that: include: a memory for storing instructions to be executed by one or more processors of the device, and A processor is used to execute the instructions so that the electronic device executes the method according to any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method according to any one of claims 1 to 11.

14. A chip structure, characterized in that: The method comprises at least one chip, wherein the at least one chip is used to execute the method according to any one of claims 1 to 11.

15. A computer program product comprising instructions, characterized in that When the computer program product runs on an electronic device, it enables the processor to execute any one of the methods described in 1-11.

Citation Information

Patent Citations

  • Navigation method, electronic equipment and navigation system

    CN109996183A