WO2017206875A1 - Data packet-based processing method and apparatus, storage medium, and electronic device - Google Patents

Data packet-based processing method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2017206875A1
WO2017206875A1 PCT/CN2017/086472 CN2017086472W WO2017206875A1 WO 2017206875 A1 WO2017206875 A1 WO 2017206875A1 CN 2017086472 W CN2017086472 W CN 2017086472W WO 2017206875 A1 WO2017206875 A1 WO 2017206875A1
Authority
WO
WIPO (PCT)
Prior art keywords
application process
data packet
target application
preset
determining
Prior art date
Application number
PCT/CN2017/086472
Other languages
French (fr)
Chinese (zh)
Inventor
张俊
Original Assignee
广东欧珀移动通信有限公司
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 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Publication of WO2017206875A1 publication Critical patent/WO2017206875A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a packet-based processing method, apparatus, storage medium, and electronic device.
  • the embodiment of the invention provides a data packet-based processing method, device, storage medium and electronic device, which can reduce the consumption of the terminal power.
  • an embodiment of the present invention provides a packet-based processing method, including:
  • the terminal system is prohibited from being woken up by the data packet.
  • the embodiment of the present invention further provides a packet-based processing apparatus, including:
  • a receiving module configured to receive a data packet sent by the server over the network, where the data packet is used to maintain a network connection with the server;
  • An acquiring module configured to acquire a wake-up frequency of the terminal system by using the data packet in a preset time period
  • a determining module configured to determine whether the wake-up frequency is greater than a preset threshold
  • a processing module configured to, when the determining module determines to be YES, prohibit the wake-up of the terminal system by using the data packet.
  • an embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the foregoing packet-based processing method.
  • an embodiment of the present invention further provides an electronic device, including a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions in the memory to perform the following steps:
  • the electronic device system is prohibited from being woken up by the data packet.
  • the embodiment of the invention provides a data packet-based processing method, device, storage medium and electronic device, which can reduce the consumption of the terminal power.
  • FIG. 1 is a schematic flowchart diagram of a packet-based processing method according to an embodiment of the present invention.
  • FIG. 2 is another schematic flowchart of a packet-based processing method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a packet-based processing apparatus according to an embodiment of the present invention.
  • FIG. 3b is another schematic structural diagram of a packet-based processing apparatus according to an embodiment of the present invention.
  • FIG. 3c is still another schematic structural diagram of a packet-based processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • FIG. 5 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • IP Internet Protocol
  • Push push
  • the server In order to ensure that the long connection is available, one method usually adopted is that the server periodically sends a data packet (heartbeat packet) to the mobile terminal, and then the mobile terminal sends a data packet (response data packet) to the server to indicate the Long connected links are available.
  • the application on the mobile terminal needs to constantly wake up the mobile terminal to send data to the server even if it does not need to receive service data from the server for a long time.
  • the packet (heartbeat packet) is replied, causing the mobile terminal to be frequently woken up, so that the resource consumption of the mobile terminal is large, and in particular, the power consumption of the mobile terminal is large.
  • the processing device may be specifically integrated in the terminal, and the terminal may be a device such as a smart phone.
  • the embodiment of the invention provides a packet-based processing method, including:
  • the terminal system is prohibited from being woken up by the data packet.
  • the step of disabling the wake-up of the terminal system by the data packet comprises:
  • the target application process is closed to prohibit wake-up of the terminal system by the data packet.
  • the step of determining a target application process corresponding to the data packet includes:
  • the step of closing the target application process comprises:
  • the target application process is closed to prohibit the terminal system from being woken up by the data packet.
  • the step of determining whether there is an application process process in the preset application process set that is the same as the target application process includes:
  • the process identifier of the target application process is the same as the process identifier of the target application process, it is determined that there is an application process in the preset application process set that is the same as the target application process.
  • the method further includes:
  • the step of disabling the wake-up of the terminal system by using the data packet specifically includes:
  • the target application process is prevented from connecting to the network to prohibit waking up the terminal system through the data packet.
  • the packet-based processing method may be as follows:
  • S101 Receive a data packet sent by a server over a network, where the data packet is used to maintain a network connection with the server.
  • a network connection needs to be established between the application and the server for data exchange.
  • the network connection established between the application and the server has two types: short connection and long connection.
  • the short connection refers to the establishment of a communication link between the application and the server and disconnection immediately after the data exchange is completed.
  • the long connection is Refers to the connection between the application and the server to establish a communication link and complete the data exchange.
  • the server After the application establishes a long connection with the server, in order to ensure that the long-connected link is always available, the server periodically sends a packet (heartbeat packet) to the application through the network (for example, Wireless Fidelity WI-FI). For example, the data packet is sent once every 0.5 s, and the application on the terminal receives the data packet and processes it.
  • a packet for example, Wireless Fidelity WI-FI
  • the terminal system in order to reduce power consumption, does not need to perform data processing, such as data analysis and data calculation, and the terminal system enters a sleep state. When data arrives and needs to be processed, the terminal system wakes up from the sleep state. The data is processed.
  • data processing such as data analysis and data calculation
  • the application program on the terminal wakes up the terminal system to analyze and process the data packet to generate response data, and then the application sends the response data to the network (long connection).
  • server The terminal collects statistics on the number of times that the terminal system wakes up the terminal system, and obtains the wake-up frequency of the terminal system being awakened within a preset time period. For example, if the preset time period is 10s, the terminal acquires the terminal according to the number of statistics every 10 seconds. The wake-up frequency of the system being woken up.
  • multiple network applications may be running on the terminal at the same time, and the multiple network applications respectively establish a communication link with multiple servers, that is, the terminal maintains multiple long connections with multiple servers at the same time.
  • Each application receives packets (heartbeat packets) from the server at regular intervals, so that the terminal can receive multiple packets sent by the server over the network.
  • packets heartbeat packets
  • the terminal In order to separately acquire the frequency of waking up the terminal system through each of the plurality of data packets within a preset time period, the terminal according to the feature information in each data packet (for example, the network address and/or the data address included in the data packet) The port information is separately counted for each data packet, so that the frequency of waking up the terminal system through each of the plurality of data packets can be obtained.
  • the preset threshold may be a value stored in a corresponding storage area (built-in storage area or an external storage area) of the terminal when the terminal is shipped from the factory, or may be a value set by the user and stored in the corresponding storage area of the terminal. For example 2Hz.
  • a method for determining whether the wake-up frequency is greater than a preset threshold is used. For example, after acquiring the wake-up frequency, the preset threshold is called from a corresponding storage area of the terminal, and a difference between the wake-up frequency and the preset threshold is calculated. If the difference is greater than zero, it is determined that the wake-up frequency is greater than the preset threshold, otherwise it is determined that the wake-up frequency is not greater than the preset threshold.
  • the terminal system is prohibited from being woken up by the data packet.
  • step S103 When it is determined in step S103 that the wake-up frequency is greater than the preset threshold, the terminal system is prohibited from being woken up by the data packet. At this time, if the terminal system is in the dormant state, even if the application in the terminal receives the data packet sent by the server, the terminal system cannot be woken up by the data packet, so that the terminal system does not need to be woken up to process the data packet, thereby The system resources are saved, and the terminal system continues to be in a sleep state to maintain low power, thereby saving power consumption of the terminal.
  • the target application process is closed to prohibit the terminal system from being woken up by the packet.
  • the target application process corresponding to the data packet may be determined according to the feature information in the data packet (for example, the network address and/or port information included in the data packet).
  • determining, according to the feature information in the data packet, the target application process corresponding to the data packet may include the following steps:
  • the corresponding target application process is determined according to the process identifier.
  • the data packet sent by the receiving server through the network includes a network address (IP address) of the server end and port information (port number) of the terminal side, and the terminal acquires the user identifier (UID) pointed to by the data packet according to the network address and port information. , User Identification), and further obtain the process identifier (PID, Process) pointed to by the user identifier according to the user identifier Identification). Since the process identifier (PID) has a unique correspondence with a process running in the terminal system, the corresponding target application process can be determined according to the process identifier (PID).
  • the target application process may have to be in a running state, that is, the application is an important application to the user, even if the application wakes up the wakeup frequency of the terminal system through the data packet. If the threshold is greater than the preset threshold, the user does not want the application to be closed. Therefore, "closing the target application process to prohibit the wakeup of the terminal system through the data packet" may specifically include the following steps:
  • the target application process is closed to prohibit the terminal system from being woken up by the data packet.
  • the preset application process set may be a set of multiple application processes stored in a corresponding storage area (built-in storage area or an external storage area) of the terminal at the time of leaving the factory, or may be multiple application processes set by the user.
  • the collection the user may add an application process to the preset application process set through the setting interface of the terminal, or delete one or several application processes from the preset application process set, and if the target application process is determined, There is no application process in the preset application process set that is the same as the target application process, and the user may be prompted to add the target application process to the preset application process set.
  • the preset application process set may also be empty, that is, the user has not added any application process to the preset application process set.
  • the process identifier (PID) of the target application process and the preset application process are determined.
  • the process identifiers (PIDs) of all the application processes in the set are compared one by one.
  • the target application process may be closed when the determination result is negative. It is forbidden to wake up the terminal system through the data packet.
  • the user may be configured to enable whether to disable the function of the target application process.
  • the target application process may be prevented from connecting to the network to prohibit the terminal system from being awake through the data packet.
  • the data packet-based processing method uses the data packet sent by the receiving server over the network to acquire the wake-up frequency of the terminal system through the data packet within a preset time period, and determines the wake-up frequency. Whether it is greater than the preset threshold, if yes, the technical solution for waking up the terminal system through the data packet is prohibited; the solution can monitor the wake-up frequency of the terminal system by the data packet wake-up, and when the wake-up frequency is greater than the preset threshold, prohibiting the data from being passed The packet wakes up the terminal system.
  • the data packet sent by the server through the network frequently wakes up the terminal system, it is prohibited to wake up the terminal system through the data packet again, so that the terminal system does not need to be frequently woken up, thereby saving system resources, especially reducing The power consumption of the terminal.
  • a data packet-based processing device is specifically integrated in a smart phone, and a packet-based processing method of the smart phone is taken as an example for detailed description.
  • a packet-based processing method is provided. As shown in FIG. 2, the specific processing may be as follows:
  • the smart phone receives a data packet sent by the server over the network, and the data packet is used to maintain a network connection between the smart phone and the server.
  • WeChat receives push information from the WeChat server.
  • the application In order to ensure that the application can receive the information sent by the server in real time, the application must maintain a long connection with the server, and in order to ensure that the long-connected link is always available, the server periodically sends a packet to the application. (Heartbeat packet), the application receives the packet and processes it.
  • the smart phone acquires a wake-up frequency of the smartphone system by using the data packet in a preset time period.
  • the application for example, WeChat
  • the application wakes up the smart phone system to process the data packet, for example, analyzes the data packet and generates response data ( The response packet), then the application sends the response data (response packet) to the server to respond to the data packet (heartbeat packet) sent by the server.
  • the smart phone counts the number of times the smart phone system is woken up by the data packet, and obtains the wake-up frequency of the smart phone system being awakened within a preset time period.
  • the preset time period is 10s, and within 10s, the smartphone system is woken up 20 times by the data packet, and the wake-up frequency of the smartphone system being awakened within 10s is 2Hz.
  • the smart phone determines whether the wake-up frequency is greater than a preset threshold.
  • the preset threshold may be a value set by the user and stored in the built-in storage area of the smart phone, for example, 1 Hz. After the smart phone obtains the wake-up frequency, the preset threshold is called from the built-in storage area, and the difference between the wake-up frequency and the preset threshold is calculated to determine whether the wake-up frequency is greater than the preset threshold. For example, if the wake-up frequency is 2 Hz, and the difference between the wake-up frequency and the preset threshold is 1 Hz, it is determined that the wake-up frequency is greater than the preset threshold.
  • the smartphone acquires a corresponding user identifier according to the data packet.
  • the data packet sent by the smart phone receiving server through the network includes a network address (IP address) of the server end and port information (port number) of the smart phone side, for example, the smart phone receives the WeChat server, and the data packet sent by the WeChat server includes WeChat.
  • IP address IP address
  • port number port information
  • the smart phone receives the WeChat server
  • the data packet sent by the WeChat server includes WeChat.
  • the IP address of the server and the port number corresponding to WeChat on the smartphone, and the smartphone obtains the user identifier (UID, User) pointed to by the data packet according to the IP address and port number in the data packet. Identification).
  • UID user identifier
  • the smart phone acquires a corresponding process identifier according to the user identifier.
  • the smart phone after obtaining the user identifier (UID) pointed to by the data packet, the smart phone further obtains the process identifier (PID, Process) pointed to by the user identifier according to the user identifier (UID). Identification).
  • the smart phone determines a corresponding target application process according to the process identifier.
  • the corresponding target application process can be determined according to the process identifier (PID).
  • the target application process corresponding to the WeChat process identifier running in the smartphone system is WeChat.
  • the smart phone determines whether there is an application process in the preset application process set that is the same as the target application process.
  • the preset application process set may be a set of multiple application processes set by the user.
  • the user may set the application process set to include WeChat, Weibo, Tmall, and Baidu map.
  • the process identifier of the target application process for example, WeChat
  • the process identifier of all application processes in the preset application process set when the process of the target application process (for example, WeChat)
  • the identifier is the same as the process identifier of the application process (WeChat) in the preset application process set, and it is determined that there is an application process in the preset application process set that is the same as the target application process.
  • the smartphone closes the target application process to prohibit the wake-up of the smartphone system by the data packet.
  • the target application process is closed to prohibit the target application process from waking up the smart phone through the data packet.
  • the data packet-based processing method uses a smart phone to receive a data packet sent by the server through the network, and obtains a wake-up frequency of the smart phone system by using the data packet in a preset time period, and determines Whether the wake-up frequency is greater than a preset threshold, when the determination is yes, the smart phone acquires a corresponding user identifier according to the data packet, and obtains a process identifier of the corresponding target application process according to the user identifier, and further determines corresponding according to the process identifier.
  • the target application process the smart phone determines whether there is an application process in the preset application process set that is the same as the target application process, and if so, closes the target application process to prohibit the technical solution of waking up the smart phone system through the data packet;
  • the smart phone can monitor the wake-up frequency of the smart phone system by using the data packet, and when the wake-up frequency is greater than the preset threshold, determine the target application process according to the data packet, and determine whether the target application process set exists in the preset application process set. Apply the same application process as the process, If yes, the target application process is closed.
  • the smart phone receives the data packet sent by the server through the network and frequently wakes up the smart phone system, and the preset application process set has the same application process as the determined target application process, the target is closed.
  • the application process makes it impossible to wake up the smart terminal system again through the data packet, and can avoid the application process that needs to keep the long connection with the server from being accidentally closed, which can save the system resources while ensuring the normal use of the smart phone, especially the smart phone.
  • the power consumption is the power consumption.
  • the embodiment of the present invention further provides a data packet-based processing device, which may be integrated in a terminal, and the terminal may be a device such as a smart phone.
  • the embodiment of the invention further provides a packet-based processing device, including:
  • a receiving module configured to receive a data packet sent by the server over the network, where the data packet is used to maintain a network connection with the server;
  • An acquiring module configured to acquire a wake-up frequency of the terminal system by using the data packet in a preset time period
  • a determining module configured to determine whether the wake-up frequency is greater than a preset threshold
  • a processing module configured to, when the determining module determines to be YES, prohibit the wake-up of the terminal system by using the data packet.
  • the processing module specifically includes:
  • a first determining submodule configured to determine a target application process corresponding to the data packet
  • the first processing submodule is configured to close the target application process to prohibit the terminal system from being woken up by the data packet.
  • the first determining submodule is specifically configured to:
  • the first processing submodule is specifically configured to:
  • the target application process is closed to prohibit the terminal system from being woken up by the data packet.
  • the processing module specifically includes:
  • a second determining submodule configured to determine a target application process corresponding to the data packet
  • a second processing submodule configured to prevent the target application process from connecting to the network to prohibit the terminal system from being woken up by the data packet.
  • the data packet-based processing apparatus may include: a receiving module 301, an obtaining module 302, a determining module 303, and a processing module 304, which are specifically described as follows:
  • the receiving module 301 is configured to receive a data packet sent by the server over the network, where the data packet is used to maintain a network connection with the server;
  • the obtaining module 302 is configured to acquire a wake-up frequency of the terminal system by using the data packet in a preset time period;
  • the determining module 303 is configured to determine whether the wake-up frequency is greater than a preset threshold
  • the processing module 304 is configured to prohibit the wake-up of the terminal system by the data packet when the determining module determines to be YES.
  • the processing module 304 specifically includes: a first determining submodule 3041 and a first processing submodule 3043, as follows:
  • the first determining submodule 3041 is configured to determine a target application process corresponding to the data packet
  • the first processing sub-module 3043 is configured to close the target application process to prohibit the terminal system from being woken up by the data packet.
  • the first determining submodule 3041 is specifically configured to:
  • the corresponding target application process is determined according to the process identifier.
  • the first processing submodule 3043 is specifically configured to:
  • the target application process is closed to prohibit the terminal system from being woken up by the data packet.
  • the processing module 304 specifically includes: a second determining submodule 3042 and a second processing submodule 3044, as follows:
  • a second determining sub-module 3042 configured to determine a target application process corresponding to the data packet
  • the second processing sub-module 3044 is configured to prevent the target application process from connecting to the network to prohibit the terminal system from being woken up by the data packet.
  • the embodiment of the present invention provides a data packet-based processing apparatus.
  • the receiving module 301 receives a data packet sent by a server through a network, and the obtaining module 302 acquires a wake-up terminal system through the data packet within a preset time period.
  • the wake-up frequency, the determining module 303 determines whether the wake-up frequency is greater than a preset threshold.
  • the processing module 304 prohibits the wake-up of the terminal system by the data packet; the solution can monitor the wake-up frequency of the terminal system through the data packet, when When the wake-up frequency is greater than the preset threshold, the terminal system is prohibited from being woken up by the data packet.
  • the terminal system If the data packet sent by the server through the network is frequently awake to the terminal system, the terminal system is prohibited from being awake through the data packet again, so that the terminal system does not need to be It is frequently awakened, which saves system resources, especially the power consumption of the terminal.
  • an electronic device is further provided, and the electronic device may be the terminal described in the foregoing embodiment, and specifically includes a device such as a smart phone or a tablet computer.
  • the electronic device 400 includes a processor 401, a memory 402, a display screen 403, and a control circuit 404.
  • the processor 401 is electrically connected to the memory 402, the display screen 403, and the control circuit 404, respectively.
  • the processor 401 is a control center of the electronic device 400, which connects various parts of the entire electronic device using various interfaces and lines, executes the electronic by running or loading an application stored in the memory 402, and calling data stored in the memory 402.
  • the various functions and processing data of the device enable overall monitoring of the electronic device.
  • the processor 401 in the electronic device 400 loads the instructions corresponding to the process of one or more applications into the memory 402 according to the following steps, and is stored and stored in the memory 402 by the processor 401.
  • the application thus implementing various functions:
  • the electronic device system is prohibited from being woken up by the data packet.
  • the processor 401 is configured to perform the following steps:
  • the target application process is closed to prohibit waking up the electronic device system through the data packet.
  • the processor 401 is configured to perform the following steps:
  • the processor 401 is further configured to perform the following steps:
  • the target application process is closed to prohibit waking up the electronic device system through the data packet.
  • the processor 401 is further configured to perform the following steps:
  • the process identifier of the target application process is the same as the process identifier of the target application process, it is determined that there is an application process in the preset application process set that is the same as the target application process.
  • the processor 401 is configured to perform the following steps:
  • the processor 401 is configured to perform the following steps:
  • the target application process is prevented from connecting to the network to prohibit waking up the electronic device system through the data packet.
  • Memory 402 can be used to store applications and data.
  • the application stored in the memory 402 contains instructions that are executable in the processor.
  • Applications can form various functional modules.
  • the processor 401 executes various functional applications and data processing by running an application stored in the memory 402.
  • Display 403 can be used to display information entered by the user or information provided to the user as well as various graphical user interfaces of the electronic device.
  • the display screen 403 is switched from the off-screen state to the bright-screen state. Therefore, when the electronic device system is prohibited from waking up through the data packet, the display screen 403 will remain in the off state.
  • the control circuit 404 is electrically connected to the display screen 403, and under the scheduling of the processor 401, controls the off-screen or bright-screen state of the display screen 403.
  • the electronic device 400 also includes a radio frequency circuit 405.
  • the radio frequency circuit 405 is configured to send and receive radio frequency signals, such as establishing a communication link with a plurality of servers, and receiving data packets sent from the server.
  • electronic device 400 also includes a power source 406.
  • Power source 406 is used to power various components of electronic device 400.
  • the power supply 406 can be logically coupled to the processor 401 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
  • the electronic device 400 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
  • an embodiment of the present invention provides an electronic device, by receiving a data packet sent by a server through a network, acquiring a wake-up frequency of the electronic device system by using the data packet in a preset time period, and determining whether the wake-up frequency is greater than Presetting the threshold, when the determination is yes, prohibiting the electronic device system from being woken up by the data packet; the solution may monitor the wake-up frequency of the electronic device system by the data packet, and prohibiting the data from being passed when the wake-up frequency is greater than a preset threshold The packet wakes up the electronic device system.
  • the data packet sent by the server through the network frequently wakes up the electronic device system, it is prohibited to wake up the electronic device system through the data packet again, so that the electronic device system does not need to be frequently woken up, thereby saving system resources. In particular, it reduces the power consumption of electronic devices.
  • the embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the packet-based processing method described in any of the foregoing embodiments.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: Read only memory (ROM, Read Only Memory), Random Access Memory (RAM), disk or optical disk.
  • ROM Read only memory
  • RAM Random Access Memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are a data packet-based processing method and apparatus, a storage medium, and an electronic device. The processing method is: receiving a data packet sent by a server via a network, obtaining a wakeup frequency for waking up a terminal system via the data packet within a preset time period, determining whether the wakeup frequency is greater than a preset threshold value, and if yes, preventing the terminal system from being woken up via the data packet.

