CN110505279B - Method and device for setting time delay - Google Patents

Method and device for setting time delay Download PDF

Info

Publication number
CN110505279B
CN110505279B CN201910670365.8A CN201910670365A CN110505279B CN 110505279 B CN110505279 B CN 110505279B CN 201910670365 A CN201910670365 A CN 201910670365A CN 110505279 B CN110505279 B CN 110505279B
Authority
CN
China
Prior art keywords
delay
target
data packet
link
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910670365.8A
Other languages
Chinese (zh)
Other versions
CN110505279A (en
Inventor
张占公
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201910670365.8A priority Critical patent/CN110505279B/en
Publication of CN110505279A publication Critical patent/CN110505279A/en
Priority to PCT/CN2020/098220 priority patent/WO2021012871A1/en
Application granted granted Critical
Publication of CN110505279B publication Critical patent/CN110505279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session

Abstract

The embodiment of the invention provides a method and equipment for setting delay, which are applied to the technical field of communication and are used for solving the problem of single delay when terminal equipment communicates with network equipment. The method comprises the following steps: under the condition that the first device and the second device establish a link, acquiring a target data packet, wherein the target data packet is as follows: determining a target delay corresponding to a data packet type of a target data packet for a data packet transmitted on a link between the first device and the second device, wherein different data packet types correspond to different link-breaking delays, and setting the link-breaking delay according to the target delay. The invention is applied to a data transmission scene.

Description

Method and device for setting time delay
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and equipment for setting time delay.
Background
With the development of terminal device technology, the frequency of using the terminal device by the user is higher and higher, and the requirements of the user on the system stability and the power consumption of the terminal device are higher and higher.
At present, when a terminal device accesses a network using a data service based on a Transmission Control Protocol (TCP)/Internet Protocol (IP), it is necessary to establish a link between the terminal device and a network device in advance, release a Transmission delay of the link, perform data Transmission through the link within the delay, and disconnect the link between the terminal device and the network device when the Transmission delay is over time.
However, since the terminal device usually sets a fixed transmission delay for the link, the fixed transmission delay may affect the terminal device or the link between the terminal device and the network device, for example, the power consumption of the terminal device is increased, or the link is disconnected in advance, so that data cannot be normally transmitted.
Disclosure of Invention
The embodiment of the invention provides a method and equipment for setting time delay, which aim to solve the problem of single time delay when terminal equipment communicates with network equipment.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present invention provides a method for setting a delay, which is applied to a first device, and the method includes:
under the condition that the first device and the second device establish a link, acquiring a target data packet, wherein the target data packet is as follows: a data packet transmitted on a link between the first device and the second device; determining a target delay corresponding to the data packet type of the target data packet, wherein different data packet types correspond to different broken link delays; and setting the broken link delay of the link according to the target delay.
In a second aspect, an embodiment of the present invention further provides a first device, where the first device includes:
an obtaining module, configured to obtain a target data packet when a link is established between a first device and a second device, where the target data packet is: a data packet transmitted on a link between the first device and the second device; the determining module is used for determining the target delay corresponding to the data packet type of the target data packet acquired by the acquiring module, and different data packet types correspond to different broken link delays; and the setting module is used for setting the broken link delay of the link according to the target delay determined by the determining module.
In a third aspect, an embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and operable on the processor, where the computer program, when executed by the processor, implements the steps of the method for setting a delay time according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for setting a delay time according to the first aspect.
In the embodiment of the present invention, when the first device and the second device establish a link, after the first device acquires the target data packet, the link-breaking delay of the link between the first device and the second device may be set according to the target delay corresponding to the data packet type of the target data packet, that is, different link-breaking delays are set for data packets of different data packet types, so as to avoid that when the terminal device communicates with the network device, the overall power consumption or the data transmission process of the terminal device is affected due to improper setting of the link-breaking delay.
Drawings
Fig. 1 is a schematic structural diagram of an android operating system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for setting a delay according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a first device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that "/" in this context means "or", for example, A/B may mean A or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone.
It should be noted that "a plurality" herein means two or more than two.
It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
It should be noted that, for the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, words such as "first" and "second" are used to distinguish the same items or similar items with substantially the same functions or actions, and those skilled in the art can understand that the words such as "first" and "second" do not limit the quantity and execution order. For example, the first device and the second device are for distinguishing between different devices, and are not for describing a particular order of the devices.
The execution main body of the method for setting a delay provided in the embodiment of the present invention may be the first device, or may also be a functional module and/or a functional entity capable of implementing the method for setting a delay in the first device, which may be specifically determined according to actual usage requirements, and the embodiment of the present invention is not limited. The following takes the first device as an example to exemplarily describe the method for setting the delay provided by the embodiment of the present invention.
The first device and the second device in the embodiment of the present invention may be terminal devices or network devices, which is not limited in this respect. For example, when the first device is a terminal device, the corresponding second device may be a network device, and when the first device is a network device, the corresponding second device may be a terminal device.
The terminal device may be a mobile terminal device or a non-mobile terminal device. The mobile terminal device may be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), etc.; the non-mobile terminal device may be a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, or the like; the embodiments of the present invention are not particularly limited.
The terminal device in the embodiment of the present invention may be a terminal device having an operating system. The operating system may be an Android operating system, an ios operating system, or other intelligent devices with batteries and network interaction, and embodiments of the present invention are not limited specifically.
The following describes a software environment applied by the method for setting delay provided by the embodiment of the present invention, taking an android operating system as an example.
Fig. 1 is a schematic diagram of an architecture of an android operating system according to an embodiment of the present invention. In fig. 1, the architecture of the android operating system includes 4 layers, which are respectively: an application layer, an application framework layer, a system runtime layer, and a kernel layer (specifically, a Linux kernel layer).
The application program layer comprises various application programs (including system application programs and third-party application programs) in an android operating system.
The application framework layer is a framework of the application, and a developer can develop some applications based on the application framework layer under the condition of complying with the development principle of the framework of the application.
The system runtime layer includes libraries (also called system libraries) and android operating system runtime environments. The library mainly provides various resources required by the android operating system. The android operating system running environment is used for providing a software environment for the android operating system.
The kernel layer is an operating system layer of an android operating system and belongs to the bottommost layer of an android operating system software layer. The kernel layer provides kernel system services and hardware-related drivers for the android operating system based on the Linux kernel.
Taking an android operating system as an example, in the embodiment of the present invention, a developer may develop a software program for implementing the method for setting a delay provided in the embodiment of the present invention based on the system architecture of the android operating system shown in fig. 1, so that the method for setting a delay may operate based on the android operating system shown in fig. 1. Namely, the processor or the terminal device can implement the method for setting the delay provided by the embodiment of the invention by running the software program in the android operating system.
The method for setting delay according to the embodiment of the present invention is described below with reference to a flowchart of the method for setting delay shown in fig. 2, and as shown in fig. 2, the method for setting delay according to the embodiment of the present invention includes steps 201 to 203:
step 201: and under the condition that the first equipment establishes a link with the second equipment, the first equipment acquires the target data packet.
Step 202: the first device determines a target delay corresponding to a packet type of the target packet.
Step 203: and the first equipment sets the chain breaking delay of the link according to the target delay.
In this embodiment of the present invention, the aforementioned link disconnection delay of the link between the first device and the second device is used to indicate a delay of disconnecting the link between the first device and the second device, that is, when the link disconnection delay times out, the link is disconnected.
In an embodiment of the present invention, the packet types include at least one of the following: transmission Control Protocol (TCP), User Datagram Protocol (UDP), and Control Message Protocol (ICMP). For example, when the packet type of the destination packet is TCP, it indicates that the destination packet is a packet encapsulated based on TCP, when the packet type of the destination packet is UDP, it indicates that the destination packet is a packet encapsulated based on UDP, and when the packet type of the destination packet is TCP, it indicates that the destination packet is a packet encapsulated based on ICMP.
In the embodiment of the invention, different data packet types correspond to different broken link delays. For example, because the UDP packet and the ICMP packet have high requirements on real-time performance and continuity of data, if the link-breaking delay is too short, the link may be reestablished in the transmission of the subsequent packet, and therefore, for the UDP packet and the ICMP packet, a longer link-breaking delay needs to be set.
In an embodiment of the present invention, the target data packet is: and a data packet transmitted on a link between the first device and the second device.
In this embodiment of the present invention, the process of the first device acquiring the target data packet may include: the first device receives the destination data packet from the second device, or the first device sends the destination data packet to the second device.
Optionally, in this embodiment of the present invention, the first device may determine, based on a preset first delay correspondence table, a target delay corresponding to a packet type of the target packet. Wherein, the first delay corresponding relation table includes: x packet types and Y delays, one packet type corresponding to at least one delay, X, Y being a positive integer and Y being greater than or equal to X. Illustratively, after acquiring the target data packet, the first device searches for the target delay corresponding to the data packet type of the target data packet in the first delay correspondence table by using the data packet type of the target data packet as an index.
Optionally, in this embodiment of the present invention, when the data packet type of the target data packet is TCP, the step 202 specifically includes the following steps:
step 202 a: and the first equipment determines the target delay corresponding to the target identifier in the target data packet from the M first delays corresponding to the TCP type.
The target mark is used for indicating the type of the broken link delay of the target data packet; the type of chain-breaking delay comprises at least one of the following: chain breakage is delayed in advance; m is a positive integer.
Illustratively, the above-mentioned types of chain-breaking delay include at least one of: a first type, a second type, a third type, a fourth type, and a fifth type. The first type is used for indicating that the chain breaking is postponed when data are transmitted subsequently, the second type is used for indicating that the chain breaking is advanced when no data are transmitted subsequently, the third type is used for indicating that the chain breaking is advanced when data response exists, the fourth type is used for indicating that the chain breaking time is distinguished according to the size of a data packet in the data transmission process, and the fifth type is used for indicating that the chain breaking is advanced when the chain breaking is forcibly performed.
In one example, the above target identifier is carried in the TCP FLAG field. The target identifier may be the following identifiers in the TCP FLAG field: establishing a connection SYN identifier, closing a connection FIN identifier, responding an ACK identifier, delivering a message to an application layer PSH identifier, a connection resetting RST identifier and an urgent pointer URG identifier, wherein the SYN indicates a first type; the FIN mentioned above indicates a second type; the ACK described above indicates a third type; the above PSH indicates a fourth type; the URG mentioned above indicates a fifth type.
In one example, when determining the target delay corresponding to the target identifier in the target data packet from the M first delays, the first device may determine the target delay corresponding to the target identifier in the target data packet based on a preset second delay correspondence table. Wherein, the delay corresponding relation table includes: m marks and M first delays, wherein the M marks comprise the target marks, and one mark corresponds to one first delay. For example, after obtaining the first delay corresponding to the packet type of the target packet, the first device uses the target identifier in the target packet as an index, and finds the first delay corresponding to the target identifier (i.e., the target delay) in the second delay correspondence table.
In another example, the first device may directly determine the target delay corresponding to the target identifier based on a preset third delay correspondence table. The third delay correspondence table is composed of the first delay correspondence table and the second delay correspondence table.
Optionally, in this embodiment of the present invention, if the target data packet is another data packet except the first data packet, before step 203, the method further includes the following steps:
step 203 a: and under the condition of acquiring the first data packet, the first equipment sets a broken link delay timer.
The timing time of the broken link delay timer is as follows: the delay time corresponding to the packet type of the first packet. The first packet is the first packet with certain data in sequence.
Further, in combination with the step 203a, the step 203 specifically includes the following steps:
step 203 b: and the first equipment updates the timing time of the delay timer according to the target delay.
Further, the step 203b specifically includes the following steps:
step 203b 1: the first device reads the remaining time of the delink delay timer.
Step 203b 2: and if the residual time is less than the target delay, the first equipment updates the target delay to the timing time of the broken link delay timer.
Further, the step 203b further includes the following steps:
step 203b 3: and if the remaining time is greater than or equal to the target delay, the first equipment does not update the timing time of the broken link delay timer.
It should be noted that the timing time in the above-mentioned delink delay timer may be a positive time or a negative time.
Illustratively, a link is established between a first device and a second device for data transmission, when the first device acquires a first data packet, the first device directly sets a broken link delay timer, the timing time of the broken link delay timer is the delay time corresponding to the data packet type of the first data packet, when the first device acquires other data packets except the first data packet, the first device directly reads the real-time of the broken link delay timer to acquire the remaining time of the broken link delay timer, compares the remaining time with the delays corresponding to the data packet types of the other data packets, and sets the timing time of the broken link delay timer according to the comparison result. For example, when the remaining time is less than the delay corresponding to the packet type of the other packet, the delay is used as the timing time of the broken link delay timer. And when the remaining time is greater than or equal to the delay corresponding to the data packet type of the other data packets, not updating the timing time of the broken link delay timer.
It should be noted that, when the delink delay timer expires, the first device is instructed to disconnect from the second device.
In the method for setting a delay provided in the embodiment of the present invention, when a link is established between a first device and a second device, after the first device acquires a target data packet, a link-breaking delay of the link between the first device and the second device may be set according to the target delay corresponding to a data packet type of the target data packet, that is, different link-breaking delays are set for data packets of different data packet types, so that when a terminal device communicates with a network device, the power consumption of the whole terminal device or the data transmission process is not affected due to improper setting of the link-breaking delay.
Fig. 3 is a schematic structural diagram of a first device for implementing an embodiment of the present invention, and as shown in fig. 3, the first device 300 includes: an obtaining module 301, a determining module 302 and a setting module 303, wherein:
an obtaining module 301, configured to obtain a target data packet when the first device and the second device establish a link, where the target data packet is: and a data packet transmitted on a link between the first device and the second device.
A determining module 302, configured to determine a target delay corresponding to the data packet type of the target data packet obtained by the obtaining module 301, where different data packet types correspond to different link-breaking delays.
A setting module 303, configured to set the link breaking delay of the link according to the target delay determined by the determining module 302.
Optionally, in a case that the data packet type of the target data packet is TCP, the determining module 302 is specifically configured to: determining a target delay corresponding to a target identifier in the target data packet from M first delays corresponding to the TCP type; the target mark is used for indicating the type of the broken link delay of the target data packet; the type of chain-breaking delay comprises at least one of the following: chain breakage is delayed in advance; m is a positive integer.
Optionally, the setting module 303 is further configured to: if the target data packet acquired by the acquisition module 301 is a data packet other than the first data packet, setting a broken link delay timer when the first data packet is acquired; the timing time of the broken link delay timer is as follows: the delay time corresponding to the packet type of the first packet; the setting module 303 is specifically configured to: according to the target delay determined by the determining module 302, the timing time of the broken link delay timer is updated.
Optionally, the setting module 303 is specifically configured to: reading the remaining time of the broken link delay timer; if the residual time is less than the target delay, updating the target delay to the timing time of the broken link delay timer;
optionally, the setting module 303 is further configured to: and if the residual time is greater than or equal to the target delay, not updating the timing time of the broken link delay timer.
In the first device provided in the embodiment of the present invention, when the first device establishes a link with the second device, after the first device acquires the target data packet, the link-breaking delay of the link between the first device and the second device may be set according to the target delay corresponding to the data packet type of the target data packet, that is, different link-breaking delays are set for data packets of different data packet types, so as to avoid that, when a terminal device communicates with a network device, the overall power consumption of the terminal device or the data transmission process is affected due to improper setting of the link-breaking delay.
The first device provided in the embodiment of the present invention is capable of implementing each process implemented by the first device in the foregoing method embodiments, and is not described here again in order to avoid repetition.
Taking a first device as an example of a terminal device, fig. 4 is a schematic diagram of a hardware structure of a terminal device for implementing various embodiments of the present invention, where the terminal device 100 includes but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the configuration of the terminal device 100 shown in fig. 4 does not constitute a limitation of the terminal device, and that the terminal device 100 may include more or less components than those shown, or combine some components, or arrange different components. In the embodiment of the present invention, the terminal device 100 includes, but is not limited to, a mobile phone, and other intelligent devices with a battery and network interaction.
Wherein, the processor 110 is configured to: under the condition that the first device and the second device establish a link, acquiring a target data packet, wherein the target data packet is as follows: determining a target delay corresponding to a data packet type of a target data packet for a data packet transmitted on a link between the first device and the second device, wherein different data packet types correspond to different link-breaking delays, and setting the link-breaking delay according to the target delay.
In the terminal device provided in the embodiment of the present invention, when the first device and the second device establish a link, after the first device acquires the target data packet, the link-breaking delay of the link between the first device and the second device may be set according to the target delay corresponding to the data packet type of the target data packet, that is, different link-breaking delays are set for data packets of different data packet types, so that when the terminal device communicates with the network device, the power consumption of the whole terminal device or the data transmission process is not affected due to improper setting of the link-breaking delay.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 101 may be used for receiving and sending signals during a message transmission or call process, and specifically, after receiving downlink data from a base station, the downlink data is processed by the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through a wireless communication system.
The terminal device 100 provides the user with wireless broadband internet access via the network module 102, such as helping the user send and receive e-mails, browse web pages, and access streaming media.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output as sound. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the terminal device 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
The input unit 104 is used to receive an audio or video signal. The input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics processor 1041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the network module 102. The microphone 1042 may receive sound and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode.
The terminal device 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the terminal device 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 105 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device 100. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072. Touch panel 1071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 1071 (e.g., operations by a user on or near touch panel 1071 using a finger, stylus, or any suitable object or attachment). The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and receives and executes commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 1071 may be overlaid on the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although in fig. 4, the touch panel 1071 and the display panel 1061 are two independent components to implement the input and output functions of the terminal device 100, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the terminal device 100, and is not limited herein.
The interface unit 108 is an interface for connecting an external device to the terminal apparatus 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 100 or may be used to transmit data between the terminal apparatus 100 and the external device.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the terminal device 100, connects various parts of the entire terminal device 100 by various interfaces and lines, and performs various functions of the terminal device 100 and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the terminal device 100. Processor 110 may include one or more processing units; alternatively, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The terminal device 100 may further include a power supply 111 (such as a battery) for supplying power to each component, and optionally, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the terminal device 100 includes some functional modules that are not shown, and are not described in detail here.
Optionally, an embodiment of the present invention further provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor 110, where the computer program, when executed by the processor, implements each process of the above method for setting a delay, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above method for setting a delay, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method of the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for setting a delay, applied to a first device, the method comprising:
under the condition that the first device and the second device establish a link, acquiring a target data packet, wherein the target data packet is as follows: a data packet transmitted on a link between the first device and the second device;
determining a target delay corresponding to the data packet type of the target data packet, wherein different data packet types correspond to different broken link delays;
setting the broken link delay of the link according to the target delay;
the determining the target delay corresponding to the data packet type of the target data packet includes:
determining a target delay corresponding to a target identifier in the target data packet from M first delays corresponding to the TCP type;
the target identification is used for indicating the type of the broken link delay of the target data packet; the type of chain scission delay comprises at least one of: chain breakage is delayed in advance; m is a positive integer.
2. The method of claim 1, wherein if the target packet is a packet other than a first packet, the method further comprises, before setting the link down delay of the link according to the target delay:
setting a broken link delay timer under the condition of acquiring the first data packet; the timing time of the broken link delay timer is as follows: the delay time corresponding to the data packet type of the first data packet;
the setting of the link breaking delay according to the target delay includes:
and updating the timing time of the broken link delay timer according to the target delay.
3. The method of claim 2, wherein the updating the timing time of the delink delay timer according to the target delay comprises:
reading the remaining time of the broken link delay timer;
and if the residual time is less than the target delay time, updating the target delay time to the timing time of the broken link delay timer.
4. The method of claim 3, further comprising:
and if the residual time is greater than or equal to the target delay time, not updating the timing time of the broken link delay timer.
5. A first device, characterized in that the first device comprises:
an obtaining module, configured to obtain a target data packet when the first device and the second device establish a link, where the target data packet is: a data packet transmitted on a link between the first device and the second device;
a determining module, configured to determine a target delay corresponding to the packet type of the target packet acquired by the acquiring module, where different packet types correspond to different broken link delays;
the setting module is used for setting the chain breakage delay of the link according to the target delay determined by the determining module;
the packet type of the target packet is transmission control protocol TCP,
the determining module is specifically configured to:
determining a target delay corresponding to a target identifier in the target data packet from M first delays corresponding to the TCP type;
the target identification is used for indicating the type of the broken link delay of the target data packet; the type of chain scission delay comprises at least one of: chain breakage is delayed in advance; m is a positive integer.
6. The first device of claim 5, wherein the setup module is further configured to:
if the target data packet acquired by the acquisition module is other data packets except the first data packet, setting a broken link delay timer under the condition of acquiring the first data packet; the timing time of the broken link delay timer is as follows: the delay time corresponding to the data packet type of the first data packet;
the setting module is specifically configured to: and updating the timing time of the broken link delay timer according to the target delay determined by the determining module.
7. The first device of claim 6, wherein the setup module is specifically configured to:
reading the remaining time of the broken link delay timer;
and if the residual time is less than the target delay time, updating the target delay time to the timing time of the broken link delay timer.
8. The first device of claim 7, wherein the setting module is further configured to not update the timing time of the delink delay timer if the remaining time is greater than or equal to the target delay time.
9. A terminal device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of setting a delay time according to any one of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for setting a latency of any one of claims 1 to 4.
CN201910670365.8A 2019-07-24 2019-07-24 Method and device for setting time delay Active CN110505279B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910670365.8A CN110505279B (en) 2019-07-24 2019-07-24 Method and device for setting time delay
PCT/CN2020/098220 WO2021012871A1 (en) 2019-07-24 2020-06-24 Method and device for setting delay

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910670365.8A CN110505279B (en) 2019-07-24 2019-07-24 Method and device for setting time delay

