CN115309253A - Method, device, terminal and storage medium for acquiring positioning data - Google Patents

Method, device, terminal and storage medium for acquiring positioning data Download PDF

Info

Publication number
CN115309253A
CN115309253A CN202110501640.0A CN202110501640A CN115309253A CN 115309253 A CN115309253 A CN 115309253A CN 202110501640 A CN202110501640 A CN 202110501640A CN 115309253 A CN115309253 A CN 115309253A
Authority
CN
China
Prior art keywords
operating system
positioning
data
instruction
positioning data
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
Application number
CN202110501640.0A
Other languages
Chinese (zh)
Inventor
胡帅
薛成飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110501640.0A priority Critical patent/CN115309253A/en
Priority to PCT/CN2022/084295 priority patent/WO2022237371A1/en
Publication of CN115309253A publication Critical patent/CN115309253A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/1613Constructional details or arrangements for portable computers
    • G06F1/163Wearable computers, e.g. on a belt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3293Power saving characterised by the action undertaken by switching to a less power-consuming processor, e.g. sub-CPU

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

The embodiment of the application discloses a method, a device, a terminal and a storage medium for acquiring positioning data, and belongs to the technical field of computers. The terminal applied to the application is provided with two processors, a first operating system is arranged in a first processor, a second operating system is arranged in a second processor and is provided with a positioning chip in a hanging mode, the power consumption of the second processor is lower than that of the first processor, a first acquisition request in the first operating system is responded, the first acquisition request is sent to the second operating system through the first operating system and is used for acquiring positioning data, in the second operating system, the terminal acquires the positioning data from the positioning chip according to the first acquisition request and feeds the positioning data back to the first operating system from the second operating system, the terminal can acquire the positioning data through the processor with lower power consumption, and the power consumption of the terminal in acquiring the positioning data is reduced.

Description

Method, device, terminal and storage medium for acquiring positioning data
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, a device, a terminal and a storage medium for acquiring positioning data.
Background
With the increasing abundance of functions of wearable devices, the positioning function gradually becomes the standard configuration of the wearable devices. The wearable positioning data is acquired from the positioning chip through the processor.
In the related art, when the wearable device acquires the positioning data in real time, the operating system needs to run continuously. That is, a processor running the operating system needs to continuously maintain an awake state to acquire the positioning data in real time, which results in a large power consumption of the wearable device when acquiring the positioning data.
Disclosure of Invention
The embodiment of the application provides a method, a device, a terminal and a storage medium for acquiring positioning data. The technical scheme is as follows:
according to an aspect of the present application, there is provided a method applied in a terminal, where the terminal includes a first processor and a second processor, the first processor has a first operating system running therein, the second processor has a second operating system running therein and a positioning chip is mounted therein, and power consumption of the second processor is lower than that of the first processor, and the method includes:
responding to a first acquisition request generated in the first operating system, and sending the first acquisition request to the second operating system through the first operating system, wherein the first acquisition request is used for requesting to acquire positioning data;
in the second operating system, acquiring the positioning data from the positioning chip according to the first acquisition request;
and feeding back the positioning data to the first operating system from the second operating system.
According to another aspect of the present application, there is provided an apparatus for acquiring positioning data, the apparatus is applied in a terminal, the terminal includes a first processor and a second processor, the first processor runs a first operating system therein, the second processor runs a second operating system therein and a positioning chip is mounted thereon, the power consumption of the second processor is lower than that of the first processor, the apparatus includes:
a first generating module, configured to send, in response to a first obtaining request generated in the first operating system, the first obtaining request to the second operating system through the first operating system, where the first obtaining request is used to request to obtain positioning data;
an obtaining module, configured to obtain, in the second operating system, the positioning data from the positioning chip according to the first obtaining request;
a feedback module for feeding back the positioning data from the second operating system to the first operating system.
According to another aspect of the present application, there is provided a terminal comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method for acquiring positioning data as provided in the embodiments of the present application.
According to another aspect of the present application, there is provided a computer-readable storage medium having at least one instruction stored therein, the instruction being loaded and executed by a processor to implement the method for acquiring positioning data as provided in the embodiments of the present application.
According to one aspect of the present application, a computer program product is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the method for acquiring positioning data provided in the various alternative implementations of the computer device.
The method and the device can be applied to a terminal comprising two processors, a first operating system runs in a first processor, a second operating system runs in a second processor, and a positioning chip is hung on the second processor, the power consumption of the second processor is lower than that of the first processor, a first acquisition request in the first operating system is responded, the first acquisition request is sent to the second operating system through the first operating system and is used for acquiring positioning data, the positioning data is acquired from the positioning chip according to the first acquisition request in the second operating system, and the positioning data is fed back to the first operating system from the second operating system, so that the terminal can acquire the positioning data through the processor with lower power consumption, and the power consumption of the terminal in acquiring the positioning data is reduced.
Drawings
In order to more clearly describe the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a block diagram of a terminal according to an exemplary embodiment of the present application;
fig. 2 is a flowchart of a method for acquiring positioning data according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart of a method for acquiring positioning data according to another exemplary embodiment of the present application;
FIG. 4 is a block diagram of a first operating system to which the present application relates;
fig. 5 is a schematic structural diagram of a second operating system according to an embodiment of the present application;
FIG. 6 is a block diagram of a system for acquiring positioning data according to an embodiment of the present disclosure;
FIG. 7 is a flowchart of a method for obtaining positioning data according to an exemplary embodiment of the present application;
fig. 8 is a flowchart of stopping acquiring positioning data according to the embodiment shown in fig. 7;
fig. 9 is a block diagram illustrating an apparatus for acquiring positioning data according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present application, it should be noted that, unless explicitly stated or limited otherwise, the terms "connected" and "connected" are to be interpreted broadly, e.g., as being fixed or detachable or integrally connected; can be mechanically or electrically connected; may be directly connected or indirectly connected through an intermediate. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. In addition, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
As used herein, the term "if" is optionally interpreted as "when.. Times", "at … …", "in response to a determination", or "in response to a detection", depending on the context. Similarly, the phrase "if it is determined … …" or "if (a stated condition or event) is detected" or "in response to detecting (a stated condition or event)" depending on the context.
It is noted that the use of personally identifiable information should follow privacy policies and practices that are recognized as meeting or exceeding industry or government requirements for maintaining user privacy. In particular, personally identifiable information should explicitly specify to the user the nature of authorized use during administration and processing to minimize the risk of inadvertent or unauthorized access or use.
In order to make the solution shown in the embodiments of the present application easy to understand, several terms appearing in the embodiments of the present application will be described below.
A dormant state: the method is used for indicating that the operating system is in a low-power online working state. In one possible approach, the state of the operating system includes a run state for power-up and an offline state for power-down. The operating states of the operating system include a wake state and a sleep state. When the operating system is in the sleep state, the processor running the operating system can also be in the sleep state.
And (3) awakening state: indicating that the operating system is in a normal operating state with relatively high power consumption. In the wake state, the operating system can respond to various application requests and control various hardware according to the application requests to realize the application functions of the response. While the operating system is in the wake state, the process running the operating system may also be in the wake state.
Wherein the operating system is capable of switching from a sleep state to a wake state. Likewise, the operating system can also switch from the awake state to the sleep state.
Illustratively, in the present application, a first operating system runs in the first processor, and a second operating system runs in the second processor. Thus, for the first operating system. When the first operating system is switched from the sleep state to the wake state, the first processor is also switched from the sleep state to the wake state along with the state switching of the first operating system. When the first operating system is switched from the wake state to the sleep state, the first processor is also switched from the wake state to the sleep state along with the state switching of the first operating system.
It should be noted that, the power consumption of the second processor per unit time is smaller than the power consumption of the first processor per unit time. Therefore, the positioning chip is mounted in the second processor, and the second processor is made to interact with the positioning chip, so that the terminal can acquire the positioning data with less energy expenditure.
For example, the method for acquiring positioning data shown in the embodiment of the present application may be applied to a terminal, where the terminal includes at least two processors, a first processor and a second processor, and a first operating system is run in the first processor and a second operating system is run in the second processor. The terminal can comprise a mobile phone, an intelligent bracelet, intelligent glasses, an intelligent watch, a digital camera, an MP4 player terminal, an MP5 player terminal, a learning machine, a point-reading machine, an electronic book, an electronic dictionary or a vehicle-mounted terminal and other equipment.
Referring to fig. 1, fig. 1 is a block diagram of a terminal according to an exemplary embodiment of the present application, and as shown in fig. 1, the terminal includes a first processor 121, a second processor 122, a memory 140, and a positioning chip 160, where the memory 140 stores at least one instruction, and the instruction is loaded and executed by the first processor 121, or is loaded and executed by the second processor 122 to implement a method for acquiring positioning data according to various method embodiments of the present application.
Alternatively, the various components described above may communicate via a bus 150, enabling signal communication between the components.
In the present application, the terminal 100 is an electronic device having a function of acquiring positioning data. When the first operating system is executed by the first processor 121 in the terminal 100, the terminal 100 can generate a first obtaining request through the first operating system, where the first obtaining request is used for requesting to obtain the positioning data. After the first acquisition request is generated, the terminal can send the first acquisition request to the second operating system through the first operating system. And in the second operating system, the terminal acquires the positioning data from the positioning chip according to the first acquisition request. Subsequently, the terminal feeds back the positioning data from the second operating system to the first operating system.
The power consumption of the first processor 121 per unit time is lower than that of the second processor 122 per unit time.
In a first possible implementation manner, the first processor 121 can load a first operating system with a complex function. For example, the first operating system loaded by the first processor 121 may be an Android (english: android) operating system with rich functions, a mobile operating system developed based on linux, or an operating system developed based on Android depth.
In another possible implementation, the second processor 122 can host a second operating system with simpler functions. For example, the second operating system loaded by the second processor 122 may be an MCU (micro controller Unit) operating system. Alternatively, the second operating system may be another embedded operating system.
It should be noted that the first processor 121 and the second processor 122 have similar parts in hardware structure and operation logic. In the following description, the first processor 121 and the second processor 122 are collectively described as a processor.
A processor may include one or more processing cores. When the processor includes a plurality of processor cores, the number of processor cores may be 2, 3, 4, 6, 8, or the like. The processor connects various parts within the overall terminal 100 using various interfaces and lines, performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 140, and calling data stored in the memory 140. Alternatively, the processor may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is to be understood that the modem may be implemented by a single chip without being integrated into the processor. When the modem is implemented separately, the modem is connected to the processor via a bus or other cable.
The Memory 140 may include a Random Access Memory (RAM) or a Read-Only Memory (ROM). Optionally, the memory 140 includes a non-transitory computer-readable medium. The memory 140 may be used to store instructions, programs, code sets, or instruction sets. The memory 140 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, or an image playing function), instructions for implementing various method embodiments for acquiring positioning data shown in the present application, and the like; the storage data area may store data and the like involved in the following embodiments of the method of acquiring positioning data.
The positioning chip 160 may be used to acquire positioning data from navigation satellites.
Referring to fig. 2, fig. 2 is a flowchart of a method for obtaining positioning data according to an exemplary embodiment of the present application. The method for acquiring the positioning data can be applied to the terminal shown in fig. 1, where the terminal includes a first processor and a second processor, the first processor runs a first operating system, the second processor runs a second operating system, and a positioning chip is mounted in the second processor. In fig. 2, the method for acquiring the positioning data includes:
step 210, in response to a first obtaining request generated in the first operating system, sending the first obtaining request to the second operating system through the first operating system, where the first obtaining request is used to request to obtain the positioning data.
In the embodiment of the application, at least two processors are arranged in the terminal. It should be noted that each processor in the terminal can run an operating system. The terminal shown in the present application comprises at least a first processor and a second processor. Wherein the first processor runs a first operating system supporting more complex functions and the second processor runs a second operating system supporting more simple functions.
In one possible implementation, the first operating system may be a Linux kernel-based operating system, such as an Android (Android) system or an Android depth-based custom developed operating system. It should be noted that the first operating system may vary from manufacturer to manufacturer of the terminal. For example, when the terminal is a device produced by a manufacturer a, the terminal may be pre-embedded with an a operating system provided by the manufacturer a and developed based on android depth customization. When the terminal is a device produced by an H manufacturer, an H operating system which is provided by the H manufacturer and developed based on android depth customization can be pre-built in the terminal. When the terminal is a device produced by an M manufacturer, the terminal can pre-store an M operating system which is customized and developed by the M manufacturer based on android depth. When the terminal is a device produced by an S manufacturer, an S operating system customized and developed by the S manufacturer based on the android depth can be pre-built in the terminal. When the terminal is a device produced by a V manufacturer, the terminal can pre-customize and develop a V operating system based on android depth by the content V manufacturer.
It should be noted that the preset manner of the first operating system is only one possible application scenario of the present application. In another possible application, the first operating system of the terminal is an operating system installed in the terminal at the time of a post-maintenance update. For example, after the terminal performs a flush or ROM operation, an operating system different from that installed at the time of factory shipment can be installed in the terminal.
In this application, the first obtaining request is used to request to obtain the positioning data. The generator of the first get request is an application in the first operating system.
Illustratively, the application may be any one of a mapping application, a health application, an athletic application, a social application, a group purchase application, a take-away application, a taxi application, or a video application. It should be noted that the above-mentioned applications are only examples, and any application capable of acquiring positioning data can be used as the application shown in the present application.
In the application, after the first obtaining request is generated in the application program, the application program calls an interface provided by the first operating system, so that the first operating system obtains the first obtaining request. After the first operating system acquires the first acquisition request, the first operating system sends the first acquisition request to the second operating system from the first operating system. In the present application, a pre-designed information transfer channel is provided between the first operating system and the second operating system. Correspondingly, an information transmission channel is also arranged between the first processor based on the first operating system and the second processor based on the second operating system on the hardware bottom layer. In one possible approach, the first processor and the second processor communicate with each other through a Serial Peripheral Interface (SPI).
Optionally, the terminal may instruct the first operating system to switch to the sleep state.
In this application, the running state of the first operating system when being powered on may include a sleep state and an awake state, and when the first operating system acquires the first acquisition request from the application program, the first operating system is in the awake state. After the terminal sends the first acquisition request from the first operating system to the second operating system, the terminal can switch the first operating system from the wake-up state to the sleep state.
Illustratively, when a first operating system enters a sleep state, a first processor supporting the first operating system will also enter the sleep state. The energy consumption of the first processor in the sleep state will be less than the energy consumption of the first processor in the wake state.
Optionally, the power consumption parameters of the first processor and the second processor in different states can be referred to in table one.
Figure BDA0003056605890000081
Watch 1
The data in Table one is now presented. Wherein the power consumption of the first processor in the sleep state is P11, the power consumption of the first processor in the wake-up state is P12, the power consumption of the second processor in the sleep state is P21, and the power consumption of the second processor in the wake-up state is P22.
Illustratively, in the solution provided by the present application, the following inequality will be satisfied, where P11+ P22 ≦ P12+ P21.
In the related art, if the first processor, the second processor, and the positioning chip in the same terminal are used and the positioning chip is mounted on the first processor, the power consumption for acquiring the positioning data is P12+ P21. On the other hand, the power consumption of the embodiment of the present application in acquiring the positioning data is P11+ P22. The scheme provided by the application can satisfy the inequality P11+ P22 which is not more than P12+ P21. Therefore, when the terminal adopts the scheme that the positioning chip is mounted in the second processor, the terminal can reduce the power consumption of the terminal when the terminal acquires the positioning data.
Step 220, in the second operating system, obtaining the positioning data from the positioning chip according to the first obtaining request.
In this embodiment of the application, the terminal can acquire the positioning data from the positioning chip in the second operating system according to the first acquisition request. It should be noted that the second operating system is a system running on the second processor. The second processor is directly connected with the positioning chip through pins. Therefore, a hardware basis for information interaction is provided between the first processor and the positioning chip. On the basis, the second processor can obtain corresponding positioning data through signal interaction with the positioning chip.
In one possible implementation, the positioning data may be provided by a navigation satellite system. The Navigation Satellite System includes a BDS (BeiDou Navigation Satellite System, beiDou System), a GPS (Global Positioning System), a GLONASS (Global Navigation Satellite SATELLITE SYSTEM, global Satellite Navigation System), and a Galileo Satellite Navigation System (Galileo Navigation Satellite System).
In another possible implementation, the positioning data may also be provided by a network positioning device or wifi positioning device.
In step 230, the positioning data is fed back from the second operating system to the first operating system.
In the application, the terminal can feed back the positioning data to the first operating system from the second operating system, so that the first operating system can acquire the corresponding positioning data after entering the awakening state.
Optionally, the terminal can further instruct the first operating system to switch from the sleep state to the wake state, and then feed back the positioning data from the second operating system to the first operating system. Based on the method for acquiring the positioning data provided by the application, the first operating system can further enter the dormant state only after sending the first acquisition request to the second operating system. And then, after the second operating system successfully acquires the positioning data, the first operating system wakes up again so as to acquire the feedback positioning data.
In summary, the method for acquiring positioning data provided in this embodiment can be applied to a terminal including two processors, where a first operating system runs in a first processor, a second operating system runs in a second processor, and a positioning chip is mounted on the second processor, and power consumption of the second processor is lower than that of the first processor, and in response to a first acquisition request in the first operating system, the first operating system sends a first acquisition request to the second operating system, where the first acquisition request is used to acquire positioning data.
Based on the scheme disclosed in the previous embodiment, the terminal can also design an information interaction logic between the first operating system and the second operating system from the operating system level, so that the power consumption of the terminal when the terminal acquires the positioning data is reduced. Please refer to the following examples.
Referring to fig. 3, fig. 3 is a flowchart of a method for acquiring positioning data according to another exemplary embodiment of the present application. The method for acquiring positioning data can be applied to the terminal shown above. In fig. 3, the method for acquiring positioning data includes:
step 301, in response to a first obtaining request generated in a first operating system, generating a corresponding first intermediate instruction through the first operating system, where a data format of the first intermediate instruction can be analyzed in a second operating system.
In this application, please refer to fig. 4, where fig. 4 is a schematic structural diagram of a first operating system related to the present application. In fig. 4, the first operating system 400 may include an Application (APP) Layer 410, a Framework (Framework) Layer 420, a Java Native Interface (Java Native Interface) Layer 430, a HAL (Hardware Abstraction Layer) 440, and a Kernel Layer (Kernel) 450.
In the application layer 410, a location manager (location manager) is included. It should be noted that the location manager directly responds to the request of the application program to acquire the positioning data, and generates the first acquisition request shown in the embodiment of the present application. Illustratively, a location manager is a class that is used to obtain and invoke location services.
In this example, the application layer 410 and the framework layer 420 may communicate via a binder data channel.
In the framework layer 420, a Location Manager Service (Location Manager Service) 421 obtains corresponding Location data through three branches. The Location manager service 421 is connected to a first third party Location (third party APK) module 423 through a Location Provider Proxy (Location Provider Proxy) 422, and has the capability of obtaining Location data from the third party Location module.
On the other hand, the location manager service 421 can also obtain satellite navigation data through a global navigation satellite system location provider 424 (gnsslocationprovider. Java), and further determine the satellite navigation data as positioning data.
In yet another aspect, the location manager service 421 can also be coupled to a second third party position (third part APK) module 426 via a geocoderpropy (geocodeproxy) 425. The location manager service 421 has the ability to obtain location data from third party location modules. In one possible implementation application scenario, the geocoder agent 425 is used to implement the functionality of an electronic fence.
In the following embodiments, a procedure for obtaining positioning data by a navigation satellite is described.
In this example, a global navigation satellite system location provider 424 in the framework layer 420 is connected to a Java native interface layer 430. The Java native interface layer 430 is provided with a C + + file for converting Java-type instructions into C + + type files so that subsequent hierarchies can understand the meaning of upper-layer instructions.
Illustratively, the C + + files in the present application may be named or selected autonomously as needed. The C + + file may be com _ android _ server _ location _ gnsslocationprovider. Cpp (JNI (lib)). In the present application, communication between the Java native interface layer 430 and the hardware abstraction layer 440 is via a hwbinder connection.
In the hardware abstraction layer 440, a file written for the positioning chip is provided, and the processed information of the file can be analyzed by the second operating system and can be identified by the positioning chip. Illustratively, the first intermediate instruction may be generated in the hardware abstraction layer 440.
In this example, the hardware abstraction layer 440 and the kernel layer 450 transfer data to each other via the IO interface.
The kernel layer 450 may continue to process the first intermediate instruction by specifying the kernel file, and send the processed first intermediate instruction to the second operating system.
Step 302, sending the first intermediate instruction to a second operating system through the first operating system.
In one possible implementation, the first operating system and the second operating system communicate with each other through the SPI.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a second operating system according to an embodiment of the present disclosure. In fig. 5, a routing task 510 and a positioning main task 520 are included in the second operating system 500. Wherein, the routing task 510 receives the first intermediate instruction sent by the first operating system and forwards the first intermediate instruction to the positioning main task 520. The positioning main task 520 is used for acquiring positioning data from the positioning chip.
Referring to fig. 6, fig. 6 is a schematic diagram of a system framework for acquiring positioning data according to an embodiment of the present disclosure. A first operating system runs on the first processor 610 and a second operating system runs on the second processor 620. In this example, the first Processor 610 may be an Application Processor (AP), and the second Processor 620 may be an MCU (Microcontroller Unit). The navigation data acquisition module 630 is mounted on the second processor 620.
Step 303, instruct the first operating system to switch to the sleep state.
In this example, after the first intermediate instruction is sent from the first operating system to the second operating system, the terminal can instruct the first operating system to switch from the awake state to the sleep state. Wherein the switching action may be an operation autonomously performed by the first operating system after sending the first intermediate instruction. Alternatively, the switching action may be an operation performed by the first operating system after sending the first intermediate instruction to the second operating system and receiving the confirmation message fed back by the second operating system.
In the second operating system, a positioning data acquisition instruction matching the first intermediate instruction is determined, step 304.
In this example, when the first intermediate instruction is transmitted to the second operating system, the terminal is able to determine a positioning data acquisition instruction that matches the first intermediate instruction. It should be noted that the positioning data acquiring instruction is an instruction that can be recognized by the positioning chip and perform a corresponding operation. Optionally, the second operating system may maintain a corresponding relationship between the first intermediate instruction and the positioning data obtaining instruction. Illustratively, the second table shows a corresponding relationship between the first intermediate instruction and the positioning data obtaining instruction.
Figure BDA0003056605890000121
Watch two
In a possible manner, the correspondence relationship may be stored in advance in the second operating system. For example, when the first intermediate instruction received by the second operating system is z3, the second operating system can determine that the corresponding positioning data acquisition instruction is positioning data acquisition instruction d3.
And step 305, acquiring positioning data from the positioning chip according to the positioning data acquisition instruction.
In this embodiment of the application, the second operating system can send the positioning data obtaining instruction to the positioning chip. Correspondingly, the positioning chip obtains corresponding positioning data after communicating with the navigation satellite through the antenna under the instruction of the positioning data obtaining instruction.
Step 306, instruct the first operating system to switch to the wake-up state, and feed back the positioning data from the second operating system to the first operating system.
In the application, after the second operating system acquires the positioning data, the terminal can instruct the first operating system to switch from the sleep state to the wake state. The first operating system can normally interact information with an external device in the awakening state. Therefore, the first operating system has the capability of acquiring the positioning data from the second operating system after waking up. When the second operating system transmits the positioning data to the first operating system, the first operating system can normally acquire the positioning data.
In one possible implementation, the instruction for instructing the first operating system to switch from the sleep state to the wake state may be issued from the second operating system. The first operating system in the sleep state is capable of switching from the sleep state to the wake state upon receiving an instruction to switch from the sleep state to the wake state.
In another possible implementation manner, the instruction for instructing the first operating system to switch from the sleep state to the wake state may be a preset periodic instruction in the first operating system. After the first os completes a sleep cycle, the first os may automatically switch from the sleep state to the wake state according to the periodic instruction.
And when the first operating system is switched to the awakening state, the positioning data can be acquired from the second operating system. Subsequently, the first operating system can feed back the positioning data to the specific application program requesting the positioning data, so as to ensure the normal operation of the application program in the first operating system.
In summary, the method provided in this embodiment can transmit the first intermediate instruction layer by layer in the first operating system having multiple system levels, so that the intention that the first operating system needs to acquire the positioning data is correctly transmitted to the second operating system, and the second operating system acquires the positioning data from the positioning chip mounted on the second processor according to the corresponding instruction. Because the first operating system only needs to send the intention of acquiring the positioning data and awakens to receive the positioning data after the second operating system program acquires the positioning data, the first processor with higher power consumption is in a dormant state in the period of acquiring the positioning data, but the second processor with lower power consumption acquires the positioning data, and the effect of acquiring the positioning data with lower power consumption is realized.
Based on the method shown in the foregoing embodiment, an embodiment of the present application further provides a method for acquiring positioning data, which can improve the efficiency of acquiring positioning data in the second operating system.
Referring to fig. 7, fig. 7 is a flowchart of a method for acquiring positioning data according to an exemplary embodiment of the present application. The method for acquiring the positioning data can be applied to the terminal shown above. In fig. 7, the method for acquiring positioning data includes:
step 701, responding to an obtaining request generated by a data request object in a first operating system, and generating a first intermediate instruction corresponding to the obtaining request through a self-defined executable file.
Wherein the executable file is a file written based on a hardware specification of the positioning chip. It should be noted that the data request object may be an application program or a process of an application layer. After the acquisition request is generated from the application layer, the acquisition request can pass through the framework layer and the Java local interface layer by layer until the acquisition request is transmitted to the hardware abstraction layer. In order to focus on the description of the interaction process of the present solution in the second operating system, the information transfer process of the acquisition request in the application layer, the framework layer and the Java native interface layer in the first operating system is not shown in fig. 7.
In a possible implementation manner, a software designer in the terminal knows the model of the adaptive positioning chip in the terminal in advance, and the designer writes a corresponding executable file according to the model of the positioning chip required to be used. Illustratively, one possible naming for the executable file may be android.
In another possible implementation, a software designer in the terminal will pre-program multiple executable files, so that the operating system can have the capability of adapting to multiple positioning chips at initialization time. In this implementation, if there are multiple kinds of preset executable files in the first operating system, it is not necessary to frequently replace the preloaded first operating system due to different used positioning chips when the terminal device is produced.
For example, if three files, namely an executable file D1, an executable file D2, and an executable file D3, are pre-programmed in the terminal, the terminal displays the chip model installed in the terminal on a display screen when the terminal is first started on a production line. And when the inspector selects the corresponding model, the terminal restarts and loads the corresponding executable file. Optionally, to avoid subsequent execution logic errors, the terminal may delete the executable files that are not selected. Optionally, in some possible scenarios, the terminal can also automatically identify an executable file that needs to be run in the process of automatic loading, and delete the remaining executable files that are not needed.
For example, executable file D1 corresponds to positioning chip L1, executable file D2 corresponds to positioning chip L2, and executable file D3 corresponds to positioning chip L3. When the inspector determines that the positioning chip L2 is mounted in the terminal, the positioning chip L2 is selected in the terminal screen. At this point, the terminal has restarted, determines executable file D2 as the component for acquiring the positioning data, and deletes executable file D1 and executable file D3 accordingly.
Step 702, a first intermediate instruction is sent from a hardware abstraction layer where an executable file is located to a kernel layer.
The hardware abstraction layer and the kernel layer belong to a first operating system.
In this application, the first intermediate instruction, after being generated, can be transferred by the terminal into the next level in the first operating system. In the transmission process, the terminal can send the first intermediate instruction to the kernel layer from the hardware abstraction layer.
It should be noted that the hardware abstraction layer and the kernel layer belong to the same operating system. In the embodiment of the application, the hardware abstraction layer and the kernel layer belong to the first operating system.
Step 703, the first intermediate instruction is transmitted from the kernel layer to the routing task through the first data channel.
Wherein the routing task belongs to the second operating system.
In this application, the first intermediate instruction is intended to instruct the second operating system to acquire the corresponding positioning data through interaction with the positioning chip. Thus, the first intermediate instruction currently located in the kernel layer will be further transmitted by the kernel layer to the routing task via the first data channel. Wherein the routing task is a task belonging to the second operating system.
Step 704, obtain the object id of the data request object in the first intermediate instruction.
It should be noted that the data request object may be any one of an application program, a process, or a service in the first operating system.
In the application, the terminal can obtain the object identifier of the data request object in the first intermediate instruction through the second operating system. It should be noted that, in the current step, the first intermediate instruction remains in the routing task. Thus, the terminal may instruct the routing task to retrieve the object identification of the data request object from the first intermediate instruction.
Step 705, according to the object identifier, forwarding the first intermediate instruction to the positioning main task through the routing task.
Wherein the positioning main task belongs to the second operating system.
In this example, the terminal can determine the destination to which it needs to be forwarded based on the object identification. When the terminal determines that the first intermediate instruction needs to be forwarded to the positioning master task, the terminal will be able to forward the first intermediate instruction to the positioning master task through the routing task.
Step 706, register the first callback function in the second operating system by locating the primary task.
The first callback function is used for feeding back the positioning data to the data request object.
In this example, the terminal is able to register the first callback function in the second operating system by locating the primary task. The first callback function is mainly used for feeding back data to a data request object requesting positioning data. Therefore, the terminal will register the first callback function in the positioning main task in advance.
And step 707, determining a positioning data acquisition instruction matched with the first intermediate instruction from the positioning instruction library through the positioning main task.
In this example, the terminal can determine, by the positioning main task, a positioning data acquisition instruction matching the first intermediate instruction from the positioning instruction library. Wherein the positioning instruction base may be a database maintained in the second operating system. Alternatively, the positioning instruction library may not have a specific file or a data set including corresponding data, and may only consist of a plurality of instructions recorded by the second operating system.
And step 708, instructing the positioning main task to call the serial communication interface, and sending a positioning data acquisition instruction to the positioning chip.
In the present application, the positioning master task has the capability of communicating with the positioning chip. The positioning main task can call the serial communication interface under the instruction of the terminal, or the positioning main task can call the serial communication interface under the control of the second operating system, and sends a positioning data acquisition instruction to the positioning chip. In one possible approach, the serial communication interface is a hardware interface that connects the positioning chip to the second processor. Therefore, a data line for transmitting data from the positioning chip to the second processor is also included in the serial communication interface.
And step 709, responding to the first data sent by the positioning chip to the serial communication interface, receiving the positioning data in an interrupt mode provided by the target interrupt task, and generating an interrupt service.
In this application, the first data sent by the positioning chip to the serial communication interface includes a plurality of data types. Wherein the data type comprises a feedback signal or positioning data.
The positioning data is positioning standard data fed back by the positioning chip based on the positioning data acquisition instruction, and the target interrupt task is used for providing interrupt for the serial communication receiving interface.
In this example, the targeted interrupt task in the second operating system can be used to receive positioning data. When the target interrupt task needs to acquire the positioning data, the target interrupt task provides an interrupt for the serial communication receiving interface, so that the positioning data is acquired.
In this example, the terminal can generate an interrupt service routine by targeting the interrupt task in response to receiving the positioning data.
After the second operating system acquires the positioning data, the second operating system can generate an interrupt service program by indicating a target interrupt task for subsequent operation.
Step 710, pushing a second callback function to the event task based on the interrupt service routine.
On the premise that the interrupt service program is generated in the preceding step, the terminal can push a second callback function to the event task based on the interrupt service in the second operating system. It should be noted that the second callback function has the capability of detecting the integrity of the positioning data.
Step 711, instruct the event task to detect the integrity of the first data based on the second callback function.
In this example, the second operating system can instruct the event task to detect the integrity of the first data based on the second callback function. The first data comprises positioning data or a feedback signal. It should be noted that, when the first data is the positioning data and the positioning data is not complete, the terminal may not be able to obtain the data reflecting the real-world position from the positioning data. When the first data is the feedback signal and the feedback signal is incomplete, the terminal may not be able to determine whether the current positioning process is completed from the feedback signal.
In the present application, if the positioning data is complete, the positioning data can reflect the position in the real world.
In response to the first data being complete data, a data type contained in the first data is detected, step 712.
The terminal can execute corresponding processing according to the data type to complete the flow of acquiring the positioning data. In one possible approach, if the data type is a feedback signal, the second processor can know whether the current process of acquiring the positioning data has ended. In another possible manner, if the data type is positioning data, this means that the process of acquiring the positioning data is completed.
In response to the data type being the positioning data, the event task is instructed to feed back the positioning data to the first operating system through the first callback function, step 721.
In another implementation solution provided in the present application, the second operating system can acquire the positioning data for the present system through a sensor task (sensor task). In the actual implementation process, the sensor task is used for registering a third callback function, and the third callback function is used for sending positioning data to the specified object through the second data channel when being called.
It should be noted that the designated object belongs to the first operating system. And meanwhile, the sensor task is also used for registering a fourth callback function, and the fourth callback function is used for sending positioning data to the object in the second operating system when being called.
In another possible implementation manner of the present application, after the first operating system acquires the positioning data, the first operating system can further issue a stop instruction to the second operating system to instruct the second operating system to stop acquiring the positioning data from the positioning chip.
Optionally, a feedback mechanism is further provided in the present application, so that the second operating system can know whether the positioning chip successfully receives the positioning data obtaining instruction. As an alternative to step 721, the terminal may also perform steps (a 1) and (a 2).
And (a 1) in response to the data type being the feedback signal, indicating the event task to send the feedback signal to the positioning main task through the second callback function.
In this example, the event task included in the second operating system sends feedback information to the positioning main task through the second callback function.
And (a 2) in response to the positioning main task receiving the feedback signal, instructing the positioning main task to stop retransmitting the positioning data acquisition instruction to the positioning chip.
In this example, in response to the positioning master task receiving the feedback signal, the terminal instructs the positioning master task to stop retransmitting the positioning data acquisition instruction to the positioning chip. It should be noted that the feedback signal is used to indicate that the positioning chip has successfully received the positioning data acquisition instruction.
In summary, the method for acquiring the positioning data provided by the present application can acquire the positioning data from the positioning chip through the interaction between the positioning main task and the positioning chip in the second operating system. After the corresponding interactive process is finished, the event task in the second operating system can feed back positioning data to the first operating system through the pre-registered callback function. Because the second operating system provides a complete information control flow, the second operating system can smoothly acquire the positioning data in the positioning chip and feed back the positioning data to the first operating system, and the stability of acquiring the positioning data by the second operating system is improved on the premise of reducing the power consumption of the terminal when acquiring the positioning data.
Optionally, the second operating system can also acquire the positioning data from the positioning chip through the target interrupt task, and know whether the positioning chip has received the first acquisition request through a feedback mechanism. After the positioning chip has acquired the first acquisition request, the positioning main task in the second operating system does not retransmit the first acquisition request to the positioning chip any more, so that the power consumption of the second operating system is saved.
Referring to fig. 8, fig. 8 is a flowchart of stopping acquiring positioning data according to the embodiment shown in fig. 7. In fig. 8, the flow of stopping acquiring the positioning data may be executed after the first operating system successfully acquires the lower data. In one possible implementation, the terminal can execute step 801 after step 721 shown in fig. 7, and in fig. 8, the execution procedure of each step is as follows:
step 801, in response to a stop request generated in the first operating system, generates a corresponding second intermediate instruction.
The stop request is used for requesting to stop obtaining the positioning data, and the stop request may carry an identifier of the data request object.
In this application, the stop request is a request generated by an application in the first operating system. In one possible approach, the application generates a stop request and notifies the first operating system when the application acquiring the positioning data in the first operating system is closed or exited. After acquiring the stop request, the first operating system can generate a corresponding second intermediate instruction according to the stop request.
In one possible approach, the first operating system generates a second intermediate instruction in the hardware abstraction layer.
Step 802, a second intermediate instruction is sent from the first operating system to the second operating system.
In one possible approach, the first operating system in the terminal can transmit the second intermediate instruction to the second operating system by means of cross-core communication. The transmission method of the second intermediate command is the same as the transmission method of the first intermediate command.
In the second operating system, a stop instruction matching the second intermediate instruction is determined, step 803.
In the present application, the second operating system is able to determine that the second intermediate instruction is a stop instruction that matches the second intermediate instruction. In one possible approach, the second intermediate instruction and the stop instruction have a matching relationship in the second operating system. In this scenario, the second operating system can determine a stop instruction that matches the second intermediate instruction according to the specified matching relationship.
And step 804, stopping acquiring the positioning data based on the stop instruction.
In one possible implementation manner of the present application, the present application can implement the process of stopping acquiring the positioning data by performing step (c 1), step (c 2), and step (c 3). Alternatively, the present application can implement the process of stopping acquiring the positioning data by performing step (c 1), step (c 2), and step (c 4).
And (c 1) indicating the positioning main task to receive a stop instruction.
In this application, the second operating system can instruct the positioning master task to receive a stop instruction.
And (c 2) indicating the positioning main task to cancel a first callback function corresponding to the data request object based on the stop instruction, wherein the first callback function is used for feeding back the positioning data to the data request object.
Optionally, after receiving the stop instruction, the positioning main task may be able to log out the first callback function corresponding to the data request object based on the stop instruction. The first callback function is used for feeding back the positioning data to the data request object.
And (c 3) responding to the positioning chip in the use state, and ending the process.
In this example, if the positioning chip is in the use state, it is described that another object is using the positioning chip in the terminal. Under the condition, the second operating system does not interfere with the state of the positioning chip any more, and the control flow is ended.
And (c 4) responding to the idle state of the positioning chip, and closing the positioning chip.
Optionally, if the positioning chip is in an idle state, the terminal may close the positioning chip in this scenario, so that the positioning chip is closed without continuously acquiring the positioning data, thereby saving energy of the terminal.
In a possible way of closing the positioning chip, the terminal can respond that the positioning chip is in an idle state, and close the positioning chip after delaying the target duration. Illustratively, the target time duration may be a fixed time duration such as 30 seconds, 40 seconds, 45 seconds, or 50 seconds, which is not limited in the embodiment of the present application.
According to the embodiment of the application, the target time length suitable for the delay specification can be selected according to the delay specification in the positioning chip. For example, if the delay specification of the positioning chip used in the terminal is 50 seconds, the target duration in the embodiment of the present application will be set to 50 seconds.
In a possible way of closing the positioning chip, the flow of closing the positioning chip is stopped in response to that the current system time is within the target time length and a positioning chip starting instruction is received. The positioning chip enabling instruction is used for enabling the positioning chip.
For example, if the target duration is 50 seconds, during the countdown of 50 seconds, if the second processor receives the positioning chip enable instruction for starting the positioning chip again, the second processor will stop the countdown and cancel the process of closing the positioning chip.
In summary, the method for acquiring positioning data provided in this embodiment can enable a terminal with dual operating systems to acquire positioning data through the operating systems that save energy consumption, and after the first operating system successfully acquires the positioning data, the effect of stopping the positioning chip from working is achieved by instructing the related program object in the second operating system, so that the positioning chip is timely turned off without working, thereby further saving electric energy and improving the endurance effect of the terminal.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 9, fig. 9 is a block diagram illustrating an apparatus for acquiring positioning data according to an exemplary embodiment of the present application. The means for acquiring positioning data may be implemented as all or part of the terminal in software, hardware or a combination of both. The terminal comprises a first processor and a second processor, wherein a first operating system runs in the first processor, a second operating system runs in the second processor, a positioning chip is hung in the second processor, and the power consumption of the second processor is lower than that of the first processor. The device includes:
a first generating module 910, configured to send, by a first operating system, a first obtaining request to a second operating system in response to the first obtaining request generated in the first operating system, where the first obtaining request is used to request to obtain positioning data;
an obtaining module 920, configured to obtain, in the second operating system, the positioning data from the positioning chip according to the first obtaining request;
a feedback module 930 configured to feed back the positioning data from the second operating system to the first operating system.
In an optional embodiment, the first generating module 910 is configured to generate, by the first operating system, a corresponding first intermediate instruction in response to the first obtaining request generated in the first operating system, where a data format of the first intermediate instruction can be parsed in the second operating system; sending the first intermediate instruction to the second operating system through the first operating system; the obtaining module 920 is configured to determine, in the second operating system, a positioning data obtaining instruction matched with the first intermediate instruction; and acquiring the positioning data from a positioning chip according to the positioning data acquisition instruction.
In an optional embodiment, the first generating module 910 is configured to generate, in response to the obtaining request generated by a data request object in the first operating system, the first intermediate instruction corresponding to the obtaining request through a customized executable file, where the executable file is a file written based on a hardware specification of the positioning chip.
In an alternative embodiment, the first generating module 910 is configured to send the first intermediate instruction from a hardware abstraction layer where the executable file is located to a kernel layer, where the hardware abstraction layer and the kernel layer belong to the first operating system; transmitting the first intermediate instruction from the kernel layer to a routing task through a first data channel, wherein the routing task belongs to the second operating system; the obtaining module 920 is configured to obtain an object identifier of the data request object in the first intermediate instruction; according to the object identifier, the first intermediate instruction is forwarded to a positioning main task through the routing task, and the positioning main task belongs to the second operating system; and determining the positioning data acquisition instruction matched with the first intermediate instruction from a positioning instruction library through the positioning main task.
In an optional embodiment, the apparatus further includes a registration module, configured to register a first callback function in the second operating system through the positioning host task, where the first callback function is used to feed back the positioning data to the data request object.
In an optional embodiment, the obtaining module 920 is configured to instruct the positioning task to call a serial communication interface, and send the positioning data obtaining instruction to the positioning chip; responding to the first data sent by the positioning chip to the serial communication interface, receiving the first data in an interrupt mode provided by a target interrupt task, wherein the first data comprises a feedback signal or the positioning data, the positioning data is positioning standard data fed back by the positioning chip based on the positioning data acquisition instruction, and the target interrupt task is used for providing interrupt for the serial communication receiving interface.
In an optional embodiment, the obtaining module 920 is configured to generate an interrupt service routine through the target interrupt task in response to the positioning chip sending the first data to the serial communication interface; pushing a second callback function to an event task based on the interrupt service program; instructing the event task to detect the integrity of the first data based on the second callback function; detecting a data type contained in the first data in response to the first data being complete data; and executing corresponding processing according to the data type to finish the flow of acquiring the positioning data.
In an optional embodiment, the obtaining module 920 is configured to instruct the event task to feed back the positioning data to the first operating system through the first callback function. Or, the obtaining module 920 is configured to, in response to that the data type is the feedback signal, instruct the event task to send the feedback signal to the positioning main task through a second callback function; and responding to the feedback signal received by the positioning main task, and indicating the positioning main task to stop retransmitting the positioning data acquisition instruction to the positioning chip.
In an optional embodiment, the second operating system to which the apparatus relates further comprises a sensor task, the sensor task is configured to register a third callback function, the third callback function is configured to send the positioning data to a specified object through a second data channel when called, and the specified object belongs to the first operating system; and/or the sensor task is used for registering a fourth callback function, and the fourth callback function is used for sending the positioning data to the object in the second operating system when being called.
In an optional embodiment, the obtaining module 920 is configured to instruct the first operating system to switch to a sleep state, and obtain, in the second operating system, the positioning data from the positioning chip according to the first obtaining request; a feedback module 930, configured to instruct the first operating system to switch to an awake state, and feed back the positioning data from the second operating system to the first operating system.
In an optional embodiment, the apparatus further comprises: the second generating module is used for responding to a stop request generated in the first operating system and generating a corresponding second intermediate instruction, wherein the stop request is used for requesting to stop acquiring the positioning data; the instruction sending module is used for sending the second intermediate instruction from the first operating system to the second operating system; the instruction determining module is used for determining a stopping instruction matched with the second intermediate instruction in the second operating system; and the first stopping module is used for stopping acquiring the positioning data based on the stopping instruction.
In an optional embodiment, the first stopping module is configured to instruct the positioning master task to receive the stopping instruction; instructing the positioning main task to log out a first callback function corresponding to the data request object based on the stop instruction, wherein the first callback function is used for feeding back the positioning data to the data request object; responding to the positioning chip in a use state, and ending the flow; and responding to the idle state of the positioning chip, and closing the positioning chip.
In an optional embodiment, the first stopping module is configured to, in response to that the positioning chip is in an idle state, delay a target duration and then turn off the positioning chip.
In an optional embodiment, the apparatus further includes a second stopping module, configured to stop the process of closing the positioning chip in response to that the current system time is within the target time length and a positioning chip enabling instruction is received, where the positioning chip enabling instruction is used to enable the positioning chip.
To sum up, the device for acquiring positioning data provided by the application can acquire the positioning data from the positioning chip through the interaction of the positioning main task and the positioning chip in the second operating system. After the corresponding interactive process is finished, the event task in the second operating system can feed back positioning data to the first operating system through the pre-registered callback function. Because the second operating system provides a complete information control flow, the second operating system can smoothly acquire the positioning data in the positioning chip and feed back the positioning data to the first operating system, and the stability of acquiring the positioning data by the second operating system is improved on the premise of reducing the power consumption of the terminal when acquiring the positioning data.
Optionally, the second operating system can also acquire the positioning data from the positioning chip through the target interrupt task, and know whether the positioning chip has received the first acquisition request through a feedback mechanism. After the positioning chip has acquired the first acquisition request, the positioning main task in the second operating system does not retransmit the first acquisition request to the positioning chip any more, so that the power consumption of the second operating system is saved.
The present application further provides a computer-readable medium, which stores at least one instruction, where the at least one instruction is loaded and executed by the processor to implement the method for acquiring positioning data according to the above embodiments.
It should be noted that: in the above embodiment, when the apparatus for acquiring positioning data executes the method for acquiring positioning data, only the division of the functional modules is taken as an example, in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for acquiring positioning data and the method for acquiring positioning data provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above description is only exemplary of the implementation of the present application and is not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (17)

1. A method for obtaining positioning data is applied to a terminal, the terminal includes a first processor and a second processor, a first operating system runs in the first processor, a second operating system runs in the second processor, a positioning chip is mounted in the second processor, and power consumption of the second processor is lower than that of the first processor, and the method includes:
responding to a first acquisition request generated in the first operating system, and sending the first acquisition request to the second operating system through the first operating system, wherein the first acquisition request is used for requesting to acquire positioning data;
in the second operating system, acquiring the positioning data from the positioning chip according to the first acquisition request;
feeding back the positioning data from the second operating system to the first operating system.
2. The method of claim 1, wherein sending, by the first operating system, the first get request to the second operating system in response to the first get request generated in the first operating system comprises:
responding to the first acquisition request generated in the first operating system, and generating a corresponding first intermediate instruction through the first operating system, wherein the data format of the first intermediate instruction can be analyzed in the second operating system;
sending the first intermediate instruction to the second operating system through the first operating system;
in the second operating system, acquiring the positioning data from the positioning chip according to the first acquisition request includes:
determining, in the second operating system, a positioning data acquisition instruction that matches the first intermediate instruction;
and acquiring the positioning data from a positioning chip according to the positioning data acquisition instruction.
3. The method of claim 2, wherein generating, by the first operating system, a corresponding first intermediate instruction in response to the first get request generated in the first operating system comprises:
responding to the acquisition request generated by a data request object in the first operating system, and generating the first intermediate instruction corresponding to the acquisition request through a self-defined executable file, wherein the executable file is a file written based on the hardware specification of the positioning chip.
4. The method of claim 3, wherein sending the first intermediate instruction to the second operating system via the first operating system comprises:
sending the first intermediate instruction to a kernel layer from a hardware abstraction layer where the executable file is located, wherein the hardware abstraction layer and the kernel layer belong to the first operating system;
transmitting the first intermediate instruction from the kernel layer to a routing task through a first data channel, wherein the routing task belongs to the second operating system;
the determining, in the second operating system, a positioning data acquisition instruction that matches the first intermediate instruction comprises:
acquiring an object identifier of the data request object in the first intermediate instruction;
according to the object identification, the first intermediate instruction is forwarded to a positioning main task through the routing task, and the positioning main task belongs to the second operating system;
and determining the positioning data acquisition instruction matched with the first intermediate instruction from a positioning instruction library through the positioning main task.
5. The method of claim 4, wherein after said forwarding the first intermediate instruction to a positioning master task by the routing task, the method further comprises:
and registering a first callback function in the second operating system through the positioning main task, wherein the first callback function is used for feeding back the positioning data to the data request object.
6. The method of claim 5, wherein the obtaining the positioning data from the positioning chip according to the positioning data obtaining instruction comprises:
instructing the positioning main task to call a serial communication interface and sending the positioning data acquisition instruction to the positioning chip;
responding to the positioning chip to send first data to the serial communication interface, receiving the first data in an interrupt mode provided by a target interrupt task, wherein the first data comprises a feedback signal or the positioning data, the positioning data is positioning standard data fed back by the positioning chip based on the positioning data acquisition instruction, and the target interrupt task is used for providing interrupt for the serial communication receiving interface.
7. The method of claim 6, wherein receiving the first data in an interrupt manner provided by a targeted interrupt task in response to the positioning chip sending the first data to the serial communication interface comprises:
responding to the first data sent to the serial communication interface by the positioning chip, and generating an interrupt service program through the target interrupt task;
pushing a second callback function to an event task based on the interrupt service program;
instructing the event task to detect the integrity of the first data based on the second callback function;
detecting a data type contained in the first data in response to the first data being complete data;
and executing corresponding processing according to the data type to finish the flow of acquiring the positioning data.
8. The method of claim 7, wherein the performing the corresponding processing according to the data type comprises:
in response to the data type being the positioning data, instructing the event task to feed back the positioning data to the first operating system through the first callback function;
or the like, or, alternatively,
in response to the data type being the feedback signal, indicating the event task to send the feedback signal to the positioning main task through a second callback function;
and responding to the feedback signal received by the positioning main task, and indicating the positioning main task to stop retransmitting the positioning data acquisition instruction to the positioning chip.
9. The method of claim 4, wherein the second operating system further comprises a sensor task, wherein the sensor task is configured to register a third callback function, wherein the third callback function is configured to send the positioning data to a specified object through a second data channel when called, and wherein the specified object belongs to the first operating system; and/or the sensor task is used for registering a fourth callback function, and the fourth callback function is used for sending the positioning data to the object in the second operating system when being called.
10. The method according to any one of claims 1 to 9, wherein said acquiring, in the second operating system, the positioning data from the positioning chip according to the first acquisition request comprises:
indicating the first operating system to switch to a dormant state, and acquiring the positioning data from the positioning chip in the second operating system according to the first acquisition request;
the feeding back the positioning data from the second operating system to the first operating system comprises:
and instructing the first operating system to switch to an awakening state, and feeding back the positioning data from the second operating system to the first operating system.
11. The method according to any one of claims 1 to 9, further comprising:
responding to a stop request generated in the first operating system, and generating a corresponding second intermediate instruction, wherein the stop request is used for requesting to stop acquiring the positioning data;
sending the second intermediate instruction from the first operating system to the second operating system;
determining, in the second operating system, a stop instruction that matches the second intermediate instruction;
and stopping acquiring the positioning data based on the stopping instruction.
12. The method of claim 11, wherein the stopping the acquisition of the positioning data based on the stop instruction comprises:
instructing the positioning main task to receive the stop instruction;
instructing the positioning main task to log out a first callback function corresponding to the data request object based on the stop instruction, wherein the first callback function is used for feeding back the positioning data to the data request object;
responding to the positioning chip in a use state, and ending the flow;
and responding to the idle state of the positioning chip, and closing the positioning chip.
13. The method of claim 12, wherein turning off the positioning chip in response to the positioning chip being in an idle state comprises:
and responding to the situation that the positioning chip is in an idle state, and closing the positioning chip after delaying the target time length.
14. The method of claim 13, further comprising:
and stopping the flow of closing the positioning chip in response to that the current system is within the target duration at the moment and a positioning chip starting instruction is received, wherein the positioning chip starting instruction is used for starting the positioning chip.
15. An apparatus for obtaining positioning data, wherein the apparatus is applied in a terminal, the terminal includes a first processor and a second processor, a first operating system is running in the first processor, a second operating system is running in the second processor, and a positioning chip is mounted in the second processor, power consumption of the second processor is lower than that of the first processor, and the apparatus includes:
a first generating module, configured to send, in response to a first obtaining request generated in the first operating system, the first obtaining request to the second operating system through the first operating system, where the first obtaining request is used to request to obtain positioning data;
an obtaining module, configured to obtain, in the second operating system, the positioning data from the positioning chip according to the first obtaining request;
a feedback module for feeding back the positioning data from the second operating system to the first operating system.
16. A terminal, characterized in that the terminal comprises a processor, a memory connected to the processor, and program instructions stored on the memory, which when executed by the processor implement the method for obtaining positioning data according to any of claims 1 to 14.
17. A computer-readable storage medium, in which program instructions are stored, which program instructions, when executed by a processor, implement a method of acquiring positioning data according to any one of claims 1 to 14.
CN202110501640.0A 2021-05-08 2021-05-08 Method, device, terminal and storage medium for acquiring positioning data Pending CN115309253A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110501640.0A CN115309253A (en) 2021-05-08 2021-05-08 Method, device, terminal and storage medium for acquiring positioning data
PCT/CN2022/084295 WO2022237371A1 (en) 2021-05-08 2022-03-31 Method and apparatus for acquiring positioning data, and terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110501640.0A CN115309253A (en) 2021-05-08 2021-05-08 Method, device, terminal and storage medium for acquiring positioning data

Publications (1)

Publication Number Publication Date
CN115309253A true CN115309253A (en) 2022-11-08

Family

ID=83854487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110501640.0A Pending CN115309253A (en) 2021-05-08 2021-05-08 Method, device, terminal and storage medium for acquiring positioning data

Country Status (2)

Country Link
CN (1) CN115309253A (en)
WO (1) WO2022237371A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105487918A (en) * 2014-10-08 2016-04-13 展讯通信(上海)有限公司 Independent information processing system
US9699594B2 (en) * 2015-02-27 2017-07-04 Plantronics, Inc. Mobile user device and method of communication over a wireless medium
CN105674977A (en) * 2016-01-06 2016-06-15 华为技术有限公司 Navigation device and navigation method
CN109996185B (en) * 2017-12-29 2022-02-15 腾讯科技(深圳)有限公司 Terminal positioning method and device, storage medium and electronic device

Also Published As

Publication number Publication date
WO2022237371A1 (en) 2022-11-17

Similar Documents

Publication Publication Date Title
US10075530B2 (en) Method and electronic device for establishing connection with external electronic device
KR101832953B1 (en) Remote wakeup of application processor of mobile device
US9338596B2 (en) Apparatus and method for determining a wireless device's location after shutdown
EP2816467A2 (en) Method and device for checkpoint and restart of container state
KR102137097B1 (en) Processing Method for periodic event and Electronic device supporting the same
CN102103526A (en) Method and system for performing inter-process communication between server and client by service management
CN1700171A (en) Providing direct access to hardware from a virtual environment
CN1722092A (en) VEX - virtual extension framework
CN111713176B (en) Data transmission method and terminal
CN105940375A (en) Dynamic reassignment for multi-operating system devices
CN108874554B (en) Information communication method and device
US20190069149A1 (en) Method for configuring action of external device and electronic device for supporting the same
WO2019227317A1 (en) Control method for power key in virtual remote controller and terminal
CN110659104B (en) Service monitoring method and related equipment
US20240111595A1 (en) Application deployment method, distributed operating system, electronic device, and storage medium
WO2018010438A1 (en) Responding method and apparatus for terminal
CN110515662B (en) Remote control method, system, equipment and readable storage medium for dual-system equipment
CN115309253A (en) Method, device, terminal and storage medium for acquiring positioning data
CN111414265A (en) Service framework and method for calling system resources
CN108156650B (en) Control method and device of positioning module, storage medium and terminal
CN110943350A (en) WIFI smart jack, based on WIFI smart jack's computer watchdog system
CN107908493B (en) Screen freezing monitoring and solving method, mobile terminal and computer readable storage medium
KR20180004956A (en) Electronic device and method for operating electronic device
CN111884906A (en) Information notification method and device and electronic equipment
US20170244644A1 (en) Electronic device and method for processing data in electronic device

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