Description

一种基于数据包的处理方法、装置、存储介质及电子设备 Data packet-based processing method, device, storage medium and electronic device 技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种基于数据包的处理方法、装置、存储介质及电子设备。The present invention relates to the field of communications technologies, and in particular, to a packet-based processing method, apparatus, storage medium, and electronic device.
背景技术Background technique
随着移动终端的快速发展,众多的第三方应用厂商和独立的第三方应用开发者开发了大量用于移动终端的应用程序。这些应用程序会不定时唤醒移动终端,以访问服务器或接收从服务器下发的数据。With the rapid development of mobile terminals, numerous third-party application vendors and independent third-party application developers have developed a large number of applications for mobile terminals. These applications will wake up the mobile terminal from time to time to access the server or receive data sent from the server.
技术问题technical problem
本发明实施例提供一种基于数据包的处理方法、装置、存储介质及电子设备,可以降低终端电量的消耗。The embodiment of the invention provides a data packet-based processing method, device, storage medium and electronic device, which can reduce the consumption of the terminal power.
技术解决方案Technical solution
第一方面,本发明实施例提供了一种基于数据包的处理方法,包括:In a first aspect, an embodiment of the present invention provides a packet-based processing method, including:
接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;Receiving a data packet sent by the server over the network, the data packet being used to maintain a network connection with the server;
获取在预设时间段内通过所述数据包唤醒终端系统的唤醒频率;Obtaining a wake-up frequency of the terminal system by using the data packet in a preset time period;
判断所述唤醒频率是否大于预设阈值;Determining whether the wake-up frequency is greater than a preset threshold;
若是,则禁止通过所述数据包唤醒所述终端系统。If so, the terminal system is prohibited from being woken up by the data packet.
第二方面,本发明实施例还提供了一种基于数据包的处理装置,包括:In a second aspect, the embodiment of the present invention further provides a packet-based processing apparatus, including:
接收模块,用于接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;a receiving module, configured to receive a data packet sent by the server over the network, where the data packet is used to maintain a network connection with the server;
获取模块,用于获取在预设时间段内通过所述数据包唤醒终端系统的唤醒频率;An acquiring module, configured to acquire a wake-up frequency of the terminal system by using the data packet in a preset time period;
判断模块,用于判断所述唤醒频率是否大于预设阈值;a determining module, configured to determine whether the wake-up frequency is greater than a preset threshold;
处理模块,用于当所述判断模块判断为是时,禁止通过所述数据包唤醒所述终端系统。And a processing module, configured to, when the determining module determines to be YES, prohibit the wake-up of the terminal system by using the data packet.
第三方面,本发明实施例还提供了一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述基于数据包的处理方法。In a third aspect, an embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the foregoing packet-based processing method.
第四方面,本发明实施例还提供了一种电子设备,包括处理器和存储器,所述存储器存储有多条指令,所述处理器加载所述存储器中的指令用于执行以下步骤:In a fourth aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions in the memory to perform the following steps:
接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;Receiving a data packet sent by the server over the network, the data packet being used to maintain a network connection with the server;
获取在预设时间段内通过所述数据包唤醒电子设备系统的唤醒频率;Acquiring a wake-up frequency of the electronic device system by the data packet during the preset time period;
判断所述唤醒频率是否大于预设阈值;Determining whether the wake-up frequency is greater than a preset threshold;
若是,则禁止通过所述数据包唤醒所述电子设备系统。If so, the electronic device system is prohibited from being woken up by the data packet.
有益效果 Beneficial effect
本发明实施例提供一种基于数据包的处理方法、装置、存储介质及电子设备,可以降低终端电量的消耗。The embodiment of the invention provides a data packet-based processing method, device, storage medium and electronic device, which can reduce the consumption of the terminal power.
附图说明DRAWINGS
图1是本发明实施例提供的基于数据包的处理方法的流程示意图。FIG. 1 is a schematic flowchart diagram of a packet-based processing method according to an embodiment of the present invention.
图2是本发明实施例提供的基于数据包的处理方法的另一流程示意图。FIG. 2 is another schematic flowchart of a packet-based processing method according to an embodiment of the present invention.
图3a是本发明实施例提供的基于数据包的处理装置的结构示意图。FIG. 3 is a schematic structural diagram of a packet-based processing apparatus according to an embodiment of the present invention.
图3b是本发明实施例提供的基于数据包的处理装置的另一结构示意图。FIG. 3b is another schematic structural diagram of a packet-based processing apparatus according to an embodiment of the present invention.
图3c是本发明实施例提供的基于数据包的处理装置的又一结构示意图。FIG. 3c is still another schematic structural diagram of a packet-based processing apparatus according to an embodiment of the present invention.
图4是本发明实施例提供的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
图5是本发明实施例提供的电子设备的另一结构示意图。FIG. 5 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
本发明的最佳实施方式BEST MODE FOR CARRYING OUT THE INVENTION
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
移动终端上的应用程序在与服务器进行通信时,为了保证能够及时接收业务数据(例如,推送信息、通知消息等),目前采用的一种方案是IP push(推送)技术,即在移动终端与为应用程序提供业务数据的应用服务器之间保持一个长连接,由于该长连接的存在,应用服务器就可以实时向移动终端内的该应用程序推送业务数据。为了确保该长连接处于可用状态,通常采用的一种方式是由服务器定时向移动终端发送一个数据包(心跳数据包),随后移动终端向服务器发送一个数据包(应答数据包),以表明该长连接的链路可用。When the application on the mobile terminal communicates with the server, in order to ensure timely receipt of service data (for example, push information, notification messages, etc.), one solution currently adopted is IP. Push (push) technology, which maintains a long connection between the mobile terminal and the application server that provides service data for the application. Due to the existence of the long connection, the application server can push the service data to the application in the mobile terminal in real time. . In order to ensure that the long connection is available, one method usually adopted is that the server periodically sends a data packet (heartbeat packet) to the mobile terminal, and then the mobile terminal sends a data packet (response data packet) to the server to indicate the Long connected links are available.
但是,在这种实现方式中,由于需要确保该长连接处于可用状态,移动终端上的应用程序即使长时间不需要从服务器接收业务数据,也需要不停地唤醒移动终端以对服务器发送的数据包(心跳数据包)进行应答,导致移动终端被频繁唤醒,从而对移动终端的资源消耗较大,特别是对移动终端的电量消耗较大。However, in this implementation, since it is necessary to ensure that the long connection is in an available state, the application on the mobile terminal needs to constantly wake up the mobile terminal to send data to the server even if it does not need to receive service data from the server for a long time. The packet (heartbeat packet) is replied, causing the mobile terminal to be frequently woken up, so that the resource consumption of the mobile terminal is large, and in particular, the power consumption of the mobile terminal is large.
接下来,本实施例将从基于数据包的处理装置的角度,描述该基于数据包的处理方法。其中,该处理装置具体可以集成在终端中,该终端可以为智能手机等设备。Next, the present embodiment will describe the packet-based processing method from the perspective of a packet-based processing apparatus. The processing device may be specifically integrated in the terminal, and the terminal may be a device such as a smart phone.
本发明实施例提供了一种基于数据包的处理方法,包括:The embodiment of the invention provides a packet-based processing method, including:
接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;Receiving a data packet sent by the server over the network, the data packet being used to maintain a network connection with the server;
获取在预设时间段内通过所述数据包唤醒终端系统的唤醒频率;Obtaining a wake-up frequency of the terminal system by using the data packet in a preset time period;
判断所述唤醒频率是否大于预设阈值;Determining whether the wake-up frequency is greater than a preset threshold;
若是,则禁止通过所述数据包唤醒所述终端系统。If so, the terminal system is prohibited from being woken up by the data packet.
在一些实施例中,所述禁止通过所述数据包唤醒所述终端系统的步骤包括:In some embodiments, the step of disabling the wake-up of the terminal system by the data packet comprises:
确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。The target application process is closed to prohibit wake-up of the terminal system by the data packet.
在一些实施例中,所述确定所述数据包对应的目标应用进程的步骤包括:In some embodiments, the step of determining a target application process corresponding to the data packet includes:
根据所述数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
根据所述用户标识获取相应的进程标识;Obtaining a corresponding process identifier according to the user identifier;
根据所述进程标识确定相应的目标应用进程。Determining a corresponding target application process according to the process identifier.
在一些实施例中,所述关闭所述目标应用进程的步骤包括:In some embodiments, the step of closing the target application process comprises:
判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
若是,则关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。If so, the target application process is closed to prohibit the terminal system from being woken up by the data packet.
在一些实施例中,所述判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程步骤包括:In some embodiments, the step of determining whether there is an application process process in the preset application process set that is the same as the target application process includes:
将所述目标应用进程的进程标识与所述预设应用进程集合中所有应用进程的进程标识逐一对比;Comparing the process identifier of the target application process with the process identifier of all application processes in the preset application process set;
当所述预设应用进程集合中,存在与所述目标应用进程的进程标识相同的进程标识时,判断预设应用进程集合中存在与所述目标应用进程相同的应用进程。When the process identifier of the target application process is the same as the process identifier of the target application process, it is determined that there is an application process in the preset application process set that is the same as the target application process.
在一些实施例中,判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程步骤之后,还包括:In some embodiments, after determining whether there is an application process step in the preset application process set that is the same as the target application process, the method further includes:
提示用户将所述目标应用进程添加至所述预设应用进程集合。Prompting the user to add the target application process to the preset application process set.
在一些实施例中,所述禁止通过所述数据包唤醒所述终端系统的步骤具体包括:In some embodiments, the step of disabling the wake-up of the terminal system by using the data packet specifically includes:
确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
阻止所述目标应用进程连接网络,以禁止通过所述数据包唤醒所述终端系统。The target application process is prevented from connecting to the network to prohibit waking up the terminal system through the data packet.
在一优选实施例中,如图1所示,该基于数据包的处理方法,具体流程可以如下:In a preferred embodiment, as shown in FIG. 1, the packet-based processing method may be as follows:
S101,接收服务器通过网络发送的数据包,该数据包用于维持与该服务器之间的网络连接。S101. Receive a data packet sent by a server over a network, where the data packet is used to maintain a network connection with the server.
具体应用中,终端上运行网络应用程序(即可以与服务器进行通信的应用程序)时,需要在该应用程序与服务器之间建立网络连接以进行数据交换。一般情况下,应用程序与服务器之间建立的网络连接有短连接和长连接两种,短连接是指应用程序与服务器之间建立通信链路并完成数据交换后立即断开连接,长连接是指应用程序与服务器之间建立通信链路并完成数据交换后继续保持连接状态。当应用程序与服务器之间建立长连接后,为了确保该长连接的链路一直处于可用状态,服务器会定时通过网络(例如无线保真WI-FI)向该应用程序发送数据包(心跳数据包),例如,每间隔0.5s发送一次数据包,终端上的应用程序接收该数据包并进行处理。In a specific application, when a network application (ie, an application that can communicate with a server) is run on a terminal, a network connection needs to be established between the application and the server for data exchange. In general, the network connection established between the application and the server has two types: short connection and long connection. The short connection refers to the establishment of a communication link between the application and the server and disconnection immediately after the data exchange is completed. The long connection is Refers to the connection between the application and the server to establish a communication link and complete the data exchange. After the application establishes a long connection with the server, in order to ensure that the long-connected link is always available, the server periodically sends a packet (heartbeat packet) to the application through the network (for example, Wireless Fidelity WI-FI). For example, the data packet is sent once every 0.5 s, and the application on the terminal receives the data packet and processes it.
S102,获取在预设时间段内通过该数据包唤醒终端系统的唤醒频率。S102. Acquire a wake-up frequency of the terminal system by using the data packet in a preset time period.
具体应用中,终端为了减少电量消耗,在终端系统不需要进行数据处理,例如数据分析、数据计算时,终端系统会进入休眠状态,当有数据到来需要进行处理时,终端系统从休眠状态唤醒并对该数据进行处理。In a specific application, in order to reduce power consumption, the terminal system does not need to perform data processing, such as data analysis and data calculation, and the terminal system enters a sleep state. When data arrives and needs to be processed, the terminal system wakes up from the sleep state. The data is processed.
本发明实施例中,终端上的应用程序接收到服务器发送的数据包后,唤醒终端系统对该数据包进行分析处理,以生成应答数据,随后应用程序通过网络(长连接)将应答数据发送给服务器。终端对通过该数据包唤醒终端系统的次数进行统计,并获取在预设时间段内终端系统被唤醒的唤醒频率,例如,该预设时间段为10s,则终端每隔10s根据统计次数获取终端系统被唤醒的唤醒频率。In the embodiment of the present invention, after receiving the data packet sent by the server, the application program on the terminal wakes up the terminal system to analyze and process the data packet to generate response data, and then the application sends the response data to the network (long connection). server. The terminal collects statistics on the number of times that the terminal system wakes up the terminal system, and obtains the wake-up frequency of the terminal system being awakened within a preset time period. For example, if the preset time period is 10s, the terminal acquires the terminal according to the number of statistics every 10 seconds. The wake-up frequency of the system being woken up.
实际应用中,终端上可能同时运行着多个网络应用程序,该多个网络应用程序分别与多个服务器之间建立通信链路,即终端同时与多个服务器之间维持着多个长连接,每个应用程序都会定时从服务器接收到数据包(心跳数据包),从而终端接收服务器通过网络发送的数据包可能有多种。为了分别获取通过该多种数据包中的每种数据包在预设时间段内唤醒终端系统的频率,终端根据每种数据包中的特征信息(例如,数据包中包括的网络地址和/或端口信息)对每种数据包分别进行统计,从而可以获取通过该多种数据包中的每一种唤醒终端系统的频率。In practical applications, multiple network applications may be running on the terminal at the same time, and the multiple network applications respectively establish a communication link with multiple servers, that is, the terminal maintains multiple long connections with multiple servers at the same time. Each application receives packets (heartbeat packets) from the server at regular intervals, so that the terminal can receive multiple packets sent by the server over the network. In order to separately acquire the frequency of waking up the terminal system through each of the plurality of data packets within a preset time period, the terminal according to the feature information in each data packet (for example, the network address and/or the data address included in the data packet) The port information is separately counted for each data packet, so that the frequency of waking up the terminal system through each of the plurality of data packets can be obtained.
S103,判断该唤醒频率是否大于预设阈值。S103. Determine whether the wake-up frequency is greater than a preset threshold.
具体地,该预设阈值可以是终端在出厂时存储在终端相应存储区域(内置存储区域或外置存储区域)中的一个数值,也可以是用户设置并存储在终端相应存储区域的一个数值,例如2Hz。判断该唤醒频率是否大于预设阈值的方式有多种,例如,在获取该唤醒频率后,从终端的相应存储区域中调用该预设阈值,计算该唤醒频率与该预设阈值之间的差值,当该差值大于零时,判断为该唤醒频率大于该预设阈值,否则判断为该唤醒频率不大于该预设阈值。Specifically, the preset threshold may be a value stored in a corresponding storage area (built-in storage area or an external storage area) of the terminal when the terminal is shipped from the factory, or may be a value set by the user and stored in the corresponding storage area of the terminal. For example 2Hz. A method for determining whether the wake-up frequency is greater than a preset threshold is used. For example, after acquiring the wake-up frequency, the preset threshold is called from a corresponding storage area of the terminal, and a difference between the wake-up frequency and the preset threshold is calculated. If the difference is greater than zero, it is determined that the wake-up frequency is greater than the preset threshold, otherwise it is determined that the wake-up frequency is not greater than the preset threshold.
S104,禁止通过该数据包唤醒该终端系统。S104. The terminal system is prohibited from being woken up by the data packet.
当步骤S103中判断为该唤醒频率大于该预设阈值时,禁止通过该数据包唤醒该终端系统。此时,若终端系统处于休眠状态,即使终端中的应用程序接收到服务器发送的数据包,也无法通过该数据包唤醒终端系统,使得终端系统不需要被唤醒以对该数据包进行处理,从而节省了系统资源,终端系统继续处于休眠状态能够保持较低的功率,从而节省了终端的电量消耗。When it is determined in step S103 that the wake-up frequency is greater than the preset threshold, the terminal system is prohibited from being woken up by the data packet. At this time, if the terminal system is in the dormant state, even if the application in the terminal receives the data packet sent by the server, the terminal system cannot be woken up by the data packet, so that the terminal system does not need to be woken up to process the data packet, thereby The system resources are saved, and the terminal system continues to be in a sleep state to maintain low power, thereby saving power consumption of the terminal.
具体应用中,当终端上的多个应用程序同时与多个服务器之间保持长连接时,若判断为该唤醒频率大于该预设阈值,则需要确定该数据包具体是在哪个应用程序与服务器之间进行数据交换,随后对该应用进程进行处理,因此,“禁止通过该数据包唤醒该终端系统”可具体包括以下步骤:In a specific application, when multiple applications on the terminal maintain a long connection with multiple servers at the same time, if it is determined that the wakeup frequency is greater than the preset threshold, it is necessary to determine which application and server the data packet is. The data is exchanged, and then the application process is processed. Therefore, "prohibiting the wake-up of the terminal system through the data packet" may specifically include the following steps:
确定该数据包对应的目标应用进程;Determining the target application process corresponding to the data packet;
关闭该目标应用进程,以禁止通过该数据包唤醒该终端系统。The target application process is closed to prohibit the terminal system from being woken up by the packet.
具体地,可以根据数据包中的特征信息(例如,数据包中包括的网络地址和/或端口信息)来确定该数据包对应的目标应用进程。Specifically, the target application process corresponding to the data packet may be determined according to the feature information in the data packet (for example, the network address and/or port information included in the data packet).
具体实施中,根据数据包中的特征信息来确定该数据包对应的目标应用进程可以包括以下步骤:In a specific implementation, determining, according to the feature information in the data packet, the target application process corresponding to the data packet may include the following steps:
根据该数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
根据该用户标识获取相应的进程标识;Obtain a corresponding process identifier according to the user identifier;
根据该进程标识确定相应的目标应用进程。The corresponding target application process is determined according to the process identifier.
具体地,接收服务器通过网络发送的数据包中包括服务器端的网络地址(IP地址)和终端侧的端口信息(端口号),终端根据该网络地址和端口信息获取该数据包指向的用户标识(UID,User identification),并进一步根据该用户标识获取该用户标识指向的进程标识(PID,Process identification)。由于进程标识(PID)与终端系统中运行的进程具有唯一对应关系,因此可以根据该进程标识(PID)确定相应的目标应用进程。Specifically, the data packet sent by the receiving server through the network includes a network address (IP address) of the server end and port information (port number) of the terminal side, and the terminal acquires the user identifier (UID) pointed to by the data packet according to the network address and port information. , User Identification), and further obtain the process identifier (PID, Process) pointed to by the user identifier according to the user identifier Identification). Since the process identifier (PID) has a unique correspondence with a process running in the terminal system, the corresponding target application process can be determined according to the process identifier (PID).
在实际应用中,当确定目标应用进程后,该目标应用进程可能必须处于运行状态,即该应用程序对用户而言是比较重要的应用程序,即使该应用程序通过数据包唤醒终端系统的唤醒频率大于预设阈值,用户也不希望该应用程序被关闭,因此,“关闭该目标应用进程,以禁止通过该数据包唤醒该终端系统”可以具体包括以下步骤:In an actual application, after determining the target application process, the target application process may have to be in a running state, that is, the application is an important application to the user, even if the application wakes up the wakeup frequency of the terminal system through the data packet. If the threshold is greater than the preset threshold, the user does not want the application to be closed. Therefore, "closing the target application process to prohibit the wakeup of the terminal system through the data packet" may specifically include the following steps:
判断预设应用进程集合中是否存在与该目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
若是,则关闭该目标应用进程,以禁止通过该数据包唤醒该终端系统。If yes, the target application process is closed to prohibit the terminal system from being woken up by the data packet.
具体地,预设应用进程集合可以是终端在出厂时存储在终端相应存储区域(内置存储区域或外置存储区域)中的多个应用进程的集合,也可以是用户设置的多个应用进程的集合,用户可以通过终端的设置界面添加应用进程到该预设应用进程集合中,也可以从该预设应用进程集合中删除某个或某几个应用进程,当确定目标应用进程后,若该预设应用进程集合中不存在与该目标应用进程相同的应用进程,也可以提示用户是否需要将该目标应用进程添加到该预设应用进程集合。当然,该预设应用进程集合也可以为空,即用户尚未添加任何应用进程到该预设应用进程集合。Specifically, the preset application process set may be a set of multiple application processes stored in a corresponding storage area (built-in storage area or an external storage area) of the terminal at the time of leaving the factory, or may be multiple application processes set by the user. The collection, the user may add an application process to the preset application process set through the setting interface of the terminal, or delete one or several application processes from the preset application process set, and if the target application process is determined, There is no application process in the preset application process set that is the same as the target application process, and the user may be prompted to add the target application process to the preset application process set. Of course, the preset application process set may also be empty, that is, the user has not added any application process to the preset application process set.
判断预设应用进程集合中是否存在与该目标应用进程相同的应用进程的方法有多种,例如,在确定目标应用进程后,将该目标应用进程的进程标识(PID)与该预设应用进程集合中的所有应用进程的进程标识(PID)逐一对比,当目标应用进程的进程标识与该预设应用进程集合中的某一个应用进程的进程标识相同时,即在预设应用进程集合中,存在与目标应用进程的进程标识相同的进程标识时,判断预设应用进程集合中存在与该目标应用进程相同的应用进程。There are various methods for determining whether there is an application process in the preset application process set that is the same as the target application process. For example, after determining the target application process, the process identifier (PID) of the target application process and the preset application process are determined. The process identifiers (PIDs) of all the application processes in the set are compared one by one. When the process ID of the target application process is the same as the process ID of the application process in the preset application process set, that is, in the preset application process set, When there is a process ID that is the same as the process ID of the target application process, it is determined that there is an application process in the preset application process set that is the same as the target application process.
优选地,在本发明的另一个实施方式中,判断预设应用进程集合中是否存在与该目标应用进程相同的应用进程后,还可以在判断结果为否时,才关闭该目标应用进程,以禁止通过该数据包唤醒该终端系统。Preferably, in another embodiment of the present invention, after determining whether there is an application process in the preset application process set that is the same as the target application process, the target application process may be closed when the determination result is negative. It is forbidden to wake up the terminal system through the data packet.
优选地,确定该数据包对应的目标应用进程后,可以接收用户设置是否启用关闭该目标应用进程的功能。Preferably, after determining the target application process corresponding to the data packet, the user may be configured to enable whether to disable the function of the target application process.
优选地,在本发明的另一个实施方式中,确定该数据包对应的目标应用进程后,可以阻止该目标应用进程连接网络,以禁止通过该数据包唤醒该终端系统。Preferably, in another embodiment of the present invention, after determining the target application process corresponding to the data packet, the target application process may be prevented from connecting to the network to prohibit the terminal system from being awake through the data packet.
由上可知,本发明实施例提供的基于数据包的处理方法,采用接收服务器通过网络发送的数据包,获取在预设时间段内通过该数据包唤醒终端系统的唤醒频率,并判断该唤醒频率是否大于预设阈值,若是,则禁止通过该数据包唤醒该终端系统的技术方案;该方案可以监控通过数据包唤醒终端系统的唤醒频率,当该唤醒频率大于预设阈值时,禁止通过该数据包唤醒该终端系统,若接收到服务器通过网络发送的数据包频繁唤醒终端系统,则禁止再次通过该数据包唤醒终端系统,使得终端系统不需要被频繁唤醒,从而节省了系统资源,特别是减少了终端的电量消耗。It can be seen that the data packet-based processing method provided by the embodiment of the present invention uses the data packet sent by the receiving server over the network to acquire the wake-up frequency of the terminal system through the data packet within a preset time period, and determines the wake-up frequency. Whether it is greater than the preset threshold, if yes, the technical solution for waking up the terminal system through the data packet is prohibited; the solution can monitor the wake-up frequency of the terminal system by the data packet wake-up, and when the wake-up frequency is greater than the preset threshold, prohibiting the data from being passed The packet wakes up the terminal system. If the data packet sent by the server through the network frequently wakes up the terminal system, it is prohibited to wake up the terminal system through the data packet again, so that the terminal system does not need to be frequently woken up, thereby saving system resources, especially reducing The power consumption of the terminal.
根据上述实施例所描述的处理方法,以下将举例作进一步详细说明。According to the processing method described in the above embodiments, the following will be exemplified in further detail.
在本实施例中,将以基于数据包的处理装置具体集成在智能手机中,以智能手机的基于数据包的处理方法为例进行详细描述。In this embodiment, a data packet-based processing device is specifically integrated in a smart phone, and a packet-based processing method of the smart phone is taken as an example for detailed description.
在一优选实施例中,提供了一种基于数据包的处理方法,如图2所示,该处理方法,具体流程可以如下:In a preferred embodiment, a packet-based processing method is provided. As shown in FIG. 2, the specific processing may be as follows:
S201,智能手机接收服务器通过网络发送的数据包,该数据包用于维持该智能手机与该服务器之间的网络连接。S201. The smart phone receives a data packet sent by the server over the network, and the data packet is used to maintain a network connection between the smart phone and the server.
具体应用中,智能手机上运行应用程序时,例如微信,需要在应用程序与服务器之间建立网络连接以进行数据交换,例如微信从微信服务器接收推送信息。为了确保该应用程序能即时接收到服务器发送的信息,该应用程序与服务器之间必须保持长连接,而为了确保该长连接的链路一直处于可用状态,服务器会定时向该应用程序发送数据包(心跳包),该应用程序接收该数据包并进行处理。In specific applications, when running an application on a smartphone, such as WeChat, a network connection needs to be established between the application and the server for data exchange, for example, WeChat receives push information from the WeChat server. In order to ensure that the application can receive the information sent by the server in real time, the application must maintain a long connection with the server, and in order to ensure that the long-connected link is always available, the server periodically sends a packet to the application. (Heartbeat packet), the application receives the packet and processes it.
S202,智能手机获取在预设时间段内通过该数据包唤醒智能手机系统的唤醒频率。S202. The smart phone acquires a wake-up frequency of the smartphone system by using the data packet in a preset time period.
具体地,智能手机上的应用程序(例如,微信)接收到服务器发送的数据包(心跳包)后,唤醒智能手机系统对该数据包进行处理,例如对该数据包进行分析并生成应答数据(应答包),随后该应用程序将该应答数据(应答包)发送给该服务器,以对该服务器发送的数据包(心跳包)进行应答。Specifically, after receiving the data packet (heartbeat packet) sent by the server, the application (for example, WeChat) on the smart phone wakes up the smart phone system to process the data packet, for example, analyzes the data packet and generates response data ( The response packet), then the application sends the response data (response packet) to the server to respond to the data packet (heartbeat packet) sent by the server.
智能手机对通过该数据包唤醒智能手机系统的次数进行统计,并获取预设时间段内智能手机系统被唤醒的唤醒频率。例如,该预设时间段为10s,在10s内智能手机系统通过数据包被唤醒了20次,则10s内智能手机系统被唤醒的唤醒频率为2Hz。The smart phone counts the number of times the smart phone system is woken up by the data packet, and obtains the wake-up frequency of the smart phone system being awakened within a preset time period. For example, the preset time period is 10s, and within 10s, the smartphone system is woken up 20 times by the data packet, and the wake-up frequency of the smartphone system being awakened within 10s is 2Hz.
S203,智能手机判断该唤醒频率是否大于预设阈值。S203. The smart phone determines whether the wake-up frequency is greater than a preset threshold.
具体应用中,该预设阈值可以是用户设置并存储在智能手机内置存储区域中的一个数值,例如1Hz。智能手机获取到该唤醒频率后,从内置存储区域中调用该预设阈值,计算该唤醒频率与该预设阈值之间的差值,来判断该唤醒频率是否大于该预设阈值。例如,该唤醒频率为2Hz,该唤醒频率与该预设阈值之间的差值为1Hz,则判断该唤醒频率大于该预设阈值。In a specific application, the preset threshold may be a value set by the user and stored in the built-in storage area of the smart phone, for example, 1 Hz. After the smart phone obtains the wake-up frequency, the preset threshold is called from the built-in storage area, and the difference between the wake-up frequency and the preset threshold is calculated to determine whether the wake-up frequency is greater than the preset threshold. For example, if the wake-up frequency is 2 Hz, and the difference between the wake-up frequency and the preset threshold is 1 Hz, it is determined that the wake-up frequency is greater than the preset threshold.
S204,智能手机根据该数据包获取相应的用户标识。S204. The smartphone acquires a corresponding user identifier according to the data packet.
具体地,智能手机接收服务器通过网络发送的数据包中包括服务器端的网络地址(IP地址)和智能手机侧的端口信息(端口号),例如,智能手机接收到微信服务器发送的数据包中包括微信服务器的IP地址和智能手机上微信对应的端口号,智能手机根据该数据包中的IP地址和端口号获取该数据包指向的用户标识(UID,User Identification)。Specifically, the data packet sent by the smart phone receiving server through the network includes a network address (IP address) of the server end and port information (port number) of the smart phone side, for example, the smart phone receives the WeChat server, and the data packet sent by the WeChat server includes WeChat. The IP address of the server and the port number corresponding to WeChat on the smartphone, and the smartphone obtains the user identifier (UID, User) pointed to by the data packet according to the IP address and port number in the data packet. Identification).
S205,智能手机根据该用户标识获取相应的进程标识。S205. The smart phone acquires a corresponding process identifier according to the user identifier.
具体地,智能手机获取到该数据包指向的用户标识(UID)后,进一步根据该用户标识(UID)获取该用户标识指向的进程标识(PID,Process Identification)。Specifically, after obtaining the user identifier (UID) pointed to by the data packet, the smart phone further obtains the process identifier (PID, Process) pointed to by the user identifier according to the user identifier (UID). Identification).
S206,智能手机根据该进程标识确定相应的目标应用进程。S206. The smart phone determines a corresponding target application process according to the process identifier.
具体地,由于进程标识(PID)与智能手机系统中运行的进程具有唯一对应关系,因此可以根据该进程标识(PID)确定相应的目标应用进程。例如,智能手机系统中运行的微信进程标识对应的目标应用进程即为微信。Specifically, since the process identifier (PID) has a unique correspondence with a process running in the smartphone system, the corresponding target application process can be determined according to the process identifier (PID). For example, the target application process corresponding to the WeChat process identifier running in the smartphone system is WeChat.
S207,智能手机判断预设应用进程集合中是否存在与该目标应用进程相同的应用进程。S207. The smart phone determines whether there is an application process in the preset application process set that is the same as the target application process.
具体应用中,该预设应用进程集合可以是用户设置的多个应用进程的集合,例如,用户可以设置该应用进程集合包括微信、微博、天猫以及百度地图。在确定目标应用进程后,将该目标应用进程(例如,微信)的进程标识与该预设应用进程集合中的所有应用进程的进程标识逐一对比,当该目标应用进程(例如,微信)的进程标识与该预设应用进程集合中的应用进程(微信)的进程标识相同,则确定预设应用进程集合中存在与该目标应用进程相同的应用进程。In a specific application, the preset application process set may be a set of multiple application processes set by the user. For example, the user may set the application process set to include WeChat, Weibo, Tmall, and Baidu map. After determining the target application process, comparing the process identifier of the target application process (for example, WeChat) with the process identifier of all application processes in the preset application process set, when the process of the target application process (for example, WeChat) The identifier is the same as the process identifier of the application process (WeChat) in the preset application process set, and it is determined that there is an application process in the preset application process set that is the same as the target application process.
S208,智能手机关闭该目标应用进程,以禁止通过该数据包唤醒该智能手机系统。S208. The smartphone closes the target application process to prohibit the wake-up of the smartphone system by the data packet.
具体地,当智能手机判断预设应用进程集合中存在与该目标应用进程(例如,微信)相同的应用进程时,关闭该目标应用进程,以禁止该目标应用进程通过该数据包唤醒该智能手机系统。Specifically, when the smart phone determines that there is an application process in the preset application process set that is the same as the target application process (eg, WeChat), the target application process is closed to prohibit the target application process from waking up the smart phone through the data packet. system.
由上可知,本发明实施例提供的基于数据包的处理方法,采用智能手机接收服务器通过网络发送的数据包,获取在预设时间段内通过该数据包唤醒智能手机系统的唤醒频率,并判断该唤醒频率是否大于预设阈值,在判断为是时,智能手机根据该数据包获取相应的用户标识,并根据该用户标识获取相应的目标应用进程的进程标识,并进一步根据该进程标识确定相应的目标应用进程,智能手机判断预设应用进程集合中是否存在与该目标应用进程相同的应用进程,若是,则关闭该目标应用进程,以禁止通过该数据包唤醒该智能手机系统的技术方案;该方案中智能手机可以监控通过数据包唤醒智能手机系统的唤醒频率,当该唤醒频率大于预设阈值时,根据该数据包确定目标应用进程,并判断预设应用进程集合中是否存在与该目标应用进程相同的应用进程,若是,则关闭该目标应用进程,若智能手机接收到服务器通过网络发送的数据包频繁唤醒智能手机系统,并且预设应用进程集合中存在与确定的目标应用进程相同的应用进程,则关闭该目标应用进程,使得不能通过该数据包再次唤醒智能终端系统,并且能够避免需要保持与服务器长连接的应用进程被意外关闭,能够在保证智能手机正常使用的同时节省系统资源,特别是减少了智能手机的电量消耗。It can be seen from the above that the data packet-based processing method provided by the embodiment of the present invention uses a smart phone to receive a data packet sent by the server through the network, and obtains a wake-up frequency of the smart phone system by using the data packet in a preset time period, and determines Whether the wake-up frequency is greater than a preset threshold, when the determination is yes, the smart phone acquires a corresponding user identifier according to the data packet, and obtains a process identifier of the corresponding target application process according to the user identifier, and further determines corresponding according to the process identifier. The target application process, the smart phone determines whether there is an application process in the preset application process set that is the same as the target application process, and if so, closes the target application process to prohibit the technical solution of waking up the smart phone system through the data packet; In the solution, the smart phone can monitor the wake-up frequency of the smart phone system by using the data packet, and when the wake-up frequency is greater than the preset threshold, determine the target application process according to the data packet, and determine whether the target application process set exists in the preset application process set. Apply the same application process as the process, If yes, the target application process is closed. If the smart phone receives the data packet sent by the server through the network and frequently wakes up the smart phone system, and the preset application process set has the same application process as the determined target application process, the target is closed. The application process makes it impossible to wake up the smart terminal system again through the data packet, and can avoid the application process that needs to keep the long connection with the server from being accidentally closed, which can save the system resources while ensuring the normal use of the smart phone, especially the smart phone. The power consumption.
为了更好地实施以上方法,本发明实施例还提供一种基于数据包的处理装置,该处理装置可以集成在终端中,该终端可以是智能手机等设备。In order to better implement the above method, the embodiment of the present invention further provides a data packet-based processing device, which may be integrated in a terminal, and the terminal may be a device such as a smart phone.
本发明实施例还提供了一种基于数据包的处理装置,包括:The embodiment of the invention further provides a packet-based processing device, including:
接收模块,用于接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;a receiving module, configured to receive a data packet sent by the server over the network, where the data packet is used to maintain a network connection with the server;
获取模块,用于获取在预设时间段内通过所述数据包唤醒终端系统的唤醒频率;An acquiring module, configured to acquire a wake-up frequency of the terminal system by using the data packet in a preset time period;
判断模块,用于判断所述唤醒频率是否大于预设阈值;a determining module, configured to determine whether the wake-up frequency is greater than a preset threshold;
处理模块,用于当所述判断模块判断为是时,禁止通过所述数据包唤醒所述终端系统。And a processing module, configured to, when the determining module determines to be YES, prohibit the wake-up of the terminal system by using the data packet.
在一些实施例中,所述处理模块具体包括:In some embodiments, the processing module specifically includes:
第一确定子模块,用于确定所述数据包对应的目标应用进程;a first determining submodule, configured to determine a target application process corresponding to the data packet;
第一处理子模块,用于关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。The first processing submodule is configured to close the target application process to prohibit the terminal system from being woken up by the data packet.
在一些实施例中,所述第一确定子模块具体用于:In some embodiments, the first determining submodule is specifically configured to:
根据所述数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
根据所述用户标识获取相应的目标应用进程的进程标识;Obtaining, according to the user identifier, a process identifier of the corresponding target application process;
根据所述进程标识确定相应的目标应用进程。Determining a corresponding target application process according to the process identifier.
在一些实施例中,所述第一处理子模块具体用于:In some embodiments, the first processing submodule is specifically configured to:
判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
若是,则关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。If so, the target application process is closed to prohibit the terminal system from being woken up by the data packet.
在一些实施例中,所述处理模块具体包括:In some embodiments, the processing module specifically includes:
第二确定子模块,用于确定所述数据包对应的目标应用进程;a second determining submodule, configured to determine a target application process corresponding to the data packet;
第二处理子模块,用于阻止所述目标应用进程连接网络,以禁止通过所述数据包唤醒所述终端系统。And a second processing submodule, configured to prevent the target application process from connecting to the network to prohibit the terminal system from being woken up by the data packet.
在一优选实施例中,如图3a所示,该基于数据包的处理装置可以包括:接收模块301、获取模块302、判断模块303、处理模块304,具体描述如下:In a preferred embodiment, as shown in FIG. 3a, the data packet-based processing apparatus may include: a receiving module 301, an obtaining module 302, a determining module 303, and a processing module 304, which are specifically described as follows:
接收模块301,用于接收服务器通过网络发送的数据包,该数据包用于维持与该服务器之间的网络连接;The receiving module 301 is configured to receive a data packet sent by the server over the network, where the data packet is used to maintain a network connection with the server;
获取模块302,用于获取在预设时间段内通过该数据包唤醒终端系统的唤醒频率;The obtaining module 302 is configured to acquire a wake-up frequency of the terminal system by using the data packet in a preset time period;
判断模块303,用于判断该唤醒频率是否大于预设阈值;The determining module 303 is configured to determine whether the wake-up frequency is greater than a preset threshold;
处理模块304,用于在该判断模块判断为是时,禁止通过该数据包唤醒该终端系统。The processing module 304 is configured to prohibit the wake-up of the terminal system by the data packet when the determining module determines to be YES.
优选地,如图3b所示,该处理模块304具体包括:第一确定子模块3041、第一处理子模块3043,具体如下:Preferably, as shown in FIG. 3b, the processing module 304 specifically includes: a first determining submodule 3041 and a first processing submodule 3043, as follows:
该第一确定子模块3041,用于确定该数据包对应的目标应用进程;The first determining submodule 3041 is configured to determine a target application process corresponding to the data packet;
该第一处理子模块3043,用于关闭该目标应用进程,以禁止通过该数据包唤醒该终端系统。The first processing sub-module 3043 is configured to close the target application process to prohibit the terminal system from being woken up by the data packet.
优选地,该第一确定子模块3041具体用于:Preferably, the first determining submodule 3041 is specifically configured to:
根据该数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
根据该用户标识获取相应的目标应用进程的进程标识;Obtaining, according to the user identifier, a process identifier of the corresponding target application process;
根据该进程标识确定相应的目标应用进程。The corresponding target application process is determined according to the process identifier.
优选地,该第一处理子模块3043具体用于:Preferably, the first processing submodule 3043 is specifically configured to:
判断预设应用进程集合中是否存在与该目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
若是,则关闭该目标应用进程,以禁止通过该数据包唤醒该终端系统。If yes, the target application process is closed to prohibit the terminal system from being woken up by the data packet.
优选地,如图3c所示,该处理模块304具体包括:第二确定子模块3042、第二处理子模块3044,具体如下:Preferably, as shown in FIG. 3c, the processing module 304 specifically includes: a second determining submodule 3042 and a second processing submodule 3044, as follows:
第二确定子模块3042,用于确定该数据包对应的目标应用进程;a second determining sub-module 3042, configured to determine a target application process corresponding to the data packet;
第二处理子模块3044,用于阻止该目标应用进程连接网络,以禁止通过该数据包唤醒该终端系统。The second processing sub-module 3044 is configured to prevent the target application process from connecting to the network to prohibit the terminal system from being woken up by the data packet.
由上可知,本发明实施例提供了一种基于数据包的处理装置,通过接收模块301接收服务器通过网络发送的数据包,获取模块302获取在预设时间段内通过该数据包唤醒终端系统的唤醒频率,判断模块303判断该唤醒频率是否大于预设阈值,当判断为是时,处理模块304禁止通过该数据包唤醒该终端系统;该方案可以监控通过数据包唤醒终端系统的唤醒频率,当该唤醒频率大于预设阈值时,禁止通过该数据包唤醒该终端系统,若接收到服务器通过网络发送的数据包频繁唤醒终端系统,则禁止再次通过该数据包唤醒终端系统,使得终端系统不需要被频繁唤醒,从而节省了系统资源,特别是减少了终端的电量消耗。As shown in the above, the embodiment of the present invention provides a data packet-based processing apparatus. The receiving module 301 receives a data packet sent by a server through a network, and the obtaining module 302 acquires a wake-up terminal system through the data packet within a preset time period. The wake-up frequency, the determining module 303 determines whether the wake-up frequency is greater than a preset threshold. When the determination is yes, the processing module 304 prohibits the wake-up of the terminal system by the data packet; the solution can monitor the wake-up frequency of the terminal system through the data packet, when When the wake-up frequency is greater than the preset threshold, the terminal system is prohibited from being woken up by the data packet. If the data packet sent by the server through the network is frequently awake to the terminal system, the terminal system is prohibited from being awake through the data packet again, so that the terminal system does not need to be It is frequently awakened, which saves system resources, especially the power consumption of the terminal.
在一优选实施例中,还提供一种电子设备,该电子设备可以是上述实施例中描述的终端,具体的包括智能手机、平板电脑等设备。图4所示,电子设备400包括处理器401、存储器402、显示屏403以及控制电路404。其中,处理器401分别与存储器402、显示屏403、控制电路404电性连接。In a preferred embodiment, an electronic device is further provided, and the electronic device may be the terminal described in the foregoing embodiment, and specifically includes a device such as a smart phone or a tablet computer. As shown in FIG. 4, the electronic device 400 includes a processor 401, a memory 402, a display screen 403, and a control circuit 404. The processor 401 is electrically connected to the memory 402, the display screen 403, and the control circuit 404, respectively.
处理器401是电子设备400的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器402内的应用程序,以及调用存储在存储器402内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。The processor 401 is a control center of the electronic device 400, which connects various parts of the entire electronic device using various interfaces and lines, executes the electronic by running or loading an application stored in the memory 402, and calling data stored in the memory 402. The various functions and processing data of the device enable overall monitoring of the electronic device.
在本实施例中,电子设备400中的处理器401会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器402中,并由处理器401来运行存储在存储器402中的应用程序,从而实现各种功能:In this embodiment, the processor 401 in the electronic device 400 loads the instructions corresponding to the process of one or more applications into the memory 402 according to the following steps, and is stored and stored in the memory 402 by the processor 401. In the application, thus implementing various functions:
接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;Receiving a data packet sent by the server over the network, the data packet being used to maintain a network connection with the server;
获取在预设时间段内通过所述数据包唤醒电子设备系统的唤醒频率;Acquiring a wake-up frequency of the electronic device system by the data packet during the preset time period;
判断所述唤醒频率是否大于预设阈值;Determining whether the wake-up frequency is greater than a preset threshold;
若是,则禁止通过所述数据包唤醒所述电子设备系统。If so, the electronic device system is prohibited from being woken up by the data packet.
在一些实施例中,所述处理器401用于执行以下步骤:In some embodiments, the processor 401 is configured to perform the following steps:
确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
关闭所述目标应用进程,以禁止通过所述数据包唤醒所述电子设备系统。The target application process is closed to prohibit waking up the electronic device system through the data packet.
在一些实施例中,所述处理器401用于执行以下步骤:In some embodiments, the processor 401 is configured to perform the following steps:
根据所述数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
根据所述用户标识获取相应的进程标识;Obtaining a corresponding process identifier according to the user identifier;
根据所述进程标识确定相应的目标应用进程。Determining a corresponding target application process according to the process identifier.
在一些实施例中,所述处理器401还用于执行以下步骤:In some embodiments, the processor 401 is further configured to perform the following steps:
判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
若是,则关闭所述目标应用进程,以禁止通过所述数据包唤醒所述电子设备系统。If so, the target application process is closed to prohibit waking up the electronic device system through the data packet.
在一些实施例中,所述处理器401还用于执行以下步骤:In some embodiments, the processor 401 is further configured to perform the following steps:
将所述目标应用进程的进程标识与所述预设应用进程集合中所有应用进程的进程标识逐一对比;Comparing the process identifier of the target application process with the process identifier of all application processes in the preset application process set;
当所述预设应用进程集合中,存在与所述目标应用进程的进程标识相同的进程标识时,判断预设应用进程集合中存在与所述目标应用进程相同的应用进程。When the process identifier of the target application process is the same as the process identifier of the target application process, it is determined that there is an application process in the preset application process set that is the same as the target application process.
在一些实施例中,所述处理器401用于执行以下步骤:In some embodiments, the processor 401 is configured to perform the following steps:
提示用户将所述目标应用进程添加至所述预设应用进程集合。Prompting the user to add the target application process to the preset application process set.
在一些实施例中,所述处理器401用于执行以下步骤:In some embodiments, the processor 401 is configured to perform the following steps:
确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
阻止所述目标应用进程连接网络,以禁止通过所述数据包唤醒所述电子设备系统。The target application process is prevented from connecting to the network to prohibit waking up the electronic device system through the data packet.
存储器402可用于存储应用程序和数据。存储器402存储的应用程序中包含有可在处理器中执行的指令。应用程序可以组成各种功能模块。处理器401通过运行存储在存储器402的应用程序,从而执行各种功能应用以及数据处理。Memory 402 can be used to store applications and data. The application stored in the memory 402 contains instructions that are executable in the processor. Applications can form various functional modules. The processor 401 executes various functional applications and data processing by running an application stored in the memory 402.
显示屏403可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口。当电子设备系统被数据包唤醒后,显示屏403由熄屏状态切换至亮屏状态。因此,当禁止通过数据包唤醒电子设备系统时,显示屏403将保持熄屏状态。Display 403 can be used to display information entered by the user or information provided to the user as well as various graphical user interfaces of the electronic device. When the electronic device system is woken up by the data packet, the display screen 403 is switched from the off-screen state to the bright-screen state. Therefore, when the electronic device system is prohibited from waking up through the data packet, the display screen 403 will remain in the off state.
控制电路404与显示屏403电性连接,在处理器401的调度下,控制显示屏403的熄屏或亮屏状态。The control circuit 404 is electrically connected to the display screen 403, and under the scheduling of the processor 401, controls the off-screen or bright-screen state of the display screen 403.
在一些实施例中,如图5所示,电子设备400还包括射频电路405。射频电路405用于收发射频信号,比如与多个服务器建立通信链路,接收从服务器发送的数据包。In some embodiments, as shown in FIG. 5, the electronic device 400 also includes a radio frequency circuit 405. The radio frequency circuit 405 is configured to send and receive radio frequency signals, such as establishing a communication link with a plurality of servers, and receiving data packets sent from the server.
在一些实施例中,电子设备400还包括电源406。电源406用于给电子设备400的各个部件供电。在一些实施例中,电源406可以通过电源管理系统与处理器401逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。In some embodiments, electronic device 400 also includes a power source 406. Power source 406 is used to power various components of electronic device 400. In some embodiments, the power supply 406 can be logically coupled to the processor 401 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
尽管图5中未示出,电子设备400还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 5, the electronic device 400 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
由上可知,本发明实施例提供了一种电子设备,通过接收服务器通过网络发送的数据包,获取在预设时间段内通过该数据包唤醒电子设备系统的唤醒频率,判断该唤醒频率是否大于预设阈值,当判断为是时,禁止通过该数据包唤醒该电子设备系统;该方案可以监控通过数据包唤醒电子设备系统的唤醒频率,当该唤醒频率大于预设阈值时,禁止通过该数据包唤醒该电子设备系统,若接收到服务器通过网络发送的数据包频繁唤醒电子设备系统,则禁止再次通过该数据包唤醒电子设备系统,使得电子设备系统不需要被频繁唤醒,从而节省了系统资源,特别是减少了电子设备的电量消耗。As can be seen from the above, an embodiment of the present invention provides an electronic device, by receiving a data packet sent by a server through a network, acquiring a wake-up frequency of the electronic device system by using the data packet in a preset time period, and determining whether the wake-up frequency is greater than Presetting the threshold, when the determination is yes, prohibiting the electronic device system from being woken up by the data packet; the solution may monitor the wake-up frequency of the electronic device system by the data packet, and prohibiting the data from being passed when the wake-up frequency is greater than a preset threshold The packet wakes up the electronic device system. If the data packet sent by the server through the network frequently wakes up the electronic device system, it is prohibited to wake up the electronic device system through the data packet again, so that the electronic device system does not need to be frequently woken up, thereby saving system resources. In particular, it reduces the power consumption of electronic devices.
本发明实施例还提供一种存储介质,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行上述任一实施例所述的基于数据包的处理方法。The embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the packet-based processing method described in any of the foregoing embodiments.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。A person skilled in the art may understand that all or part of the various steps of the foregoing embodiments may be performed by a program to instruct related hardware. The program may be stored in a computer readable storage medium, and the storage medium may include: Read only memory (ROM, Read Only Memory), Random Access Memory (RAM), disk or optical disk.
以上对本发明实施例所提供的一种基于数据包的处理方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用程序范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The data packet-based processing method, device, storage medium, and electronic device provided by the embodiments of the present invention are described in detail. The principles and implementation manners of the present invention are described in the following. The descriptions are only used to help understand the method of the present invention and its core ideas; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the scope of specific implementations and applications, The description is not to be construed as limiting the invention.