Publications (2)

Publication Number Publication Date
CN110505279A CN110505279A (en) 2019-11-26
CN110505279B true CN110505279B (en) 2021-11-23

Family

ID=68586903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910670365.8A Active CN110505279B (en) 2019-07-24 2019-07-24 Method and device for setting time delay

Country Status (2)

Country Link
CN (1) CN110505279B (en)
WO (1) WO2021012871A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110505279B (en) * 2019-07-24 2021-11-23 维沃移动通信有限公司 Method and device for setting time delay
CN113687782B (en) * 2021-07-30 2023-12-22 济南浪潮数据技术有限公司 Storage pool time delay determining method and device, electronic equipment and readable storage medium
CN116367238A (en) * 2021-12-28 2023-06-30 北京小米移动软件有限公司 Data transmission method, device, terminal and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486453A (en) * 2014-11-19 2015-04-01 中国联合网络通信集团有限公司 Ageing-time adjusting method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2776076B2 (en) * 1991-08-21 1998-07-16 日本電気株式会社 Setting line disconnection method
US6260072B1 (en) * 1997-06-12 2001-07-10 Lucent Technologies Inc Method and apparatus for adaptive routing in packet networks
CN103327647B (en) * 2010-10-29 2016-03-30 华为技术有限公司 The delayed release method and apparatus of Temporary Block Flow
JP2016010088A (en) * 2014-06-26 2016-01-18 株式会社日立製作所 Network control device
CN104519064B (en) * 2014-12-22 2018-09-25 厦门广控物联科技有限公司 A method of realizing that communication link is kept online
CN108966365A (en) * 2018-08-15 2018-12-07 上海移远通信技术股份有限公司 A kind of link keeping method, relevant apparatus, terminal and storage medium
CN110505279B (en) * 2019-07-24 2021-11-23 维沃移动通信有限公司 Method and device for setting time delay

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486453A (en) * 2014-11-19 2015-04-01 中国联合网络通信集团有限公司 Ageing-time adjusting method and device

Also Published As

Publication number Publication date
CN110505279A (en) 2019-11-26
WO2021012871A1 (en) 2021-01-28

Similar Documents

Publication Publication Date Title
CN107889151B (en) Measurement report reporting method, mobile terminal and computer readable storage medium
CN112799577B (en) Method, terminal and storage medium for projecting small window
CN110505279B (en) Method and device for setting time delay
CN109831359B (en) Method for detecting connection state of data network and terminal equipment thereof
CN111182563B (en) Wireless capability identifier transmission method, terminal equipment and network node
CN110958710B (en) Channel access method, configuration method, terminal and network side equipment
CN111131885A (en) Play control method and electronic equipment
CN111343710B (en) Power adjustment method and electronic equipment
CN109151741B (en) Multimedia message receiving method and terminal
CN111093289A (en) Service transmission method and electronic equipment
US20220110036A1 (en) Random access method and terminal
CN110475303B (en) Data transmission method and terminal equipment
CN111800835B (en) Switching configuration method, network device, terminal device and storage medium
CN111083009B (en) Packet capturing method and device and mobile terminal
CN111601334B (en) Measuring method, device and system
CN110224732B (en) Antenna switching method and terminal equipment
CN112395106A (en) Process management method, mobile terminal, and computer-readable storage medium
CN110209434B (en) Memory management method and device and computer readable storage medium
CN109947617B (en) Method, terminal and readable storage medium for monitoring display content of application interface
CN111107589B (en) Configuration parameter negotiation method, terminal device, system and storage medium
CN110034873B (en) Reconfiguration method, terminal and base station
CN111818657B (en) Uplink transmission discarding method, uplink transmission discarding configuration method and related equipment
CN107864294B (en) Do not disturb mode starting method and mobile terminal
CN111132187B (en) Determination method, terminal equipment and network equipment
CN108668005B (en) Terminal detection method and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant