Network management method and terminal
By judging the importance of data flow through the system framework layer and modem in the sleep state of electronic devices, selectively intercepting or releasing data flow, the frequent wake-up problem caused by UDP packets is solved, and power consumption reduction and battery life improvement is achieved.
Patent Information
- Application Number
- CN202510441660.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-18
AI Technical Summary
When the electronic device is in a sleep state, UDP data packets cause the operating system to wake up frequently, increasing system power consumption and affecting battery life.
The importance of data flow is judged through the system framework layer and modem, and selectively intercept or release uplink and downlink data flows to avoid unnecessary system wake-up.
Effectively reduce system power consumption, improve battery life, and ensure the normal transmission of important data streams.
Smart Images

Figure CN120343679A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technologies, and particularly relates to a network management method and a terminal. Background Art
[0002] With the development of communication technologies, electronic devices have become increasingly important in life, and users' requirements for the battery life of electronic devices have also become higher. To extend the battery life, some electronic devices are equipped with a power-saving mode, which reduces power consumption by restricting the activities of background applications, lowering the screen brightness, reducing network connections, etc.
[0003] In related technologies, when an electronic device is in a sleep state or a low-power state, if the electronic device receives a User Datagram Protocol (UDP) data packet, since UDP data packets are transmitted independently, the operating system kernel layer cannot refuse to receive the UDP data packet, which may cause the operating system to be frequently awakened, thereby increasing the system power consumption. Summary of the Invention
[0004] The objective of the embodiments of this application is to provide a network management method and a terminal, which can avoid the system from being frequently awakened and save power consumption.
[0005] In a first aspect, the embodiments of this application provide a network management method, which is executed by a terminal. The method includes: when the terminal is in a sleep state, obtaining first information corresponding to an uplink data stream of a target application or second information corresponding to a downlink data stream; the system framework layer of the terminal determines whether the first information meets a first condition, and allows or intercepts the uplink data stream; alternatively, the modem of the terminal determines whether the second information meets a second condition, and allows or intercepts the downlink data stream.
[0006] In a second aspect, the embodiments of this application provide a network management device. The network management device includes: a system framework layer, a modem, and an obtaining module. The obtaining module is configured to obtain first information corresponding to an uplink data stream of a target application or second information corresponding to a downlink data stream when the terminal is in a sleep state; the system framework layer is configured to determine whether the first information meets a first condition, and allow or intercept the uplink data stream; alternatively, the modem is configured to determine whether the second information meets a second condition, and allow or intercept the downlink data stream.
[0007] In a third aspect, the embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores a program or instructions that can run on the processor. When the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0008] Fourthly, an embodiment of the present application provides a readable storage medium, on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0009] Fifthly, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instructions to implement the method described in the first aspect.
[0010] Sixthly, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0011] In an embodiment of the present application, when the terminal is in a sleep state, the first information corresponding to the uplink data stream or the second information corresponding to the downlink data stream of the target application can be obtained. Then, the system framework layer of the terminal determines whether the first information meets the first condition to allow or intercept the uplink data stream. Alternatively, the modem of the terminal determines whether the second information meets the second condition to allow or intercept the downlink data stream. In this solution, by the system framework layer determining whether the uplink data stream contains important information, the interception operation can be selectively performed on the uplink data stream. By the modem determining whether the downlink data stream contains important information, the interception operation can be selectively performed on the downlink data stream, thereby avoiding the system from being frequently awakened and reducing the system power consumption. The embodiment of the present application can not only ensure the normal transmission of important data streams, but also reduce the system power consumption and improve the battery life. Description of the Drawings
[0012] Figure 1 is a schematic diagram of the network management and control architecture provided by an embodiment of the present application;
[0013] Figure 2 is one of the flowcharts of the network management method provided by an embodiment of the present application;
[0014] Figure 3 is another flowchart of the network management method provided by an embodiment of the present application;
[0015] Figure 4 is yet another flowchart of the network management method provided by an embodiment of the present application;
[0016] Figure 5 is still another flowchart of the network management method provided by an embodiment of the present application;
[0017] Figure 6 is a schematic diagram of the process of obtaining information of key content provided by an embodiment of the present application;
[0018] Figure 7 One of the schematic diagrams for sending information on key content provided by an embodiment of the present application;
[0019] Figure 8 The fifth flowchart of the network management method provided by an embodiment of the present application;
[0020] Figure 9 The schematic diagram of the process for matching preset important information provided by an embodiment of the present application;
[0021] Figure 10 The sixth flowchart of the network management method provided by an embodiment of the present application;
[0022] Figure 11 The second schematic diagram for sending information on key content provided by an embodiment of the present application;
[0023] Figure 12 The schematic diagram of the process for disconnecting the link between the system kernel and the network interface provided by an embodiment of the present application;
[0024] Figure 13 The schematic diagram for disconnecting the link between the system kernel and the network interface provided by an embodiment of the present application;
[0025] Figure 14 The schematic diagram of the execution process of the network management method provided by an embodiment of the present application;
[0026] Figure 15 The schematic diagram of the terminal provided by an embodiment of the present application;
[0027] Figure 16 The schematic structural diagram of the electronic device provided by an embodiment of the present application;
[0028] Figure 17 The schematic hardware structure diagram of the electronic device provided by an embodiment of the present application. Detailed implementation manners
[0029] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope protected by the present application.
[0030] The terms "first", "second", etc. in the specification of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.
[0031] The terms "at least one (item)", "at least one of", etc. in this application refer to any one, any two or more combinations of the objects it contains. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".
[0032] The network management method, terminal, electronic device, storage medium, and program product provided by the embodiments of this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and their application scenarios.
[0033] The embodiments of this application can be applied to the scenario where a terminal manages network data streams in the power-saving mode.
[0034] The network management method provided by the embodiments of this application will be described exemplarily below by taking some specific scenarios of the embodiments of this application as examples.
[0035] Scenario 1: The power-saving mode of a mobile phone
[0036] Suppose the user's mobile phone automatically enters the power-saving mode at night while sleeping. At this time, the mobile phone needs to intercept the data stream to avoid the increased power consumption caused by the data stream frequently waking up the operating system.
[0037] Scenario 2: The power-saving mode of a smart speaker
[0038] Suppose the smart speaker enters the power-saving mode after not playing audio for a period of time. In the power-saving mode, the smart speaker needs to intercept the data stream to avoid the increased power consumption caused by the data stream frequently waking up the operating system.
[0039] It should be noted that the above Scenario 1 and Scenario 2 only exemplarily list some scenarios to which the embodiments of this application may be applied. In actual implementation, the embodiments of this application can also be applied to more scenarios where network management is required for any possible needs, and the embodiments of this application are not limited herein.
[0040] This application relates to a network management and control architecture, which is shown as follows Figure 1 and includes an application layer (App), a system framework layer (Framework), a kernel layer, and a modem layer, and is used to manage the process of receiving and sending data streams. Among them:
[0041] 1. Application layer: It includes various application programs, such as instant messaging applications, social media applications, email applications, etc., and is responsible for generating or receiving data streams and initiating data transmission requests according to user operations.
[0042] 2. System framework layer:
[0043] (1) Network management service (Net manager service): Responsible for managing network connections and data streams.
[0044] (2) Application management service (App manager service): Manages the running status of application programs and network usage.
[0045] (3) Power management service (Power manager service): Monitors the power status of the system and manages the sleep and wake-up of the system.
[0046] (4) Telephony management service (Telephony manager service): Responsible for communicating with the modem, processing AT commands and data stream information.
[0047] 3. Kernel layer: That is, the Kernel layer, which is the core part of the operating system, is responsible for managing system resources and hardware, includes a network protocol stack, and processes the transmission and reception of data streams.
[0048] 4. Modem:
[0049] (1) Rmnet driver: The network interface driver on the modem side is used to manage the transmission of network data.
[0050] (2) TCP / IP protocol stack: The protocol stack for processing network data packets.
[0051] (3) ATCI (AT command Interface) module: The module on the modem side that receives AT commands is responsible for processing AT commands from the system framework layer.
[0052] (4) Um interface: The upstream port where the data stream of the Rmnet network port flows to the network.
[0053] (5) Air interface protocol stack: The data stream is spliced into protocol messages for communicating with the network.
[0054] When a data packet is received, the terminal processes it as follows:
[0055] (1) The terminal receives data packets through the modem layer: When a data packet arrives at the device from the network, it is first received by the Rmnet driver of the modem layer. The Rmnet driver is responsible for managing the data transmission of the network interface. The terminal passes the received data packet to the Kernel layer through a specific interface through it.
[0056] (2) The terminal processes the data packet through the Kernel layer: The terminal performs preliminary processing on the data packet through the network protocol stack of the Kernel layer, including checking the integrity of the data packet and parsing the header information of the data packet (such as the target IP address, protocol type, etc.). If the data packet is TCP protocol, the terminal can maintain the TCP connection status through the Kernel layer; if it is UDP protocol, the terminal can directly pass the data packet to the upper layer through the Kernel layer.
[0057] (3) The terminal processes the data packet through the Framework layer: The terminal passes the data packet information to the Net manager service of the Framework layer through the Kernel layer. The Net manager service is responsible for managing network connections and data flows. The terminal further processes the data packet through it based on the information of the data packet (such as the transmission network port, target IP address, protocol type, etc.). If the data packet needs to wake up the application, the terminal can notify the App manager service through the Net manager service.
[0058] (4) The terminal processes the data packet through the application layer: The terminal uses the App manager service to determine whether the corresponding application needs to be awakened to process the data packet based on preset rules or application priority. If awakening is required, the application is started and receives the data packet for processing.
[0059] When sending a data packet, the terminal processes it as follows:
[0060] (1) The terminal generates data packets through the application layer: The terminal generates the data to be sent through the application program of the application layer and initiates the sending request through the Net manager service of the Framework layer.
[0061] (2) The terminal processes the data packet through the Framework layer: After receiving the sending request through the Net manager service, the terminal performs preliminary processing on the data packet, including checking the legality of the data packet, adding necessary header information, etc. Then, the terminal passes the data packet to the Kernel layer through the Net manager service.
[0062] (3) The terminal processes the data packet through the Kernel layer: The network protocol stack of the terminal through the Kernel layer performs routing selection and protocol encapsulation according to the destination IP address and protocol type of the data packet. If the data packet is of the TCP protocol, the terminal maintains the TCP connection through the Kernel layer and ensures the reliable transmission of data; if it is of the UDP protocol, the terminal directly passes the data packet to the modem layer through the Kernel layer.
[0063] (4) The terminal sends the data packet through the modem layer: After receiving the data packet through the Rmnet driver of the modem layer, the terminal sends the data packet to the network through the network interface.
[0064] The embodiments of the present application provide a network management method, a terminal, an electronic device, a storage medium, and a program product. By judging whether the uplink data stream contains important information through the system framework layer, the interception operation can be selectively performed on the uplink data stream. By judging whether the downlink data stream contains important information through the modem, the interception operation can be selectively performed on the downlink data stream, so that the system can be prevented from being frequently awakened, and the system power consumption is reduced. The embodiments of the present application can not only ensure the normal transmission of important data streams, but also reduce the system power consumption and improve the battery life.
[0065] The execution subject of the network management method provided by the embodiments of the present application may be a network management device, and the network management device may be a terminal, or a functional module or functional entity in the terminal. Hereinafter, taking the terminal as an example, the technical solutions provided by the embodiments of the present application will be described.
[0066] Figure 2 The flowchart of a network management method provided by the embodiments of the present application is shown. As Figure 2 shown, the network management method provided by the embodiments of the present application may include the following step 201 and step 202, or the network management method provided by the embodiments of the present application may include the following step 201 and step 203.
[0067] Step 201: When the terminal is in the sleep state, obtain the first information corresponding to the uplink data stream of the target application or the second information corresponding to the downlink data stream.
[0068] In the embodiments of the present application, the above data stream is the data stream of the target application received or the data stream to be transmitted by the target application.
[0069] In the embodiments of the present application, the above data stream is a sequence of bytes that is ordered, has a starting point and an ending point. In actual network transmission, the data stream is usually split into multiple data packets for transmission. Each data packet carries a part of the data stream and is reassembled into the original data stream at the destination.
[0070] In the embodiments of the present application, the above sleep state is a mode of the terminal, which is used to reduce the power consumption of the terminal to extend the battery life. In this state, the terminal can limit or suspend the functions in the terminal to reduce the power consumption, such as by reducing the screen brightness, restricting the activities of background applications, turning off unnecessary hardware modules such as Bluetooth, and restricting the network connection of applications, thereby effectively extending the battery life of the terminal.
[0071] In the embodiments of the present application, the terminal can enter the sleep state when it detects that the battery power is lower than a set threshold, for example, when the battery power is lower than 20%; or, the terminal can also enter the sleep state when no user input is detected within a certain period of time; or, the terminal can also enter the sleep state in response to the user's input. Specifically, it can be determined according to the actual usage requirements, and the embodiments of the present application do not make any restrictions.
[0072] In the embodiments of the present application, the above target application can be any networked application, including but not limited to social applications, video applications, email applications, browser applications, etc. The terminal can send or receive data packets through these applications.
[0073] In the embodiments of the present application, the above first information and second information are the data stream information of the data stream. The data stream information is the metadata of the data stream, which is used to identify and describe the characteristics of the data stream.
[0074] In the embodiments of the present application, in combination with Figure 2 , as Figure 3 shown, the above step 201 can be specifically implemented through the following step 201a.
[0075] Step 201a: When the terminal is in the sleep state, the system framework layer of the terminal obtains the first information corresponding to the uplink data stream of the target application.
[0076] In the embodiments of the present application, the above terminal refers to an electronic device that directly interacts with the user, such as a smart phone, a tablet computer, a smart watch, etc. It is an interface for the user to interact with network services or application programs. The above system framework layer is the framework layer.
[0077] In the embodiments of the present application, the above-mentioned first information includes: the user identifier (UID) of the target application, the transmission network interface of the uplink data stream, the destination Internet Protocol (IP) address of the uplink data stream, and the encapsulation protocol type of the uplink data stream.
[0078] In the embodiments of the present application, the above-mentioned UID is a unique identifier assigned by the operating system to each application. Each application will be assigned a unique UID during installation, which is used to identify and manage the processes, resources, and permissions of the application.
[0079] In the embodiments of the present application, the above-mentioned transmission network interface is the network interface used by the data stream, such as Remote Network (Rmnet) A, Rmnet B, etc. Different network interfaces may correspond to different network services or priorities.
[0080] In the embodiments of the present application, the above-mentioned target IP address is the IP address of the destination of the data stream, which is used to determine the target location of data transmission.
[0081] In the embodiments of the present application, the above-mentioned encapsulation protocol type is the network protocol used by the data stream, such as Transmission Control Protocol (TCP), UDP, Quick UDP Internet Connections (QUIC), etc. Different protocols are suitable for different application scenarios and data transmission requirements. Among them:
[0082] (1) TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol that can ensure that data packets arrive in order and perform error detection and correction during transmission. TCP establishes a connection through a three-way handshake and disconnects through a four-way handshake after the data transmission is completed. TCP is suitable for scenarios that require high reliability and data integrity, such as web browsing, file transfer, email, etc.
[0083] (2) UDP is a connectionless, datagram-oriented transport layer communication protocol. It does not guarantee the reliable transmission of data packets and does not perform error detection and correction. UDP has low latency and is suitable for scenarios with high real-time requirements and low sensitivity to data loss, such as video calls, online games, real-time audio transmission, etc.
[0084] (3) QUIC is a transport layer protocol implemented based on UDP. It combines the reliability of TCP while reducing the latency of connection establishment. By using UDP ports, QUIC avoids the multiple round-trips of the traditional TCP handshake, thus accelerating the connection establishment speed. QUIC is suitable for scenarios that require rapid connection establishment and high security, such as web page loading, Application Programming Interface (API) calls, etc.
[0085] In the embodiments of the present application, when detecting the data stream of the target application to be sent, for example, when the weather application automatically updates weather information and needs to send a request to obtain the latest weather data, the terminal can detect this data stream of the request to be sent through the network management service. When the terminal detects the data stream to be transmitted through the network management service, the terminal can obtain the data stream information in cooperation with the network protocol stack in the kernel (kernel) through the network management service, and record information such as the transmission network interface, target IP address, protocol, and UID of the application of the data stream through the kernel.
[0086] In this way, the terminal can obtain the uplink data stream information through the system framework layer, and determine whether the uplink data stream contains important information according to the uplink data stream information, so as to ensure that only the data stream containing important information is sent, thereby saving network bandwidth and device power consumption.
[0087] In the embodiments of the present application, in combination with Figure 2 , as Figure 4 shown, the above step 201 can be specifically implemented through the following step 201b.
[0088] Step 201b: When the terminal is in the sleep state, the modem of the terminal obtains the second information corresponding to the downlink data stream of the target application.
[0089] In the embodiments of the present application, the above second information includes: the transmission network interface of the downlink data stream, the destination IP address of the downlink data stream, and the encapsulation protocol type of the downlink data stream.
[0090] In the embodiments of the present application, the above modem (modem) is also called a modulation and demodulation module, which is used to process the network communication of the terminal, including the sending and receiving of data. In the sleep state, the terminal can maintain a basic network connection through the modem to receive important data packets.
[0091] In an embodiment of the present application, when the data stream is the data stream of the target application received, the terminal can continuously monitor the network interface through the modem to detect whether there is a data packet incoming. For example, when the user receives an instant messaging message, the terminal can detect the data stream of this instant messaging message through the modem. When the terminal detects the data stream through the modem, it can process the data stream of the network interface through the Rmnet driver in the modem, and can receive and process the Attention (AT) command from the Application Processor (AP) system through the Attention Command Interface (ATCI) module in the modem. The terminal can work in cooperation with these two modules to obtain relevant information of the data stream, such as the transmission network interface, the target IP address, the encapsulation protocol type, etc.
[0092] In this way, the terminal can obtain the downlink data stream information through the modem, and determine whether the downlink data stream contains important information according to the downlink data stream information, so as to ensure that only the data stream containing important information is received, thereby effectively reducing the number of times the non-important data wakes up the device and reducing the power consumption.
[0093] Step 202: The system framework layer of the terminal determines whether the first information meets the first condition, and releases or intercepts the uplink data stream.
[0094] In an embodiment of the present application, when the terminal is in the sleep state, the terminal can obtain the data stream information of the uplink data stream of the first application to be transmitted through the application layer.
[0095] In an embodiment of the present application, the above application layer is the interface for the user to interact with the terminal, responsible for processing user operations and preliminary processing of data, including various application programs, such as instant messaging applications, social media applications, email applications, etc.
[0096] In an embodiment of the present application, the above first application may be the same application as the target application, or the above first application may also be a different application from the target application.
[0097] In an embodiment of the present application, the terminal can send the data stream information of the uplink data stream to the network management service through the application layer.
[0098] In an embodiment of the present application, the above network management service is a service in the system, responsible for managing network resources and data streams. It cooperates with the network protocol stack in the kernel to manage and control the data stream.
[0099] In an embodiment of the present application, when detecting an uplink data stream of a first application to be transmitted, the terminal can extract data stream information of the data stream through the application layer, such as the transmission network interface, the target IP address, the encapsulation protocol type, etc., and send this data stream information to the network management service.
[0100] In an embodiment of the present application, the terminal can determine whether the uplink data stream contains important information based on the data stream information of the uplink data stream through the network management service.
[0101] In an embodiment of the present application, the terminal can perform sending control on the kernel on the system side through the network management service. After the terminal receives the preset important information from the application management service through the network management service, it can set up a firewall to allow the data streams that are the same as the UID, encapsulation protocol, address, and network interface in the preset important information to pass through the firewall, while restricting the sending of other data streams.
[0102] In an embodiment of the present application, when receiving the data stream information of the uplink data stream of the first application, the terminal can use the preset important information as a pairing basis through the firewall set by the network management service to ensure that only the data streams that meet these conditions are allowed to pass through, while other data streams are restricted or blocked from being sent.
[0103] In this way, the terminal can accurately identify important data streams and allow them to pass through by judging the characteristics of the data streams to be sent, while restricting the sending of non-important data streams, thereby saving power consumption while ensuring the transmission of important information.
[0104] In an embodiment of the present application, in combination with Figure 2 , such as Figure 5 shown, the above step 202 can be specifically implemented by the following step 202a or step 202b.
[0105] Step 202a: The system framework layer of the terminal determines that the first information meets the first condition and allows the uplink data stream to pass through.
[0106] In an embodiment of the present application, the above first condition includes: the user identifier of the uplink data stream is the same as the user identifier of the target application, the transmission network interface of the uplink data stream is the same as the target transmission network interface, the destination IP address of the uplink data stream is the same as the target IP address, and the encapsulation protocol type of the uplink data stream is the same as the target encapsulation protocol.
[0107] In an embodiment of the present application, when the system framework layer of the terminal determines whether the first information meets the first condition, the terminal can determine that the uplink data stream contains important information.
[0108] In the embodiments of the present application, the above-mentioned important information is also referred to as key content, which refers to the information in the data stream that contains information with relatively high priority and urgency, and such information needs to be known or processed by the user in a timely manner. Whether information is important information is mainly related to the content, source, and type of the information. The following are several exemplary explanations:
[0109] Exemplarily, in an instant messaging application, messages such as text, voice, and video sent between users in the application are usually regarded as important information. These messages are important for the connection and communication between users and need to be transmitted and processed in a timely manner.
[0110] Also exemplarily, notifications and reminders of the terminal, such as earthquake warnings, account security alerts, etc., are important for the user to understand the device status and take actions in a timely manner, and the user needs to know them in a timely manner.
[0111] Also exemplarily, files such as documents, contracts, reports, etc. transmitted by the terminal are usually regarded as important information. These files often contain key data and content and play an important role in the user's work or study.
[0112] Optionally, in the embodiments of the present application, in the case where any of the following is included in the data stream, it can be understood that important information is included:
[0113] (1) Operations initiated by the user actively: such as messages sent by the user in the application, requested data, etc.
[0114] (2) Key system notifications: such as low battery warnings, system update prompts, etc.
[0115] (3) Important interactions of the application: such as new messages, video call invitations, etc. in the instant messaging application.
[0116] (4) Preset important application data: data streams of key applications preset by the user or the system, such as work-related emails, messages of important contacts, etc.
[0117] In the embodiments of the present application, the reason for the terminal to release the data stream containing important information is to ensure that the user will not miss key notifications and data, maintain a good user experience, and meet the user's need to process important information in a timely manner.
[0118] In the embodiments of the present application, the terminal can, according to rules preset by the system or application, identify which data streams with certain characteristics (such as specific network interfaces, protocols, target IP addresses) contain important information; the terminal can also analyze the content of the data stream to identify key information therein, such as keywords, formats, etc., to determine whether it is important information. For example, when it is recognized that a text message contains a verification code, the text message is determined to be important information; the terminal can also determine whether a data stream is important information according to the user's settings, such as specific contacts, specific applications, etc.
[0119] The terminal can, through the application, decide which data streams corresponding to which content are the data streams that the user currently needs to wake up. Suppose the scenario is as follows:
[0120] (1) The user browses the web through a browser and uses a general Internet network interface, such as rmnet A.
[0121] (2) The user watches a video using a video application. To ensure communication quality, the video application uses a sliced network, and the network interface corresponding to the sliced network is rmnet B.
[0122] (3) The user uses an IMS network interface for transmission through a communication application, and the network interface is rmnet C.
[0123] Among them, compared with the general Internet network interface, the sliced network interface has a dedicated network and has the characteristics of high speed and low latency, and can be used after the application signs a contract with the operator.
[0124] In the embodiments of the present application, the process by which the terminal obtains information on key content is as Figure 6 shown.
[0125] Exemplarily, suppose the target IP address of the data stream corresponding to the advertisement loading content in the video application used by user B is m, and the network interface used is A. The video application determines that the advertisement loading content is not key content and does not process it. The target IP address used for the video corresponding content is n, and the sliced network interface B is used, and its own QUIC protocol is used for transmission. The video application can regard the content of the video as key content, and the video application collates and summarizes the target IP address N, network interface B, and protocol QUIC. As Figure 7 shown, during the collation process, the video application can, through the interface of the network management service, query the network interface used by the current data stream. The video application itself can obtain the target IP address of the application server used by the short video data stream, as well as the communication protocol (TCP, UDP, QUIC, etc.) selected by this application. Inform the network management service of the data stream information that needs to be woken up by incoming packets. This data stream identifies the corresponding protocol, target IP address, and network interface, and the application management service obtains the protocol, target IP address, and network interface information of the key content.
[0126] In the embodiments of the present application, the terminal can determine whether the data stream contains important information based on the data stream information.
[0127] In the embodiments of the present application, the above-mentioned release means that the terminal allows the data stream to pass through and processes it. Specifically, the terminal can wake up relevant components for processing according to the type and content of the data stream. For example, releasing an upstream data stream can be sharing photos or videos, sending messages, uploading files, etc., and releasing a downstream data stream can be receiving messages, loading web pages, displaying notifications, running applications, etc.
[0128] In the embodiments of the present application, when the first information corresponding to the upstream data stream of the target application matches the preset important information of the target application, the terminal determines that the upstream data stream contains important information.
[0129] In the embodiments of the present application, the above-mentioned preset important information is the standard information preset by the terminal according to the target application for determining whether the data stream is important. These preset information can be specific transmission network ports, target IP addresses, encapsulation protocol types, etc.
[0130] In the embodiments of the present application, the above-mentioned preset important information may include the UID, target IP address, network port, and encapsulation protocol of an application, or may be the UIDs, target IP addresses, network ports, and encapsulation protocols of multiple applications. When the preset important information includes the UIDs, target IP addresses, network ports, and encapsulation protocols of multiple applications, the acquisition steps for each application to obtain the UID, target IP address, network port, and encapsulation protocol are the same as those of the target application, which will not be elaborated here.
[0131] In the embodiments of the present application, the matching of the first information and the preset important information of the target application refers to the consistency of the first information and the preset important information of the target application in specific fields. Specifically, the device will compare the key fields in the data stream information with the corresponding fields in the preset important information. If the values of these fields are the same, it is considered that the data stream matches the preset important information, thereby determining that the data stream contains important information. Specifically, the terminal can determine whether the first information and the preset important information of the target application match by comparing the following fields:
[0132] (1) UID: The UID of the application corresponding to the data stream is consistent with the UID specified in the preset important information.
[0133] (2) Network port: The network port used by the data stream (such as Rmnet A, Rmnet B, etc.) is consistent with the network port specified in the preset important information.
[0134] (3) Target IP address: The destination IP address of the data stream is the same as the target IP address specified in the preset important information.
[0135] (4) Encapsulation protocol: The encapsulation protocol used by the data stream (such as TCP, UDP, QUIC, etc.) is consistent with the encapsulation protocol specified in the preset important information.
[0136] In the embodiments of the present application, the terminal can preset the data stream information corresponding to the important information according to the application, and determine which data streams with which data stream information contain important information, that is, the data streams that need to wake up the terminal.
[0137] For example, in the case where the target application is a video application, assume that the UID corresponding to the data stream of the advertisement loading content in the target application is 10000, the target IP address is m, the network interface used is A, and it is transmitted through the TCP protocol. The UID corresponding to the data stream of the video content in the target application is 10001, the target IP address is n, the sliced network interface B is used, and it is transmitted through the QUIC protocol. The terminal can determine that the video content is important content according to the target application, while the advertisement loading content is not important content. That is, the terminal can determine 10001 corresponding to the video content, the target IP address n, the network interface B, and the QUIC protocol as the preset important information.
[0138] In the embodiments of the present application, the terminal can send the preset important information to the network management service and the telephone management service through the application management service.
[0139] In the embodiments of the present application, the terminal can perform sending control on the kernel on the system side through the network management service. After receiving the preset important information through the network management service, the terminal can set up a firewall according to the preset important information, and intercept the data streams whose data stream information does not match the preset important information through the firewall.
[0140] In the embodiments of the present application, when the terminal enters the sleep state, the terminal can notify the network management service that the terminal enters the sleep state through the power management service, so that the terminal can perform data stream disconnection processing through the network management service, that is, disconnect the connection between the data stream that does not contain important information using the TCP protocol and the destination address by sending an RST message, so that the terminal intercepts all packets encapsulated by the TCP protocol.
[0141] In the embodiments of the present application, when the terminal is about to enter the system sleep state after being locked for a long time, the power management service notifies the network management service. The network management service performs data stream disconnection processing. If the protocol used by the application at this time is the TCP protocol, an RST message will be sent to disconnect the connection of the destination IP address. Since UDP is an unreliable connection protocol, no such message will be sent. And since QUIC is a higher-layer protocol of UDP, it will not be disconnected either. Subsequently, interception will be performed on the modem side.
[0142] It should be noted that since UDP is a connectionless protocol, the terminal cannot disconnect the data stream link of the UDP protocol through the RST message. Moreover, since the QUIC protocol is a transport protocol implemented based on the UDP protocol, which is also a connectionless protocol, it cannot be disconnected through the RST message either. Therefore, in the embodiments of the present application, the terminal can send preset important information to the ATCI module in the modem, and the modem intercepts the data stream of the UDP protocol.
[0143] In the embodiments of the present application, after obtaining the first information, the terminal can compare the first information with the preset important information. When the first information is exactly the same as the preset important information in the target application, the terminal can determine that the data stream information matches the preset important information. For example, if the preset important information specifies a certain specific transport network interface, target IP address, and encapsulation protocol type, and the upstream data stream uses this network interface, target IP address, and encapsulation protocol type, then the terminal can determine that the upstream data stream contains important information.
[0144] In the embodiments of the present application, the system framework layer of the terminal can judge the data stream information of the upstream data stream, and when it is determined that the upstream data stream contains important information, release the upstream data stream.
[0145] Step 202b: The system framework layer of the terminal determines that the first information does not meet the first condition and intercepts the upstream data stream.
[0146] In the embodiments of the present application, when the first information does not match any of the preset important information in the target application, the terminal determines that the upstream data stream does not contain important information.
[0147] In the embodiments of the present application, that the first information does not match any of the preset important information in the target application means that the first information is inconsistent with any of the preset important information in the target application in the key fields. Specifically, the device compares the key fields such as UID, transport network interface, target IP address, and encapsulation protocol type in the data stream information with the corresponding fields in the preset important information. If any field is inconsistent, it is considered that the data stream does not match the preset important information, and thus it is determined that the data stream does not contain important information. Specifically, the terminal can determine whether the first information does not match the preset important information of the target application by comparing the following fields:
[0148] (1) UID mismatch: The UID used by the data stream is inconsistent with the UID specified in the preset important information.
[0149] (2) Transport network interface mismatch: The network interface used by the data stream is inconsistent with the network interface specified in the preset important information.
[0150] (3) The destination IP address does not match: The destination IP address of the data stream is inconsistent with the IP address specified in the preset important information.
[0151] (4) The encapsulation protocol does not match: The encapsulation protocol used by the data stream is inconsistent with the encapsulation protocol specified in the preset important information.
[0152] In the embodiments of the present application, after obtaining the first information, the terminal can compare the first information with the preset important information. When the first information is not exactly the same as the preset important information in the target application, that is, when the first information is different from any of the preset important information in the target application, the terminal can determine that the data stream information does not match the preset important information. For example, if the preset important information specifies a certain specific transmission network port, destination address, and encapsulation protocol type, and the upstream data stream uses the network port and protocol but does not use the target address, then the terminal can determine that the upstream data stream does not contain important information.
[0153] In the embodiments of the present application, if it is determined based on the data stream information of the data stream that the data stream does not contain important information, the terminal can intercept the data stream.
[0154] In the embodiments of the present application, when the data stream does not contain the content of the above important information, it can be understood as not containing important information, which generally includes:
[0155] 1. Upstream data stream:
[0156] (1) Data automatically synchronized in the background: Such as synchronizing user preference settings, etc.
[0157] (2) Data not actively requested by the user: Such as device status information, error logs, etc.
[0158] (3) Data with low priority: Such as uploading usage statistics information, etc.
[0159] 2. Downstream data stream:
[0160] (1) Data automatically synchronized in the background: Such as background data refresh of the application, cache update, etc.
[0161] (2) Data not actively requested by the user: Such as advertisement push, content update not subscribed by the user, etc.
[0162] (3) Data with low priority: Such as secondary function data of the application, non-urgent notifications, etc.
[0163] In the embodiments of the present application, the reason for the terminal to intercept the data stream that does not contain important information is: to reduce the energy consumption of the device, extend the battery life, reduce the occupation of system resources, improve the overall operation efficiency of the device, and also avoid unnecessary notification interference to the user, and improve the user's concentration and satisfaction.
[0164] In the embodiments of the present application, intercepting a data stream means that the terminal uses certain technical means to prevent the data stream from continuing to be transmitted upward in the network stack or being processed by the application layer. Specifically, intercepting a data stream may include the following methods:
[0165] (1) Discarding data packets: The device directly discards these data packets at the modem layer or the Kernel layer without passing them to the upper network protocol stack or the application layer.
[0166] (2) Preventing the data stream from passing through the firewall: By setting firewall rules, prevent the data stream that meets specific conditions from passing through, so that it cannot reach the application layer.
[0167] (3) Not waking up the Application Processor (AP) system: If the device is in the power-saving mode, intercepting the data stream can avoid waking up the AP system, thereby reducing power consumption.
[0168] (4) Caching the data stream: In some cases, the device may cache these data streams and process them after the device wakes up or at an appropriate time.
[0169] In the embodiments of the present application, the terminal can judge the data stream information of the uplink data stream through the system framework layer of the terminal, and intercept the uplink data stream when it is determined that the uplink data stream does not contain important information.
[0170] In this way, the terminal can match the destination IP address, network interface, and encapsulation protocol of the data stream with the destination IP address, network interface, and encapsulation protocol in the preset important information, so as to accurately judge whether the data stream contains important information, so that the terminal can process the data stream containing important information and intercept the data that does not contain important information, ensuring that only truly important data streams can wake up the device, thereby saving power while ensuring that the user does not miss key information.
[0171] Step 203: The modem of the terminal judges whether the second information meets the second condition, and releases or intercepts the downlink data stream.
[0172] In the embodiments of the present application, combined with Figure 2 , as Figure 8 shown, the above step 203 can be specifically implemented by the following step 203a or step 203b.
[0173] Step 203a: The modem of the terminal judges that the second information meets the second condition, and releases the downlink data stream.
[0174] In the embodiments of the present application, the above second condition includes: the transmission network interface of the downlink data stream is the same as the target transmission network interface, the destination IP address of the downlink data stream is the same as the target IP address, and the encapsulation protocol type of the downlink data stream is the same as the target encapsulation protocol.
[0175] In the embodiments of the present application, when it is determined that the data stream contains important information, the terminal can wake up the AP system through the Power manager service, so that the terminal resumes from the sleep state to the normal working state, and then the terminal can process the data stream through the application corresponding to the data stream.
[0176] For example, when receiving a data stream of a text message sent by a contact in an instant messaging application, the terminal can determine that the data stream contains important information, so as to wake up the AP system and use the instant messaging application to process the data stream to display the text message.
[0177] Step 203b: The modem of the terminal determines that the second information does not meet the second condition and intercepts the downlink data stream.
[0178] When the terminal is in the sleep state, the terminal obtains the second information through the modulation and demodulation module in the terminal.
[0179] In the embodiments of the present application, the modem is the core component in the device responsible for processing network communication and directly manages the data transmission between the device and the network. When the terminal is in the sleep state, the modem still maintains a basic network connection to receive important data packets. The terminal obtains the data stream information through the modem, and can screen and process the data stream at the earliest stage, thereby effectively reducing unnecessary system wake-up and power consumption.
[0180] In the embodiments of the present application, when the terminal receives a data stream through the modem, it can receive the data stream through the network interface, extract the data stream information of the data stream, and then determine whether the data stream contains important information according to a preset rule. If the data stream contains important information, the terminal can release the data packet through the modem and allow it to wake up the AP system; if the data stream does not contain important information, the terminal can intercept the data packet through the modem to prevent it from waking up the AP system.
[0181] In an embodiment of the present application, after the terminal sends preset important information to the ATCI module through the telephone management service using AT commands, in order to prevent the AP system from being woken up by unimportant information, the terminal can send the preset important information to the TCP / IP protocol stack in the modem through the ATCI module. When the terminal receives the downlink data stream of the target application, the terminal can obtain relevant information of the data stream through the Rmnet driver and the ATCI module. The Rmnet driver is responsible for processing the data stream of the network interface, while the ATCI module is responsible for receiving and processing AT commands from the AP system. The terminal can obtain the second information, such as the transmission network interface, the target IP address, the encapsulation protocol type, etc., through these two modules.
[0182] In an embodiment of the present application, the terminal determines whether the downlink data stream contains important information based on the second information through the modulation and demodulation module.
[0183] In an embodiment of the present application, the terminal can compare the header structure of the encapsulation protocol in the preset important information with the header structure in the data packet through the modem to determine whether the encapsulation protocol in the second information is the same as the encapsulation protocol in the preset important information. When the header structure of the encapsulation protocol in the preset important information is the same as the header structure in the data packet, it is determined that the encapsulation protocol in the second information has the same structural characteristics as the encapsulation protocol in the preset important information.
[0184] Exemplarily, taking the downlink data stream with the QUIC protocol as the encapsulation protocol as an example, its header structure has a specific format and fields. When the terminal receives a data packet through the modem, it will extract the header structure of the data packet and compare it with the preset QUIC protocol header structure. If the two are the same, the terminal determines that the data stream uses the QUIC protocol and determines whether it contains important information according to the preset rules.
[0185] In an embodiment of the present application, since the QUIC protocol is a transport layer protocol implemented based on the UDP protocol, it has the same header structure as the UDP protocol. The terminal can first compare the header structure of the data packet with the preset UDP protocol header structure to determine whether the data stream uses the UDP protocol. If it is the UDP protocol, the terminal can continue to compare the header structure of the data packet with the preset QUIC protocol header structure to further determine whether the data stream uses the QUIC protocol.
[0186] In an embodiment of the present application, the header structure of the UDP protocol is shown in Table (1) as follows:
[0187]
[0188]
[0189] Table (1)
[0190] Meanwhile, the data packets encapsulated by the QUIC protocol have the header structure of the QUIC protocol. Therefore, after the terminal determines that the encapsulation protocol in the data stream information of the downlink data stream is the UDP protocol, it can continue to compare the header structure of the QUIC protocol with the header structure in the data stream information to further determine whether the encapsulation protocol in the data stream information is the QUIC protocol.
[0191] In the embodiments of the present application, the header structure of the QUIC protocol is shown in Table (2) as follows:
[0192]
[0193] Table (2)
[0194] In the embodiments of the present application, when the terminal determines whether the data stream contains important information through the modem, it can determine whether the encapsulation protocol of the data stream is the encapsulation protocol in the preset important information through the above process.
[0195] In the embodiments of the present application, the terminal can first determine through the modem whether the network interface in the second information is the same as the network interface in the preset important information. If not, the terminal can discard the data packets of the data stream. If the same, the terminal can continue to determine through the modem whether the target IP address in the second information is the same as the IP address in the preset important information. If not, the terminal can discard the data packets of the data stream. If the same, the terminal can continue to determine through the modem whether the header structure in the second information is the same as the header structure of the encapsulation protocol in the preset important information. If not, the terminal can discard the data packets of the data stream. If the same, the terminal can determine through the modem whether the downlink data stream contains important information.
[0196] Exemplarily, such as Figure 9As shown, assume that the preset important information is the target IP address n, network interface B, and QUIC protocol. The terminal receives the second piece of information. First, the terminal uses the modem to determine whether the network interface B in the second piece of information is the same as the network interface in the preset important information. If they are different, the data packets of the downstream data stream are discarded. Assume that the network interface B in the second piece of information is the same as the network interface in the preset important information. The terminal can then continue to use the modem to determine whether the IP address n in the second piece of information is the same as the target IP address in the preset important information. If they are different, the data packets of the downstream data stream are discarded. Assume that the target IP address n in the second piece of information is the same as the target IP address in the preset important information. Then, the terminal can continue to use the modem to compare whether the header structure in the second piece of information is the same as the header structure of the UDP protocol. If they are different, the data packets of the downstream data stream are discarded. Assume that the header structure in the second piece of information is the same as the header structure of the UDP protocol. The terminal can then continue to use the modem to determine whether the header structure in the second piece of information is the same as the header structure of the QUIC protocol. If they are different, the data packets of the downstream data stream are discarded. Assume that the terminal determines that the header structure in the second piece of information is the same as the header structure of the QUIC protocol. Then, the terminal can determine that the downstream data stream contains important information.
[0197] In the embodiments of the present application, in order not to let the AP system wake up, ATCI sorts out the protocol, IP, and network interface information of the key content and specifies rules to be sent to the modem tcp / ip protocol stack. When receiving a network packet, assume that the information of the key content is protocol QUIC, target IP address n, and network interface B for rule matching. First, judge the network interface, discard those that are not network interface B. Then, judge the address of the incoming packet, discard those that are not address n. Then, judge the protocol through Table (1), discard those that are not UDP. Finally, judge whether it is the application-specific QUIC protocol. As shown in Table (2), it can be judged according to the characteristic structure of the QUIC header itself. If the number of bytes in the front is the same as the QUIC header structure, it is considered a QUIC packet. In this way, all scenarios of discarding incoming packets can be processed. And for the incoming and received packets of the user's key content on a specific protocol and network interface, they are not intercepted, and the reminder needed by the user can be given in the first time.
[0198] In this way, the terminal can accurately identify and process important data streams by layer-by-layer judging the characteristics of the received data streams, and at the same time intercept non-important data streams, thereby saving power consumption and preventing users from missing important information.
[0199] In the embodiments of the present application, when receiving the data stream of the target application, the terminal can determine whether the data stream contains important information through the modem according to the data stream information, namely, such as the transmission network port, the target IP address, and the encapsulation protocol type. When it is determined that the data stream does not contain important information, the terminal can intercept these data streams through the modem.
[0200] In the embodiments of the present application, when detecting the data stream of the target application to be sent, the terminal can send the data stream to the network management service through the application management service (App manager service), and then the network management service determines whether the data stream contains important information according to the data stream information, namely, such as the transmission network port, the target IP address, the encapsulation protocol type, and the UID of the target application. When it is determined that the data stream does not contain important information, the terminal can intercept these data streams through the network management service.
[0201] The embodiments of the present application provide a network management method. By judging whether the upstream data stream contains important information through the system framework layer, the interception operation can be selectively performed on the upstream data stream, and by judging whether the downstream data stream contains important information through the modem, the interception operation can be selectively performed on the downstream data stream, so that the system can be prevented from being frequently awakened and the system power consumption is reduced. The embodiments of the present application can not only ensure the normal transmission of important data streams, but also reduce the system power consumption and improve the battery life.
[0202] In the embodiments of the present application, the network management method provided in the embodiments of the present application further includes the following step 301.
[0203] Step 301: Before the terminal goes to sleep, if the encapsulation protocol of the upstream data stream of the target application is the TCP protocol and the system framework layer of the terminal determines that the first information does not meet the first condition, the power management server of the terminal sends an RST message to the network management server.
[0204] In the embodiments of the present application, the above RST message is used to indicate disconnecting the link of the destination IP address of the upstream data stream.
[0205] In an embodiment of the present application, when the terminal is about to enter the sleep state, the terminal can notify the network management service that the terminal is entering the sleep state through the power management service. Thus, the terminal can determine whether the first information of the data stream of the TCP protocol for which a connection has been established currently meets the first condition through the system framework layer of the terminal. If the first information of the data stream of the TCP protocol of the target application does not meet the first condition, the terminal can perform data stream disconnection processing through the network management service, that is, the terminal can send an RST message to the network management service through the power management server of the terminal to disconnect the connection between the data stream that does not contain important information using the TCP protocol and the destination address, so that the terminal intercepts all packets encapsulated by the TCP protocol.
[0206] In this way, the terminal can send an RST message to disconnect unimportant TCP connections before the terminal goes to sleep, thereby reducing network activities and power consumption.
[0207] In an embodiment of the present application, in combination with Figure 2 , as Figure 10 shown, before the above step 201, the network management method provided by the embodiment of the present application further includes the following step 401 and step 402.
[0208] Step 401: The target application on the terminal determines the target transmission network interface, the target IP address, and the target encapsulation protocol, and sends the user identifier of the target application, the target transmission network interface, the target IP address, and the target encapsulation protocol to the system framework layer of the terminal.
[0209] In an embodiment of the present application, the terminal can query the network interface used by the current data stream through the interface of the network management service. The terminal can obtain the target IP address of the application server used by the short video data stream and the selected communication protocol through the application. Then, the terminal can send the data stream information corresponding to the important information, that is, the preset important information, to the network management service through the application.
[0210] In an embodiment of the present application, after receiving the preset important information through the application management service, the terminal can pair and save the UID of the application corresponding to the preset important information with the corresponding preset important information for subsequent judgment of the data stream.
[0211] Exemplarily, assume that the preset important information is the target IP address n, network interface B, and QUIC protocol, and the UID of the target application is 10000. After the terminal sends the preset important information to the application management service, the terminal can use the UID 10000 of the target application as the key through the application management service, and pair and save the target IP address n, network interface B, and QUIC protocol as the value for subsequent judgment of the data stream of the target application.
[0212] In the embodiments of the present application, the terminal may send preset important information to the network management service and the telephone management service in the system framework layer through the application management service.
[0213] Step 402: The system framework layer sends the target transmission network interface, the target IP address, and the target encapsulation protocol to the modem of the terminal.
[0214] In the embodiments of the present application, after the terminal receives the preset important information through the telephone management service, the terminal may send an AT command from the AT Client in the telephone management service to the ATCI module in the modem, and send the preset important information to the ATCI module through the AT command, so that the terminal can intercept the subsequent received data packets through the modem.
[0215] In the embodiments of the present application, as Figure 11 shown, the application management service passes the key information UID, protocol, address, and network interface B corresponding to the key content to the telephone management service to the modem. Here, the telephone management service includes the AT client and sends a command to the modem ATCI module. Here, the UID information will be removed because the received data packet information will not have UID information, and the modem system has no concept of UID. The terminal sends the pairing of the protocol, address, and network to the modem ATCI module through the AT command so that the modem can perform subsequent incoming packet interception.
[0216] In this way, through information such as the target transmission network interface, the target IP address, and the target encapsulation protocol provided by the target application, the device can more accurately identify which data streams contain the important information required by the user currently, ensuring that only truly important data streams can be processed and sent, and improving the accuracy of determining whether the data stream contains important information.
[0217] In the embodiments of the present application, the network management method provided by the embodiments of the present application further includes the following step 501.
[0218] Step 501: If the modem of the terminal continuously receives a downlink data stream that does not meet the second condition within a preset time period, the modem of the terminal disconnects the transmission network interface corresponding to the downlink data stream that does not meet the second condition.
[0219] In the embodiments of the present application, if the terminal receives N data streams through the modulation and demodulation module of the terminal within a preset time period, the terminal disconnects the link between the system kernel and the network interface through the modulation and demodulation module.
[0220] In the embodiments of the present application, N is a preset value greater than 0.
[0221] In the embodiments of the present application, the terminal can monitor and count the received data stream through a modulation and demodulation module, i.e., a modem. If the number of received data streams reaches a preset N value within a preset time period, the terminal can take measures to disconnect the connection between the system kernel and the network interface.
[0222] In the embodiments of the present application, the terminal can continuously detect the incoming packet situation through the modem. If more than N non-key data packets, i.e., data packets that do not contain important information, are received within a preset duration when the AP system is in the sleep state, the terminal can directly disconnect the network interface and does not report the disconnection message to the AP system until the AP system is awakened by other events and then reports it to the AP system.
[0223] In the embodiments of the present application, as Figure 12 shown, when the AP system is in the sleep state, the terminal can start to detect incoming packets through the modem protocol stack. Assume that the current time is T and the number of incoming packets is count. After detecting a data packet, if it is a key content data packet, it will be released, causing the AP system to be awakened by the data packet, so that the terminal can wait for the next sleep state of the AP system. After detecting a data packet, if it is a non-key packet, the terminal can record the current time when the data packet is detected. If the current time minus T is less than the preset duration, the terminal can increment count by 1. If the current time minus T is greater than the preset duration, the terminal can clear count to zero, update T to the current time when the data packet is detected, and then wait for the next incoming packet. When count is greater than 3, the terminal can directly disconnect the network connection to reduce unnecessary network activities and lower power consumption. The following takes the preset duration of 30 minutes as an example for illustration.
[0224] Exemplarily, assume that the current time T is 0:00 and the initial value of count is 0. When the AP system is in the sleep state, the terminal starts to detect incoming packets through the modem protocol stack. When a non-key content data packet is detected, the current time is recorded as 0:05. Since the current time minus T is 5 minutes, which is less than the preset duration of 30 minutes, count is incremented by 1 to become 1. Then the terminal detects a non-key data packet again at 0:10. The current time minus T is 10 minutes, still less than 30 minutes, and count is incremented by 1 to become 2. Subsequently, the terminal detects another non-key data packet at 0:15, and count is incremented by 1 to become 3. Finally, the terminal detects a non-key data packet again at 0:20. At this time, the current time minus T is 20 minutes, still less than 30 minutes, and count is incremented by 1 to become 4, which is greater than the preset threshold of 3. Then the terminal can directly disconnect the network connection to reduce unnecessary network activities and lower power consumption.
[0225] In an embodiment of the present application, when the AP system is in the sleep state, the modem protocol stack starts to detect packets. At this time, T is set to the current time, which represents the interval between incoming packets, and count is recorded as 0, representing the number of incoming packets. If it is a data stream (packet) of key content, it will be released, and at this time, the AP system will be awakened. At this time, it will wait for the next sleep of the AP system. If it is a non-key packet, record the current time of the incoming packet. If the current time minus T is less than half an hour, then count is incremented by 1. If it is greater than half an hour, then count is cleared. And set T to the current time of the incoming packet, and wait for the next incoming packet. If count is greater than 3 at a certain time, a disconnection operation will be directly performed.
[0226] In an embodiment of the present application, in combination with Figure 11 , such as Figure 13 shown, the terminal can directly disconnect the rmnet connection through the modem, then the path from the AP system kernel to the Um interface (Uminterface) in the modem will be closed.
[0227] In this way, after the terminal receives multiple unimportant data streams, the terminal can determine that there is an abnormal data stream, and then can disconnect the network connection through the modulation and demodulation module, so as to prevent being frequently awakened by the abnormal data stream and reduce power consumption.
[0228] In an embodiment of the present application, after the above step 501, the network management method provided by the embodiment of the present application further includes the following step 601.
[0229] Step 601: When the terminal is in the wake state, the modem sends a disconnection prompt message to the system framework layer of the terminal.
[0230] In an embodiment of the present application, the above disconnection prompt message is used to prompt the disconnection of the transmission network interface corresponding to the downlink data stream that does not meet the second condition.
[0231] In an embodiment of the present application, after the terminal disconnects the transmission network interface, the terminal can not notify the AP system of the disconnection message of the rmnet network interface, but can wait until the AP system is awakened by other events and then report it. In this way, it can prevent the network from frequently awakening the modem, and further awaken the AP system. After the AP system is awakened by other events, such as being awakened by user input, the terminal can notify the AP system of the disconnection message of the rmnet network interface through the modem, and reconnect the network through the AP system to re-establish the rmnet network interface for data communication.
[0232] In the embodiments of the present application, according to the above strategy, a disconnection operation will be performed. On the modem side, the link of the rmnet port will be directly disconnected, and then the paths to the AP kernel and the modem Um port will both be closed. However, the system side will not be immediately notified that the rmnet network port is disconnected. Instead, the report will be made after the AP system is awakened by other events. This can prevent the network from frequently awakening the modem, and further awaken the AP system. After the AP system is awakened by the user itself, the modem will send a disconnection request, and the AP side will reconnect to the network and re - establish the rmnet network port for data communication.
[0233] In this way, the terminal can avoid frequently awakening the modem and the AP system due to network activities by delaying the notification to the AP system about the disconnection of the rmnet network port, thereby reducing the power consumption of the terminal.
[0234] In the embodiments of the present application, the system framework layer intercepts the uplink of the application data stream, and the modem side intercepts the downlink of the data stream, so that incoming packets only awaken the modem and do not awaken the AP system, thereby achieving the purpose of saving power consumption. For the data stream of the user's key content, incoming packets are allowed to pass. The application notifies the target IP address, network port information, and protocol information to the system framework layer, and the system framework layer passes it to the modem, and the modem makes interception and passing - through strategies. And a method is provided to identify and distinguish packets with the UDP protocol being QUIC by the modem, and perform interception and passing - through control. The terminal continuously detects incoming packets of non - key content through the modem. If there are continuous incoming packets, the network - side network port link will be disconnected, and a delayed notification message will be sent to the AP system so that it will not be awakened by the actions of the modem.
[0235] In the embodiments of the present application, the terminal can separately process the application's packet sending and receiving on the system side and the modem side to improve power consumption. For multiple networks and packets in special application scenarios, policy control is performed, and while saving power consumption, the necessary message reminders are provided to the user.
[0236] In the related art, in order to prevent network data packets from awakening the operating system in the sleep or low - power state, the terminal will take certain measures at the operating system kernel layer to reduce unnecessary system awakenings. For example, the operating system kernel layer can prevent application programs from sending network data packets to avoid these network data packets triggering network activities and causing the operating system to wake up from the sleep state.
[0237] For example, the operating system kernel layer will terminate all established TCP connections to ensure that there is no active network communication and prevent the operating system from being awakened from the sleep state. However, terminating all TCP connections completely will result in partial data loss or communication interruption because TCP is a connection-oriented protocol, and the termination of its connection means that the two communicating parties can no longer exchange data. This will not only affect the communication tasks that the user is performing but may also cause exceptions or errors in some applications that rely on continuous connections.
[0238] Through the solution of this application, system wake-up can be reduced through more refined control without completely terminating all TCP connections. For example, firewall rules can be set to only allow data streams that meet the preset important information criteria to pass through, while restricting the transmission of other non-important data streams. This can avoid unnecessary system wake-up and maintain the continuity of important communications, ensuring that users can still normally receive and send critical data in the power-saving mode, thereby saving power while ensuring the normal transmission of important data streams. At the same time, through the solution of this application, UDP-type data packets can also be screened, and only UDP data streams that meet the preset important information criteria are allowed to pass through, while intercepting other non-important UDP data streams, which can effectively reduce the number of system wake-ups triggered by non-important UDP data packets, further reducing power consumption, and ensuring that important UDP data can be transmitted in a timely manner to avoid communication interruption or data loss.
[0239] Figure 14 It is a schematic diagram of the execution process of the network management method provided by the embodiment of this application. As Figure 14 shown, the network management method provided by the embodiment of this application may include the following steps 10 to step 15.
[0240] Step 10: The terminal determines the key content through the application and sends the target IP address, network interface, and protocol information of the data stream corresponding to the key content to the network management service.
[0241] Step 11: The terminal matches the UID corresponding to the application with the protocol, target IP address, and network interface information of the key content transmitted by the application through the application management service and transmits the information to the network management service and the call management service.
[0242] Step 12: The terminal protects the key content data stream through the network management service and sets up a firewall, and disconnects the data stream of non-key content before the system goes to sleep.
[0243] Step 13: After the call management service receives the key content information, the terminal sends it to the ATCI of the modem through the call management service using the AT command.
[0244] Step 14: The terminal passes the information to the modem TCP / IP protocol stack through the modem ATCI. The modem identifies the protocol of the data stream, matches the target IP address, matches the network interface, and allows the data packets of key content to pass through, while intercepting other data packets.
[0245] Step 15: The terminal continuously detects the incoming packet situation through the modem. When there are continuous non-key incoming packets during the sleep of the AP system, the network interface is directly disconnected without reporting the disconnection message, and the reporting is delayed until the AP system is awakened by other events.
[0246] Each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed independently, or any two or more of them can be combined with each other. It can be specifically determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0247] For the network management method provided by the embodiments of the present application, the execution subject can be a network management device, and this network management device can be a terminal. In the embodiments of the present application, taking the terminal executing the network management method as an example, the terminal provided by the embodiments of the present application is described.
[0248] Figure 15 Shows a possible structural schematic diagram of a terminal involved in some embodiments of the present application. As Figure 15 shown, the terminal 70 may include: a system framework layer 71, a modem 72, and an acquisition module 73.
[0249] The above acquisition module 73 is used to acquire the first information corresponding to the uplink data stream of the target application or the second information corresponding to the downlink data stream when the terminal is in the sleep state.
[0250] The above system framework layer 71 is used to determine whether the first information acquired by the acquisition module 73 meets the first condition, and allow or intercept the uplink data stream; or,
[0251] The above modem 72 is used to determine whether the second information acquired by the acquisition module 73 meets the second condition, and allow or intercept the downlink data stream.
[0252] In a possible implementation manner, the above acquisition module 73 includes the system framework layer 71, and the system framework layer 71 is specifically used to acquire the first information corresponding to the uplink data stream of the target application, and the first information includes: the user identifier of the target application, the transmission network interface of the uplink data stream, the destination IP address of the uplink data stream, and the encapsulation protocol type of the uplink data stream.
[0253] In a possible implementation, the above system framework layer is specifically configured to: determine whether the first information obtained by the obtaining module 73 meets the first condition, and release the uplink data stream if it does; determine that the first information obtained by the obtaining module 73 does not meet the first condition, and intercept the uplink data stream; wherein, the above first condition includes: the user identifier of the uplink data stream is the same as the user identifier of the target application, the transmission network port of the uplink data stream is the same as the target transmission network port, the destination IP address of the uplink data stream is the same as the target IP address, and the encapsulation protocol type of the uplink data stream is the same as the target encapsulation protocol.
[0254] In a possible implementation, the above obtaining module 73 includes a modem 72, and the modem 72 is specifically configured to obtain second information corresponding to the downlink data stream of the target application, and the second information includes: the transmission network port of the downlink data stream, the destination IP address of the downlink data stream, and the encapsulation protocol type of the downlink data stream.
[0255] In a possible implementation, the above modem 72 is specifically configured to: determine whether the second information obtained by the obtaining module 73 meets the second condition, and release the downlink data stream if it does; determine that the second information obtained by the obtaining module 73 does not meet the second condition, and intercept the downlink data stream. Wherein, the above second condition includes: the transmission network port of the downlink data stream is the same as the target transmission network port, the destination IP address of the downlink data stream is the same as the target IP address, and the encapsulation protocol type of the downlink data stream is the same as the target encapsulation protocol.
[0256] In a possible implementation, the terminal provided by the embodiments of the present application further includes: a power management server and a network management server. The above power management server is configured to, before the terminal goes to sleep, if the encapsulation protocol of the uplink data stream of the target application is the TCP protocol, and the system framework layer of the terminal determines that the first information does not meet the first condition, send an RST message to the network management server, and the RST message is used to indicate disconnecting the link of the destination IP address of the uplink data stream.
[0257] In a possible implementation, before the obtaining module 73 obtains the first information corresponding to the uplink data stream of the target application or the second information corresponding to the downlink data stream, the target application on the terminal is used to determine the target transmission network port, the target IP address, and the target encapsulation protocol, and send the user identifier of the target application, the target transmission network port, the target IP address, and the target encapsulation protocol to the system framework layer. The above system framework layer 71 is further configured to send the target transmission network port, the target IP address, and the target encapsulation protocol to the modem 72 of the terminal.
[0258] In a possible implementation, the above-mentioned modem 72 is further configured to disconnect the transmission network interface corresponding to the downlink data stream that does not meet the second condition if the downlink data stream that does not meet the second condition is continuously received within a preset duration.
[0259] In a possible implementation, the above-mentioned modem 72 is further configured to, after disconnecting the transmission network interface corresponding to the downlink data stream that does not meet the second condition and when the terminal is in a wake-up state, send a disconnection prompt message to the system framework layer of the terminal, where the disconnection prompt message is used to prompt that the transmission network interface corresponding to the downlink data stream that does not meet the second condition has been disconnected.
[0260] In the embodiments of the present application, a terminal is provided. By judging whether the uplink data stream contains important information through the system framework layer, the interception operation can be selectively performed on the uplink data stream. By judging whether the downlink data stream contains important information through the modem, the interception operation can be selectively performed on the downlink data stream, so that the system can be prevented from being frequently woken up, and the system power consumption is reduced. The embodiments of the present application can not only ensure the normal transmission of important data streams, but also reduce the system power consumption and improve the battery life.
[0261] The terminal in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0262] The terminal in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0263] The terminal provided in the embodiments of the present application can implement each process implemented by the above method embodiments. To avoid repetition, it will not be elaborated here.
[0264] Optionally, as Figure 16 shown, an embodiment of the present application further provides an electronic device 1000, including a processor 1001 and a memory 1002. A program or instruction that can run on the processor 1001 is stored on the memory 1002. When the program or instruction is executed by the processor 1001, each step of the above-described embodiment of the network management method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described in detail here.
[0265] It should be noted that the electronic device in the embodiment of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.
[0266] Figure 17 It is a schematic diagram of the hardware structure of an electronic device for implementing an embodiment of the present application.
[0267] The electronic device 100 includes, but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110 and other components.
[0268] Those skilled in the art can understand that the electronic device 100 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 110 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 17 The structure of the electronic device shown in does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be described in detail here.
[0269] In the embodiment of the present application, the electronic device further includes a system framework layer and a modem.
[0270] Among them, the processor 110 is used to obtain the first information corresponding to the uplink data stream or the second information corresponding to the downlink data stream when the electronic device is in a sleep state.
[0271] The system framework layer is used to determine whether the first information meets the first condition, and release or intercept the uplink data stream; or,
[0272] The modem is used to determine whether the second information meets the second condition, and release or intercept the downlink data stream.
[0273] In some embodiments, the system framework layer is specifically configured to obtain first information corresponding to the uplink data stream of the target application, where the first information includes: the user identifier of the target application, the transmission network interface of the uplink data stream, the destination IP address of the uplink data stream, and the encapsulation protocol type of the uplink data stream.
[0274] In some embodiments, the system framework layer is specifically configured to: determine that the first information meets the first condition and release the uplink data stream; determine that the first information does not meet the first condition and intercept the uplink data stream; where the first condition includes: the user identifier of the uplink data stream is the same as the user identifier of the target application, the transmission network interface of the uplink data stream is the same as the target transmission network interface, the destination IP address of the uplink data stream is the same as the target IP address, and the encapsulation protocol type of the uplink data stream is the same as the target encapsulation protocol.
[0275] In some embodiments, the modem is specifically configured to obtain second information corresponding to the downlink data stream of the target application, where the second information includes: the transmission network interface of the downlink data stream, the destination IP address of the downlink data stream, and the encapsulation protocol type of the downlink data stream.
[0276] In some embodiments, the modem is specifically configured to: determine that the second information meets the second condition and release the downlink data stream; determine that the second information does not meet the second condition and intercept the downlink data stream. Where the second condition includes: the transmission network interface of the downlink data stream is the same as the target transmission network interface, the destination IP address of the downlink data stream is the same as the target IP address, and the encapsulation protocol type of the downlink data stream is the same as the target encapsulation protocol.
[0277] In some embodiments, the electronic device further includes a power management server and a network management server. Before the terminal goes to sleep, if the encapsulation protocol of the uplink data stream of the target application is the TCP protocol and the system framework layer determines that the first information does not meet the first condition, the power management server sends an RST message to the network management server, and the RST message is used to indicate disconnecting the link of the destination IP address of the uplink data stream.
[0278] In some embodiments, the processor 110 is configured to, before obtaining the first information corresponding to the uplink data stream of the target application or the second information corresponding to the downlink data stream, control the target application on the terminal to determine the target transmission network interface, the target IP address, and the target encapsulation protocol, and send the user identifier, the target transmission network interface, the target IP address, and the target encapsulation protocol of the target application to the system framework layer. The system framework layer is further configured to send the target transmission network interface, the target IP address, and the target encapsulation protocol to the modem.
[0279] In some embodiments, the modem is further configured to disconnect the transmission network interface corresponding to the downlink data stream that does not meet the second condition if the downlink data stream that does not meet the second condition is continuously received within a preset duration.
[0280] In some embodiments, after disconnecting the transmission network interface corresponding to the downlink data stream that does not meet the second condition, the modem is configured to send a disconnection prompt message to the system framework layer when the terminal is in a wake-up state. The disconnection prompt message is used to prompt that the transmission network interface corresponding to the downlink data stream that does not meet the second condition has been disconnected.
[0281] In the embodiments of the present application, an electronic device is provided. By determining whether the uplink data stream contains important information through the system framework layer, the interception operation can be selectively performed on the uplink data stream. By determining whether the downlink data stream contains important information through the modem, the interception operation can be selectively performed on the downlink data stream, thereby avoiding frequent wake-up of the system and reducing the system power consumption. The embodiments of the present application can not only ensure the normal transmission of important data streams but also reduce the system power consumption and improve the battery life.
[0282] The electronic device provided in the embodiments of the present application can implement each process implemented in the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described in detail here. The beneficial effects of various implementation manners in this embodiment can be specifically referred to the beneficial effects of the corresponding implementation manners in the above method embodiments. To avoid repetition, it will not be described here.
[0283] It should be understood that in the embodiments of the present application, the input unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061. The display panel 1061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. The other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power-on keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.
[0284] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 109 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0285] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 110 either.
[0286] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above embodiment of the network management method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0287] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs.
[0288] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above embodiment of the network management method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0289] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0290] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above embodiment of the network management method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0291] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0292] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0293] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A network management method, executed by a terminal, characterized in that, Including: When the terminal is in the sleep state, obtaining first information corresponding to the uplink data stream of the target application or second information corresponding to the downlink data stream; The system framework layer of the terminal determines whether the first information meets a first condition, and allows or intercepts the uplink data stream; or, The modem of the terminal determines whether the second information meets a second condition, and allows or intercepts the downlink data stream.
2. The method according to claim 1, wherein The obtaining of the first information corresponding to the uplink data stream of the target application includes: The system framework layer of the terminal obtains the first information corresponding to the uplink data stream of the target application, and the first information includes: the user identifier of the target application, the transmission network interface of the uplink data stream, the destination IP address of the uplink data stream, and the encapsulation protocol type of the uplink data stream.
3. The method according to claim 1 or 2, characterized in that, The system framework layer of the terminal determines whether the first information meets the first condition, and allows or intercepts the uplink data stream, including: The system framework layer of the terminal determines that the first information meets the first condition, and allows the uplink data stream; The system framework layer of the terminal determines that the first information does not meet the first condition, and intercepts the uplink data stream; Wherein, the first condition includes: the user identifier of the uplink data stream is the same as the user identifier of the target application, the transmission network interface of the uplink data stream is the same as the target transmission network interface, the destination IP address of the uplink data stream is the same as the target IP address, and the encapsulation protocol type of the uplink data stream is the same as the target encapsulation protocol.
4. The method according to claim 1, wherein The obtaining of the second information corresponding to the downlink data stream of the target application includes: The modem of the terminal obtains the second information corresponding to the downlink data stream of the target application, and the second information includes: the transmission network interface of the downlink data stream, the destination IP address of the downlink data stream, and the encapsulation protocol type of the downlink data stream.
5. The method according to claim 1 or 4, characterized in that, The modem of the terminal determines whether the second information meets the second condition, and allows or intercepts the downlink data stream, including: The modem of the terminal determines that the second information meets the second condition, and allows the downlink data stream; The modem of the terminal determines that the second information does not meet the second condition, and intercepts the downlink data stream; Wherein, the second condition includes: the transmission network interface of the downlink data stream is the same as the target transmission network interface, the destination IP address of the downlink data stream is the same as the target IP address, and the encapsulation protocol type of the downlink data stream is the same as the target encapsulation protocol.
6. The method according to claim 1, wherein The method further includes: Before the terminal goes to sleep, if the encapsulation protocol of the uplink data stream of the target application is the TCP protocol, and the system framework layer of the terminal determines that the first information does not meet the first condition, the power management server of the terminal sends an RST message to the network management server, and the RST message is used to indicate disconnecting the link of the destination IP address of the uplink data stream.
7. The method according to claim 1, wherein Before obtaining the first information corresponding to the uplink data stream of the target application or the second information corresponding to the downlink data stream, the method further includes: The target application on the terminal determines a target transmission network interface, a target IP address, and a target encapsulation protocol, and sends the user identifier of the target application, the target transmission network interface, the target IP address, and the target encapsulation protocol to the system framework layer of the terminal; The system framework layer sends the target transmission network interface, the target IP address, and the target encapsulation protocol to the modem of the terminal.
8. The method according to claim 1, wherein The method further includes: If the modem of the terminal continuously receives a downlink data stream that does not meet the second condition within a preset time period, the modem of the terminal disconnects the transmission network interface corresponding to the downlink data stream that does not meet the second condition.
9. The method according to claim 8, wherein After the modem of the terminal disconnects the transmission network interface corresponding to the downlink data stream that does not meet the second condition, the method further includes: When the terminal is in the wake-up state, the modem sends a disconnection prompt message to the system framework layer of the terminal, and the disconnection prompt message is used to prompt that the transmission network interface corresponding to the downlink data stream that does not meet the second condition has been disconnected.
10. A terminal, characterized in that, It includes a system framework layer, a modem, and an acquisition module; The acquisition module is configured to acquire first information corresponding to an uplink data stream of a target application or second information corresponding to a downlink data stream when the terminal is in the sleep state; The system framework layer is configured to determine whether the first information meets a first condition, and allow or intercept the uplink data stream; or, The modem is configured to determine whether the second information meets a second condition, and allow or intercept the downlink data stream.
11. The terminal according to claim 10, wherein The acquisition module includes the system framework layer, and the system framework layer is specifically configured to acquire first information corresponding to an uplink data stream of a target application, and the first information includes: the user identifier of the target application, the transmission network interface of the uplink data stream, the destination IP address of the uplink data stream, and the encapsulation protocol type of the uplink data stream.
12. The terminal according to claim 10 or 11, characterized in that, The system framework layer is specifically configured to: Determine that the first information acquired by the acquisition module meets the first condition, and allow the uplink data stream; Determine that the first information acquired by the acquisition module does not meet the first condition, and intercept the uplink data stream; Wherein, the first condition includes: the user identifier of the uplink data stream is the same as the user identifier of the target application, the transmission network interface of the uplink data stream is the same as the target transmission network interface, the destination IP address of the uplink data stream is the same as the target IP address, and the encapsulation protocol type of the uplink data stream is the same as the target encapsulation protocol.
13. The terminal according to claim 10, wherein The acquisition module includes the modem, and the modem is specifically configured to acquire second information corresponding to a downlink data stream of a target application, and the second information includes: the transmission network interface of the downlink data stream, the destination IP address of the downlink data stream, and the encapsulation protocol type of the downlink data stream.
14. The terminal according to claim 10 or 13, characterized in that, The modem is specifically configured to: Determine that the second information acquired by the acquisition module meets the second condition, and allow the downlink data stream; Determine that the second information obtained by the acquisition module does not meet the second condition, and intercept the downstream data stream; Among them, the second condition includes: the transmission network port of the downstream data stream is the same as the target transmission network port, the destination IP address of the downstream data stream is the same as the target IP address, and the encapsulation protocol type of the downstream data stream is the same as the target encapsulation protocol.
15. The terminal according to claim 10, wherein The terminal further includes a power management server and a network management server; The power management server is configured to, before the terminal goes to sleep, if the encapsulation protocol of the upstream data stream of the target application is the TCP protocol, and the system framework layer of the terminal determines that the first information does not meet the first condition, send an RST message to the network management server, and the RST message is used to indicate disconnecting the link of the destination IP address of the upstream data stream.
16. The terminal according to claim 10, wherein Before the acquisition module acquires the first information corresponding to the upstream data stream of the target application or the second information corresponding to the downstream data stream, the target application on the terminal is configured to determine a target transmission network port, a target IP address, and a target encapsulation protocol, and send the user identifier of the target application, the target transmission network port, the target IP address, and the target encapsulation protocol to the system framework layer; The system framework layer is further configured to send the target transmission network port, the target IP address, and the target encapsulation protocol to the modem.
17. The terminal according to claim 10, wherein The modem is further configured to, if it continuously receives a downstream data stream that does not meet the second condition within a preset duration, disconnect the transmission network port corresponding to the downstream data stream that does not meet the second condition.
18. The terminal according to claim 17, wherein, The modem is further configured to: After disconnecting the transmission network port corresponding to the downstream data stream that does not meet the second condition, and when the terminal is in the wake-up state, send a disconnection prompt message to the system framework layer, and the disconnection prompt message is used to prompt that the transmission network port corresponding to the downstream data stream that does not meet the second condition has been disconnected.