Claims (20)

  1. 一种基于数据包的处理方法,其包括:A packet-based processing method, including:
    接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;Receiving a data packet sent by the server over the network, the data packet being used to maintain a network connection with the server;
    获取在预设时间段内通过所述数据包唤醒终端系统的唤醒频率;Obtaining a wake-up frequency of the terminal system by using the data packet in a preset time period;
    判断所述唤醒频率是否大于预设阈值;Determining whether the wake-up frequency is greater than a preset threshold;
    若是,则禁止通过所述数据包唤醒所述终端系统。If so, the terminal system is prohibited from being woken up by the data packet.
  2. 根据权利要求1所述的处理方法,其中,所述禁止通过所述数据包唤醒所述终端系统的步骤包括:The processing method according to claim 1, wherein said step of prohibiting waking up said terminal system by said data packet comprises:
    确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
    关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。The target application process is closed to prohibit wake-up of the terminal system by the data packet.
  3. 根据权利要求2所述的处理方法,其中,所述确定所述数据包对应的目标应用进程的步骤包括:The processing method according to claim 2, wherein the determining the target application process corresponding to the data packet comprises:
    根据所述数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
    根据所述用户标识获取相应的进程标识;Obtaining a corresponding process identifier according to the user identifier;
    根据所述进程标识确定相应的目标应用进程。Determining a corresponding target application process according to the process identifier.
  4. 根据权利要求2所述的处理方法,其中,所述关闭所述目标应用进程的步骤包括:The processing method according to claim 2, wherein the step of closing the target application process comprises:
    判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
    若是,则关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。If so, the target application process is closed to prohibit the terminal system from being woken up by the data packet.
  5. 根据权利要求4所述的处理方法,其中,所述判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程步骤包括:The processing method of claim 4, wherein the determining, by the preset application process set, whether the application process process is the same as the target application process comprises:
    将所述目标应用进程的进程标识与所述预设应用进程集合中所有应用进程的进程标识逐一对比;Comparing the process identifier of the target application process with the process identifier of all application processes in the preset application process set;
    当所述预设应用进程集合中,存在与所述目标应用进程的进程标识相同的进程标识时,判断预设应用进程集合中存在与所述目标应用进程相同的应用进程。When the process identifier of the target application process is the same as the process identifier of the target application process, it is determined that there is an application process in the preset application process set that is the same as the target application process.
  6. 根据权利要求4所述的处理方法,其中,判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程步骤之后,还包括:The processing method of claim 4, wherein after determining whether the application process step is the same as the target application process in the preset application process set, the method further includes:
    提示用户将所述目标应用进程添加至所述预设应用进程集合。Prompting the user to add the target application process to the preset application process set.
  7. 根据权利要求1所述的处理方法,其中,所述禁止通过所述数据包唤醒所述终端系统的步骤具体包括:The processing method of claim 1, wherein the step of disabling the wake-up of the terminal system by the data packet comprises:
    确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
    阻止所述目标应用进程连接网络,以禁止通过所述数据包唤醒所述终端系统。The target application process is prevented from connecting to the network to prohibit waking up the terminal system through the data packet.
  8. 一种基于数据包的处理装置,其包括:A packet based processing apparatus comprising:
    接收模块,用于接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;a receiving module, configured to receive a data packet sent by the server over the network, where the data packet is used to maintain a network connection with the server;
    获取模块,用于获取在预设时间段内通过所述数据包唤醒终端系统的唤醒频率;An acquiring module, configured to acquire a wake-up frequency of the terminal system by using the data packet in a preset time period;
    判断模块,用于判断所述唤醒频率是否大于预设阈值;a determining module, configured to determine whether the wake-up frequency is greater than a preset threshold;
    处理模块,用于当所述判断模块判断为是时,禁止通过所述数据包唤醒所述终端系统。And a processing module, configured to, when the determining module determines to be YES, prohibit the wake-up of the terminal system by using the data packet.
  9. 根据权利要求8所述的处理装置,其中,所述处理模块具体包括:The processing device according to claim 8, wherein the processing module specifically comprises:
    第一确定子模块,用于确定所述数据包对应的目标应用进程;a first determining submodule, configured to determine a target application process corresponding to the data packet;
    第一处理子模块,用于关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。The first processing submodule is configured to close the target application process to prohibit the terminal system from being woken up by the data packet.
  10. 根据权利要求9所述的处理装置,其中,所述第一确定子模块用于:The processing device of claim 9, wherein the first determining sub-module is for:
    根据所述数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
    根据所述用户标识获取相应的目标应用进程的进程标识;Obtaining, according to the user identifier, a process identifier of the corresponding target application process;
    根据所述进程标识确定相应的目标应用进程。Determining a corresponding target application process according to the process identifier.
  11. 根据权利要求9所述的处理装置,其中,所述第一处理子模块用于:The processing device of claim 9, wherein the first processing sub-module is for:
    判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
    若是,则关闭所述目标应用进程,以禁止通过所述数据包唤醒所述终端系统。If so, the target application process is closed to prohibit the terminal system from being woken up by the data packet.
  12. 根据权利要求8所述的处理装置,其中,所述处理模块包括:The processing device of claim 8, wherein the processing module comprises:
    第二确定子模块,用于确定所述数据包对应的目标应用进程;a second determining submodule, configured to determine a target application process corresponding to the data packet;
    第二处理子模块,用于阻止所述目标应用进程连接网络,以禁止通过所述数据包唤醒所述终端系统。And a second processing submodule, configured to prevent the target application process from connecting to the network to prohibit the terminal system from being woken up by the data packet.
  13. 一种存储介质,其中,所述存储介质中存储有多条指令,所述指令适于由处理器加载以执行如权利要求1-7任意一项所述方法的步骤。A storage medium, wherein the storage medium stores a plurality of instructions adapted to be loaded by a processor to perform the steps of the method of any of claims 1-7.
  14. 一种电子设备,其包括处理器和存储器,所述存储器存储有多条指令,所述处理器加载所述存储器中的指令用于执行以下步骤:An electronic device includes a processor and a memory, the memory storing a plurality of instructions, the processor loading instructions in the memory for performing the following steps:
    接收服务器通过网络发送的数据包,所述数据包用于维持与所述服务器之间的网络连接;Receiving a data packet sent by the server over the network, the data packet being used to maintain a network connection with the server;
    获取在预设时间段内通过所述数据包唤醒电子设备系统的唤醒频率;Acquiring a wake-up frequency of the electronic device system by the data packet during the preset time period;
    判断所述唤醒频率是否大于预设阈值;Determining whether the wake-up frequency is greater than a preset threshold;
    若是,则禁止通过所述数据包唤醒所述电子设备系统。If so, the electronic device system is prohibited from being woken up by the data packet.
  15. 根据权利要求14所述的电子设备,其中,所述处理器用于执行以下步骤:The electronic device of claim 14, wherein the processor is configured to perform the following steps:
    确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
    关闭所述目标应用进程,以禁止通过所述数据包唤醒所述电子设备系统。The target application process is closed to prohibit waking up the electronic device system through the data packet.
  16. 根据权利要求15所述的电子设备,其中,所述处理器用于执行以下步骤:The electronic device of claim 15 wherein said processor is operative to perform the steps of:
    根据所述数据包获取相应的用户标识;Obtaining a corresponding user identifier according to the data packet;
    根据所述用户标识获取相应的进程标识;Obtaining a corresponding process identifier according to the user identifier;
    根据所述进程标识确定相应的目标应用进程。Determining a corresponding target application process according to the process identifier.
  17. 根据权利要求15所述的电子设备,其中,所述处理器用于执行以下步骤:The electronic device of claim 15 wherein said processor is operative to perform the steps of:
    判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程;Determining whether there is an application process in the preset application process set that is the same as the target application process;
    若是,则关闭所述目标应用进程,以禁止通过所述数据包唤醒所述电子设备系统。If so, the target application process is closed to prohibit waking up the electronic device system through the data packet.
  18. 根据权利要求17所述的电子设备,其中,所述处理器用于执行以下步骤:The electronic device of claim 17 wherein said processor is operative to perform the steps of:
    将所述目标应用进程的进程标识与所述预设应用进程集合中所有应用进程的进程标识逐一对比;Comparing the process identifier of the target application process with the process identifier of all application processes in the preset application process set;
    当所述预设应用进程集合中,存在与所述目标应用进程的进程标识相同的进程标识时,判断预设应用进程集合中存在与所述目标应用进程相同的应用进程。When the process identifier of the target application process is the same as the process identifier of the target application process, it is determined that there is an application process in the preset application process set that is the same as the target application process.
  19. 根据权利要求17所述的电子设备,其中,所述判断预设应用进程集合中是否存在与所述目标应用进程相同的应用进程步骤之后,所述处理器用于执行以下步骤:The electronic device according to claim 17, wherein the processor is configured to perform the following steps after determining whether there is an application process step in the preset application process set that is the same as the target application process:
    提示用户将所述目标应用进程添加至所述预设应用进程集合。Prompting the user to add the target application process to the preset application process set.
  20. 根据权利要求14所述的电子设备,其中,所述处理器用于执行以下步骤:The electronic device of claim 14, wherein the processor is configured to perform the following steps:
    确定所述数据包对应的目标应用进程;Determining a target application process corresponding to the data packet;
    阻止所述目标应用进程连接网络,以禁止通过所述数据包唤醒所述电子设备系统。The target application process is prevented from connecting to the network to prohibit waking up the electronic device system through the data packet.
PCT/CN2017/086472 2016-05-31 2017-05-29 Data packet-based processing method and apparatus, storage medium, and electronic device WO2017206875A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610379854.4A CN106102141B (en) 2016-05-31 2016-05-31 A kind of processing method and processing device based on packet
CN201610379854.4 2016-05-31

Publications (1)

Publication Number Publication Date
WO2017206875A1 true WO2017206875A1 (en) 2017-12-07

Family

ID=57230589

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086472 WO2017206875A1 (en) 2016-05-31 2017-05-29 Data packet-based processing method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN106102141B (en)
WO (1) WO2017206875A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117135729A (en) * 2023-01-20 2023-11-28 荣耀终端有限公司 Multi-device cooperation method, system and terminal device

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106102142B (en) * 2016-05-31 2017-11-17 广东欧珀移动通信有限公司 terminal data processing method and device
CN106102141B (en) * 2016-05-31 2017-10-17 广东欧珀移动通信有限公司 A kind of processing method and processing device based on packet
CN106686633A (en) * 2017-02-20 2017-05-17 苏州蜗牛数字科技股份有限公司 Method for preventing WIFI malicious frequent awakening
CN106937258B (en) 2017-03-10 2019-07-12 Oppo广东移动通信有限公司 A kind of control method of broadcast, device and mobile terminal
CN107027141B (en) * 2017-05-08 2019-02-12 Oppo广东移动通信有限公司 Information processing method, device and mobile terminal
CN109461238A (en) * 2018-10-30 2019-03-12 北京摩拜科技有限公司 Control method for vehicle, server, vehicle and Vehicular system
CN109901697A (en) * 2019-03-04 2019-06-18 上海卓易科技股份有限公司 A kind of method, apparatus, equipment and medium reducing system power dissipation
CN110687998A (en) * 2019-09-18 2020-01-14 华为技术有限公司 Application management method and device
CN112187733A (en) * 2020-09-09 2021-01-05 青岛海信移动通信技术股份有限公司 Network side equipment, terminal and talkback method
CN112084494A (en) * 2020-09-21 2020-12-15 百度在线网络技术(北京)有限公司 Sensitive information detection method, device, equipment and storage medium
CN117135730A (en) * 2023-02-07 2023-11-28 荣耀终端有限公司 Interrupt processing method and electronic equipment
CN117389733B (en) * 2023-10-25 2024-04-26 无锡众星微系统技术有限公司 SAS I/O scheduling method and device for reducing switch chain overhead

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140066063A1 (en) * 2012-08-30 2014-03-06 Samsung Electronics Co., Ltd. Heartbeat period determination method and apparatus for push service in wireless network
CN103970255A (en) * 2014-04-01 2014-08-06 联想(北京)有限公司 Information processing method and electronic equipment
CN103971050A (en) * 2014-05-21 2014-08-06 深圳市中兴移动通信有限公司 Mobile terminal awakening control method and device and mobile terminal
CN104221445A (en) * 2013-11-15 2014-12-17 华为终端有限公司 Method for waking up terminal system and terminal
CN106102141A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 A kind of processing method and processing device based on packet
CN106102142A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 terminal data processing method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7589629B2 (en) * 2007-02-28 2009-09-15 Apple Inc. Event recorder for portable media device
CN103312766B (en) * 2011-11-15 2016-06-29 华为技术有限公司 A kind of method, system and device supporting applications client forever online
CN103118188B (en) * 2013-01-25 2014-08-20 华为终端有限公司 Application heartbeat cycle adjusting method and device, and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140066063A1 (en) * 2012-08-30 2014-03-06 Samsung Electronics Co., Ltd. Heartbeat period determination method and apparatus for push service in wireless network
CN104221445A (en) * 2013-11-15 2014-12-17 华为终端有限公司 Method for waking up terminal system and terminal
CN103970255A (en) * 2014-04-01 2014-08-06 联想(北京)有限公司 Information processing method and electronic equipment
CN103971050A (en) * 2014-05-21 2014-08-06 深圳市中兴移动通信有限公司 Mobile terminal awakening control method and device and mobile terminal
CN106102141A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 A kind of processing method and processing device based on packet
CN106102142A (en) * 2016-05-31 2016-11-09 广东欧珀移动通信有限公司 terminal data processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117135729A (en) * 2023-01-20 2023-11-28 荣耀终端有限公司 Multi-device cooperation method, system and terminal device
CN117135729B (en) * 2023-01-20 2024-05-24 荣耀终端有限公司 Multi-device cooperation method, system and terminal device

Also Published As

Publication number Publication date
CN106102141A (en) 2016-11-09
CN106102141B (en) 2017-10-17

Similar Documents

Publication Publication Date Title
WO2017206875A1 (en) Data packet-based processing method and apparatus, storage medium, and electronic device
WO2017206883A1 (en) Application processing method and apparatus, storage medium, and electronic device
WO2017206878A1 (en) Wakeup lock-based processing method and apparatus, storage medium, and electronic device
WO2017206862A1 (en) Bright screen lock-based processing method and apparatus, storage medium, and electronic device
WO2014019139A1 (en) Method, device and system for implementing radio resource control connection release
WO2017206880A1 (en) Terminal data processing method and apparatus, storage medium, and electronic device
WO2015167258A1 (en) Proximity communication method and apparatus
WO2016065619A1 (en) Data traffic management method and device
WO2018076812A1 (en) Data request response method and device, storage medium, server and system
WO2018076866A1 (en) Data processing method, device, storage medium, electronic device and server
WO2018076841A1 (en) Data sharing method, apparatus, storage medium and server
WO2014171728A1 (en) Method and apparatus for setting up/releasing radio resource control connection between evolved node b and user equipment in communication system
WO2018076868A1 (en) Data synchronization method, device and system, storage medium and server
WO2017206890A1 (en) Wakeup lock-based processing method and apparatus, storage medium, and electronic device
WO2018010507A1 (en) Awakening monitoring method of terminal system, storage medium, terminal, and electronic device
WO2018076840A1 (en) Data sharing method, device, storage medium and server
WO2017206886A1 (en) Wakeup lock releasing method and apparatus, storage medium, and electronic device
WO2018166199A1 (en) Method for adjusting precision level of positioning, device, storage medium and electronic device
WO2017206885A1 (en) Application program shutdown method and apparatus, storage medium, and electronic device
WO2014200319A1 (en) Terminal and application synchronization method therefor
WO2020032449A1 (en) Electronic device for supporting data communication and method therefor
WO2018076829A1 (en) Terminal data processing method, apparatus, system, storage medium and server
WO2018161580A1 (en) Broadcast control method and apparatus, storage medium, and electronic device
WO2017206870A1 (en) Sensor shutdown method and apparatus, storage medium, and electronic device
WO2020096303A1 (en) Apparatus and method for communication between devices in close proximity in wireless network

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: 17805820

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17805820

Country of ref document: EP

Kind code of ref document: A1