CN117714974A - Positioning method, device, chip structure and storage medium based on Bluetooth transmission - Google Patents
Positioning method, device, chip structure and storage medium based on Bluetooth transmission Download PDFInfo
- Publication number
- CN117714974A CN117714974A CN202311028441.8A CN202311028441A CN117714974A CN 117714974 A CN117714974 A CN 117714974A CN 202311028441 A CN202311028441 A CN 202311028441A CN 117714974 A CN117714974 A CN 117714974A
- Authority
- CN
- China
- Prior art keywords
- navigation
- data
- bluetooth
- module
- bluetooth module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 106
- 230000005540 biological transmission Effects 0.000 title claims abstract description 104
- 230000004044 response Effects 0.000 claims abstract description 12
- 230000015654 memory Effects 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 8
- 230000006399 behavior Effects 0.000 claims description 7
- 230000006978 adaptation Effects 0.000 claims description 6
- 230000000977 initiatory effect Effects 0.000 claims description 2
- 239000003795 chemical substances by application Substances 0.000 claims 4
- 239000000758 substrate Substances 0.000 claims 1
- 239000010410 layer Substances 0.000 description 59
- 230000008569 process Effects 0.000 description 32
- 230000006854 communication Effects 0.000 description 24
- 238000004891 communication Methods 0.000 description 22
- 238000010586 diagram Methods 0.000 description 22
- 230000006870 function Effects 0.000 description 17
- 238000005516 engineering process Methods 0.000 description 5
- 230000009471 action Effects 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 238000010295 mobile communication Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 230000003416 augmentation Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 239000012792 core layer Substances 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
- H04W4/024—Guidance services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Navigation (AREA)
Abstract
The application provides a positioning method, equipment, a chip structure and a storage medium based on Bluetooth transmission, wherein the positioning method is applied to electronic equipment, and the electronic equipment is used for acquiring navigation data from external navigation equipment and comprises a map application, a Bluetooth module and a position service module, and the method comprises the following steps: receiving a first operation; in response to a first operation, the Bluetooth module determines a transmission channel for transmitting first navigation data, and registers and monitors the behavior of acquiring the first navigation data, wherein the transmission channel is negotiated with the navigation device; receiving a second operation; responding to a second operation, wherein the Bluetooth module is used for establishing Bluetooth connection with the navigation equipment and establishing the transmission channel; the Bluetooth module acquires first navigation data from the navigation device based on the transmission channel; the location service module determines current location data based on the first navigation data and reports the location data to the map application. The method is simple to operate, space can be saved, power consumption can be reduced, and user experience can be improved.
Description
Technical Field
The present application relates to the field of navigation technologies, and in particular, to a positioning method, device, chip structure, and storage medium based on bluetooth transmission.
Background
With the progress of technology, navigation technology of electronic devices is mature, and positioning is accurate. The user is also increasingly dependent on navigation. However, when an electronic device with navigation capability, such as a mobile phone, is used for 2 to 3 years, a global positioning system (Global Positioning System, GPS) hardware module tends to be aged, and Over-The-Air (OTA) degradation is serious, which results in a drastic decrease in positioning accuracy and timeliness of The electronic device, and seriously affects The use experience of a user.
In other scenarios, for example, when navigating using a small-screen mobile phone during driving, the mobile phone is inconvenient to view due to the small-screen mobile phone. If the user wants to use a tablet with a relatively large screen for navigation, the user's needs cannot be satisfied if the tablet has no GPS function.
Therefore, there is a need for an external GPS device that can be assisted and used conveniently, and has good compatibility to serve as a functional extension of the GPS of the electronic device.
Disclosure of Invention
In view of the above, the present invention provides a positioning method, device, chip structure and storage medium based on bluetooth transmission, which can enhance the GPS capability of the electronic device without or with reduced navigation function in the prior art, and is simple and convenient to operate.
Some embodiments of the present application provide a positioning method based on bluetooth transmission, and the following description will be presented in terms of various aspects, which may be referred to with reference to the following embodiments and advantageous effects.
In a first aspect, the present invention provides a positioning method based on bluetooth transmission, where the method may be applied to an electronic device, where the electronic device is configured 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, and the method includes:
receiving a first operation, wherein the first operation is an operation of Bluetooth pairing between a user and navigation equipment based on a Bluetooth module; in response to a first operation, the Bluetooth module of the electronic device determines a transmission channel for transmitting first navigation data, and registers and monitors the behavior of acquiring the first navigation data, wherein the transmission channel is negotiated with the navigation device;
receiving a second operation, wherein the second operation is an operation of opening the map application by a user; responding to the second operation, the Bluetooth module of the electronic equipment is used for establishing Bluetooth connection with the navigation equipment, and establishing a transmission channel, wherein the transmission channel is used for transmitting first navigation data from the navigation equipment; the Bluetooth module of the electronic equipment acquires first navigation data from the navigation equipment based on the transmission channel; the position service module of the electronic device determines current position data based on the first navigation data and reports the position data to the map application so that the map application displays the position data.
According to the positioning method based on Bluetooth transmission, the operation is simple, additional downloading application is not needed, and space can be saved. In addition, compared with the scheme adopting the Bluetooth navigation application, the method reduces the running of one application program, can reduce the power consumption and greatly improves the user experience.
As an embodiment of the first aspect of the present application, in a case where the bluetooth module and the navigation device bluetooth are already paired, the electronic device receives the second operation again, establishes a bluetooth connection and a transmission channel directly with the navigation device, and obtains the first navigation data based on the transmission channel, and obtains the position data based on the first navigation data. Thereby being simpler and more convenient in operation.
As an embodiment of the first aspect of the present application, the electronic device determining current location data based on the first navigation data includes: the Bluetooth module acquires first navigation data and establishes a hardware abstraction layer hal data channel with the location service module; the Bluetooth module transmits the first navigation data to the position 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. By establishing the hal data channel, navigation data in hal format can be transmitted to the location service module without other auxiliary applications.
As an embodiment of the first aspect of the present application, the bluetooth module includes a navigation agent module, the location service module includes a navigation abstraction layer library, the navigation agent module establishes a hal data channel with the navigation abstraction layer library, and transmits the first navigation data to the navigation abstraction layer library. The establishment of the hal data channel can be realized through the navigation agent module and the navigation abstract layer library, so that the indiscriminate transmission of data is facilitated, and the integrity of the data is ensured.
As an embodiment of the first aspect of the present application, the bluetooth module further includes a data decision module, where the data decision module determines, based on a specific format of the navigation data, that the obtained data is first navigation data, and 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. The centralized processing of the navigation data in the unified format is convenient, and when the navigation data is not in the specific format, the navigation data does not need to be sent to the navigation agent module, so that unnecessary data transmission can be avoided.
As an embodiment of the first aspect of the present application, the bluetooth module is a classical bluetooth module, and the transmission channel includes at least one of the following transmission channels: a logical link control and adaptation protocol L2CAP transport channel, a host control interface command HCI L2CP ehco transport channel over L2CAP, a serial protocol SPP channel, or a bluetooth hands-free protocol HFP transport channel.
As an embodiment of the first aspect of the present application, the bluetooth module is a bluetooth low energy module, and in response to the second operation, the bluetooth module of the electronic device is configured to establish a bluetooth connection with the navigation device, including: the electronic device initiates a generic attribute protocol GATT connection to establish a bluetooth connection with the navigation device.
As an embodiment of the first aspect of the present application, the electronic device initiates a generic attribute protocol GATT connection to establish a bluetooth connection with a navigation device, including: the electronic device initiates a generic attribute protocol GATT connection to the navigation device based on the agreed GATT service unique identification code to establish a bluetooth connection with the navigation device after the navigation device determines the unique identification code. Ensuring that the transmitted data can accurately reach the device to be delivered.
As an embodiment of the first aspect of the present application, the method further comprises: second navigation data obtained by a navigation chip of the electronic equipment; the electronic device determines current position data based on the first navigation data and the second navigation data, and reports the position data to the map application so that the map application displays the position data. Through the mutual positioning of the two groups of navigation data, the positioning accuracy can be effectively improved.
As an embodiment of the first aspect of the present application, the electronic device determining current location data based on the first navigation data and the second navigation data includes: the navigation abstract layer library respectively acquires and analyzes the first navigation data and the second navigation data, and determines current position data based on the first navigation data and the second navigation data. And unified calculation and processing of multiple groups of data are facilitated.
As an embodiment of the first aspect of the present application, the plurality of navigation devices are a plurality of electronic devices, and the electronic device is configured to simultaneously establish bluetooth connections with the plurality of navigation devices to obtain first navigation data from the plurality of navigation devices. Under a specific scene, navigation data of a plurality of navigation devices can be acquired, and compared with the data of a single navigation device, the navigation device is more accurate in positioning. And can satisfy specific scene, for example can satisfy the vehicle and travel in comparatively remote place, the condition that single navigation's data is not accurate enough.
In a second aspect, the present application further provides an electronic device, including: a memory for storing instructions for execution by one or more processors of the device, and a processor for executing instructions to cause the electronic device to perform any one of the methods of the first aspect.
In a third aspect, the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor causes the processor to perform any one of the methods in the first aspect.
In a fourth aspect, the present application further provides a chip structure, including at least one chip, where the at least one chip is configured to perform any one of the methods in the first aspect.
In a fifth aspect, the present application also provides a computer program product comprising instructions which, when run on an electronic device, cause a processor to perform any one of the methods of the first aspect.
Drawings
FIG. 1 is a scene diagram of a cell phone and navigator communication positioning in some embodiments;
FIG. 2 is a flow diagram that illustrates the interaction of modules in a cell phone with a navigator based on user operations in some embodiments;
FIG. 3a is a flow diagram of NMEA data from a navigator to the interior of a handset in some embodiments;
FIG. 3b is a diagram of a location service corresponding to FIG. 3a in some embodiments;
FIG. 4 is a schematic diagram of an operator interface for location service selection in some embodiments;
FIG. 5 is a schematic diagram of an operator interface for user input of a connection establishment command with a navigator in some embodiments;
FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 7 is a block diagram of the software architecture of an electronic device according to one embodiment of the present application;
fig. 8 is a flow chart of a positioning method based on classical bluetooth transmission according to an embodiment of the present application;
FIG. 9 is a flow diagram of NMEA data from a navigator to a handset according to one embodiment of the present application;
fig. 10 is a flowchart of a positioning method based on bluetooth low energy transmission according to an embodiment of the present application;
FIG. 11 is a flow chart of NMEA data from a navigator to a handset according to another embodiment of the present application;
FIG. 12 is a diagram of a mobile phone with two navigation chips according to one embodiment of the present application;
fig. 13 is a block diagram of a system-on-chip according to some embodiments of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
For the convenience of understanding the technical solution of the present application, first, the technical problems of the embodiments of the present application will be described.
Referring to fig. 1, fig. 1 illustrates a scene diagram of a cell phone in some embodiments in communication with a navigator. As shown in fig. 1, in this scene diagram, a cell phone 10 and a navigator 20 are included. The navigator may be understood as an external GPS device independent of the mobile phone, and the navigator 20 may perform a satellite searching operation to obtain navigation data sent by satellites and generate NMEA data in a unified format of national marine electronics association (National Marine Electronics Association, NMEA). The handset 10 may establish a communication connection with the navigator 20 and obtain navigation data from the navigator 20 to obtain its own location information. Thus, even if the navigation chip of the mobile phone fails or the acquired navigation is not accurate enough, the navigator 20 can acquire the position information of the mobile phone, so as to realize the positioning navigation function. In addition, even the electronic equipment without the navigation chip, such as a tablet, can realize positioning navigation, thereby meeting the requirement of a user on the auxiliary external GPS equipment.
In order to ensure the positioning accuracy, the mobile phone and the navigator should keep a relatively short distance, so that the mobile phone and the navigator need to be connected through close-range communication. In some aspects, both communicate using a bluetooth connection. However, in some embodiments, to implement the communication between the mobile phone 10 and the navigator 20 and to implement the positioning for displaying navigation in the interface of the mobile phone, a navigation-assisting software, such as a bluetooth navigation application (Bluetooth Global Positioning System application), needs to be downloaded in the mobile phone, and the communication connection between the mobile phone and the navigator is implemented through the bluetooth navigation application. However, this solution is very complex to operate. In the following embodiments, the positioning process of this scheme is described.
Referring to fig. 2, fig. 2 illustrates a flow chart for enabling modules in a cell phone to interact with a navigator based on user operations in some embodiments. As shown in fig. 2, the handset includes a setting apk module (setting apk), a Bluetooth apk module (Bluetooth apk), a location service module (i.e., a location based service (Location Based Service, LBS), also called a mobile location service), a map application, and a Bluetooth navigation application. The Bluetooth navigation application is downloaded before the mobile phone is in communication connection with an external navigator.
As shown in fig. 2, in step (1), the user downloads and installs the bluetooth navigation application through an application marketplace or other website in the handset. Step (2), when the installation of the Bluetooth navigation application is completed, the user needs several operations in succession, for example, 1. Open the setup module (settings apk); 2. finding a version number, clicking the version number for multiple times, and entering a developer mode; 3. in the developer option menu, "simulation location information application" is selected; 4. the "bluetooth navigation application" is selected under the selection application. In step (3), the pairing of the mobile phone and the external navigator is completed, for example, the navigator is searched in the setting application, and the pairing is clicked. When the navigator is started, namely in power-on operation, the navigator is automatically paired with the Bluetooth module of the mobile phone. In step (4), before each navigation, the user needs to click on the desktop of the mobile phone and open the Bluetooth navigation application, and input a connection instruction for establishing a navigator through a prompt in a corresponding interface of the Bluetooth navigation application. The Bluetooth navigation application receives the instruction input by the user, constructs the SPP client, and executes the SPP client in the step (5). And (5) initiating a command of connecting a Bluetooth protocol stack serial port protocol (Serial Port Profile, SPP) to the Bluetooth module, and receiving the command by the Bluetooth module and establishing SPP connection with the navigator. After the navigator establishes a connection, satellite signals are received, data sent by satellites are obtained, and navigation data in NMEA format is constructed. In step (6), the navigator sends NMEA data in a uniform format to the bluetooth module based on the SPP connection. The Bluetooth module calls back the SPP client, sends NMEA data to a Bluetooth navigation application with the SPP client, analyzes the NMEA data by the Bluetooth navigation application to obtain the position information of the current device, and executes the step (7). In step (7), the bluetooth navigation application injects location information into the location service module through the analog location service provider interface. Step (8), the user uses the map application, i.e. opens the map application, and the location service module performs step (9). And (9) reporting the position information to a map application. The user knows the position of the user according to the position display in the map application and performs navigation operation, so that the positioning process based on the navigator is realized.
In the positioning process, in the steps (1), (2), (3), (4) and (8), user operation is needed, the number of times of user operation is large, and the operation is frequent, so that the user experience is low. In particular in step (2), since in the currently designed navigation architecture multiple GPS data sources may be allowed, these data sources may be handled by two location services, or location providers, e.g. a home location provider (Original Location Provider) and an analog location provider (Mock Location Provider). However, since the two location services are mutually exclusive, one of them can be selected only according to the device support situation.
Referring to fig. 3a and 3b, fig. 3a illustrates a flow diagram of NMEA data from within a navigator to a handset in some embodiments; fig. 3b shows a schematic diagram of a location service corresponding to fig. 3 a. As shown in fig. 3a, the mobile phone includes a bluetooth module, a bluetooth navigation application, and a location-based service map application. The navigator can search for the star to obtain and generate NMEA data and transmit the data to the handset, and the transmission process includes steps (1) - (6) in fig. 2. The bluetooth module obtains NMEA data and transmits the NMEA data to the bluetooth navigation application, the bluetooth navigation application comprises an analog position provider, and the data is transmitted to the position service module based on the analog position provider and then transmitted to the map application, and the map application corresponds to (7) in fig. 2. In connection with the architecture diagram shown in fig. 3b, the architecture diagram includes a Location based service application (Location Based Service application, LBS app), location management (Location Manager), as well as a home Location provider and a simulated Location provider. Wherein the location service application may record the location. The simulated location provider includes a bluetooth navigation agent module, i.e., for communication connection with the bluetooth module. Therefore, in the current scheme depending on the bluetooth navigation application, only the analog location provider can be selected, and the selection process of the analog location provider can refer to the description of the step (2) in fig. 2, which is very cumbersome to operate.
It should be noted that the simulated location provider may also include other proxy modules, such as a differential global positioning system (Differential Global Positioning System, DGPS), a corresponding Component Object Model (COM), a WIFI proxy corresponding network (network), and the like, which are not described in the present application.
The following describes further the operation procedure of selecting the bluetooth navigation application under the simulated location information application in step (2) in fig. 2 with reference to the interface operation chart.
Referring to fig. 4, fig. 4 illustrates an operational interface diagram of location service selection in some embodiments. As shown in fig. 4 (a), the user opens the setup interface 410, clicks the option "about cell phone" at the interface 410, and enters the interface 420 about cell phone as shown in fig. 4 (b). The option "version number" is found in interface 420 and after clicking the version number multiple times, the previous menu is returned to enter the system and update interface 430 as shown in fig. 4 (c). In interface 430, select "developer option", then enter developer option interface 440 as shown in fig. 4 (d). In interface 440, the user clicks "select simulated location information application", which corresponds to the simulated location information application in step (2) in FIG. 2, i.e., the simulated location provider. Thereafter, the user enters a select application interface 450 as shown in fig. 4 (e), where the interface 450 includes an option for a bluetooth navigation application, and the user selects the bluetooth navigation application. And finishing the selection process of the simulation position information application. It follows that this procedure is very cumbersome and the user experience is not high.
The process of establishing a connection instruction with the navigator by user input in step (4) in fig. 2 will be further described with reference to an interface operation chart.
Referring to fig. 5, fig. 5 illustrates an operational interface diagram of user input of a connection establishment instruction with a navigator in some embodiments. As shown in fig. 5 (a), in the desktop interface 510, click on an icon of the bluetooth navigation application, open the bluetooth navigation application, enter the connection interface 520 shown in fig. 5 (b), and 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 (refer to the whole process in fig. 2 (4)). After the user clicks on the connect, the interface 530 shown in fig. 5 (b) is entered, and the connect option is now the "disconnect" option. The user can click "off" to disconnect the navigator from the handset. This procedure is also cumbersome.
In the above positioning scheme, the operation process of the user is complicated, and the user experience is poor. In addition, because the Bluetooth navigation application needs to be downloaded and installed, the application program not only occupies the memory of the mobile phone, but also consumes very fast power. It is also necessary to manually shut down the bluetooth navigation application when the navigation exits, otherwise the power will soon be exhausted. Therefore, the bluetooth navigation application, which is an app for relaying NMEA data, is easily turned off by the system, and if navigation is being performed, navigation cannot be performed.
In view of the above-mentioned problems, the present application provides a positioning method based on bluetooth transmission, which can be applied to a system formed by a mobile phone and a navigator, wherein when the mobile phone receives an operation (first operation) of pairing a user with the navigator bluetooth, for example, the user turns on the bluetooth by setting, discovers peripheral navigators by a discovery function of the bluetooth, and selects the operation of the navigator after discovery. The mobile phone responds to the operation of Bluetooth pairing with the navigator, and the transmission channel for transmitting the first navigation data is determined through negotiation between the Bluetooth module and the navigator. The Bluetooth module registers, monitors and acquires the navigation data after determining the transmission channel so as to communicate with the navigator when receiving the navigation instruction of the user, so that the navigator performs the star searching action, and NMEA data is acquired.
When the mobile phone receives an operation (second operation) of opening the map application by the user, for example, the user clicks the map application in the mobile phone interface. In response to the operation, the mobile phone establishes a bluetooth connection with the navigator through the bluetooth module, and establishes a transmission channel through which the bluetooth module obtains NMEA data (first navigation data) from the navigator. The Bluetooth module can directly process and analyze NMEA data and send the NMEA data to the location service module. The position service module determines current position data based on the processed NMEA data and reports the position data to a map application so that the map application displays the position data.
According to the positioning method based on Bluetooth transmission, the function of relaying NMEA data is moved to a Bluetooth module (system application), NMEA data is directly obtained through the Bluetooth module, and the Bluetooth module and the location service module can directly transmit the analyzed NMEA data in an indiscriminate manner, and in the process, auxiliary navigation software is not needed to be downloaded for assistance. The method is simple to operate, does not need to additionally download the application, and can save space. In addition, compared with the scheme adopting the Bluetooth navigation application, the method reduces the running of one application program, can reduce the power consumption and greatly improves the user experience.
In the above embodiments, the mobile phone is described as an example of the electronic device. In some embodiments, the electronic device may also be a tablet computer, personal computer (personal computer, PC), notebook computer, personal digital assistant (personal digital assistant, PDA), in-vehicle device, web television, wearable device, or the like product with a display interface. In addition, the above embodiment is described taking a navigator as an example of a navigation apparatus. In some embodiments, the navigation device may be a cell phone, tablet, personal computer (personal computer, PC), notebook, wearable device, etc. with navigation functionality. The present application does not particularly limit the existence form of the electronic device.
The positioning method based on bluetooth transmission according to the embodiment of the present application is described below with reference to a specific structure of an electronic device.
Fig. 6 shows a schematic structural diagram of the 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 (universal serial bus, USB) connector 130, a charge 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 interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
In some embodiments, when the processor 110 receives the first operation, the first operation is an operation by which the user bluetooth pairs with the navigation device based on the bluetooth module. In response to the first operation, the processor 110 determines a transmission channel for transmitting the first navigation data through the bluetooth module and registers the behavior of monitoring acquisition of the first navigation data. Wherein the transmission channel is negotiated with the navigation device. When the processor 110 receives the second operation, the second operation is an operation in which the user opens 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 acquire the first navigation data from the navigation device. The processor 110 determines current location data based on the first navigation data and reports the location data to a display screen, which displays the location data in a corresponding map application interface.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 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 change display information.
In one embodiment, the display 194 displays positioning information in a corresponding interface of the map application according to control instructions of the processor 110, and may display navigation devices that are found when bluetooth pairing, connection prompts when bluetooth connection is established, and the like.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store, among other things, an application program (e.g., bluetooth application, map application, location service program) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., NMEA data, location information, voice stream data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
In one embodiment of the present application, the internal memory 121 may store therein instructions of the positioning method based on bluetooth transmission, and the processor 110 enables the electronic device 100 to obtain NMEA data from the navigator and display positioning information in the display 194 when the user opens the map application through the instructions of the positioning method based on bluetooth transmission.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation acting thereon or thereabout, for example, a touch operation clicking on an edit box. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
In some embodiments, when the user touches the display 194 and is treated as a specific click or the like, the processor 110 receives an operation of clicking the map application for the display 194 by the user, and in response to the operation, the processor 110 controls the display 194 to display the current location information of the mobile phone.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, bluetooth (bluetooth module) may make a bluetooth connection with a device with navigation, e.g., a navigator. And, the processor 110 may obtain NMEA data obtained by the navigator search through the bluetooth connection. The processor may obtain the NMEA data and parse the NMEA data, calculate the current navigator (i.e., electronic device 100) location information based on the NMEA data, and display the location information on the display 194.
The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
In the embodiment of the present application, the processor 110 may obtain NMEA data through GPS, and calculate and obtain location information of the electronic device 100 based on the NMEA data, so as to implement positioning.
In some embodiments, the processor 110 may combine the NMEA data obtained from its GPS system with the NMEA data obtained from the navigator via the bluetooth connection, and calculate the current position based on the two sets of NMEA data, which may improve the accuracy of the positioning.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the invention, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 7 is a software configuration block diagram of the electronic device 100 according to the embodiment of the present invention.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system library (not shown), and a hardware abstraction layer and kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 7, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 7, 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, etc.
The location service management is used to acquire data related to navigation, for example, may manage location data obtained from a GPS chip of the electronic device 100 itself, or may manage location data obtained from other devices, determine a geographic location where a device or a user is located based on the location data, and provide various information services related to the location, and the like.
And the Bluetooth management is used for negotiating the transmission mode of the data with other navigation equipment with navigation function, and establishing Bluetooth connection so as to directly obtain NMEA data from the navigation equipment.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a location information picture in a map application, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (e.g., openGL ES), 2D graphics engine (e.g., SGL), bluetooth navigation agent (hal), and navigation abstraction layer library (hal), etc.
The bluetooth navigation agent (hal) may obtain NMEA data (NMEA data) in a format relayed from the external navigation device, parse the NMEA data, and encapsulate the parsed data into Non-NMEA data (Non-NMEA) in a hal format that may be transmitted at a hardware abstraction layer (hardware abstraction layer, hal) layer, i.e., NNMEA data. The Bluetooth navigation agent (hal) is communicated with the navigation abstraction layer library (hal), can directly send NNMEA data to the navigation abstraction layer library (hal), can realize the indiscriminate transparent transmission of NNMEA data to the navigation abstraction layer library, and ensures the integrity of the data.
The navigation abstraction layer library, abbreviated as gps.hal, refers to the global navigation satellite system (Global Navigation Satellite System, GNSS) Hal service on Android, such as libgps.so (Hal) and the like. The navigation abstraction layer library defines various constants and information, including positioning patterns, states, etc. The NMEA data may be directly communicated to the bluetooth navigation agent (hal) and obtained. And the obtained hal format data (NNMEA data) can be analyzed, and the distance is calculated based on the analyzed data so as to obtain the current position information of the equipment or the user.
In some embodiments, the navigation abstraction layer library may also directly obtain the NMEA data from its own GPS chip and parse the NMEA data. And can combine NNMEA data that is relayed from navigation device to calculate electronic device or user's positional information to improve the accuracy of location.
According to the embodiment of the application, the NMEA data relayed by the relay and the NMEA data reported by the GPS chip of the electronic equipment are used indiscriminately through the newly added Bluetooth navigation agent (hal) and the navigation abstraction layer library (hal), so that the complexity of a data processing flow is simplified.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The following describes in detail a positioning method based on bluetooth transmission according to the embodiment of the present application, in combination with two bluetooth connection scenarios, i.e. classical bluetooth and bluetooth low energy. The method provided by the embodiment of the application can be applied to the electronic equipment with the hardware structure shown in the figure 6 and the software structure shown in the figure 7. Or more or less components than illustrated, or some components may be combined, or some components may be separated, or different components may be arranged, or the like in hardware and software configurations.
For convenience of explanation, the following embodiments are exemplified by taking an electronic device as a mobile phone and a navigation device as a navigator.
Referring to fig. 8, fig. 8 shows a flowchart of a positioning method based on classical bluetooth transmission according to an embodiment of the present application. As shown in fig. 8, the method is performed by a mobile phone and a navigator, and is suitable for a scene that the navigation module of the mobile phone is insufficient or fails and positioning needs to be realized by means of an external navigator. The mobile phone comprises a Bluetooth module, a location service module and a map application, and the function modules are all functions of the system. The method includes S811-S820.
S811, the Bluetooth module of the mobile phone is matched and connected with the navigator.
Here, the Bluetooth module refers to a classical Bluetooth (BT), which generally refers to a module supporting Bluetooth protocol below 4.0, and is generally used for transmission with relatively large data volume. The bluetooth transmission protocol used by the bluetooth module may include Radio Frequency Communication (RFCOMM), logical link control and adaptation protocol (Logical Link Control and Adaptation Protocol, L2 CAP), and may also include service discovery protocol (Service Discovery Protocol, SDP), serial protocol (Serial Port Profile, SPP), hands Free Profile (HFP), and the like.
In the embodiment of the application, the user may use a conventional bluetooth pairing operation, for example, bluetooth is turned on from a setting, bluetooth automatically searches for a peripheral device, for example, searches for a navigator, and after the user clicks the navigator (the first operation), the mobile phone communicates with the navigator and mutually authenticates to complete the pairing process. This establishes the basis for subsequent connections and data transmission. Once pairing is successful, when the user navigates for the second time or more, the mobile phone and the navigator are connected in a Bluetooth mode, pairing operation is not needed, bluetooth of the mobile phone and the navigator is directly started, and Bluetooth connection is automatically established between the mobile phone and the navigator, so that data transmission is facilitated.
S812, the mobile phone negotiates with the navigator and determines a transmission channel.
For example, the bluetooth module negotiates with the navigator whether or not to support the connection of classical bluetooth of the external navigator. If so, the transmission channel is further negotiated, and if not, the subsequent connection operation is not performed.
In some embodiments, the handset, after pairing with the navigator, takes a negotiated transport channel based on SDP service discovery. Such as a transmission channel for transmitting NMEA data. In the embodiment of the application, the bluetooth protocol of the navigator may be the same as that of the mobile phone. Both determine a transmission channel for transmitting NMEA based on their own capabilities, wherein the transmission channel may be a transmission channel established based on any of L2CAP channel (channel), L2CAP request-response (SPP), and HFP. For example, if it is determined to establish an L2CAP channel, during the subsequent data transmission, the L2CAP channel is directly used to establish a transmission channel, and NMEA data is transmitted based on the transmission channel.
In the embodiment of the application, after the Bluetooth module of the mobile phone negotiates with the navigator to obtain a transmission channel, the Bluetooth module registers and monitors satellite searching behaviors, so that once the Bluetooth module receives a satellite searching instruction, the connection is initiated like the navigator, and the navigator is informed to perform the satellite searching behaviors so as to acquire navigation data from satellites.
S813, the map application receives the navigation operation (second operation) input by the user, and initiates the instruction of navigation to the location service module.
For example, the user clicks an icon of the map application or an operation of the navigation application in the interface of the mobile phone, the map application obtains the operation instruction, and sends the instruction of navigation to the location service module.
S814, the location service module stores the star searching instruction and sends the star searching instruction to the Bluetooth module.
The position service module not only can send a star searching instruction to the Bluetooth module, but also can inform the GPS chip of star searching behavior when the mobile phone has the GPS chip with the star searching function, so that two groups of NMEA data can be obtained.
S815, the Bluetooth module initiates Bluetooth connection to the navigator, and establishes Bluetooth connection with the Bluetooth module after the navigator receives the connection request. The process of the bluetooth connection may refer specifically to the bluetooth connection method of the prior art, which is not described in detail in this application.
S816, the Bluetooth module initiates a transmission channel request of NMEA data transmission to the navigator to establish a transmission channel. For example, in S812, the transmission channel determined by the bluetooth module and the navigator is an L2CAP channel protocol transmission channel, and at this time, the navigator establishes an L2CAP channel protocol transmission channel with the bluetooth module and transmits NMEA data (first navigation data) through the transmission channel.
In addition, in some embodiments, a transmission channel may also be established using HCI L2CP ehco request-response over L2CAP channel and NMEA data may be transmitted. An SPP transmission channel may also be established to transmit NMEA data. When the SPP transmission channel is established, the Bluetooth module needs to establish a new SPP client (client), and communicates with the SPP server of the navigator to complete the establishment of the transmission channel. In other embodiments, since the NMEA data is in AT command format, it may also be transmitted over the transmission channel of HFP signaling.
In the embodiment of the present application, when the navigator receives a request for a transmission channel of NMEA data initiated by the bluetooth module, a satellite searching operation is started to acquire navigation data from satellites, for example, the number of satellites, the positions of the satellites, the moving track of the satellites, the distance between the satellites and the navigator, and the like. The navigator obtains the navigation data and encapsulates the navigation data into NMEA (network management and analysis) format data unified by the GPS navigation equipment, namely NMEA data, so as to realize the unification of the data formats.
S817, the Bluetooth module and the location service module establish a GPS.hal data channel.
In one embodiment of the present application, the data channel of gps.hal may be implemented by bluetooth navigation agent (hal) and navigation abstraction layer library (hal) as in fig. 7. The Bluetooth navigation agent (hal) analyzes the NMEA data and encapsulates the NMEA data into non-NMEA data (NNMEA data) in a hal format which can be in a hal layer transmission format, so that the non-differential transmission in the hal layer can be realized, and the integrity of the data is ensured. The specific implementation of this channel can refer to the prior art for implementing a data transmission process with respect to a GPS Hal in the Android GNSS Hal service, and will not be described in detail here.
S818, the bluetooth module injects NMEA data to the location service module. That is, NNMEA data can be transmitted to the location service module through the data channel of GPS.hal, so that the transmission process of complete data is ensured to the greatest extent.
And S819, combining the data transmitted by the Bluetooth navigation agent by the position service module.
In the embodiment of the application, after NNMEA data is obtained, the location service module analyzes the data, and calculates the distance between the mobile phone and the satellite based on the analyzed data, so that the current location information is determined.
S820, the location service module reports the current location information to the map application. The user can know the current position in the map application interface, and the quick positioning process is realized.
The whole process of S811-S820 is the operation of the user when the user first uses the mobile phone to establish bluetooth connection with the navigator, and the process of realizing data transmission. When the Bluetooth connection is not established for the first time, the user does not need to perform the operation of pairing connection. Positioning can be achieved by simply clicking on the map application.
According to the positioning method, in the whole positioning navigation process, a user only needs to execute Bluetooth pairing (first operation) of the mobile phone and the navigator. After that, when navigation is needed, the map application (second operation) is clicked, so that accurate positioning can be realized, and the operation process is very simple. In addition, the additional downloading of the application program is not needed to assist in positioning, so that space is saved, electricity consumption caused by running the downloaded application can be avoided, and user experience is greatly improved.
The positioning method of classical bluetooth transmission in the embodiment of the present application is described below with reference to a flow chart of data between modules in a mobile phone.
Referring to fig. 9, fig. 9 shows a main configuration of a mobile phone and a navigator and a flow chart of NMEA data from the navigator to the inside of the mobile phone according to an embodiment of the present application. The following aspects explain the flow of data during implementation of the embodiments of the present application, and may also be used to generally describe the architecture of a cell phone and a navigator in conjunction with the flow of data between the navigator and the cell phone.
The mobile phone comprises a Bluetooth module, a Bluetooth location service and a map application, and a navigator for establishing a Bluetooth connection with the mobile phone.
As shown in fig. 9, the flow chart is mainly divided into five main processes, i.e., S910-S940.
Wherein, at S910, the snma data is transmitted from the navigator to the handset. The transmission channel may be a transmission channel established based on any one of L2CAP channel protocol, L2CAP echo request-response, SPP and HFP. The transmission channel establishment process may refer to S811-S816 in fig. 8.
At S920, the bluetooth module of the mobile phone includes an NMEA data identification module, and when the bluetooth module obtains NMEA data based on the transmission channel, the bluetooth module transmits the NMEA data to the NMEA data identification module.
In the embodiment of the application, the NMEA data identification module determines the format of the obtained data, and when the NMEA data identification module obtains the data with the data format of NMEA data, the NMEA data is transmitted to the bluetooth navigation agent module (hal). Otherwise, the data is processed according to the conventional processing mode of the Bluetooth module without being transmitted to the Bluetooth navigation agency module (hal), so that the Bluetooth navigation agency module (hal) is ensured to transmit NMEA data.
The Bluetooth navigation agent module (hal) analyzes NMEA data, encapsulates the NMEA data into hal-format NNMEA data which can be transmitted in a hal layer, and is convenient for transmitting the data to a navigation abstraction layer library, so that the integrity of the data is ensured.
At S930, the bluetooth navigation agent module (hal) transparently passes NNMEA data to the navigation abstraction layer library (corresponding to libgps. So (hal)) based on the channel established with the navigation abstraction layer library. This step corresponds to S818-S820 in fig. 8, and specific implementations of the transmission may be described with reference to S818-S820 in fig. 8.
At S940, the navigation abstraction layer library obtains NNMEA data, parses the data to obtain hal format data corresponding to ***, and calculates parameters such as a distance between a mobile phone or a navigator and a satellite based on the parsed data to obtain current location information. And finally, reporting the position information to a navigation position provider and position management until the map application is finished, so that the mobile phone is positioned.
It should be noted that, in some embodiments, the navigation abstraction layer library may further obtain NMEA data (second navigation data) obtained by the mobile phone navigation chip, and combine the NMEA data obtained by the navigator, and calculate the current position by combining the two sets of NMEA data. Thereby improving the accuracy of positioning.
The bluetooth transmission-based positioning method of the embodiments of the present application is implemented in a device utilizing bluetooth low energy (Bluetooth Low Energe, BLE) is explained below.
Referring to fig. 10, fig. 10 shows a flowchart of a positioning method based on bluetooth low energy transmission according to an embodiment of the present application. As shown in fig. 10, the method is performed by a mobile phone and a navigator, wherein the mobile phone includes a bluetooth module, a location service module and a map application, and the function modules are all functions of the system. The method includes S1011-S1020.
S1011, the Bluetooth module of the mobile phone is matched and connected with the navigator.
Herein, the bluetooth module refers to bluetooth low energy BLE. The composition of the BLE protocol stack includes logical link control and adaptation protocol (Logic link control and adaptation protocol, L2 CAP), attribute protocol (Attribute protocol, ATT) generic attribute profile layer (Generic attribute profile, GATT), etc. The GATT is based on the concept of attributes (Attribute) and services (service), and by encapsulating data in attributes, that is, attribute is used to describe data one by one, each Attribute has a unique identifier (UUID), so that when a device broadcasts, other devices can accurately identify the data through UUID, thereby realizing communication with a designated device. That is, the two devices finally implement communication between the two devices through the BLE protocol stack, and the complete communication process thereof can refer to the communication process of BLE in the prior art, which is not described in detail in the present application.
As shown in fig. 10, in pairing, the GATT service of the navigator is first to be in a start state, so that GATT Client pairing connection with the bluetooth module can be realized, and services and the like can be provided.
It should be noted that, for the operation of the user during pairing, reference may be made to the description of S811 in fig. 8, which is not repeated here.
It should be noted that, the negotiation process between the navigator and the bluetooth module may be the negotiation between the bluetooth module of the navigator and the bluetooth module of the mobile phone.
S1012, the mobile phone negotiates with the navigator GATT capability and determines a transmission channel.
After the mobile phone is matched with the navigator Bluetooth, the Bluetooth module negotiates with the navigator based on the GATT to determine whether NMEA data can be transmitted. And after determining that the satellite can be transmitted, the Bluetooth module registers and monitors satellite searching behaviors, so that when a satellite searching instruction is received, the navigator is informed of satellite searching, and meanwhile, the navigator is ready to initiate BLE broadcasting.
S1013, the map application receives the navigation operation (second operation) input by the user, and initiates the instruction of navigation to the location service module. This step corresponds to S813 in fig. 8, and the description in S813 may be referred to.
S1014, the location service module stores the star searching instruction and sends the star searching instruction to the Bluetooth module. This step corresponds to S814 in fig. 8, and reference is made to the description in S814.
S1015, the Bluetooth module initiates GATT Bluetooth connection to the navigator, and establishes Bluetooth connection when the navigator receives a connection request.
The process is that the Bluetooth module communicates with the GATT service of the navigator through the GATT client and establishes connection. The process of establishing a bluetooth connection with bluetooth low energy in the prior art may be referred to for a specific connection, and will not be described herein.
S1016, the Bluetooth module and the navigator establish an NMAE data transmission channel. Since the capability of transmitting NMEA data has been negotiated in S1012, a data transmission channel may be directly established after the bluetooth connection is established.
S1017, the Bluetooth module and the location service module establish a GPS.hal data channel. This step corresponds to S817 in fig. 8, and specific reference may be made to the description in S817, which is not repeated here.
S1018, the bluetooth module injects NNMEA data into the location services module.
In particular, navigation extraction by a location services module may be performedElephant imageLayer library (libgps. So (hal)) reception. This step corresponds to S818 in fig. 8, and specific reference is made to S818, which is not repeated here.
S1019, the location service module merges the data transmitted by the Bluetooth navigation agent.
In the embodiment of the application, after NNMEA data is obtained, the location service module analyzes the data, and calculates the distance between the mobile phone and the satellite based on the analyzed data, so that the current location information is determined.
S1020, the location service module reports the current location information to the map application. The user can know the current position in the map application interface, and the quick positioning process is realized.
The whole process of S1011-S1020 is the operation of the user when the user first uses the mobile phone to establish bluetooth connection with the navigator, and the process of realizing data transmission. When the Bluetooth connection is not established for the first time, the user does not need to perform the operation of pairing connection. Positioning can be achieved by simply clicking on the map application.
According to the positioning method, the operation process is very simple. Furthermore, no additional download application is required to assist in positioning. Not only saving space, but also avoiding the consumption of electric quantity caused by running downloaded application, so that the user experience is greatly improved.
The following describes a positioning method for bluetooth low energy transmission according to the embodiments of the present application in combination with a flow chart of data between modules in a mobile phone.
Referring to fig. 11, fig. 11 shows a main configuration of a mobile phone and a navigator according to another embodiment of the present invention and a flow chart of NMEA data from the navigator to the inside of the mobile phone. The following aspects explain the flow of data during implementation of the embodiments of the present application, and may also be used to generally describe the architecture of a cell phone and a navigator in conjunction with the flow of data between the navigator and the cell phone.
The mobile phone comprises a Bluetooth module, a Bluetooth location service and a map application, and a navigator for establishing a Bluetooth connection with the mobile phone.
As shown in fig. 11, the flow chart is largely divided into five main processes, S1110-S1140.
Wherein at S1110, NMEA data is transmitted from the navigator to the handset. The transmission channel may be a GATT transmission channel established based on various components of a BLE protocol stack, such as an L2CAP channel protocol, a GATT protocol, an ATT protocol, and the like. The transmission channel establishment process may refer to S1011-S1016 in fig. 10.
At S1120, the bluetooth module of the mobile phone includes an NMEA data identification module, and when the bluetooth module obtains NMEA data based on the transmission channel, the bluetooth module transmits the NMEA data to the NMEA data identification module. This step corresponds to S920 in fig. 9.
The NMEA data identification module judges the format of the obtained data, and when the NMEA data identification module obtains the data with the NMEA data format, the NMEA data is transmitted to the Bluetooth navigation agent module (hal). Otherwise, the data is processed according to the conventional processing mode of the Bluetooth module without being transmitted to the Bluetooth navigation agency module (hal), so that the Bluetooth navigation agency module (hal) is ensured to transmit NMEA data.
The Bluetooth navigation agent module (hal) analyzes the NMEA data, encapsulates the analyzed data into hal-format NNMEA data which can be transmitted in a hal layer, and is convenient for transmitting the data to a navigation abstraction layer library, so that the integrity of the data is ensured.
At S1130, the bluetooth navigation agent module (hal) transparently passes NNMEA data to the navigation abstraction layer library (corresponding to libgps. So (hal)) based on the channel established with the navigation abstraction layer library. This step corresponds to S930 in fig. 9, and specific reference may be made to the description of S930 in fig. 9.
At S1140, the navigation abstraction layer library obtains NMEA data, parses the data to obtain hal format data corresponding to ***, and calculates parameters such as a distance between the mobile phone or navigator and a satellite based on the parsed data to obtain current location information. And finally, reporting the position information to a navigation position provider and position management until the map application is finished, so that the mobile phone is positioned.
In other embodiments, when a plurality of navigator are connected with the mobile phone bluetooth, the mobile phone can obtain NMEA data from the plurality of navigator, and then calculate the current position information, thereby effectively improving the positioning accuracy and avoiding the influence of single navigator data on the positioning accuracy.
In some embodiments, the mobile phone may have a plurality of navigation chips, and at this time, the navigation abstract layer library may obtain navigation data of the plurality of navigation chips at the same time, and perform merging to calculate a distance, so as to obtain more accurate location information.
Referring to fig. 12, fig. 12 shows a scenario in which a mobile phone according to an embodiment of the present application has two navigation chips. The scenario may correspond to adding data of a navigation chip at S940 in fig. 9, or to adding data of a navigation chip at S1140 in fig. 11. As shown in fig. 12. The mobile phone comprises two mobile phone navigation chips, each of which can correspond to one sub-navigation abstraction layer library, for example, mobile phone navigation chip 1 corresponds to libgps.so1 (hal), and mobile phone navigation chip 2 corresponds to libgps.so2 (hal). The data obtained by the two sub navigation abstraction layer libraries are uniformly transmitted to a father navigation abstraction layer library (libGPS. Common. So (hal)), and the father navigation abstraction layer library calculates the distance from the mobile phone or the navigator to the satellite by combining the two sub navigation abstraction layer libraries and NMEA data obtained from a Bluetooth navigation agent (hal) (navigator) to obtain the current position of the mobile phone or the navigator. The procedure of NMEA data obtained from the bluetooth navigation agent (hal), i.e. from the navigator, may refer to the acquisition procedure of fig. 8-11, and will not be described herein.
According to the positioning method based on Bluetooth transmission, the NMEA data relayed by indiscriminate use and the NMEA data reported by the GPS chip of the electronic equipment are realized through the newly added Bluetooth navigation agent (hal) and the navigation abstract layer library (hal), so that the complexity of a data processing flow is simplified, the user operation is simplified, and the positioning accuracy is improved. In addition, no program outside the additional system is needed to assist the navigation process, so that the space utilization rate and the electric quantity loss are saved, and the user experience is improved.
The application also provides an electronic device comprising:
a memory for storing instructions for execution by one or more processors of the device, an
A processor for performing the method explained in connection with fig. 8 to 12 in the above embodiments.
The present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the method explained in fig. 8 to 12 in the above embodiments.
The present application also provides a computer program product comprising instructions which, when run on an electronic device, cause a processor to perform the method shown in fig. 8 to 12 in the above-described embodiments.
Referring now to fig. 13, shown is a block diagram of a SoC (System on Chip) 1300 in accordance with an embodiment of the present application. In fig. 13, similar parts have the same reference numerals. In addition, the dashed box is an optional feature of a more advanced SoC. In fig. 13, soC1300 includes: an interconnect unit 1350 coupled to the application processor 1310; a system agent unit 1380; a bus controller unit 1390; an integrated memory controller unit 1340; a set or 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 (Static Random Access Memory, SRAM) unit 1330; a Direct Memory Access (DMA) unit 1360. In one embodiment, coprocessor 1320 includes a special-purpose processor, such as, for example, a network or communication processor, compression engine, general purpose computing graphics processor (General Purpose Computing on GPU, GPGPU), high-throughput integrated multi-core architecture (Many Integrated Core, MIC) processor, embedded processor, or the like.
One or more computer-readable media for storing data and/or instructions may be included in Static Random Access Memory (SRAM) unit 1330. The computer-readable storage medium may have stored therein instructions, and in particular, temporary and permanent copies of the instructions. The instructions may include: the execution of at least one unit in the processor causes the Soc1500 to perform the method according to the above embodiment, and the method explained with reference to fig. 8 to 12 of the above embodiment may be specifically referred to, which is not described herein.
Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementations. Embodiments of the present application may be implemented as a computer program or program code that is executed on a programmable system including 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.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (Digital Signal Processor, DSP), microcontroller, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. Program code may also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described in the present application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.
In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy diskettes, optical disks, compact disk Read-Only memories (Compact Disc Read Only Memory, CD-ROMs), magneto-optical disks, read-Only memories (ROMs), random Access Memories (RAMs), erasable programmable Read-Only memories (Erasable Programmable Read Only Memory, EPROMs), electrically erasable programmable Read-Only memories (Electrically Erasable Programmable Read Only Memory, EEPROMs), magnetic or optical cards, flash Memory, or tangible machine-readable Memory for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) in an electrical, optical, acoustical or other form of propagated signal using the internet. Thus, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such a particular arrangement and/or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different manner and/or order than shown in the drawings of the specification. Additionally, the inclusion of structural or methodological features in a particular figure is not meant to imply that such features are required in all embodiments, and in some embodiments, may not be included or may be combined with other features.
It should be noted that, in the embodiments of the present application, each unit/module is a logic unit/module, and in physical aspect, one logic unit/module may be one physical unit/module, or may be a part of one physical unit/module, or may be implemented by a combination of multiple physical units/modules, where the physical implementation manner of the logic unit/module itself is not the most important, and the combination of functions implemented by the logic unit/module is the key to solve the technical problem posed by the present application. Furthermore, to highlight the innovative part of the present application, the above-described device embodiments of the present application do not introduce units/modules that are less closely related to solving the technical problems presented by the present application, which does not indicate that the above-described device embodiments do not have other units/modules.
It should be noted that in the examples and descriptions of this patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
While 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 present application.
Claims (15)
1. The positioning method based on Bluetooth transmission is characterized by being applied to electronic equipment, wherein the electronic equipment is used for acquiring navigation data from external navigation equipment, the electronic equipment comprises a map application, a Bluetooth module and a position service module, and the method comprises the following steps:
receiving a first operation, wherein the first operation is an operation of Bluetooth pairing between a user and the navigation equipment based on the Bluetooth module;
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 the behavior of acquiring the first navigation data, wherein the transmission channel is negotiated with the navigation device;
receiving a second operation, wherein the second operation is an operation of opening the map application by a user;
responding to the second operation, wherein the Bluetooth module of the electronic equipment is used for establishing Bluetooth connection with the navigation equipment and establishing the transmission channel, and the transmission channel is used for transmitting the first navigation data from the navigation equipment;
the Bluetooth module of the electronic device acquires the first navigation data from the navigation device based on the transmission channel;
The position service module of the electronic equipment determines current position data based on the first navigation data and reports the position data to the map application so that the map application displays the position data.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
and under the condition that the Bluetooth module is paired with the Bluetooth of the navigation equipment, the electronic equipment receives the second operation again, establishes Bluetooth connection with the navigation equipment and the transmission channel directly, acquires the first navigation data based on the transmission channel, and acquires the position data based on the first navigation data.
3. A method according to claim 1 or 2, characterized in that,
the electronic device determining 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 position 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 of claim 3, wherein the Bluetooth module comprises a navigation agent module, the location services module comprises a navigation abstraction layer library,
the navigation agent module establishes the hal data channel with the navigation abstraction layer library and transmits the first navigation data to the navigation abstraction layer library.
5. The method of claim 4, wherein the Bluetooth module further comprises a data decision module,
and the data decision module determines that the acquired data is first navigation data based on a specific format of the navigation data, and transmits the first navigation data to the navigation agent module so that the navigation agent module can transmit the first navigation data to the navigation abstract layer library.
6. The method according to any of claims 1-5, wherein the bluetooth module is a classical bluetooth module, and the transmission channels comprise at least one of the following transmission channels:
a logical link control and adaptation protocol L2CAP transmission channel, a command HCI L2CP ehco transmission channel of a host control interface above the L2CAP, a serial protocol SPP channel, or a bluetooth hands-free protocol HFP transmission channel.
7. The method of any one of claims 1-5, wherein the Bluetooth module is a low energy Bluetooth module,
The Bluetooth module of the electronic device is used for establishing Bluetooth connection with the navigation device in response to the second operation, and comprises the following components:
the electronic equipment initiates a generic attribute protocol GATT connection to establish the Bluetooth connection with the navigation equipment.
8. The method of claim 7, wherein the electronic device initiating a generic attribute protocol GATT connection to establish a bluetooth connection with the navigation device comprises:
and the electronic equipment initiates a general attribute protocol (GATT) connection to the navigation equipment based on the agreed GATT service unique identification code, so that the Bluetooth connection is established with the navigation equipment after the navigation equipment determines the unique identification code.
9. The method as recited in claim 4, further comprising:
second navigation data obtained by a navigation chip of the electronic equipment;
the electronic device determines current position data based on the first navigation data and the second navigation data, and reports the position data to the map application so that the map application displays the position data.
10. The method of claim 9, wherein the electronic device determining current location data based on the first navigation data and the second navigation data comprises:
The navigation abstraction layer library respectively acquires and analyzes the first navigation data and the second navigation data, and determines the current position data based on the first navigation data and the second navigation data.
11. The method of claim 1, wherein the navigation device is a plurality of the electronic devices for simultaneously establishing bluetooth connections with a plurality of the navigation devices to obtain the first navigation data from the plurality of the navigation devices.
12. An electronic device, comprising:
a memory for storing instructions for execution by one or more processors of the device, an
A processor for executing the instructions to cause the electronic device to perform the method of any one of claims 1-11.
13. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to perform the method of any of claims 1-11.
14. A chip architecture comprising at least one chip for performing the method of any one of claims 1-11.
15. A computer program product comprising instructions which, when run on an electronic device, cause a processor to perform the method of any one of claims 1-11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311028441.8A CN117714974A (en) | 2023-08-14 | 2023-08-14 | Positioning method, device, chip structure and storage medium based on Bluetooth transmission |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311028441.8A CN117714974A (en) | 2023-08-14 | 2023-08-14 | Positioning method, device, chip structure and storage medium based on Bluetooth transmission |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117714974A true CN117714974A (en) | 2024-03-15 |
Family
ID=90148642
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311028441.8A Pending CN117714974A (en) | 2023-08-14 | 2023-08-14 | Positioning method, device, chip structure and storage medium based on Bluetooth transmission |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117714974A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102967314A (en) * | 2012-11-15 | 2013-03-13 | 广东翼卡车联网服务有限公司 | Method and device for updating vehicle navigation system |
CN109996183A (en) * | 2019-04-04 | 2019-07-09 | 广东工业大学 | A kind of air navigation aid, electronic equipment and navigation system |
US20210148723A1 (en) * | 2019-11-18 | 2021-05-20 | International Business Machines Corporation | Methods and systems for event initiated navigational assistance |
-
2023
- 2023-08-14 CN CN202311028441.8A patent/CN117714974A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102967314A (en) * | 2012-11-15 | 2013-03-13 | 广东翼卡车联网服务有限公司 | Method and device for updating vehicle navigation system |
CN109996183A (en) * | 2019-04-04 | 2019-07-09 | 广东工业大学 | A kind of air navigation aid, electronic equipment and navigation system |
US20210148723A1 (en) * | 2019-11-18 | 2021-05-20 | International Business Machines Corporation | Methods and systems for event initiated navigational assistance |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3958533B1 (en) | Method for accessing wireless local area network and terminal | |
CN111684778B (en) | Implementation method of application function and electronic equipment | |
WO2022089207A1 (en) | Cross-device application interaction method, electronic device, and server | |
CN111434132A (en) | Method and terminal for opening account of eSIM card | |
CN110602686B (en) | Method for using remote SIM module and electronic equipment | |
US20230054451A1 (en) | Communication Connection Method and Electronic Device | |
CN113727333B (en) | Downloading system for custom applications | |
US20220113957A1 (en) | Software Upgrade Method, Apparatus, and System | |
CN112860445B (en) | Method and terminal for sharing data between fast application and native application | |
WO2022199673A1 (en) | Login authentication method and electronic device | |
CN115002747B (en) | Parameter updating method, system, terminal equipment and chip system | |
WO2024037032A1 (en) | Account login method and electronic device | |
CN116980867A (en) | Data transmission method and electronic equipment | |
CN117714974A (en) | Positioning method, device, chip structure and storage medium based on Bluetooth transmission | |
CN115314427A (en) | Protocol testing method, electronic equipment and chip system | |
CN113790732B (en) | Method and device for generating position information | |
WO2023274026A1 (en) | Interaction method and apparatus for electronic device | |
CN117119077B (en) | Communication method and electronic equipment | |
CN113790733B (en) | Navigation method and device | |
WO2023160217A1 (en) | Method for detecting embedded subscriber identity module (esim) card, and terminal device | |
CN118264709A (en) | Service discovery method and electronic equipment | |
CN118227222A (en) | Application management method, server, electronic equipment and system | |
CN115914985A (en) | Device searching method, electronic device and system | |
CN117640717A (en) | Equipment connection method and equipment | |
CN117632534A (en) | Inter-process communication method and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |