WO2017193795A1 - 一种移动终端的数据传输方法和装置 - Google Patents

一种移动终端的数据传输方法和装置 Download PDF

Info

Publication number
WO2017193795A1
WO2017193795A1 PCT/CN2017/081456 CN2017081456W WO2017193795A1 WO 2017193795 A1 WO2017193795 A1 WO 2017193795A1 CN 2017081456 W CN2017081456 W CN 2017081456W WO 2017193795 A1 WO2017193795 A1 WO 2017193795A1
Authority
WO
WIPO (PCT)
Prior art keywords
mobile terminal
long connection
heartbeat packet
time
connection heartbeat
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.)
Ceased
Application number
PCT/CN2017/081456
Other languages
English (en)
French (fr)
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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Publication of WO2017193795A1 publication Critical patent/WO2017193795A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

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/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a data transmission method and apparatus for a mobile terminal.
  • the mobile terminals have two processors, and the operating system, the user interface, and the application-related tasks are all executed on an AP (Application Processor), and the AP generally adopts an CPU of an ARM chip;
  • the mobile terminal radio frequency communication control software runs on another processor BP (Based Band Processor); wherein BP is always working, the AP does not work after the mobile terminal goes out of the screen, and performs the task again on the AP. You need to wake up the AP.
  • the task of the mobile terminal to send the data packet to the server is performed on the AP, and the task of transmitting the long connection heartbeat packet between the mobile terminal and the server is also performed on the AP, which is performed.
  • the execution of each of the two tasks requires the AP to wake up to work, resulting in higher power consumption.
  • the present invention has been made in order to provide a data transmission method and apparatus for a mobile terminal that overcomes the above problems or at least partially solves the above problems.
  • a data transmission method for a mobile terminal comprising: acquiring a data packet in a mobile terminal that needs to be sent to a server; and using the data packet as a long connection heartbeat between the mobile terminal and the server The package is sent to the server.
  • a data transmission apparatus for a mobile terminal comprising: a data acquisition unit adapted to acquire a data packet in a mobile terminal that needs to be sent to a server; and a data transmission unit adapted to The packet is sent to the server as a long connection heartbeat packet between the mobile terminal and the server.
  • a computer program comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform a data transmission method according to said mobile terminal .
  • a computer readable medium wherein a computer program as described above is stored.
  • the task of the mobile terminal to send the data packet to the server is performed on the AP, and the task of transmitting the long connection heartbeat packet between the mobile terminal and the server is also performed on the AP, which is performed.
  • the execution of each of the two tasks needs to wake up the AP to work, which will bring higher power consumption.
  • the technical solution provided by Ming is based on the rule that both tasks need to wake up the AP, and the two tasks are combined into one, and the data packet that needs to be sent to the server in the mobile terminal is used as the long connection heartbeat packet between the mobile terminal and the server;
  • the technical solution provided by the invention can not only complete the transmission of the data packet from the mobile terminal to the server, but also complete the function of maintaining the long connection between the mobile terminal and the server through the long connection heartbeat packet, and only needs to wake up the AP once, which greatly reduces
  • the power consumption of the mobile terminal is in line with the usage requirements of the mobile terminal.
  • FIG. 1 is a schematic flowchart diagram of a data transmission method of a mobile terminal according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a data transmission apparatus of a mobile terminal according to an embodiment of the present invention
  • Figure 3 schematically shows a block diagram of a computing device for performing the method according to the invention
  • Fig. 4 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • FIG. 1 is a schematic flowchart diagram of a data transmission method of a mobile terminal according to an embodiment of the present invention. As shown in Figure 1, the method includes:
  • Step S110 Acquire a data packet in the mobile terminal that needs to be sent to the server.
  • Step S120 Send the data packet as a long connection heartbeat packet between the mobile terminal and the server to the server.
  • AP Application Processor
  • the AP generally uses the CPU of the ARM chip.
  • the mobile terminal radio frequency communication control software runs on another processor BP (Based Band Processor); wherein BP is always working, the AP does not work after the mobile terminal goes out of the screen, and when the task is performed again on the AP Need to wake up the AP.
  • BP Based Band Processor
  • the task of the mobile terminal to send the data packet to the server is performed on the AP, and the task of transmitting the long connection heartbeat packet between the mobile terminal and the server is also performed on the AP, which is performed.
  • the execution of each task in the two tasks needs to wake up the AP to work, which will bring higher power consumption.
  • the method shown in Figure 1 is based on the rule that both tasks need to wake up the AP, and the two tasks are combined into one.
  • the data packet that needs to be sent to the server in the mobile terminal is used as a long connection heartbeat packet between the mobile terminal and the server. According to this scheme, the data packet can be transmitted from the mobile terminal to the server, or the long connection heartbeat packet can be completed.
  • the function of maintaining a long connection between the mobile terminal and the server only needs to wake up the AP once, which greatly reduces the power consumption of the mobile terminal and meets the usage requirements of the mobile terminal.
  • the data packet that the mobile terminal needs to send to the server is sent as a long connection heartbeat packet between the mobile terminal and the server. Before this, it is necessary to clearly identify the long connection between the mobile terminal and the server. There is, therefore, the method shown in FIG. 1 further includes: determining whether there is a long connection with the server in the mobile terminal.
  • the process of determining whether there is a long connection with the server in the mobile terminal may be: determining whether a notification that a long connection heartbeat packet needs to be sent is received, and if yes, determining that there is a long connection with the server in the mobile terminal.
  • an application in a mobile terminal first broadcasts a notification that a long connection heartbeat packet needs to be sent before sending a long connection heartbeat packet to the server.
  • the notification that the application in the mobile terminal needs to send a long connection heartbeat packet before being pushed to the server to send the long connection heartbeat packet can be received; wherein the notification of the long connection heartbeat packet needs to be sent out.
  • the one or more of the following may be included: an identifier of an application that needs to issue a long connection heartbeat packet in the mobile terminal, a push time of the next long connection heartbeat packet of the application, a push period of the long connection heartbeat packet of the application, and the like.
  • the data packet that needs to be sent to the server in step S110 of the method shown in FIG. 1 is positioning data of the mobile terminal.
  • Step S120, the step of sending the data packet as a long connection heartbeat packet between the mobile terminal and the server to the server includes:
  • Step S121 receiving a notification that a long connection heartbeat packet needs to be sent.
  • Step S123 Determine whether the notification that the long connection heartbeat packet needs to be issued meets a preset condition.
  • Step S125 If yes, send the positioning data of the mobile terminal to the application that needs to send a long connection heartbeat packet, and the application that needs to send the long connection heartbeat packet pushes the positioning data of the mobile terminal as a long connection heartbeat packet to server.
  • step S127 if it does not match, when the next preset positioning time is reached, the location information of the mobile terminal is acquired and recorded, and the location information of the mobile terminal is directly sent to the server, and is not sent together by the long connection heartbeat packet.
  • Step S123 determining whether the notification that the long connection heartbeat packet needs to be sent meets the preset condition includes:
  • step S123a the push time of the long connection heartbeat packet is extracted from the notification that the long connection heartbeat packet needs to be sent.
  • Step S123b Determine whether the time difference between the push time of the long connection heartbeat packet and the next preset positioning time is within a preset time range.
  • Step S123c if yes, determining that the notification that the long connection heartbeat packet needs to be issued meets a preset condition.
  • the notification that the long-term connection heartbeat packet needs to be issued in accordance with the preset conditions determined by the above process includes two cases:
  • the notification that the long connection heartbeat packet needs to be sent meets the preset condition, and the push time of the long connection heartbeat packet is before the next preset positioning time, that is, the long connection heartbeat packet is to be sent before the preset positioning time.
  • the positioning data needs to be sent out in advance, and then the positioning time needs to be advanced to adapt to the pushing time of the long connection heartbeat packet; specifically, in this case
  • Obtaining, in the mobile terminal, the data packet that needs to be sent to the server comprising: acquiring and recording the mobile before the push time of the long connection heartbeat packet and the push time of the long connection heartbeat packet is different from the push time by a first time interval
  • the location information of the terminal is used as positioning data of the mobile terminal.
  • the process of obtaining the location information of the mobile terminal takes a certain time, and the first time interval is used by the mobile terminal to obtain the location information, so that after obtaining the location information of the mobile terminal,
  • the positioning data of the mobile terminal is sent to an application that needs to issue a long connection heartbeat packet, and the application pushes the positioning data as a long connection heartbeat packet to the server at the push time.
  • the push time of the long connection heartbeat packet is after the next preset positioning time, that is, after the long connection heartbeat packet is between the preset positioning Issued, in order to push the positioning data of the mobile terminal as a long connection heartbeat packet to the server, the number of positioning needs to be
  • the push time of the long-connected heartbeat packet is adapted; specifically, the step of acquiring the data packet in the mobile terminal that needs to be sent to the server in this case includes: when the next preset positioning time is reached, Obtaining and recording location information of the mobile terminal as positioning data of the mobile terminal.
  • the positioning data is not sent immediately, but the positioning data is sent to an application that needs to send a long connection heartbeat packet to wait, and the pushing time of the long connection heartbeat packet is reached, and the positioning data is used by the application.
  • the long connection heartbeat packet is pushed to the server, or the positioning data is sent to the application that needs to send a long connection heartbeat packet before the push time of the long connection heartbeat packet and the second time interval of the push time of the long connection heartbeat packet.
  • the application pushes the location data as a long connection heartbeat packet to the server.
  • the positioning task is adapted to the push task of the long connection heartbeat packet by adjusting the positioning task to a certain extent without affecting the positioning effect, so that the sending data of the positioning data and the push of the long connection heartbeat packet are made.
  • Time alignment, pushing the positioning data as a long-connected heartbeat packet has two important things, which is of great significance.
  • the positioning task can be adjusted to adapt to the push time of the long-connected heartbeat packet, and the positioning analysis result of the subsequent server side is not affected, and if not, the first positioning task is not the first time.
  • the server side has obtained the previous positioning data. The unrestricted adjustment of the current positioning task may result in errors in the positioning analysis result of the subsequent server side, which may affect the positioning effect.
  • the next preset positioning time of the mobile terminal is 9:10 AM
  • the notification that the application a needs to issue a long connection heartbeat packet is subscribed to, and at 9:00 AM, the notification that the application a needs to send a long connection heartbeat packet is received.
  • the push time for extracting the long connection heartbeat packet from the notification that the long connection heartbeat packet needs to be sent is 9:08 AM
  • the time difference between the push time of the long connection heartbeat packet and the next preset positioning time of the mobile terminal is 2 min. If the time difference is within the preset time range of 5 minutes, it is determined that the received notification that the long connection heartbeat packet needs to be sent meets the preset condition, and the location information of the mobile terminal is obtained as the positioning data of the mobile terminal at 9:07 AM.
  • the positioning data is pushed to the server as a long connection heartbeat packet at 9:08 AM.
  • receiving the notification that the application a needs to issue a long connection heartbeat packet, and extracting the push time of the long connection heartbeat packet from the notification that the long connection heartbeat packet needs to be sent is 9:13 AM, the push time and movement of the long connection heartbeat packet
  • the time difference between the next preset positioning time of the terminal is 3 minutes.
  • the preset positioning time is 9:10AM. Taking the location information of the mobile terminal as the positioning data of the mobile terminal, the positioning data is sent to the application a that needs to send the long connection heartbeat packet to wait, and the application a pushes the positioning data as a long connection heartbeat packet to the server at 9:13AM. .
  • the time for actually acquiring the positioning data is the push of the long connection heartbeat packet.
  • the time of the first time interval before the time is the time when the next preset positioning time is a preset period of time, and the time for actually transmitting the positioning data is the pushing time of the long connection heartbeat packet; when the long connection heartbeat packet is long After the preset positioning time, the time for actually obtaining the positioning data is the preset positioning time, and the next preset positioning time is the time after a preset period from the moment, and the time for actually transmitting the positioning data is Long push time for heartbeat packets.
  • the method further includes: using a time after a preset positioning period from the time when the location information of the mobile terminal is acquired the previous time as the next preset positioning time.
  • the push frequency of the long-connected heartbeat packet when the push frequency of the long-connected heartbeat packet is higher than the positioning frequency, a plurality of notifications that need to send a long-connected heartbeat packet are received in each preset positioning period, in order to avoid having more than one need to issue
  • the notification of the long connection heartbeat packet falls within a range that meets the preset condition, and the preset time range should be smaller than the push period of the long connection heartbeat packet, which may be: the preset time range and the push period of the long connection heartbeat packet
  • the preset time range is, for example, 1/4 of the push period of the long connection heartbeat packet.
  • the preset time range is 1 min
  • the long connection heartbeat packet is The above adaptation and adjustment can be performed on the positioning task within a time interval of 1 min between the push time and the next preset positioning time.
  • the mobile terminal should perform multiple positioning in the push period of each long-connected heartbeat packet, and the preset time range should be less than the preset positioning period.
  • the preset time range may be a preset ratio of the positioning period of the mobile terminal; for example, the preset time range is 1/4 of the preset positioning period, and when the preset positioning period is 4 minutes, the pre-predetermined period is The time range is 1 min, and the time difference between the push time of the long connection heartbeat packet and the next preset positioning time is within 1 min to perform the above adaptation and adjustment on the positioning task.
  • the mobile terminal is a smart watch.
  • FIG. 2 shows a schematic diagram of a data transmission apparatus of a mobile terminal according to an embodiment of the present invention.
  • the data transmission device of the mobile terminal includes:
  • the data obtaining unit 210 is adapted to acquire a data packet in the mobile terminal that needs to be sent to the server.
  • the data transmission unit 220 is adapted to send the data packet as a long connection heartbeat packet between the mobile terminal and the server to the server.
  • the task of the mobile terminal to send the data packet to the server is performed on the AP, and the task of sending the long connection heartbeat packet between the mobile terminal and the server is also performed on the AP, and each of the two tasks is performed.
  • the execution needs to wake up the AP to work, which will bring higher power consumption.
  • the device shown in Figure 2 is based on the rule that both tasks need to wake up the AP, and the two tasks are combined into one, and the mobile terminal needs to be sent.
  • the data packet to the server is used as a long connection heartbeat packet between the mobile terminal and the server. According to this scheme, the data packet can be transmitted from the mobile terminal to the server, and the long connection heartbeat packet can be used to maintain the mobile terminal and the server.
  • the long connection function and only needs to wake up the AP once, which greatly reduces the power consumption of the mobile terminal and meets the usage requirements of the mobile terminal.
  • the data transmission unit 220 is further adapted to determine whether there is a long connection with the server in the mobile terminal.
  • the data transmission unit 210 is adapted to determine whether a notification that a long connection heartbeat packet needs to be sent is received, and if yes, determine that there is a long connection between the mobile terminal and the server.
  • the data packet that needs to be sent to the server is positioning data of the mobile terminal.
  • the data transmission unit 220 is adapted to receive a notification that a long connection heartbeat packet needs to be sent; determine whether the notification that the long connection heartbeat packet needs to be sent meets a preset condition; if yes, send the positioning data of the mobile terminal to need to be sent long
  • the application for connecting the heartbeat packet is used to push the positioning data of the mobile terminal as a long connection heartbeat packet to the server by the application that needs to issue a long connection heartbeat packet.
  • the data transmission unit 220 is configured to extract a push time of the long connection heartbeat packet from the notification that the long connection heartbeat packet needs to be sent out; determine a push time of the long connection heartbeat packet and a next preset location Whether the time difference between the time is within the preset time range; if so, determining that the notification that the long connection heartbeat packet needs to be issued meets the preset condition.
  • the data acquiring unit 210 is adapted to be in the Before the push time of the long connection heartbeat packet is different from the push time of the long connection heartbeat packet, the location information of the mobile terminal is acquired and recorded as the positioning data of the mobile terminal.
  • the data acquiring unit 210 is adapted to arrive under When the positioning time is preset, the location information of the mobile terminal is acquired and recorded as the positioning data of the mobile terminal.
  • the data transmission unit 220 is further adapted to use the time after a preset positioning period from the time when the location information of the mobile terminal is acquired last time as the next preset positioning. time.
  • the preset time range when the push frequency of the long connection heartbeat packet is higher than the positioning frequency, the preset time range is a preset ratio with the push period of the long connection heartbeat packet; when the push frequency of the long connection heartbeat packet is When the positioning frequency of the mobile terminal is lower than the positioning frequency of the mobile terminal, the preset time range is at a preset ratio to the positioning period of the mobile terminal.
  • the mobile terminal is a smart watch.
  • the data transmission unit 220 is further adapted to subscribe to a notification in the mobile terminal that a long connection heartbeat packet needs to be sent.
  • AP Application Processor
  • the AP generally uses the CPU of the ARM chip.
  • the mobile terminal radio frequency communication control software runs on another processor BP (Based Band Processor); wherein BP is always working, the AP does not work after the mobile terminal goes out of the screen, and performs the task again on the AP. You need to wake up the AP.
  • BP Binary Band Processor
  • the task of the mobile terminal to send the data packet to the server is performed on the AP, and the task of transmitting the long connection heartbeat packet between the mobile terminal and the server is also performed on the AP, which is performed.
  • the execution of each task in the two tasks needs to wake up the AP to work, which will bring higher power consumption.
  • the scheme is based on the rule that both tasks need to wake up the AP, and the two tasks are combined into one, and the mobile terminal is combined.
  • the data packet that needs to be sent to the server is used as a long connection heartbeat packet between the mobile terminal and the server. According to this scheme, the data packet can be transmitted from the mobile terminal to the server, and the mobile terminal can be maintained through the long connection heartbeat packet.
  • the long connection function between the servers, and only needs to wake up the AP once which greatly reduces the power consumption of the mobile terminal and meets the usage requirements of the mobile terminal.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the data transmission device of the mobile terminal in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 3 shows a block diagram of a computing device for performing the method in accordance with the present invention.
  • the computing device conventionally includes a processor 310 and a computer program product or computer readable medium in the form of a memory 320.
  • the memory 320 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • the memory 320 has storage for performing any of the above methods
  • storage space 330 storing program code may store various program code 331 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such computer program products are typically portable or fixed storage units such as those shown in FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 320 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit stores computer readable program code 331' for performing the steps of the method according to the invention, ie program code readable by a processor such as 310, when the program code is run by the computing device, resulting in The computing device performs the various steps in the methods described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种移动终端的数据传输方法和装置,所述方法包括:获取移动终端中的需要发送到服务器的数据包;将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器。其中,移动终端要将数据包发送到服务器的任务是在AP上执行的,而在移动终端与服务器之间发送长连接心跳包的任务也是在AP上执行的。本方案基于将数据包发送到服务器以及在移动终端与服务器之间发送长连接心跳包两个任务都需要唤醒AP的规律,将两个任务合二为一,既可以完成数据包从移动终端到服务器的传送,也可以完成通过长连接心跳包维持移动终端与服务器之间的长连接的功能,且只需要唤醒一次AP,大大降低了移动终端的电量消耗。

Description

一种移动终端的数据传输方法和装置 技术领域
本发明涉及互联网技术领域,具体涉及一种移动终端的数据传输方法和装置。
背景技术
现有技术中,大多数的移动终端都含有两个处理器,操作系统、用户界面和应用程序相关的任务都在AP(Application Processor,应用处理器)上执行,AP一般采用ARM芯片的CPU;而移动终端射频通信控制软件则运行在另一个处理器BP(Basedband Processor,基带处理器)上;其中BP是一直工作的,AP在移动终端熄屏之后就不再工作,再次在AP上执行任务时需要唤醒AP。在本发明提供的技术方案中,移动终端要将数据包发送到服务器的任务是在AP上执行的,而在移动终端与服务器之间发送长连接心跳包的任务也是在AP上执行的,这两个任务中每个任务的执行都需要唤醒AP来工作,会带来较高的电量消耗。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的移动终端的数据传输方法和装置。
依据本发明的一个方面,提供了一种移动终端的数据传输方法,包括:获取移动终端中的需要发送到服务器的数据包;以及将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器。
依据本发明的另一个方面,提供了一种移动终端的数据传输装置,包括:数据获取单元,适于获取移动终端中的需要发送到服务器的数据包;以及数据传输单元,适于将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器。
依据本发明的另一个方面,提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据上述的移动终端的数据传输方法。
依据本发明的另一个方面,提供了一种计算机可读介质,其中存储了如上所述的计算机程序。
由上述可知,在本方案中,移动终端要将数据包发送到服务器的任务是在AP上执行的,而在移动终端与服务器之间发送长连接心跳包的任务也是在AP上执行的,这两个任务中每个任务的执行都需要唤醒AP来工作,会带来较高的电量消耗,本发 明提供的技术方案基于两个任务都需要唤醒AP的规律,将两个任务合二为一,将移动终端中需要发送给服务器的数据包作为移动终端与服务器之间的长连接心跳包;依据本发明提供的技术方案,既可以完成数据包从移动终端到服务器的传送,也可以完成通过长连接心跳包维持移动终端与服务器之间的长连接的功能,且只需要唤醒一次AP,大大降低了移动终端的电量消耗,符合移动终端的使用需求。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了根据本发明一个实施例的一种移动终端的数据传输方法的流程示意图;
图2示出了根据本发明一个实施例的一种移动终端的数据传输装置的示意图;
图3示意性地示出了用于执行根据本发明的方法的计算设备的框图;以及
图4示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
具体实施例
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
图1示出了根据本发明一个实施例的一种移动终端的数据传输方法的流程示意图。如图1所示,该方法包括:
步骤S110,获取移动终端中的需要发送到服务器的数据包。
步骤S120,将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器。
一般来说,大多数的移动终端都含有两个处理器,操作系统、用户界面和应用程序相关的任务都在AP(Application Processor,应用处理器)上执行,AP一般采用ARM芯片的CPU;而移动终端射频通信控制软件则运行在另一个处理器BP(Basedband Processor,基带处理器)上;其中BP是一直工作的,AP在移动终端熄屏之后就不再工作,再次在AP上执行任务时需要唤醒AP。在图1所示的方法中,移动终端要将数据包发送到服务器的任务是在AP上执行的,而在移动终端与服务器之间发送长连接心跳包的任务也是在AP上执行的,这两个任务中每个任务的执行都需要唤醒AP来工作,会带来较高的电量消耗,图1所示的方法基于两个任务都需要唤醒AP的规律,将两个任务合二为一,将移动终端中需要发送给服务器的数据包作为移动终端与服务器之间的长连接心跳包,依据此方案,既可以完成数据包从移动终端到服务器的传送,也可以完成通过长连接心跳包维持移动终端与服务器之间的长连接的功能,且只需要唤醒一次AP,大大降低了移动终端的电量消耗,符合移动终端的使用需求。
图1所示的方法中要将移动终端需要发送给服务器的数据包当做移动终端与服务器之间的长连接心跳包进行发送,在这之前,需要明确的是移动终端与服务器之间的长连接是存在的,因此,图1所示的方法进一步包括:判断移动终端中是否存在与服务器之间的长连接。
具体地,判断移动终端中是否存在与服务器之间的长连接的过程可以是:判断是否接收到需要发出长连接心跳包的通知,若是,则确定移动终端中存在与服务器之间的长连接。通常情况下,移动终端中的应用在需要向服务器发送长连接心跳包之前会先广播需要发出长连接心跳包的通知,在本发明的一个实施例中,当订阅移动终端中一个应用的需要发出长连接心跳包的通知后,便可以接收到移动终端中的该应用在向服务器推送长连接心跳包之前所广播的需要发出长连接心跳包的通知;其中,需要发出长连接心跳包的通知中可以包括以下一种或几种:移动终端中需要发出长连接心跳包的应用的标识,该应用的下一个长连接心跳包的推送时间,该应用的长连接心跳包的推送周期等。
在一个具体的实施例中,图1所示方法的步骤S110中需要发送到服务器的数据包为移动终端的定位数据。则步骤S120将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器的步骤包括:
步骤S121,接收需要发出长连接心跳包的通知。
步骤S123,判断所述需要发出长连接心跳包的通知是否符合预设条件。
步骤S125,若符合,将移动终端的定位数据发送至需要发出长连接心跳包的应用,由所述需要发出长连接心跳包的应用将所述移动终端的定位数据作为一个长连接心跳包推送至服务器。
步骤S127,若不符合,在到达下一预设定位时间时,获取并记录移动终端的位置信息并直接将移动终端的位置信息发送至服务器,不再借助长连接心跳包一同发送。
其中,步骤S123判断所述需要发出长连接心跳包的通知是否符合预设条件的步骤包括:
步骤S123a,从所述需要发出长连接心跳包的通知中提取出长连接心跳包的推送时间。
步骤S123b,判断所述长连接心跳包的推送时间与下一预设定位时间之间的时间差是否在预设时间范围内。
步骤S123c,若是,确定所述需要发出长连接心跳包的通知符合预设条件。
上述过程判断出的符合预设条件的需要发出长连接心跳包的通知包括两种情况:
情况1,所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之前,也就是说长连接心跳包要在预设定位时间之前发出,为了将移动终端的定位数据作为长连接心跳包推送到服务器,需要将定位数据提前发出,进而需要将定位时间提前,以适配于长连接心跳包的推送时间;具体地,在这种情况下获取移动终端中的需要发送到服务器的数据包的步骤包括:在所述长连接心跳包的推送时间之前且与所述长连接心跳包的推送时间相差第一时间间隔时,获取并记录移动终端的位置信息作为所述移动终端的定位数据。其中,考虑到获取移动终端的位置信息的过程是需要一定时间的,所述第一时间间隔即是留给移动终端获取位置信息所用的,以使得获取到移动终端的位置信息之后,来得及将该移动终端的定位数据发送给需要发出长连接心跳包的应用,由该应用将定位数据作为长连接心跳包在推送时间推送到服务器。
情况2,所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之后,也就是说长连接心跳包要在预设定位之间之后发出,为了将移动终端的定位数据作为长连接心跳包推送到服务器,需要将定位数 据延后发出,以适配长连接心跳包的推送时间;具体地,在这种情况下获取移动终端中的需要发送到服务器的数据包的步骤包括:在到达下一预设定位时间时,获取并记录移动终端的位置信息作为所述移动终端的定位数据。其中,在定位时间获取到定位数据之后不立即发出,而是将定位数据发送给需要发出长连接心跳包的应用进行等待,等到达长连接心跳包的推送时间,由所述应用将定位数据作为长连接心跳包推送到服务器,或者,在长连接心跳包的推送时间之前且与长连接心跳包的推送时间距离第二时间间隔时将定位数据发送给需要发出长连接心跳包的应用,由所述应用将定位数据作为长连接心跳包推送到服务器。
可见,本实施例在不影响定位效果的前提下,通过对定位任务的一定程度的调整使得定位任务适配于长连接心跳包的推送任务,使得定位数据的发送数据与长连接心跳包的推送时间对齐,将定位数据作为长连接心跳包进行推送,一举两得,具有重要的意义。其中需要说明的是,在有的实施例中,针对第一次获取移动终端的定位数据的定位任务,只要接收到需要发出长连接心跳包的通知,由于之前没有定位数据,因此无论该需要发出长连接心跳包的通知是否符合条件,都可以调整该定位任务来适配于长连接心跳包的推送时间,不会影响到后续服务器侧的定位分析结果,反之,如果不是第一次的定位任务,则服务器侧已经获取到先前的定位数据,对本次的定位任务不加限制的调整会导致后续服务器侧的定位分析结果有误差,影响定位效果。
例如,移动终端的下一预设定位时间为9:10AM,订阅了移动终端中应用a需要发出长连接心跳包的通知,在9:00AM时,接收到应用a需要发出长连接心跳包的通知,从该需要发出长连接心跳包的通知中提取出长连接心跳包的推送时间是9:08AM,该长连接心跳包的推送时间与移动终端的下一预设定位时间之间的时间差为2min,该时间差在预设时间范围5min内,则判断所接收到的该需要发出长连接心跳包的通知符合预设条件,则可在9:07AM时获取移动终端的位置信息作为移动终端的定位数据,将该定位数据发送给需要发出长连接心跳包的应用a,9:07AM-9:08AM之间的第一时间间隔是预留给获取位置信息并发送给应用a的过程所用,由应用a在9:08AM将该定位数据作为长连接心跳包推送到服务器。或者,接收到应用a需要发出长连接心跳包的通知,从该需要发出长连接心跳包的通知中提取出长连接心跳包的推送时间是9:13AM,该长连接心跳包的推送时间与移动终端的下一预设定位时间之间的时间差为3min,该时间差在预设时间范围5min内,则判断所接收到的该需要发出长连接心跳包的通知符合预设条件,则在到达下一预设定位时间9:10AM时获 取移动终端的位置信息作为移动终端的定位数据,将该定位数据发送给需要发出长连接心跳包的应用a进行等待,由应用a在9:13AM将该定位数据作为长连接心跳包推送到服务器。
从上述的例子中可以看出,对于符合条件的需要发出长连接心跳包的通知,当长连接心跳包的推送时间在预设定位时间之前,实际获取定位数据的时间是长连接心跳包的推送时间之前第一时间间隔的时刻,则其下一预设定位时间是从该时刻起经过一个预设周期的时间,实际发送定位数据的时间是长连接心跳包的推送时间;当长连接心跳包的推送时间在预设定位时间之后,实际获取定位数据的时间是预设定位时间,则其下一预设定位时间是从该时刻起经过一个预设周期的时间,实际发送定位数据的时间是长连接心跳包的推送时间。总结来说,即上述方法进一步包括:将从前一次获取移动终端的位置信息的时间开始经过一个预设定位周期后的时间作为下一预设定位时间。
依据上述具体的实施例,当长连接心跳包的推送频率高于定位频率时,每个预设定位周期内将接收到多个需要发出长连接心跳包的通知,为了避免有不止一个的需要发出长连接心跳包的通知落入符合预设条件的范围内,所述预设时间范围应当小于长连接心跳包的推送周期,可以是:所述预设时间范围与长连接心跳包的推送周期成预设比率;例如,所述预设时间范围是长连接心跳包的推送周期的1/4,当上述长连接心跳包的推送周期为4min时,预设时间范围是1min,长连接心跳包的推送时间与下一预设定位时间之间的时间差在1min之内才可以对定位任务执行上述适配和调整。相应地,当长连接心跳包的推送频率低于移动终端的定位频率时,每个长连接心跳包的推送周期内移动终端应当做多次定位,所述预设时间范围应当小于预设定位周期,可以是:所述预设时间范围与移动终端的定位周期成预设比率;例如,所述预设时间范围是预设定位周期的1/4,当上述预设定位周期为4min时,预设时间范围是1min,长连接心跳包的推送时间与下一预设定位时间之间的时间差在1min之内才可以对定位任务执行上述适配和调整。
在本发明的一个实施例中,所述移动终端为智能手表。
图2示出了根据本发明一个实施例的一种移动终端的数据传输装置的示意图。如图2所示,该移动终端的数据传输装置包括:
数据获取单元210,适于获取移动终端中的需要发送到服务器的数据包。
数据传输单元220,适于将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器。
可见,移动终端要将数据包发送到服务器的任务是在AP上执行的,而在移动终端与服务器之间发送长连接心跳包的任务也是在AP上执行的,这两个任务中每个任务的执行都需要唤醒AP来工作,会带来较高的电量消耗,图2所示的装置基于两个任务都需要唤醒AP的规律,将两个任务合二为一,将移动终端中需要发送给服务器的数据包作为移动终端与服务器之间的长连接心跳包,依据此方案,既可以完成数据包从移动终端到服务器的传送,也可以完成通过长连接心跳包维持移动终端与服务器之间的长连接的功能,且只需要唤醒一次AP,大大降低了移动终端的电量消耗,符合移动终端的使用需求。
在本发明的一个实施例中,所述数据传输单元220,进一步适于判断移动终端中是否存在与服务器之间的长连接。
其中,所述数据传输单元210,适于判断是否接收到需要发出长连接心跳包的通知,若是,则确定移动终端中存在与服务器之间的长连接。
在本发明的一个具体的实施例中,所述需要发送到服务器的数据包为移动终端的定位数据。
所述数据传输单元220,适于接收需要发出长连接心跳包的通知;判断所述需要发出长连接心跳包的通知是否符合预设条件;若符合,将移动终端的定位数据发送至需要发出长连接心跳包的应用,由所述需要发出长连接心跳包的应用将所述移动终端的定位数据作为一个长连接心跳包推送至服务器。
具体地,所述数据传输单元220,适于从所述需要发出长连接心跳包的通知中提取出长连接心跳包的推送时间;判断所述长连接心跳包的推送时间与下一预设定位时间之间的时间差是否在预设时间范围内;若是,确定所述需要发出长连接心跳包的通知符合预设条件。
其中,一种情况,若所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之前,所述数据获取单元210,适于在所述长连接心跳包的推送时间之前且与所述长连接心跳包的推送时间相差第一时间间隔时,获取并记录移动终端的位置信息作为所述移动终端的定位数据。另一种情况,若所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之后,所述数据获取单元210,适于在到达下一预设定位时间时,获取并记录移动终端的位置信息作为所述移动终端的定位数据。
在本发明的一个实施例中,所述数据传输单元220,进一步适于将从前一次获取移动终端的位置信息的时间开始经过一个预设定位周期后的时间作为下一预设定位 时间。
在本发明的一个实施例中,当长连接心跳包的推送频率高于定位频率时,所述预设时间范围与长连接心跳包的推送周期成预设比率;当长连接心跳包的推送频率低于移动终端的定位频率时,所述预设时间范围与移动终端的定位周期成预设比率。
在本发明的一个实施例中,所述移动终端为智能手表。
在本发明的一个实施例中,所述数据传输单元220,进一步适于订阅移动终端中需要发出长连接心跳包的通知。
需要说明的是,图2所示装置的各实施例与图1所示方法的各实施例对应相同,上文中已经详细说明,在此不再赘述。
综上所述,大多数的移动终端都含有两个处理器,操作系统、用户界面和应用程序相关的任务都在AP(Application Processor,应用处理器)上执行,AP一般采用ARM芯片的CPU;而移动终端射频通信控制软件则运行在另一个处理器BP(Basedband Processor,基带处理器)上;其中BP是一直工作的,AP在移动终端熄屏之后就不再工作,再次在AP上执行任务时需要唤醒AP。在本发明提供的技术方案中,移动终端要将数据包发送到服务器的任务是在AP上执行的,而在移动终端与服务器之间发送长连接心跳包的任务也是在AP上执行的,这两个任务中每个任务的执行都需要唤醒AP来工作,会带来较高的电量消耗,该方案基于两个任务都需要唤醒AP的规律,将两个任务合二为一,将移动终端中需要发送给服务器的数据包作为移动终端与服务器之间的长连接心跳包,依据此方案,既可以完成数据包从移动终端到服务器的传送,也可以完成通过长连接心跳包维持移动终端与服务器之间的长连接的功能,且只需要唤醒一次AP,大大降低了移动终端的电量消耗,符合移动终端的使用需求。
需要说明的是:
在此提供的算法和显示不与任何特定计算机、虚拟装置或者其它设备固有相关。各种通用装置也可以与基于在此的示教一起使用。根据上面的描述,构造这类装置所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的移动终端的数据传输装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图3示出了用于执行根据本发明的方法的计算设备的框图。该计算设备传统上包括处理器310和以存储器320形式的计算机程序产品或者计算机可读介质。存储器320可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器320具有存储用于执行上述方法中的任何 方法步骤的程序代码331的存储空间330。例如,存储程序代码的存储空间330可以存储分别用于实现上面的方法中的各种步骤的各个程序代码331。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为例如图4所示的便携式或者固定存储单元。该存储单元可以具有与图3的计算设备中的存储器320类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元存储有用于执行根据本发明的方法步骤的计算机可读程序代码331’,即可以由诸如310之类的处理器读取的程序代码,当这些程序代码由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。

Claims (26)

  1. 一种移动终端的数据传输方法,包括:
    获取移动终端中的需要发送到服务器的数据包;以及
    将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器。
  2. 如权利要求1所述的方法,还包括:
    判断移动终端中是否存在与服务器之间的长连接。
  3. 如权利要求2所述的方法,其中,判断移动终端中是否存在与服务器之间的长连接的步骤进一步包括:
    判断是否接收到需要发出长连接心跳包的通知,若是,则移动终端中存在与服务器之间的长连接。
  4. 如权利要求1-3中任一项所述的方法,其中,所述需要发送到服务器的数据包为移动终端的定位数据。
  5. 如权利要求4所述的方法,其中,所述将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器的步骤进一步包括:
    接收需要发出长连接心跳包的通知;
    判断所述需要发出长连接心跳包的通知是否符合预设条件;以及
    若符合,将移动终端的定位数据发送至需要发出长连接心跳包的应用,由所述需要发出长连接心跳包的应用将所述移动终端的定位数据作为一个长连接心跳包推送至服务器。
  6. 如权利要求5所述的方法,其中,所述判断所述需要发出长连接心跳包的通知是否符合预设条件的步骤进一步包括:
    从所述需要发出长连接心跳包的通知中提取出长连接心跳包的推送时间;
    判断所述长连接心跳包的推送时间与下一预设定位时间之间的时间差是否在预设时间范围内;以及
    若是,确定所述需要发出长连接心跳包的通知符合预设条件。
  7. 如权利要求6所述的方法,其中,若所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之前,则所述获取移动终端中的需要发送到服务器的数据包的步骤进一步包括:
    在所述长连接心跳包的推送时间之前且与所述长连接心跳包的推送时间相差第一时间间隔时,获取并记录移动终端的位置信息作为所述移动终端的定位数 据。
  8. 如权利要求6或7所述的方法,其中,若所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之后,则所述获取移动终端中的需要发送到服务器的数据包的步骤进一步包括:
    在到达下一预设定位时间时,获取并记录移动终端的位置信息作为所述移动终端的定位数据。
  9. 如权利要求1-8中任一项所述的方法,还包括:
    将从前一次获取移动终端的位置信息的时间开始经过一个预设定位周期后的时间作为下一预设定位时间。
  10. 如权利要求1-9中任一项所述的方法,其中,
    当长连接心跳包的推送频率高于定位频率时,所述预设时间范围与长连接心跳包的推送周期成预设比率;
    当长连接心跳包的推送频率低于移动终端的定位频率时,所述预设时间范围与移动终端的定位周期成预设比率。
  11. 如权利要求1-10中任一项所述的方法,其中,所述移动终端为智能手表。
  12. 如权利要求1-11中任一项所述的方法,还包括:
    订阅移动终端中需要发出长连接心跳包的通知。
  13. 一种移动终端的数据传输装置,包括:
    数据获取单元,适于获取移动终端中的需要发送到服务器的数据包;以及
    数据传输单元,适于将所述数据包作为移动终端与服务器之间的长连接心跳包发送至服务器。
  14. 如权利要求13所述的装置,其中,
    所述数据传输单元,进一步适于判断移动终端中是否存在与服务器之间的长连接。
  15. 如权利要求14所述的装置,其中,
    所述数据传输单元,适于判断是否接收到需要发出长连接心跳包的通知,若是,则确定移动终端中存在与服务器之间的长连接。
  16. 如权利要求13-15中任一项所述的装置,其中,所述需要发送到服务器的数据包为移动终端的定位数据。
  17. 如权利要求16所述的装置,其中,
    所述数据传输单元,适于接收需要发出长连接心跳包的通知;判断所述需要发出长连接心跳包的通知是否符合预设条件;若符合,将移动终端的定位数据发送至需要发出长连接心跳包的应用,由所述需要发出长连接心跳包的应用将所述移动终端的定位数据作为一个长连接心跳包推送至服务器。
  18. 如权利要求17所述的装置,其中,
    所述数据传输单元,适于从所述需要发出长连接心跳包的通知中提取出长连接心跳包的推送时间;判断所述长连接心跳包的推送时间与下一预设定位时间之间的时间差是否在预设时间范围内;若是,确定所述需要发出长连接心跳包的通知符合预设条件。
  19. 如权利要求18所述的装置,其中,若所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之前,
    所述数据获取单元,适于在所述长连接心跳包的推送时间之前且与所述长连接心跳包的推送时间相差第一时间间隔时,获取并记录移动终端的位置信息作为所述移动终端的定位数据。
  20. 如权利要求18或19所述的装置,其中,若所述需要发出长连接心跳包的通知符合预设条件且所述长连接心跳包的推送时间在下一预设定位时间之后,
    所述数据获取单元,适于在到达下一预设定位时间时,获取并记录移动终端的位置信息作为所述移动终端的定位数据。
  21. 如权利要求13-20中任一项所述的装置,其中,
    所述数据传输单元,进一步适于将从前一次获取移动终端的位置信息的时间开始经过一个预设定位周期后的时间作为下一预设定位时间。
  22. 如权利要求13-21中任一项所述的装置,其中,
    当长连接心跳包的推送频率高于定位频率时,所述预设时间范围与长连接心跳包的推送周期成预设比率;
    当长连接心跳包的推送频率低于移动终端的定位频率时,所述预设时间范围与移动终端的定位周期成预设比率。
  23. 如权利要求13-22中任一项所述的装置,其中,所述移动终端为智能手表。
  24. 如权利要求13-23中任一项所述的装置,其中,
    所述数据传输单元,进一步适于订阅移动终端中需要发出长连接心跳包的通知。
  25. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-12中的任一个所述的移动终端的数据传输方法。
  26. 一种计算机可读介质,其中存储了如权利要求25所述的计算机程序。
PCT/CN2017/081456 2016-05-10 2017-04-21 一种移动终端的数据传输方法和装置 Ceased WO2017193795A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610307898.6A CN105978966B (zh) 2016-05-10 2016-05-10 一种移动终端的数据传输方法和装置
CN201610307898.6 2016-05-10

Publications (1)

Publication Number Publication Date
WO2017193795A1 true WO2017193795A1 (zh) 2017-11-16

Family

ID=56992104

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/081456 Ceased WO2017193795A1 (zh) 2016-05-10 2017-04-21 一种移动终端的数据传输方法和装置

Country Status (2)

Country Link
CN (1) CN105978966B (zh)
WO (1) WO2017193795A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112911021A (zh) * 2021-03-23 2021-06-04 厦门四信通信科技有限公司 一种主动连接终端的方法、装置及设备
CN115695251A (zh) * 2022-09-13 2023-02-03 浪潮云信息技术股份公司 自适应的心跳间隔调整方法及系统

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105978966B (zh) * 2016-05-10 2019-03-05 北京奇虎科技有限公司 一种移动终端的数据传输方法和装置
KR102768964B1 (ko) * 2016-12-19 2025-02-18 현대자동차주식회사 전기 자동차, 그를 포함하는 시스템 및 전기 자동차의 배터리 충전 방법
CN112669591A (zh) * 2020-12-23 2021-04-16 深圳市骏普科技开发有限公司 抄表数据传输方法、从设备、系统及存储介质
CN116192926A (zh) * 2023-01-04 2023-05-30 北京小米移动软件有限公司 通信连接的确定方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100185773A1 (en) * 2004-02-25 2010-07-22 Research In Motion Limited Electronic device and base station for maintaining a network connection
CN102523178A (zh) * 2011-12-20 2012-06-27 华为技术有限公司 一种基于推送的心跳消息发送方法和终端
CN102684949A (zh) * 2012-06-04 2012-09-19 北京神州泰岳软件股份有限公司 一种长连接下心跳数据包的处理方法、装置和客户端
CN102790776A (zh) * 2012-08-03 2012-11-21 中国联合网络通信集团有限公司 心跳连接归一处理方法、终端、服务器及通信系统
CN105338195A (zh) * 2015-12-14 2016-02-17 魅族科技(中国)有限公司 一种终端节电的方法及终端
CN105978966A (zh) * 2016-05-10 2016-09-28 北京奇虎科技有限公司 一种移动终端的数据传输方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8732810B2 (en) * 2011-10-27 2014-05-20 Cellco Partnership IP push platform and connection protocol in a push notification framework
CN104836814B (zh) * 2015-05-29 2018-09-18 北京奇虎科技有限公司 智能硬件云端接入控制方法及其相应的装置
CN105357283B (zh) * 2015-10-20 2020-02-11 北京奇宝科技有限公司 智能可佩戴设备的长连接建立方法及服务器、终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100185773A1 (en) * 2004-02-25 2010-07-22 Research In Motion Limited Electronic device and base station for maintaining a network connection
CN102523178A (zh) * 2011-12-20 2012-06-27 华为技术有限公司 一种基于推送的心跳消息发送方法和终端
CN102684949A (zh) * 2012-06-04 2012-09-19 北京神州泰岳软件股份有限公司 一种长连接下心跳数据包的处理方法、装置和客户端
CN102790776A (zh) * 2012-08-03 2012-11-21 中国联合网络通信集团有限公司 心跳连接归一处理方法、终端、服务器及通信系统
CN105338195A (zh) * 2015-12-14 2016-02-17 魅族科技(中国)有限公司 一种终端节电的方法及终端
CN105978966A (zh) * 2016-05-10 2016-09-28 北京奇虎科技有限公司 一种移动终端的数据传输方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112911021A (zh) * 2021-03-23 2021-06-04 厦门四信通信科技有限公司 一种主动连接终端的方法、装置及设备
CN115695251A (zh) * 2022-09-13 2023-02-03 浪潮云信息技术股份公司 自适应的心跳间隔调整方法及系统

Also Published As

Publication number Publication date
CN105978966A (zh) 2016-09-28
CN105978966B (zh) 2019-03-05

Similar Documents

Publication Publication Date Title
US10229681B2 (en) Voice command processing of wakeup signals from first and second directions
CN104376127B (zh) 一种数据操作方法及装置
US11151185B2 (en) Content recognition apparatus and method for operating same
WO2016155379A1 (zh) 动态获取app界面控件数据的方法、设备以及系统
US9508383B2 (en) Method for creating a content and electronic device thereof
CN205140021U (zh) 一种多功能考勤系统
CN114157677B (zh) 数据同步方法及相关产品
WO2017107843A1 (zh) 周期性任务的处理方法和装置及计算机程序和可读介质
TWI754111B (zh) 用於在混合參數集中進行干擾消除的設備和方法
CN105898890A (zh) 装置搜索方法和用于支持其的电子装置
WO2017028651A1 (zh) 一种设备间进行配置性设置的方法、装置及系统
US20150200835A1 (en) Method for providing status messaging service in electronic device and the electronic device thereof
WO2017101126A1 (zh) 一种监控系统的数据存储方法及系统
CN105978966A (zh) 一种移动终端的数据传输方法和装置
WO2015062494A1 (zh) Sdk实现文件上传、下载的方法与装置
WO2017107680A1 (zh) 一种终端配置的调整方法及装置
CN102917060B (zh) 应用匹配消息发送服务器、应用推送系统及方法
US10108391B2 (en) Audio data operating method and electronic device supporting the same
WO2017107679A1 (zh) 一种历史信息展示方法及装置
CN108139811B (zh) 记录执行屏幕的方法和处理该方法的电子设备
WO2020118656A8 (zh) 基于文件传输协议的数据传输方法、装置和电子设备
CN105550098B (zh) 电子装置和在电子装置中控制内容的方法
CN104516740B (zh) 一种函数调用方法、装置及移动终端
CN104391662B (zh) 一种数据读写方法及装置
CN104350476B (zh) 一种版本检测周期调节方法及装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17795413

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17795413

Country of ref document: EP

Kind code of ref document: A1