CN112261099B - Position information acquisition method and device and electronic equipment - Google Patents

Position information acquisition method and device and electronic equipment Download PDF

Info

Publication number
CN112261099B
CN112261099B CN202011102542.1A CN202011102542A CN112261099B CN 112261099 B CN112261099 B CN 112261099B CN 202011102542 A CN202011102542 A CN 202011102542A CN 112261099 B CN112261099 B CN 112261099B
Authority
CN
China
Prior art keywords
terminal
information
position information
service control
cloud server
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.)
Active
Application number
CN202011102542.1A
Other languages
Chinese (zh)
Other versions
CN112261099A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011102542.1A priority Critical patent/CN112261099B/en
Publication of CN112261099A publication Critical patent/CN112261099A/en
Application granted granted Critical
Publication of CN112261099B publication Critical patent/CN112261099B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/52Network services specially adapted for the location of the user terminal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The embodiment of the application relates to the field of cloud application, and provides a position information acquisition method, a position information acquisition device and electronic equipment, wherein the position information acquisition method comprises the following steps: acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server; opening the position service control according to the opening request to acquire initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal; sending the opening information of the position service control to the terminal; acquiring current position information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information; and updating the initial position information provided by the position service control into the current position information of the terminal. The purpose of sharing the position information of the terminal by the cloud application can be achieved.

Description

Position information acquisition method and device and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of cloud application, in particular to a position information obtaining method and device and electronic equipment.
Background
The cloud application refers to that the application is placed on a cloud server to run based on a cloud computing technology, and the rendered program picture is compressed and encoded by the cloud server and then transmitted to the user terminal through a network. The cloud application may be a cloud education application, a cloud gaming application, or the like. Taking cloud game application as an example, the cloud game runs on a cloud server, audio and video data rendered by the game are compressed and encoded, then the compressed and encoded audio and video data are transmitted to a terminal through a network, and the encoded file is decoded by the terminal and then rendered to a display screen for display. However, since the cloud game runs on a cloud server, which is usually deployed in a computer room, the cloud game cannot acquire the location information of the terminal, so that the game depending on the location information cannot be experienced. It can be seen that the current cloud application cannot share the location information of the terminal.
Disclosure of Invention
The embodiment of the application provides a position information acquisition method and device and electronic equipment, and the purpose of sharing position information of a terminal by cloud application can be achieved.
In a first aspect, an embodiment of the present application provides a method for acquiring location information, including:
acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server;
opening the position service control according to the opening request to acquire initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal;
sending the opening information of the position service control to the terminal;
acquiring current position information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information;
and updating the initial position information provided by the position service control into the current position information of the terminal.
Optionally, in some possible implementation manners of the present application, the obtaining current location information of the terminal sent by the terminal includes:
acquiring a data packet sent by the terminal, wherein the data packet is obtained by sequencing current position information of the terminal after the terminal determines that the position service control is successfully started according to the starting information and packaging the current position information of the terminal after the sequencing according to a preset protocol;
and analyzing the data packet to obtain the current position information of the terminal.
Optionally, in some possible implementation manners of the present application, the updating the initial location information provided by the location service control to the current location information of the terminal includes:
acquiring a closing request of the position service control sent by the terminal;
closing the position service control according to the closing request;
and sending closing information of the position service control to the terminal, so that the terminal stops sending the position information of the terminal after determining that the position service control is successfully closed according to the closing information.
In a second aspect, an embodiment of the present application provides a method for acquiring location information, including:
sending an opening request to a cloud server; the starting request is used for requesting to start a position service control in the cloud server;
acquiring starting information of the position service control sent by the cloud server; the starting information is information sent by the cloud server after the cloud server starts the position service control according to the starting request so as to obtain initial position information, the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset by the terminal;
if the position service control is determined to be successfully started according to the starting information, current position information of the terminal is obtained;
and sending the current position information to the cloud server so that the cloud server updates the initial position information provided by the position service control to the current position information of the terminal.
Optionally, in some possible implementation manners of the present application, the sending the current location information to the cloud server includes:
carrying out serialization processing on the current position information;
packaging the current position information after the serialization processing according to a preset protocol to obtain a data packet;
and sending the data packet to the cloud server.
Optionally, in some possible implementation manners of the present application, the sending the current location information to the cloud server includes:
sending the current position information to the cloud server in real time; or the like, or, alternatively,
and sending the current position information to the cloud server according to a preset time interval.
Optionally, in some possible implementations of the present application, the sending the current location information to the cloud server then includes:
sending a closing request of the position service control to the cloud server;
obtaining closing information of the position service control sent by the cloud server; the closing information is information sent by the cloud server after the cloud server closes the position service control according to the closing request;
and if the position service control is determined to be successfully closed according to the closing information, stopping sending the position information.
In a third aspect, an embodiment of the present application provides a location information acquiring apparatus having a function of implementing a location information acquiring method corresponding to the first aspect. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions, which may be software and/or hardware.
In one possible design, the position information acquiring device includes:
the first acquisition unit is used for acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server;
the starting unit is used for starting the position service control according to the starting request so as to obtain initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal;
a sending unit, configured to send opening information of the location service control to the terminal;
a second obtaining unit, configured to obtain current location information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information;
and the updating unit is used for updating the initial position information provided by the position service control into the current position information of the terminal.
In a fourth aspect, an embodiment of the present application provides a position information acquiring apparatus having a function of implementing the position information acquiring method corresponding to the second aspect. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions, which may be software and/or hardware.
In one possible design, the position information acquiring device includes:
the cloud server comprises a first sending unit, a second sending unit and a third sending unit, wherein the first sending unit is used for sending an opening request to the cloud server; the starting request is used for requesting to start a position service control in the cloud server;
the first obtaining unit is used for obtaining the starting information of the position service control sent by the cloud server; the starting information is information sent by the cloud server after the cloud server starts the position service control according to the starting request so as to obtain initial position information, the position service control is used for providing position information of the terminal for cloud application, and the initial position information is initial position information preset for the terminal;
a second obtaining unit, configured to obtain current location information of the terminal if it is determined that the location service control is successfully started according to the start information;
a second sending unit, configured to send the current location information to the cloud server, so that the cloud server updates the initial location information provided by the location service control to the current location information of the terminal.
In yet another aspect, an electronic device is provided, which includes at least one connected processor, a memory and a transceiver, wherein the memory is used for storing a computer program, and the processor is used for calling the computer program in the memory to execute the method in the above aspects.
Yet another aspect of the embodiments of the present application provides a storage medium including instructions that, when executed on a computer, cause the computer to perform the method of the above aspects.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. A 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 computer device to perform the method provided in the first aspect, the various implementations of the first aspect, and the method provided in the second aspect, the various implementations of the second aspect.
Compared with the prior art, in the scheme provided by the embodiment of the application, after the cloud server starts the position service control, the position information can be provided for the cloud application through the position service control, so that after the cloud server obtains the current position information of the terminal, the current position information of the terminal is provided for the cloud application through the position service control, and the cloud application can obtain the current position information of the terminal. Therefore, the purpose of sharing the position information of the terminal by the cloud application is achieved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced 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 to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a system architecture diagram illustrating an operation of a position information acquiring apparatus according to an embodiment of the present application;
fig. 2 is a flowchart of a method for acquiring location information according to an embodiment of the present disclosure;
fig. 3a is a schematic view of a cloud game login interface according to an embodiment of the present disclosure;
fig. 3b is a schematic view of a cloud game control interface according to an embodiment of the present disclosure;
fig. 3c is a schematic interface diagram illustrating position information displayed in a cloud game scene according to an embodiment of the present disclosure;
fig. 4 is an interaction diagram of another location information obtaining method according to an embodiment of the present application;
fig. 5 is a schematic diagram of signaling interaction between a cloud server and a terminal according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a position information acquiring apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another position information acquiring apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
Detailed Description
The terms "first," "second," and the like in the description and in the claims of the embodiments of the application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprise" and "have," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules expressly listed, but may include other steps or modules not expressly listed or inherent to such process, method, article, or apparatus, such that the division of modules presented in the present application is merely a logical division and may be implemented in a practical application in a different manner, such that multiple modules may be combined or integrated into another system or some features may be omitted or not implemented, and such that couplings or direct couplings or communicative connections shown or discussed may be through interfaces, indirect couplings or communicative connections between modules may be electrical or the like, the embodiments of the present application are not limited. Moreover, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed in a plurality of circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
The cloud application refers to that the application is placed on a cloud server to run based on a cloud computing technology, and the rendered program picture is compressed and encoded by the cloud server and then transmitted to the user terminal through a network. The cloud application may be a cloud education application, a cloud gaming application, or the like. Taking cloud game application as an example, the cloud game runs on a cloud server, audio and video data rendered by the game are compressed and encoded, then the compressed and encoded audio and video data are transmitted to a user terminal through a network, and a user terminal decodes an encoded file and renders the encoded file to a display screen for display. However, since the cloud game runs on a cloud server, which is usually deployed in a computer room, the cloud game cannot acquire the location information of the terminal, so that the game depending on the location information cannot be experienced. It can be seen that the current cloud application cannot share the location information of the terminal.
The cloud computing technology is a computing mode, and distributes computing tasks on a resource pool formed by a large number of computers, so that various application systems can acquire computing power, storage space and information services according to needs. The network that provides the resources is referred to as the "cloud". Resources in the "cloud" appear to the user as being infinitely expandable and available at any time, available on demand, expandable at any time, and paid for on-demand. As a basic capability provider of cloud computing, a cloud computing resource pool (called as a cloud Platform in general, an Infrastructure as a Service) Platform is established, and multiple types of virtual resources are deployed in the resource pool for selective use by external clients, the cloud computing resource pool mainly includes a computing device (including an operating system, for a virtualized machine), a storage device, and a network device, and is divided according to logical functions, a PaaS (Platform as a Service) layer may be deployed on an IaaS (Infrastructure as a Service) layer, a SaaS (Software as a Service) layer may be deployed on the PaaS layer, or the SaaS may be directly deployed on the IaaS layer, the PaaS may be a Platform running on Software, such as a web database, a container, and the like, as business Software of various websites, a web portal, and the like, SaaS and PaaS are upper layers relative to IaaS.
The cloud game may also be called a game on demand (gaming), which is an online game technology based on a cloud computing technology. Cloud game technology enables light-end devices (thin clients) with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud game scene, a game is not operated in a player game terminal but in a cloud server, and the cloud server renders the game scene into a video and audio stream which is transmitted to the player game terminal through a network. The player game terminal does not need to have strong graphic operation and data processing capacity, and only needs to have basic streaming media playing capacity and capacity of acquiring player input instructions and sending the instructions to the cloud server.
In order to solve the technical problem that the cloud application cannot share the location information of the terminal, embodiments of the present application provide a location information obtaining method and apparatus, an electronic device, and a storage medium. Therefore, the purpose of sharing the position information of the terminal by the cloud application is achieved.
The position information acquisition method provided by the embodiment of the application can be used in scenes such as cloud education, cloud live broadcast and cloud games, can be used on a server side and can also be used on a terminal side, wherein the terminal side provides a client for accessing cloud application, and the client can run in a terminal operated by a user. The server related to the embodiment of the application can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (content delivery network), a big data and artificial intelligence platform and the like. The terminal related to the embodiment of the application can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart sound box, a smart watch, and the like, but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
The position information obtaining method provided by the embodiment of the present application is executed by a position information obtaining device, the position information obtaining device may operate in the system architecture shown in fig. 1, and fig. 1 is a system architecture diagram of the position information obtaining device provided by the embodiment of the present application. The system comprises a cloud server and a terminal, wherein the cloud server can be a container or a virtual machine for operating an android system, the terminal provides a client for accessing cloud application, the terminal supports different positioning systems, and an operating system of the terminal is not limited. The cloud server comprises a Hardware Abstraction Layer (HAL), a Framework Layer (Framework) and an Application Layer (App), and the terminal comprises a physical Hardware Layer, a Linux kernel Layer, a Hardware Abstraction Layer, a Framework Layer and an Application Layer. In one scenario, the location information may be transmitted as follows:
first, on the terminal side: a Global Positioning System (GPS) device in a physical hardware layer acquires position information of a current terminal, and sends the position information to a cloud game App in an application layer through a GPS driver in a Linux kernel layer, a data monitoring thread in a hardware abstraction layer, a position Provider (Location Provider) and a position Manager Service (Location Manager Service) in a framework layer, and a position Manager (Location Manager) in the application layer, and the cloud game App sends the acquired position information to a cloud game business process in the application layer of a cloud server;
then, on the cloud server side: after receiving the position information, the cloud game business process sends the position information to the game App in the application layer sequentially through the data monitoring thread in the hardware abstraction layer, the position provider and the position manager service in the framework layer and the position manager service in the application layer, so that the game App running on the cloud server can acquire the position information of the terminal. The hardware abstraction layer of the cloud server is different from the hardware abstraction layer of the terminal, the hardware abstraction layer of the cloud server is mainly used for creating a data monitoring thread, monitoring commands and position information forwarded by a cloud game service process through the data monitoring thread, executing a corresponding callback function after analyzing the position information, and transmitting the analyzed position information to a position provider in a framework layer of the cloud server, and the hardware abstraction layer of the terminal is mainly used for calling the position information of the terminal and transmitting the called position information to the framework layer of the terminal. The position provider in the framework layer of the cloud server and the position provider in the framework layer of the terminal have the same function, and both provide received position information for corresponding position manager services, and the position manager services in the framework layer of the cloud server and the position manager services in the framework layer of the terminal have the same function, and both provide positioning service functions.
It should be understood that the cloud game App in the application layer of the terminal does not need to be installed locally, and the game App in the application layer of the cloud server needs to be installed.
With reference to the above system architecture, the following describes a location information obtaining method in an embodiment of the present application through a cloud server side, please refer to fig. 2, where fig. 2 is a flowchart of a location information obtaining method provided in an embodiment of the present application, and the embodiment of the present application at least includes the following steps:
201. acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server;
in this embodiment, when the terminal requests access to the cloud application through the client, the terminal may send an opening request of the location service control to the cloud server, so that the cloud server receives the opening request sent by the terminal. The number of the terminals may be 1 or more, and is not limited herein. Different terminals may access the same cloud application, and may also access different cloud applications, which is not limited herein. The location service control is provided by the cloud server, the location service control is usually located in a framework layer of the cloud server, the cloud application is usually located in an application layer of the cloud server, and an interface is provided between the framework layer and the application layer, so that information (such as location information) is transmitted from the framework layer to the application layer. The location service control provides location service function, also called positioning service, which is a location-related service provided by wireless operation company for users. The cloud server can keep a complete position service function and can default to the authorized positioning authority, so that the interference of positioning authority popup is avoided in the running process of the cloud application. The default authorized positioning permission means that the cloud server defaults that the cloud application opens the positioning permission of the terminal. Considering that a plurality of cloud applications in an actual scene can request the position information of a terminal in the running process, and the request can be presented on a display interface of a user terminal in a pop-up window form, which can cause certain interference on the user experience of the cloud applications, the cloud server can open the positioning authority of the terminal for the cloud applications by default, so as to avoid the interference of the pop-up window of the positioning authority. For example, when a user logs in a cloud application a for the first time through a mobile phone, if the cloud server does not default that the cloud application a starts the positioning authority of the mobile phone, the cloud application a displays the following contents on a login interface of a cloud application of a terminal in a popup mode: allow "cloud application a" access to your location? And provides the user with three options: only during use of the application, always allowed, not allowed. The user needs to manually select from the three options to smoothly perform the next operation. In this embodiment, the cloud server defaults that the cloud application a starts the positioning authority of the mobile phone, so that the user is not interfered by a positioning authority popup window in the whole process of using or experiencing the cloud application a, on one hand, time spent on accessing the cloud application a can be saved, and on the other hand, user experience is improved.
In one scenario, a user starts a cloud application on a mobile phone, and after a cloud application login interface is displayed, a terminal of the cloud application sends a start request of a position service control to a cloud server. Specifically, a cloud game is taken as an example for explanation, as shown in fig. 3a and fig. 3b, fig. 3a is a schematic diagram of a cloud game login interface provided in the embodiment of the present application, and fig. 3b is a schematic diagram of a cloud game control interface provided in the embodiment of the present application. After a player opens the game of 'together XX' on the mobile phone, a game login interface shown in fig. 3a is displayed, a floating button is arranged on the right side of the game login interface, the player clicks the floating button to pop up a game control interface shown in fig. 3b, and control components displayed on the game control interface have image quality, opening positioning and sharing. When the player opens the opening positioning, the terminal sends an opening request of the position service control to the cloud server. It can be understood that when the player turns off the "open positioning", the terminal sends a closing request of the location service control to the cloud server; when the player opens the "image quality", if the "image quality" is set to 1080P image quality, the terminal presents the game picture according to the 1080P image quality, and when the player opens the "share", the player can be provided with a plurality of different types of receivers to share the game to the receivers. It should be understood that in some possible scenarios, after a player opens a game of "XX together" on a mobile phone, a terminal defaults to automatically send a start request of a location service control to a cloud server, and does not need to actively trigger "open positioning" by the player to accelerate sending of the start request of the location service control to the cloud server, which is beneficial to improving location information acquisition efficiency.
202. Opening the position service control according to the opening request to acquire initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information is preset initial position information for the terminal;
in this embodiment, after receiving a start request of a location service control sent by a terminal, a cloud server starts the location service control according to the start request. The position service control of the cloud server is mainly used for providing position information of the terminal for the cloud application, the position information of the position service control mainly comes from the position information sent by the terminal, and after the position service control obtains the position information sent by the terminal, the cloud application running on the cloud server can also obtain the position information of the terminal.
In addition, considering that part of the cloud applications cannot display the application scene under the condition that the position information cannot be acquired, for example, part of the cloud games cannot display the game scene under the condition that the position information cannot be acquired, before the cloud applications receive the position information of the terminal, the position service control of the cloud server keeps default position information (initial position information) for the cloud applications to acquire, so that the cloud applications can smoothly display the application scene on the display interface of the terminal, and in addition, the method is also beneficial to accelerating the entering of the application scene and reducing the waiting time for entering the application scene. Therefore, the initial position information is the position information provided by the position service control of the cloud server to the cloud application before the cloud application receives the position information of the terminal. In an actual scenario, the initial position information may be set by a user, for example, the initial position information is set to "beijing", "shenzhen", and the like, which is not limited herein. The initial position information may be set to be multiple, and when the initial position information needs to be determined, the cloud server may randomly select from the multiple initial position information.
203. Sending the opening information of the position service control to the terminal;
in this embodiment, after the location service control is started, the cloud server sends the start information of the location service control to the terminal. In consideration of the possibility that the position service control is failed to be opened in practical application, if the position service control is failed to be opened, the terminal sends the current position information of the terminal to the cloud server, which cannot be provided for the cloud application, so that the current position information of the terminal is frequently sent in order to avoid the terminal being invalid, and network resources are saved, and therefore the cloud server is required to send the opening information of the position service control to the terminal after the position service control is opened.
204. Acquiring current position information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information;
in this embodiment, after the opening information of the location service control is sent to the terminal, the terminal determines whether the location service control is successfully opened according to the opening information, and if it is determined that the location service control is successfully opened, the terminal acquires current location information and sends the current location information to the cloud server, so that the cloud server acquires the current location information of the terminal. It can be understood that if the terminal determines that the location service control is not successfully started, the terminal does not send the current location information to the cloud server, and the terminal can select to resend the start request of the location service control so as to resend the request of the cloud server for starting the location service control. The terminal can acquire the position information of itself through various modes such as a GPS, a base station, a wireless network and the like. In an actual scene, the terminal may obtain the current position information in real time, or the terminal may obtain the current position information according to a preset time interval or a preset frequency. Since the position of the terminal may change with time, the current position information is usually a dynamic position information, and the position information at different time points may be different or the same.
It should be noted that the current location information generally includes a time stamp (also referred to as a timestamp). The time stamp is data generated by using a data signature technology, a signature object comprises information such as original file information, signature parameters, signature time and the like, and the time stamp is mainly used for authenticating the data generation time through a certain technical means so as to verify whether the data is falsified after being generated.
In some possible embodiments, the step 204 of obtaining the current location information of the terminal sent by the terminal includes:
acquiring a data packet sent by the terminal, wherein the data packet is obtained by sequencing current position information of the terminal after the terminal determines that the position service control is successfully started according to the starting information and packaging the current position information of the terminal after the sequencing according to a preset protocol;
and analyzing the data packet to obtain the current position information of the terminal.
Specifically, considering that the data volume of the current position information acquired by the terminal is relatively large, some redundant data (for example, data of a plurality of search satellites before the position positioning is successful) exists in the current position information, and the cloud application needs to preferentially ensure the transmission bandwidth of the audio/video stream, if the data amount of the current location information is too large, the overall transmission bandwidth is affected, and in order to solve the technical problem, in some embodiments, the current location information sent by the terminal to the cloud server is sent in a data packet form, and the terminal needs to perform serialization processing on the current location information before sending the current location information to the cloud server, and then packaging the current position information of the terminal after the serialization processing according to a preset protocol (such as a private protocol such as a SUBCMD _ LOCATION _ UPDATE protocol) to obtain a data packet, and finally sending the data packet to a cloud server. After receiving the data packet, the cloud server analyzes the data packet to obtain the analyzed current position information (such as longitude, latitude, altitude, azimuth, and the like). It should be understood that by performing serialization processing on the current position information, redundant data in the current position information can be removed, transmission bandwidth can be saved, and by encapsulating the current position information after serialization processing, transmission bandwidth is further reduced, so that the transmission bandwidth of audio and video streams of cloud application is ensured.
When the terminal needs to transmit the current position information through the network or needs to persist the current position information so as to be used in the future, the current position information can be serialized, the serialization processing of the current position information refers to a process of converting the current position information into a byte sequence (binary byte) which can be kept or transmitted, the deserialization corresponds to the serialization, the deserialization refers to a process of converting a binary byte generated in the serialization process into the current position information, and the serialization and the deserialization are combined to realize data storage and transmission. In the data transmission process that the terminal sends the current position information to the cloud server, the current position information can be processed according to a default serialization mode generally, so that the close coupling of the position information and the serialization is realized.
205. And updating the initial position information provided by the position service control into the current position information of the terminal.
In this embodiment, after receiving the current location information sent by the terminal, the cloud server provides the current location information of the terminal to the location service control, and after the location service control obtains the current location information of the terminal, the location service control updates the initial location information provided by the location service control to the current location information of the terminal, so that the cloud application can obtain the current location information of the terminal. In a scene, after the cloud application acquires the current position information of the terminal, the current position information of the terminal can be rendered in real time, and then the current position information is transmitted to the terminal through the cloud server through the network for rendering presentation, so that the current position information can be displayed on a display interface of the terminal. Specifically, on the basis of fig. 3a and 3b, as shown in fig. 3c, fig. 3c is an interface schematic diagram for displaying location information in a cloud game scene provided in the embodiment of the present application, if a location service control is successfully started, a terminal will display the game scene on the display interface, and current location information will be displayed in the game scene, and the current location information displayed in fig. 3c is "shenzhen nan shan district XX street".
In some possible embodiments, step 205 updates the location information provided by the location service control to the current location information of the terminal, and then includes:
acquiring a closing request of the position service control sent by the terminal;
closing the position service control according to the closing request;
and sending closing information of the position service control to the terminal, so that the terminal stops sending the position information of the terminal after determining that the position service control is successfully closed according to the closing information.
Specifically, after the cloud application acquires the location information of the terminal, the cloud server may receive a closing request of the location service control sent by the terminal at a certain time point, for example, at a certain time point, a user closes the cloud application, the user exits the cloud application, the user requests to close the positioning service, a network is suddenly disconnected, and the like, which may trigger the terminal to send the closing request of the location service control to the cloud server, the cloud server closes the location service control according to the received closing request, and then sends the closing information of the location service control to the terminal, and after the terminal receives the closing information, if it is determined that the location service control is successfully closed, the terminal stops sending the location information. It should be noted that in some scenarios, after the terminal sends the closing request of the location service control to the cloud server, the terminal directly stops sending the location information without waiting for receiving the closing information sent by the cloud service. In other scenes, when the user closes the cloud application, the user exits the cloud application, and the user requests to close the positioning service and suddenly disconnect the network, the terminal directly stops sending the position information. Therefore, after the terminal sends the closing request of the position service control to the cloud server, the cloud server closes the position service control according to the closing request, the position service control of the cloud server is prevented from being always in an open state in some scenes, and therefore the operation burden of the cloud server is relieved.
According to the scheme provided by the embodiment of the application, after the cloud server starts the position service control, the position information can be provided for the cloud application through the position service control, so that after the cloud server obtains the current position information of the terminal, the current position information of the terminal is provided for the cloud application through the position service control, and the cloud application can obtain the current position information of the terminal. Therefore, the purpose of sharing the position information of the terminal by the cloud application is achieved.
Referring to fig. 4, fig. 4 is an interaction schematic diagram of another location information acquisition method provided in the embodiment of the present application, where the location information acquisition method according to the embodiment of the present application is introduced from the perspective of information interaction between a cloud server side and a terminal side, and the embodiment of the present application at least includes the following steps:
401. the terminal sends an opening request to the cloud server; the starting request is used for requesting to start a position service control in the cloud server;
in this embodiment, when the terminal requests access to the cloud application through the client, the terminal may send an opening request of the location service control to the cloud server. The protocol adopted by the position service control opening request sent by the terminal to the cloud server may be: SUBCMD _ GPS _ ON _ REQ. Wherein, SUBCMD _ GPS _ ON _ REQ is a private protocol.
The cloud server may be a container or a virtual machine running an android system, and the client may be a client of an App on an android device or an IOS device supporting a GPS positioning system.
402. The cloud server starts the position service control according to the starting request to acquire initial position information;
in this embodiment, the location service control is configured to provide location information of the terminal to the cloud application, where the initial location information is initial location information preset for the terminal.
403. The cloud server sends the opening information of the position service control to the terminal;
in this embodiment, the opening information of the location service control sent by the cloud server to the terminal may be: SUBCMD _ GPS _ ON _ RSP. The SUBCMD _ GPS _ ON _ RSP refers to the cloud server sending a Global Positioning System (GPS) ON reply.
404. If the terminal determines that the position service control is successfully started according to the starting information, current position information is obtained;
in an actual application scenario, the terminal may acquire the current location information by using the following network protocol:
if the terminal is an android device, current position information is acquired through the following steps:
1) requesting ACCESS _ FINE _ LOCATION, ACCESS _ COARSE _ LOCATION to ACCESS the right related to the LOCATION information;
wherein, android provides two types of location permissions:
acquiring an accurate positioning authority feature (ACCESS _ FINE _ LOCATION) and acquiring a COARSE positioning authority feature (ACCESS _ COARSE _ LOCATION), wherein ACCESS _ FINE _ LOCATION refers to determining a position (LOCATION) as accurately as possible by using an available LOCATION provider including a GPS and a Wireless Local Area Network (WLAN) and mobile data traffic, and ACCESS _ COARSE _ LOCATION refers to determining position information by using the WLAN and/or mobile data traffic, and the accuracy of the position information is not high and is equivalent to positioning accuracy at a city block level.
2) Obtaining a LocationManager: an application layer management class of location services controls;
the location manager (LocationManager) refers to a management class in android that accesses a system location service control, and can be obtained through a contextual location service.
3) Creating a Location data monitoring class and realizing a Location Listener interface function onlocation changed;
the Location data monitoring class is created by mainly creating a Location listening (Location listener) interface to monitor the change of the Location (such as GPS and WLAN) and dynamically acquire the Location information in real time. Location changed refers to a callback function that is automatically called when the Location changes, where Location records the latest Location information.
4) Adding Location data monitoring: calling requestLocationUpdates;
wherein, Location data listening is realized by calling request Location updates (requestLocationUpdates).
5) And monitoring a callback function: onLocationChanged acquires Location data.
The callback function may be onLocationChanged by listening to the callback function to obtain Location data.
If the terminal is an IOS device, the current position information is obtained in the following mode:
in the IOS system, the location service control is based on a core location (CoreLocation) framework, and when positioning, a location service object (CLLocationManager), an interface of location information (CLLocationManager) and a CLLocation (a class of location information) are mainly used, where CoreLocation is a core framework of a physical location and direction, CLLocationManager is a location service control management class for obtaining information of a location, an altitude, a speed, a direction, and the like of a device, CLLocationManager is an interface for receiving location information, and CLLocation is a class of information of a latitude, a longitude, a heading, and the like reported by the system.
405. The terminal sends the current position information to a cloud server;
in this embodiment, the protocol used by the terminal to send the current location information to the cloud server may be: SUBCMD _ LOCATION _ UPDATE.
Wherein, the command word in the private protocol is used to distinguish different commands or data for transmission. In this embodiment, the terminal sends the location information to the cloud server by using a private protocol, which can improve the security of data transmission and facilitate distinguishing and transmitting the location information.
In some possible embodiments, step 405 sends the current location information to a cloud server, including:
carrying out serialization processing on the current position information;
packaging the current position information after the serialization processing according to a preset protocol to obtain a data packet;
and sending the data packet to the cloud server.
Specifically, considering that the data volume of the current position information acquired by the terminal is relatively large, some redundant data (for example, data of a plurality of search satellites before the position positioning is successful) exists in the current position information, and the cloud application needs to preferentially ensure the transmission bandwidth of the audio/video stream, if the data amount of the current location information is too large, the overall transmission bandwidth is affected, and in order to solve the technical problem, in some embodiments, the current location information sent by the terminal to the cloud server is sent in a data packet form, and the terminal needs to perform serialization processing on the current location information before sending the current location information to the cloud server, and then packaging the current position information of the terminal after the serialization processing according to a preset protocol (such as a SUBCMD _ LOCATION _ UPDATE protocol) to obtain a data packet, and finally sending the data packet to a cloud server. After receiving the data packet, the cloud server analyzes the data packet to obtain the analyzed current position information (such as longitude, latitude, altitude, azimuth, and the like). It should be understood that by performing serialization processing on the current position information, redundant data in the current position information can be removed, transmission bandwidth can be saved, and by encapsulating the current position information after serialization processing, transmission bandwidth is further reduced, so that the transmission bandwidth of audio and video streams of cloud application is ensured.
In some possible embodiments, step 405 sends the current location information to a cloud server, including:
sending the current position information to the cloud server in real time; or the like, or, alternatively,
and sending the current position information to the cloud server according to a preset time interval.
Specifically, in an actual scene, the terminal may obtain the current location information in real time, and the terminal may also obtain the current location information according to a preset time interval or a preset frequency. The terminal may send the acquired current location information to the cloud server in real time, or may send the current location information to the cloud server according to a preset time interval or a preset frequency, which is not limited herein. Since the position of the terminal may change with time, the current position information is usually a dynamic position information, and the position information at different time points may be different or the same.
In an actual application scenario, the terminal may send the current location information by using the following network protocol:
serializing current position information (Location data) and corresponding time stamps (time stamps) by adopting a protocol buffers data format, and sending the serialized current position information and the time stamps to a cloud server through a network, wherein the data format is as follows:
Figure BDA0002725874280000171
406. the cloud server updates the initial position information provided by the position service control into the current position information;
in this embodiment, the location service control updates the location information provided to the cloud application based on the current location information, so that the cloud application acquires the current location information of the terminal.
407. The terminal sends a closing request of the position service control to a cloud server;
in this embodiment, a protocol adopted by a request for closing a location service control sent by a terminal to a cloud server may be: SUBCMD _ GPS _ OFF _ REQ. Wherein, SUBCMD _ GPS _ OFF _ REQ refers to a request for the terminal to send GPS OFF to the cloud service.
408. The cloud server closes the position service control according to the closing request;
409. the cloud server sends closing information of the position service control to the terminal;
in this embodiment, the protocol adopted by the closing information of the location service control sent by the cloud server to the terminal may be: SUBCMD _ GPS _ OFF _ RSP.
410. And if the terminal determines that the position service control is successfully closed according to the closing information, stopping sending the position information.
According to the scheme provided by the embodiment of the application, after the cloud server starts the position service control, the position information can be provided for the cloud application through the position service control, so that after the cloud server obtains the current position information of the terminal, the current position information of the terminal is provided for the cloud application through the position service control, and the cloud application can obtain the current position information of the terminal. Therefore, the purpose of sharing the position information of the terminal by the cloud application is achieved.
In this embodiment, the cloud server side obtains the location information mainly through the cloud application service Process and the GPS hardware abstraction layer, and the cloud application service Process and the GPS hardware abstraction layer perform Inter-Process Communication (IPC) through UNIX sockets. The UNIX refers to an operating system, and domain socket is used for realizing interprocess communication.
Cloud application service process:
the device is used for monitoring the request of the terminal and forwarding the request and Location data of the terminal to the GPS hardware abstraction layer.
GPS hardware abstraction layer:
and transforming a GPS hardware abstract layer based on the UNIX domain socket to realize a GpsInterface interface. Unlike the GPS hardware abstraction layer based on real hardware devices, GPS data is not from a GPS driver, but from the cloud application service process's SUBCMD _ LOCATION _ UPDATE protocol.
The GpsInterface interface is realized as follows:
Figure BDA0002725874280000181
Figure BDA0002725874280000191
the following 4 interfaces are mainly realized:
group _ gps _ init, group _ gps _ start, group _ gps _ stop, and group _ gps _ clear.
The following describes the above 4 interfaces respectively:
closed _ gps _ init: initializing an interface, and setting a GpsCallbacks callback structure body. Creating a GPS data monitoring process GPS _ state _ thread, creating an unix socket in the GPS _ state _ thread, monitoring a command and Location data forwarded by a cloud Application service process, analyzing the Location data, then executing a corresponding callback function in the GPS callbacks, transmitting the data to a Framework layer, and obtaining the data by an Application Program Interface (API).
The GpsCallbacks callback construct is as follows:
Figure BDA0002725874280000192
Figure BDA0002725874280000201
closed _ gps _ start: opening and positioning: sending a positioning starting command to a monitoring thread GPS _ state _ thread through unix socket, updating the current state to be GPS _ STATUS _ SESSION _ BEGIN through a GPS Callbacks callback function after the monitoring thread GPS _ state _ thread monitors the command, and setting a positioning data callback function GPS _ Location _ callback.
close _ gps _ stop: closing and positioning: sending a positioning closing command to a monitoring thread GPS _ state _ thread through unix socket, after the GPS _ state _ thread monitors the command, updating the current state to be GPS _ STATUS _ SESSION _ END through a GPS _ STATUS _ callback function in a GPS callbacks structure, and setting a Location data callback function GPS _ Location _ callback function to NULL, namely, no longer reporting Location data.
clean: and clearing the gps _ state _ thread and closing the interface.
Referring to fig. 5, fig. 5 is a schematic diagram of signaling interaction between a cloud server and a terminal according to an embodiment of the present disclosure, where the terminal includes a cloud game terminal, and the cloud server includes a cloud game service process, a GPS hardware abstraction layer, and a system framework layer; the cloud game terminal is communicated with the cloud game service process through a tcp socket, and the cloud game service process is communicated with the GPS hardware abstraction layer through a unix socket; the signaling interaction process between the cloud server and the terminal is as follows:
501. initializing a data monitoring thread by a GPS hardware abstraction layer;
502a, the cloud game terminal sends a GPS positioning starting request to a cloud game service process;
502b, the cloud game service process sends a GPS positioning starting request to a GPS hardware abstraction layer;
502c, the GPS hardware abstraction layer provides a GPS positioning starting request for the data monitoring thread;
503a, the GPS hardware abstraction layer sends GPS positioning starting information to the cloud game service process;
503b, the cloud game service process sends GPS positioning starting information to the cloud game terminal;
504. the cloud game terminal acquires position information;
505a, the cloud game terminal sends position information to a cloud game service process;
505b, the cloud game service process sends position information to the GPS hardware abstraction layer;
505c, the GPS hardware abstraction layer provides position information for the data monitoring thread;
505d, the data monitoring thread executes a callback function to send the position information to the system framework layer;
506a, the cloud game terminal sends a GPS positioning closing request to the cloud game service process;
506b, the cloud game service process sends a GPS positioning closing request to the GPS hardware abstraction layer;
506c, the GPS hardware abstraction layer provides a GPS positioning closing request for the data monitoring thread;
507a, the GPS hardware abstraction layer sends GPS positioning closing information to the cloud game service process;
507b, the cloud game service process sends GPS positioning closing information to the cloud game terminal;
508. the cloud game terminal stops requesting the position information.
In this embodiment, on one hand, the cloud game service process is configured to monitor a request of the cloud game terminal, and forward the request of the cloud game terminal and the location information to the GPS hardware abstraction layer. And on the other hand, the method is used for forwarding information (such as GPS positioning on information and GPS positioning off information) sent by the GPS hardware abstraction layer to the cloud game terminal.
In order to better implement the above solution of the embodiment of the present application, a related apparatus for implementing the above solution is further provided below, please refer to fig. 6, fig. 6 is a schematic structural diagram of a location information acquiring apparatus provided in the embodiment of the present application, where the location information acquiring apparatus may be a server, and the server includes:
a first obtaining unit 601, configured to obtain a start request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server;
an opening unit 602, configured to open the location service control according to the opening request, so as to obtain initial location information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal;
a sending unit 603, configured to send opening information of the location service control to the terminal;
a second obtaining unit 604, configured to obtain current location information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information;
an updating unit 605, configured to update the initial location information provided by the location service control to the current location information of the terminal.
In this embodiment, after the opening unit 602 opens the location service control, location information can be provided for the cloud application through the location service control, so that after the second obtaining unit 604 obtains the current location information of the terminal, the current location information of the terminal is provided for the cloud application through the location service control, and the cloud application can obtain the current location information of the terminal. Therefore, the purpose of sharing the position information of the terminal by the cloud application is achieved.
Optionally, in some possible embodiments of the present application, the second obtaining unit 604 is specifically configured to obtain a data packet sent by the terminal, where the data packet is obtained by performing serialization processing on the current location information of the terminal after the terminal determines that the location service control is successfully started according to the start information, and encapsulating the current location information of the terminal after the serialization processing according to a preset protocol; and analyzing the data packet to obtain the current position information of the terminal.
Optionally, in some possible embodiments of the present application, the updating unit 605 updates the initial location information provided by the location service control to the current location information of the terminal, and then includes:
a third obtaining unit, configured to obtain a closing request of the location service control sent by the terminal;
a closing unit, configured to close the location service control according to the closing request;
the sending unit 603 is further configured to send closing information of the location service control to the terminal, so that the terminal stops sending the location information of the terminal after determining that the location service control is successfully closed according to the closing information.
Referring to fig. 7, fig. 7 is a schematic structural diagram of another location information acquiring device provided in an embodiment of the present application, where the location information acquiring device may be a terminal, and the terminal includes:
a first sending unit 701, configured to send an opening request to a cloud server; the starting request is used for requesting to start a position service control in the cloud server;
a first obtaining unit 702, configured to obtain start information of the location service control sent by the cloud server; the starting information is information sent by the cloud server after the cloud server starts the position service control according to the starting request so as to obtain initial position information, the position service control is used for providing position information of the terminal for cloud application, and the initial position information is initial position information preset for the terminal;
a second obtaining unit 703, configured to obtain current location information of the terminal if it is determined that the location service control is successfully started according to the start information;
a second sending unit 704, configured to send the current location information to the cloud server, so that the cloud server updates the initial location information provided by the location service control to the current location information of the terminal.
In the scheme provided by the embodiment of the application, after the cloud server starts the location service control, location information can be provided for the cloud application through the location service control, so that after the second sending unit 704 sends the current location information to the cloud server, the cloud server can provide the current location information of the terminal to the cloud application through the location service control, and the cloud application can obtain the current location information of the terminal. Therefore, the purpose of sharing the position information of the terminal by the cloud application is achieved.
Optionally, in some possible embodiments of the present application, the second sending unit 704 is specifically configured to perform serialization processing on the current location information; packaging the current position information after the serialization processing according to a preset protocol to obtain a data packet; and sending the data packet to the cloud server.
Optionally, in some possible embodiments of the present application, the second sending unit 704 is specifically configured to send the current location information to the cloud server in real time; or, the current position information is sent to the cloud server according to a preset time interval.
Optionally, in some possible embodiments of the present application, the sending, by the second sending unit 704, the current location information to the cloud server, and then includes:
a third sending unit, configured to send a closing request of the location service control to the cloud server;
a third obtaining unit, configured to obtain closing information of the location service control sent by the cloud server; the closing information is information sent by the cloud server after the cloud server closes the position service control according to the closing request;
and the processing unit is used for stopping sending the position information if the position service control is determined to be successfully closed according to the closing information.
Fig. 8 is a schematic structural diagram of an electronic device provided in this embodiment, where the electronic device is specifically a cloud server, and the cloud server 800 may generate a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 801 (e.g., one or more processors) and a memory 802, and one or more storage media 805 (e.g., one or more mass storage devices) storing an application 803 or data 804. Memory 802 and storage media 805 may be, among other things, transient storage or persistent storage. The program stored in the storage medium 805 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, the central processor 801 may be configured to communicate with the storage medium 805, and execute a series of instruction operations in the storage medium 805 on the cloud server 800.
The cloud Server 800 may also include one or more power supplies 806, one or more wired or wireless network interfaces 807, one or more input-output interfaces 808 (transceivers), and/or one or more operating systems 809, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
The steps performed by the cloud server in the above embodiment may be based on the structure of the server 1020 shown in fig. 8. The steps performed by the position information acquiring apparatus shown in fig. 6 in the above-described embodiment, for example, may be based on the server configuration shown in fig. 8. For example, the processor 801, by calling instructions in the memory 802, performs the following operations: acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server; opening the position service control according to the opening request to acquire initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal; sending the opening information of the position service control to the terminal; acquiring current position information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information; and updating the initial position information provided by the position service control into the current position information of the terminal.
An embodiment of the present application further provides an electronic device, where the electronic device is specifically a terminal, and the terminal is specifically a terminal in the foregoing embodiment, and taking a mobile phone as an example, referring to fig. 9, the mobile phone includes: radio Frequency (RF) circuit 901, memory 902, input unit 903, display unit 904, sensor 905, audio circuit 906, wireless-fidelity (Wi-Fi) module 907, processor 908, and power supply 909. Those skilled in the art will appreciate that the handset configuration shown in fig. 9 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 9:
RF circuit 901 is used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then processes the received downlink information to processor 908; in addition, the data for designing uplink is transmitted to the base station. In general, RF circuit 901 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 901 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
The memory 902 may be used to store software programs and modules, and the processor 908 executes various functional applications and data processing of the cellular phone by operating the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 902 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 903 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 903 may include a touch panel 9031 and other input devices 9032. The touch panel 9031, also called a touch screen, may collect a touch operation performed by a user on or near the touch panel 9031 (e.g., an operation performed by the user on or near the touch panel 9031 by using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a preset program. Alternatively, the touch panel 9031 may include two parts, namely, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 908, and receives and executes commands from the processor 908. In addition, the touch panel 9031 may be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 903 may include other input devices 9032 in addition to the touch panel 9031. In particular, other input devices 9032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 904 may be used to display information input by the user or information provided to the user and various menus of the cellular phone. The Display unit 904 may include a Display panel 9041, and optionally, the Display panel 9041 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 9031 may cover the display panel 9041, and when the touch panel 9031 detects a touch operation on or near the touch panel 9031, the touch panel is transmitted to the processor 908 to determine the type of the touch event, and then the processor 908 provides a corresponding visual output on the display panel 9041 according to the type of the touch event. Although in fig. 9, the touch panel 9031 and the display panel 9041 are two independent components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 9031 and the display panel 9041 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 905, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 9041 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 9041 and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The audio circuitry 906, speaker 9061, microphone 9062 may provide an audio interface between the user and the cell phone. The audio circuit 906 may transmit the electrical signal obtained by converting the received audio data to the speaker 9061, and convert the electrical signal into a sound signal by the speaker 9061 and output the sound signal; on the other hand, the microphone 9062 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 906, processes the audio data by the audio data output processor 908, and then sends the audio data to, for example, another cellular phone via the RF circuit 901 or outputs the audio data to the memory 902 for further processing.
Wi-Fi belongs to short-distance wireless transmission technology, and a mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through a Wi-Fi module 907, and provides wireless broadband internet access for the user. Although fig. 9 shows the Wi-Fi module 907, it is understood that it does not belong to the essential constitution of the handset, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 908 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 902 and calling data stored in the memory 902, thereby performing overall monitoring of the mobile phone. Alternatively, processor 908 may include one or more processing units; preferably, the processor 908 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 908.
The handset also includes a power supply 909 (e.g., a battery) that provides power to the various components, which is preferably logically connected to the processor 908 via a power management system, such that the power management system performs functions of managing charging, discharging, and power consumption.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In this embodiment of the present invention, the processor 908 included in the terminal device further has the following functions: sending an opening request to a cloud server; the starting request is used for requesting to start a position service control in the cloud server; acquiring starting information of the position service control sent by the cloud server; the starting information is information sent by the cloud server after the cloud server starts the position service control according to the starting request so as to obtain initial position information, the position service control is used for providing position information of the terminal for cloud application, and the initial position information is initial position information preset for the terminal; if the position service control is determined to be successfully started according to the starting information, current position information of the terminal is obtained; and sending the current position information to the cloud server so that the cloud server updates the initial position information provided by the position service control to the current position information of the terminal.
On the other hand, embodiments of the present application further provide a storage medium, on which a computer program is stored, where the computer program is implemented to, when executed by a processor, perform the position information acquiring method provided in the foregoing embodiments, for example, including: acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server; opening the position service control according to the opening request to acquire initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal; sending the opening information of the position service control to the terminal; acquiring current position information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information; and updating the initial position information provided by the position service control into the current position information of the terminal. Further examples include: sending an opening request to a cloud server; the starting request is used for requesting to start a position service control in the cloud server; acquiring starting information of the position service control sent by the cloud server; the starting information is information sent by the cloud server after the cloud server starts the position service control according to the starting request so as to obtain initial position information, the position service control is used for providing position information of the terminal for cloud application, and the initial position information is initial position information preset for the terminal; if the position service control is determined to be successfully started according to the starting information, current position information of the terminal is obtained; and sending the current position information to the cloud server so that the cloud server updates the initial position information provided by the position service control to the current position information of the terminal.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the module described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the present application are generated in whole or in part when the computer program is loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The technical solutions provided by the embodiments of the present application are introduced in detail, and the principles and implementations of the embodiments of the present application are explained by applying specific examples in the embodiments of the present application, and the descriptions of the embodiments are only used to help understanding the method and core ideas of the embodiments of the present application; meanwhile, for a person skilled in the art, according to the idea of the embodiment of the present application, there may be a change in the specific implementation and application scope, and in summary, the content of the present specification should not be construed as a limitation to the embodiment of the present application.

Claims (10)

1. A method for acquiring location information, the method comprising:
acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server;
opening the position service control according to the opening request to acquire initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal;
sending the opening information of the position service control to the terminal;
acquiring current position information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information;
and updating the initial position information provided by the position service control into the current position information of the terminal.
2. The method according to claim 1, wherein the acquiring the current location information of the terminal sent by the terminal comprises:
acquiring a data packet sent by the terminal, wherein the data packet is obtained by sequencing current position information of the terminal after the terminal determines that the position service control is successfully started according to the starting information and packaging the current position information of the terminal after the sequencing according to a preset protocol;
and analyzing the data packet to obtain the current position information of the terminal.
3. The method according to claim 1 or 2, wherein the updating the initial location information provided by the location service control to the current location information of the terminal comprises:
acquiring a closing request of the position service control sent by the terminal;
closing the position service control according to the closing request;
and sending closing information of the position service control to the terminal, so that the terminal stops sending the position information of the terminal after determining that the position service control is successfully closed according to the closing information.
4. A method for acquiring location information, the method comprising:
sending an opening request to a cloud server; the starting request is used for requesting to start a position service control in the cloud server;
acquiring starting information of the position service control sent by the cloud server; the starting information is information sent by the cloud server after the cloud server starts the position service control according to the starting request so as to obtain initial position information, the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset by the terminal;
if the position service control is determined to be successfully started according to the starting information, current position information of the terminal is obtained;
and sending the current position information to the cloud server so that the cloud server updates the initial position information provided by the position service control to the current position information of the terminal.
5. The method according to claim 4, wherein the sending the current location information to the cloud server includes:
carrying out serialization processing on the current position information;
packaging the current position information after the serialization processing according to a preset protocol to obtain a data packet;
and sending the data packet to the cloud server.
6. The method according to claim 4, wherein the sending the current location information to the cloud server includes:
sending the current position information to the cloud server in real time; or the like, or, alternatively,
and sending the current position information to the cloud server according to a preset time interval.
7. The method according to any one of claims 4 to 6, wherein the sending the current location information to the cloud server thereafter includes:
sending a closing request of the position service control to the cloud server;
obtaining closing information of the position service control sent by the cloud server; the closing information is information sent by the cloud server after the cloud server closes the position service control according to the closing request;
and if the position service control is determined to be successfully closed according to the closing information, stopping sending the position information.
8. A positional information acquisition apparatus characterized by comprising:
the first acquisition unit is used for acquiring a starting request sent by a terminal; the starting request is used for requesting to start a position service control in the cloud server;
the starting unit is used for starting the position service control according to the starting request so as to obtain initial position information; the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset for the terminal;
a sending unit, configured to send opening information of the location service control to the terminal;
a second obtaining unit, configured to obtain current location information of the terminal sent by the terminal; the current position information of the terminal is the position information obtained after the terminal determines that the position service control is successfully started according to the starting information;
and the updating unit is used for updating the initial position information provided by the position service control into the current position information of the terminal.
9. A positional information acquisition apparatus characterized by comprising:
the cloud server comprises a first sending unit, a second sending unit and a third sending unit, wherein the first sending unit is used for sending an opening request to the cloud server; the starting request is used for requesting to start a position service control in the cloud server;
the first obtaining unit is used for obtaining the starting information of the position service control sent by the cloud server; the starting information is information sent by the cloud server after the cloud server starts the position service control according to the starting request so as to obtain initial position information, the position service control is used for providing position information of the terminal for cloud application, and the initial position information refers to initial position information preset by the terminal;
a second obtaining unit, configured to obtain current location information of the terminal if it is determined that the location service control is successfully started according to the start information;
a second sending unit, configured to send the current location information to the cloud server, so that the cloud server updates the initial location information provided by the location service control to the current location information of the terminal.
10. An electronic device, characterized in that the electronic device comprises:
at least one processor, memory, and transceiver;
wherein the memory is configured to store a computer program, and the processor is configured to invoke the computer program stored in the memory to perform the location information acquisition method according to any one of claims 1 to 3, or to perform the location information acquisition method according to any one of claims 4 to 7.
CN202011102542.1A 2020-10-15 2020-10-15 Position information acquisition method and device and electronic equipment Active CN112261099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011102542.1A CN112261099B (en) 2020-10-15 2020-10-15 Position information acquisition method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011102542.1A CN112261099B (en) 2020-10-15 2020-10-15 Position information acquisition method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112261099A CN112261099A (en) 2021-01-22
CN112261099B true CN112261099B (en) 2021-08-31

Family

ID=74243241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011102542.1A Active CN112261099B (en) 2020-10-15 2020-10-15 Position information acquisition method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112261099B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106797535A (en) * 2014-08-28 2017-05-31 酷派软件技术(深圳)有限公司 Terminal and its antitheft tracing method and anti-theft tracking device
CN108400926A (en) * 2017-02-08 2018-08-14 腾讯科技(深圳)有限公司 A kind of method of information processing, relevant device and system
CN109325363A (en) * 2018-09-26 2019-02-12 平安普惠企业管理有限公司 Management method, device, computer equipment and the storage medium of authority information
CN109817022A (en) * 2019-02-13 2019-05-28 腾讯科技(深圳)有限公司 A kind of method, terminal, automobile and system obtaining target object position

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017219266A1 (en) * 2016-06-22 2017-12-28 北京小米移动软件有限公司 Information displaying method, and information pushing method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106797535A (en) * 2014-08-28 2017-05-31 酷派软件技术(深圳)有限公司 Terminal and its antitheft tracing method and anti-theft tracking device
CN108400926A (en) * 2017-02-08 2018-08-14 腾讯科技(深圳)有限公司 A kind of method of information processing, relevant device and system
CN109325363A (en) * 2018-09-26 2019-02-12 平安普惠企业管理有限公司 Management method, device, computer equipment and the storage medium of authority information
CN109817022A (en) * 2019-02-13 2019-05-28 腾讯科技(深圳)有限公司 A kind of method, terminal, automobile and system obtaining target object position

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android智能手机的云服务应用研究;江燕良等;《单片机与嵌入式系统应用》;20130901(第09期);全文 *

Also Published As

Publication number Publication date
CN112261099A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
US10834432B2 (en) Method, device and system for in-sequence live streaming
US10341716B2 (en) Live interaction system, information sending method, information receiving method and apparatus
US10635449B2 (en) Method and apparatus for running game client
US20220210729A1 (en) Network slice determination method and related apparatus
US20170302990A1 (en) Method, terminal, and system for processing data of video stream
US10824449B2 (en) Application running method and device
US10701451B2 (en) Program interaction system, method, client, and backend server
EP4029582A1 (en) Information processing method, system and apparatus, and device and storage medium
CN106658064B (en) Virtual gift display method and device
WO2018006841A1 (en) Qr code information transmission method, device and apparatus
JP2017521899A (en) Method, terminal, server, and system for acquiring interactive information
WO2018137304A1 (en) Method for displaying 2d application in vr device, and terminal
WO2017215661A1 (en) Scenario-based sound effect control method and electronic device
WO2021078215A1 (en) Method for cross-terminal switching of cloud game and related device
CN111444237A (en) Server system, data transmission method and electronic equipment
WO2019071600A1 (en) Image processing method and apparatus
CN111475359B (en) System testing method, device and storage medium under multi-message interaction scene
CN109495769B (en) Video communication method, terminal, smart television, server and storage medium
WO2015135457A1 (en) Method, apparatus, and system for sending and playing multimedia information
CN112261099B (en) Position information acquisition method and device and electronic equipment
CN107623788B (en) Method and device for improving application starting speed and computer readable storage medium
CN113617020B (en) Game control method, game control device, storage medium, server and terminal
JP2022141683A (en) Application function implementation method and electronic device
CN111372127B (en) Data transmission method and related device
US10853412B2 (en) Scenario-based sound effect control method and 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
GR01 Patent grant
GR01 Patent grant