WO2017113240A1 - Method, apparatus and system for processing keepalive probe packet - Google Patents

Method, apparatus and system for processing keepalive probe packet Download PDF

Info

Publication number
WO2017113240A1
WO2017113240A1 PCT/CN2015/099974 CN2015099974W WO2017113240A1 WO 2017113240 A1 WO2017113240 A1 WO 2017113240A1 CN 2015099974 W CN2015099974 W CN 2015099974W WO 2017113240 A1 WO2017113240 A1 WO 2017113240A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
keep
terminal
message
alive
Prior art date
Application number
PCT/CN2015/099974
Other languages
French (fr)
Chinese (zh)
Inventor
胡星星
张宏卓
邓天乐
庞伶俐
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/099974 priority Critical patent/WO2017113240A1/en
Publication of WO2017113240A1 publication Critical patent/WO2017113240A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data

Definitions

  • the present invention relates to the field of communications, and in particular, to a method, device, and system for processing keep-alive detection messages.
  • the server needs to communicate with its corresponding client, the server first needs to know whether the client is online.
  • the server can determine whether the client is online by sending a keep-alive probe packet (also called a heartbeat packet) to the terminal running the client.
  • a keep-alive probe packet also called a heartbeat packet
  • the server sends the keep-alive detection packet to the mobile management entity (English: mobile managementnment entity, abbreviation: MME), and the MME sends the keep-alive detection packet to the serving general packet radio service technical support node (English: serving The general packet radio service support node (abbreviation: SGSN), if the SGSN detects that the terminal is in an idle state (English: idle), the SGSN sends the keep-alive detection message to the paging controller, and the paging controller pages the The terminal, after the terminal is transferred from the idle state to the connected state (English: connect), sends the keep-alive probe message to the terminal response. If the SGSN detects that the terminal is in the connected state, the SGSN may directly send the keep-alive probe message to the terminal to respond.
  • the SGSN directly sends the keep-alive detection packet to the terminal, so the keep-alive detection packet needs to occupy the air interface resource, in particular, multiple terminals are installed on the terminal.
  • the air interface resources are occupied in large quantities.
  • Embodiments of the present invention provide a method, an apparatus, and a system for processing keep-alive detection messages, which can save air interface resources.
  • an embodiment of the present invention provides a method for processing a keep-alive detection message, where the method includes:
  • the network device receives the data packet sent by the server
  • the network device determines that the terminal does not restart after receiving the second keep-alive detection message, the network device generates a probe response message according to the first keep-alive detection message, where the The second keep-alive detection packet is the previous keep-alive detection packet of the first keep-alive detection packet;
  • the network device sends the probe response message to the server.
  • the method for processing the keep-alive detection packet provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal is in the network device After receiving the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device can directly generate the probe response packet according to the first keep-alive probe packet.
  • the server that is, the method for processing the keep-alive detection message provided by the embodiment of the present invention, whether the terminal is in the connected state or the idle state, if the terminal receives the second keep-alive detection on the network device
  • the network device proxy terminal replies to the server with the probe response packet in response to the keep-alive detection packet, thereby saving the network device. Air interface resources with the terminal.
  • the network device needs to determine whether the terminal is restarted after receiving the second keep-alive detection packet, if the terminal has not been restarted.
  • the terminal and the server are always connected, that is, the client running on the terminal is always online, so that in order to save the air interface overhead between the network device and the terminal, the network device can directly receive the first security according to the The live probe packet generates a probe response packet. In this way, it also enables the network device to more accurately proxy the terminal to the server. Responding to the probe response message of the keep-alive probe message.
  • the method further includes:
  • the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection packet, the network device sends the first keep-alive detection packet to the terminal .
  • the network device may consider that the connection between the terminal and the network device has changed, that is, the terminal is re-established. Before the startup, the connection established between the terminal and the network device is an invalid connection. Therefore, in this case, the network device cannot reply to the probe response message of the first keep-alive detection packet to the server, but the network device The first keep-alive detection packet is sent to the terminal, and the terminal returns a probe response message in response to the first keep-alive detection packet to the server. In this way, it is possible to ensure that the server accurately knows the state of the client running on the terminal.
  • the network device determines that the terminal does not restart or has been restarted after the network device receives the second keep-alive detection packet, and may be implemented by any one of the following possible implementation manners:
  • a possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a non-access stratum NAS message sent by the terminal; if the NAS message does not Carrying the attach request message, the network device determines that the terminal does not restart after the network device receives the second keep-alive probe message; if the NAS message carries the attach request message, the The network device determines that the terminal has been restarted after the network device receives the second keep-alive detection message.
  • Another possible implementation manner is: after the network device receives the second keep-alive detection message, if the network device does not receive the attach request message sent by the core network device, the network device determines The terminal does not restart after the network device receives the second keep-alive detection message, where the attach request message is sent by the terminal to the core network device; and the network device receives the After the second keep-alive probe message is received, if the network device receives the packet sent by the core network device And the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection message.
  • a further possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a radio resource control RRC connection request message sent by the terminal, the RRC connection request The message carries a re-establishment cause; if the re-establishment cause indicates that the RRC connection request message is not triggered by the terminal restarting, the network device determines that the terminal receives the second at the network device After the keep-alive probe message is not restarted; if the re-establishment cause indicates that the RRC connection request message is triggered by the terminal restarting, the network device determines that the terminal receives the location on the network device The second keep-alive probe message has been restarted.
  • the network device may determine whether the terminal has restarted after the network device receives the second keep-alive detection message (including no restart or has been restarted) by using any one of the foregoing possible implementation manners. . In this way, it is possible to ensure that the network device accurately knows whether the terminal has been restarted.
  • the method further includes:
  • the network device sends the service data packet to the terminal.
  • the network device may send the service data packet to the terminal, and the terminal processes the service data packet to ensure that the service data packet is processed by the terminal.
  • the service data message terminal sent by the server to the terminal can be normally received, thereby completing communication between the server and the terminal.
  • an embodiment of the present invention provides a network device, where the network device includes:
  • a receiving unit configured to receive a data packet sent by the server
  • a determining unit configured to determine that the data packet received by the receiving unit is a first keep alive detection packet
  • a generating unit configured to: if the determining unit determines that the terminal receives at the receiving unit And after the second keep-alive detection packet is not restarted, generating a probe response packet according to the first keep-alive probe packet received by the receiving unit, where the second keep-alive probe packet is the first The previous keep-alive probe message of the keep-alive probe message;
  • a sending unit configured to send the probe response message generated by the generating unit to the server.
  • the embodiment of the present invention provides a network device, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal receives the data packet on the network device, After the second keep-alive detection packet (that is, the previous keep-alive detection packet of the first keep-alive detection packet) is not restarted, the network device can directly generate a probe response packet according to the first keep-alive detection packet.
  • the probe response message is sent to the server, that is, the method for processing the keep-alive detection packet provided by the embodiment of the present invention, whether the terminal is in the connected state or the idle state, if the terminal receives the second keep-alive detection report on the network device
  • the network device proxy terminal returns a probe response message in response to the keep-alive probe message to the server, thereby saving network equipment. Air interface resources with the terminal.
  • the sending unit is further configured to: if the determining unit determines that the terminal has been restarted after the receiving unit receives the second keep-alive detecting message, the first keep-alive The probe message is sent to the terminal.
  • the determining unit includes a receiving module and a determining module, where
  • the determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, including:
  • the receiving module is configured to: after the receiving unit receives the second keep-alive detecting message, receive a non-access stratum NAS message sent by the terminal; and the determining module is configured to: if the receiving module If the received NAS message does not carry the attach request message, it is determined that the terminal does not restart after receiving the second keep-alive probe message by the receiving unit; if the NAS message received by the receiving module And carrying the attach request message, determining that the terminal has been restarted after the receiving unit receives the second keep alive detection message.
  • the determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, and includes:
  • the determining unit is configured to: after the receiving unit receives the second keep-alive detecting message, if the receiving unit does not receive the attach request message sent by the core network device, determine that the terminal is in the Receiving, after receiving the second keep-alive detection message, the receiving unit does not restart, the attach request message is sent by the terminal to the core network device; and the second keep-alive detection is received by the receiving unit After the message, the receiving unit receives the attach request message sent by the core network device, and determines that the terminal has been restarted after the receiving unit receives the second keep-alive probe message.
  • the determining unit includes a receiving module and a determining module, where
  • the determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, including:
  • the receiving module is configured to receive, after the receiving unit receives the second keep-alive detection message, a radio resource control RRC connection request message sent by the terminal, where the RRC connection request message carries a re-establishment cause
  • the determining module if the re-establishment cause received by the receiving module indicates that the RRC connection request message is not triggered by the terminal restarting, determining that the terminal receives the location at the receiving unit After the second keep-alive probe message is not restarted; if the re-establishment cause received by the receiving module indicates that the RRC connection request message is triggered by the terminal restarting, determining that the terminal is in the The receiving unit has restarted after receiving the second keep-alive detection message.
  • the determining unit is further configured to: after the receiving unit receives the data packet sent by the server, determining that the data packet received by the receiving unit is a service data packet; And sending the service data packet received by the receiving unit to the terminal.
  • the network device is a base station or a core network device.
  • an embodiment of the present invention provides a network device, where the network device includes a processor, an interface circuit, a memory, and a system bus.
  • the memory is configured to store computer execution instructions, the processor, the interface circuit, and the memory are connected to each other through the system bus, and when the network device is running, the processor executes the memory storage
  • the computer executes the instructions to cause the network device to perform the method of processing the keep-alive detection message as described in the first aspect or the optional aspect of the first aspect.
  • the embodiment of the present invention provides a communication system, where the communication system includes the network device according to any one of the foregoing second aspect or the second aspect, or Internet equipment.
  • the embodiment of the present invention provides a network device and a communication system, where the network system includes the network device, and when the network device receives the data packet sent by the server, the network device determines that the data packet is the first keep-alive detection. After the packet is not restarted after the network device receives the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device can directly A keep-alive probe packet generates a probe response packet, and then sends the probe response packet to the server, that is, the method for processing the keep-alive probe packet provided by the embodiment of the present invention, whether the terminal is in a connected state or an idle state, if After the network device does not restart after receiving the second keep-alive detection packet, the network device does not need to send the keep-alive detection packet to the terminal, but the network device proxy terminal responds to the server with the keep-alive detection. The packet is detected by the response packet, thereby saving air interface resources between the network device and the terminal.
  • FIG. 1 is a schematic structural diagram of a communication system according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a method for processing keep-alive detection packets according to an embodiment of the present invention.
  • One is a schematic diagram of a method for processing keep-alive detection packets according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a format of a data packet according to an embodiment of the present disclosure
  • FIG. 4 is a second schematic diagram of a method for processing keep-alive detection packets according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram 1 of a network device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram 2 of a network device according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of hardware of a network device according to an embodiment of the present invention.
  • first and second and the like in the specification and claims of the present invention are used to distinguish different objects, and are not intended to describe a particular order of the objects.
  • first keep-alive detection message and the second keep-alive detection message are used to distinguish different keep-alive detection messages, instead of describing the feature sequence of the keep-alive detection message.
  • a plurality means two or more unless otherwise indicated.
  • multiple clients refer to two or more clients; multiple core networks refer to two or more core networks and the like.
  • a method for processing a keep-alive detection message may be applied to a communication system, where the communication system may be a second-generation mobile communication technology network (referred to as 2G network) and adopts a third-generation mobile communication technology.
  • the network (referred to as 3G network), the network using the fourth generation mobile communication technology (referred to as 4G network) or the network using the fifth generation mobile communication technology (referred to as 5G network), the present invention is not specifically limited.
  • FIG. 1 is a schematic structural diagram of a communication system according to an embodiment of the present invention.
  • the network device is a base station
  • the terminal is a user equipment (English: user equipment, abbreviated as UE)
  • the server is an application server.
  • the network device in the embodiment of the present invention may also be a network device such as a core network device; the terminal may also be another type of terminal device; the server may also need to communicate with the terminal (ie, an application running on the terminal).
  • Other servers may be used to communicate with the terminal (ie, an application running on the terminal).
  • the terminal is a device that provides voice and/or data connectivity to the user, including a wireless terminal or a wired terminal.
  • the wireless terminal can be a handheld device with wireless connectivity, or other processing device connected to a wireless modem, and a mobile terminal that communicates with one or more core networks via a wireless access network.
  • the wireless terminal can be a mobile phone (or "cellular" phone) and a computer with a mobile terminal.
  • the wireless terminal can also be a portable, pocket, handheld, computer built-in or in-vehicle mobile device.
  • the wireless terminal can be a mobile station (mobile station), an access point (English: access point), or a part of the UE. The specifics may be determined according to the actual application scenario, and are not specifically limited in the embodiment of the present invention.
  • the application server when the application server needs to communicate with its corresponding client (for example, the application server needs to send data to the client, ie, the application), the application server first needs to know the client. Whether it is online, usually the application server can send a keep-alive probe to the terminal running the client. The text (also known as the heartbeat packet) determines whether the client is online.
  • the application server sends the keep-alive detection packet to the terminal
  • the SGSN in the network sends the keep-alive detection packet to the terminal, and the terminal responds to the keep-alive detection packet. If the client is online, the terminal responds to the protection.
  • the SGSN replies to the application server with the probe response packet of the keep-alive probe packet, so that the application server can learn that the client is online after receiving the probe response packet. If the application server needs to communicate with the client, the application server can send data directly to the client. If the client is offline, the terminal will not reply to the server with a probe response packet for the keep-alive probe packet, so that if the server does not receive the probe response packet replied by the terminal after the preset time, the server may Know that the client is offline.
  • the SGSN needs to send the keep-alive probe message to the terminal response, especially when the terminal is in the connected state, it can be considered that the client running on the terminal maintains a connection state with the corresponding application server, that is, the client is in the connection state.
  • the online status so if the SGSN still sends the keep-alive probe message to the terminal when the terminal is in the connected state, and the terminal replies with the probe response message to the keep-alive probe message, the SGSN and the terminal are Air interface resources are occupied, especially when the number of clients is increasing, the air interface resources will be occupied a lot.
  • the embodiment of the present invention provides a method for processing a keep-alive detection message, as shown in FIG. Can include:
  • the server sends a data packet to the network device.
  • the network device receives a data packet sent by the server.
  • the data packet sent by the server to the network device may also be referred to as a downlink data packet, and the downlink data packet may be a keep-alive detection packet (or a downlink keep-alive detection packet), or It is a service data packet (or a downlink service data packet).
  • the network device provided by the embodiment of the present invention may be a base station or a core network device.
  • the server can send the number to the core network device.
  • the core network device forwards the data packet to the base station; when the network device is the core network device, the server can directly send the data packet to the core network device.
  • the network device determines that the data packet is the first keepalive detection packet.
  • the network device determines that the data packet is a keep-alive probe packet, where the keep-alive probe packet may also be referred to as a first keep-alive probe packet.
  • the method for determining, by the network device, that the data packet is the first keepalive detection packet may be the following (1) to (5):
  • the network device determines that the data packet carries an acknowledgement (English: acknowledgement, abbreviation: ACK); (2) the network device determines that the data packet is a data packet without a data payload or the data packet is a data message with an invalid data payload of 1 byte; (3) the network device determines that the data sequence number of the data packet is the data sequence number of the next service data packet to be transmitted minus 1; (4) network The device determines that the ACK is set to confirm that the sequence number is valid (for example, the ACK is set to 1 to indicate that the acknowledgment sequence number is valid); (5) the network device determines that the acknowledgment sequence number of the data message is set to the next acknowledgment sequence number that the server expects to receive.
  • ACK acknowledgement
  • the network device determines that the data packet is a data packet without a data payload or the data packet is a data message with an invalid data payload of 1 byte
  • the network device determines that the data sequence number of the data packet is the data sequence number of the next service data packet to
  • the network device determines that the data sequence number of the data packet is the data sequence number of the next service data packet to be sent minus one, which can be understood as:
  • the network device determines that the data sequence number of the data packet is the number of bytes that have been confirmed to be successfully transmitted minus one. Specifically, the network device may determine that the data sequence number of the data packet is the acknowledgement sequence number of the uplink service data packet minus one by detecting the uplink service data packet that carries the ACK flag.
  • the network device may determine that the data packet is a keep-alive detection packet (ie, the first keep-alive detection packet). If the data packet received by the network device does not satisfy at least one of the foregoing (1) to (5), the network device determines that the data packet is not a keep-alive probe message.
  • the network device determines that the received data packet is a keep-alive probe packet
  • the format of the data packet is exemplarily described below.
  • the data packet in the embodiment of the present invention may be a transmission control protocol/Internet protocol.
  • (English: transmission control protocol/Internet protocol, abbreviation: TCP/IP) data message the format of the TCP/IP data message is shown in Figure 3.
  • the TCP/IP data packet shown in FIG. 3 includes three parts: an IP header, a TCP header, and a data payload. The following is an example of each of the three fields.
  • Version refers to the current protocol version number. For example, it can be 4, which is IPv4.
  • Head length refers to the number of 32-bit (English: bit) words occupied by the IP header.
  • Type of service (TOS): consists of 8 bits, including the 3-bit priority subfield, the 4-bit TOS subfield and the 1-bit unused bit (which must be set to 0).
  • the 4bit TOS subfields are respectively Represents minimum latency, maximum throughput, maximum reliability, and minimum cost.
  • Total length refers to the length of the entire data packet.
  • Each data packet sent by the host ie, the sender, which is a server in the embodiment of the present invention is uniquely identified.
  • Flag It consists of 3 bits, including 1bit unused, 1bit setting whether to allow segmentation, and 1bit indicating whether there is still a segment for router to segment data packets.
  • Segment Offset Indicates the location of this segment in the current data message.
  • Time to live (English: time to live, abbreviation: TTL): Sets the maximum number of routers that data packets can pass.
  • Protocol code Indicates which transmission process the data message belongs to, such as TCP or user datagram protocol (abbreviation: UDP).
  • Header checksum Only verifies the header, that is, generates a checksum based on the contents of other fields in the header.
  • Source address and destination address Indicates the network number and host number of the source and destination, that is, the source IP address and the destination IP address.
  • Source port number and destination port number used to find the application process of the sender and receiver. These two values plus the source IP address and the destination IP address in the IP header uniquely identify a TCP connection.
  • Data sequence number represents the serial number of the first byte of the TCP connection. Specifically, when establishing a new TCP connection, the host selects an initial sequence number, and the first byte sequence number sent is the initial sequence number plus one.
  • Confirmation sequence number indicates the serial number of the number of bytes sent correctly by the peer.
  • Head length refers to the number of 32-bit words occupied by the header of the TCP header.
  • Emergency position (English: urgent, abbreviation: URG): Indicates whether the emergency pointer is valid. Let one end tell the other end that there is some kind of urgent data (such as the data when the user types the interrupt key or the user abandons the transfer of a file) has been placed in the normal data stream.
  • Reset (English: reset, abbreviation: RST): Indicates whether to re-establish the connection.
  • End (English: finish, abbreviation: FIN): Indicates whether the sender completes the sending task.
  • TCP's flow control is provided by the window size declared at each end. This value is the byte that the receiver expects to receive.
  • Packet checksum Verify the TCP header and TCP data.
  • Data payload Indicates the payload of a TCP/IP data packet, that is, the data that the TCP/IP data packet needs to transmit.
  • the network device determines, in the method that the received data packet is the first keep alive detection packet, the ACK, the data payload, the data sequence number, the confirmation sequence number, and the specific settings thereof.
  • the received data packet is the first keep alive detection packet, the ACK, the data payload, the data sequence number, the confirmation sequence number, and the specific settings thereof.
  • the network device determines that the terminal does not restart after receiving the second keep-alive detection packet, the network device generates a probe response packet according to the first keep-alive detection packet.
  • the first keep-alive detection packet and the second keep-alive detection packet are the keep-alive detection packets received by the network device twice, and the second keep-alive detection packet is the first keep-alive detection packet.
  • the second keep-alive detection packet is the keep-alive detection packet received by the network device before receiving the first keep-alive detection packet. Specifically, the network device first receives the second keep-alive detection packet, and then the network The device receives the first keep-alive detection packet again.
  • the network device needs to determine whether the terminal is restarted after receiving the second keep-alive detection packet, if the terminal has not been restarted.
  • the terminal and the server are always connected, that is, the client running on the terminal is always online, so that in order to save the air interface overhead between the network device and the terminal, the network device can directly receive the first security according to the The live probe packet generates a probe response packet. In this way, the network device can also make the proxy device more accurately return the probe response message to the server in response to the keep-alive probe message.
  • the format of the probe response packet is the same as the format of the keep-alive probe packet. That is, the format of the probe response packet can also be seen in the format of the TCP/IP data packet as shown in FIG.
  • the method for the network device to generate the probe response packet according to the first keepalive detection packet may be:
  • the ACK in the data packet is set to 1 (that is, the acknowledgment sequence number carried in the data packet is valid); the acknowledgment sequence number in the data packet is set to be the received acknowledgment number.
  • the value of the data sequence number in the keep-alive detection message is incremented by one; the data sequence number in the data message is set to the acknowledgement sequence number in the first keep-alive probe message received; for other data packets Field settings, network devices
  • the network device may set the value of the field of the data packet received by the network device, or the network device may obtain the value of some field in the data packet, and then the network device sets the calculated result to the corresponding field.
  • the network device can generate a probe response message in response to the first keep-alive probe message.
  • the acknowledgment sequence number and the data sequence number in the data packet may be set by the network device to be the same as the content of the corresponding field in the uplink service data packet received within a certain period of time; the segment offset and the segment in the data packet
  • the URG or the like may be set to 0 by the network device; the header length, the total length, the header checksum, and the packet checksum in the data packet may be calculated by the network device according to the specific meaning of the fields, and then the network device According to the calculation result, the header length, the total length, the header checksum, and the packet checksum in the data packet are set; the URG, PSH, RST, SYN, and FIN in the data packet can be set by the network device. It is 0 and so on.
  • the identifier in the probe response packet generated by the network device proxy terminal may be related to the uplink service datagram generated by the terminal.
  • the identifier when the network device generates the probe response packet, the identifier is the same as the identifier of the traffic data packet sent by the terminal to the server. The random number corresponding to the identifier in the uplink service data packet received by the last time is generated, and then the random number is set as the identifier of the probe response message.
  • the random number generated by the network device and the identifier of the uplink service data packet received by the network device is relatively large, and can be implemented by any of the following methods:
  • the network device After the network device generates a random number, compare the random number with the identifier in the uplink service data packet received last time, if the difference between the two is relatively large (for example, the absolute value of the difference is greater than or equal to a preset threshold, which may be set according to actual usage requirements, which is not specifically limited by the present invention, and the random number is As the identifier of the probe response message; if the difference between the two is relatively small (for example, the absolute value of the difference between the two is less than the preset threshold), a random number is regenerated, until the difference between the two is relatively large, the last generated The random number is used as the identifier of the probe response message.
  • a preset threshold which may be set according to actual usage requirements, which is not specifically limited by the present invention
  • the network device generates a plurality of random numbers, and determines, in the plurality of random numbers, a random number having the largest difference from the identifier in the uplink service data packet received last time (for example, the identifier is included in the plurality of random numbers) The absolute value of the difference is the largest random number), and then the network device uses the random number as the identifier of the probe response message.
  • the method for the network device to generate a random number that is relatively different from the identifier of the uplink service data packet received last time includes, but is not limited to, the foregoing (1) and (2), that is, the network.
  • the device generates a random number that is different from the identifier of the uplink service data packet that is received by the device, and can be implemented in other manners, which is not described in the embodiment of the present invention.
  • the method for determining, by the network device, that the terminal does not restart after the network device receives the second keep alive detection packet is described in detail in the following embodiments, and details are not described herein again.
  • the network device sends a probe response message to the server.
  • the server receives the probe response packet sent by the network device.
  • the network device may send the probe response packet to the server.
  • the server may learn that the client is online.
  • the method for processing the keep-alive detection packet provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal is in the network device After receiving the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device can directly generate the probe response packet according to the first keep-alive probe packet.
  • the server that is, the method for processing the keep-alive detection message provided by the embodiment of the present invention, whether the terminal is in the connected state or the idle state, if the terminal receives the second keep-alive detection on the network device
  • the network device does not need to send the keep-alive probe packet to the terminal, but the network device proxy terminal sends the service to the terminal.
  • the server responds to the probe response packet of the keep-alive probe packet, thereby saving air interface resources between the network device and the terminal.
  • the method for processing the keep-alive detection packet may further include:
  • the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection packet, the network device sends the first keep-alive detection packet to the terminal.
  • the terminal receives the first keep-alive detection packet sent by the network device.
  • S104-S106 and S107-S108 are alternatively executed; that is, after S101-S103 is executed, S104-S106 is executed or S107-S108 is executed.
  • S104-S106 and S107-S108 are both shown in broken lines in FIG.
  • the method for processing the keep-alive detection packet may further include:
  • the terminal generates a probe response packet according to the first keepalive detection packet.
  • the terminal sends a probe response packet to the network device.
  • the network device receives the probe response packet sent by the terminal.
  • the network device sends a probe response message to the server.
  • the server receives a probe response packet sent by the network device.
  • the terminal processes the first keep-alive detection packet, that is, the foregoing S109-S113 and the normal terminal response server send the packet.
  • the method for keeping the probe packet is similar, and is not described in detail in the embodiment of the present invention.
  • the network device may consider that the connection between the terminal and the server has changed, that is, restart the terminal.
  • the connection established between the terminal and the server is already an invalid connection.
  • the network device cannot reply to the probe response packet of the first keep-alive probe message to the server, but the network device The first keep-alive detection message is sent to the terminal, and the terminal returns a probe response message in response to the first keep-alive detection message to the server. So, can Ensure that the server accurately knows the state of the client running on the terminal.
  • the network device determines that the terminal does not restart or has been restarted after the network device receives the second keep-alive detection packet, which may be specifically described below. Any method to achieve:
  • a possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a non-access stratum (English: non-access stratum, abbreviation: NAS) message sent by the terminal; if the NAS message If the network device does not carry the attach request message, the network device determines that the terminal does not restart after the network device receives the second keep-alive probe message; if the NAS message carries the attach request message, the network device determines that the terminal receives the first The second keep-alive probe message has been restarted.
  • NAS non-access stratum
  • Another possible implementation manner is: after the network device receives the second keep-alive probe message, if the network device does not receive the attach request message sent by the core network device, the network device determines that the terminal receives the second device on the network device. After the keepalive detection packet is not restarted, the attach request message is sent by the terminal to the core network device; after the network device receives the second keep alive detection packet, if the network device receives the attach request sent by the core network device The message, the network device determines that the terminal has restarted after the network device receives the second keep alive detection message.
  • a further possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a radio resource control (English: radio resource control, abbreviation: RRC) connection request message sent by the terminal, where the RRC connection
  • the request message carries the re-establishment cause; if the re-establishment cause indicates that the RRC connection request message is not triggered by the terminal restarting, the network device determines that the terminal does not restart after receiving the second keep-alive detection message by the network device;
  • the re-establishment cause indicates that the RRC connection request message is triggered by the terminal restarting, and the network device determines that the terminal has restarted after the network device receives the second keep-alive detection message.
  • the foregoing network device determines that the terminal does not restart or has restarted after the network device receives the second keep-alive detection message, and the time period after the network device receives the second keep-alive detection message is The time period after the network device receives the second keep-alive probe message, and the network device performs S104.
  • the network device when the network device receives the data packet sent by the server, if the network device determines that the data packet is a service data packet, the network device The service data packet can be sent to the terminal, and the service data packet is processed by the terminal, so that the service data packet terminal sent by the server to the terminal can be normally received, thereby completing communication between the server and the terminal.
  • an embodiment of the present invention provides a network device, where the network device is configured to perform the steps performed by the network device in the method in the foregoing embodiment.
  • the network device may include a module corresponding to the corresponding step.
  • the network device includes:
  • the receiving unit 10 is configured to receive a data packet sent by the server, and the determining unit 11 is configured to determine that the data packet received by the receiving unit 10 is a first keep-alive detecting packet, and the generating unit 12 is configured to: The determining unit 11 determines that the terminal does not restart after the receiving unit 10 receives the second keep-alive detecting message, and generates a probe response message according to the first keep-alive detecting message received by the receiving unit 10, The second keep-alive detection packet is the previous keep-alive detection packet of the first keep-alive detection packet, and the sending unit 13 is configured to send the probe response packet generated by the generating unit 12 to The server.
  • the sending unit 13 is further configured to: if the determining unit 11 determines that the terminal has been restarted after the receiving unit 10 receives the second keep-alive detecting message, A keep-alive detection message is sent to the terminal.
  • the determining unit 11 includes a receiving module 110 and a determining module 111.
  • the determining unit 11 determines that the terminal does not restart or has been restarted after the receiving unit 10 receives the second keep-alive detecting message, and includes:
  • the receiving module 110 is configured to receive the NAS message sent by the terminal after the receiving unit 10 receives the second keep-alive detecting message
  • the determining module 111 is configured to: if the receiving module 110 The received NAS message does not carry The request message is determined, the terminal is not restarted after the receiving unit 10 receives the second keep-alive detection message; if the NAS message received by the receiving module 110 carries the attach request message And determining that the terminal has been restarted after the receiving unit 10 receives the second keep-alive detection message.
  • the determining unit 11 determines that the terminal does not restart or has been restarted after the receiving unit 10 receives the second keep-alive detection message, and includes:
  • the determining unit 11 is configured to: after the receiving unit 10 receives the second keep-alive detecting message, if the receiving unit 10 does not receive the attach request message sent by the core network device, determine the terminal After the receiving unit 10 receives the second keep-alive detecting message, the attach request message is sent by the terminal to the core network device; and the receiving unit 10 receives the After the second keepalive detection message, if the receiving unit 10 receives the attach request message sent by the core network device, it is determined that the terminal receives the second keep-alive detection at the receiving unit 10 The message has been restarted afterwards.
  • the determining unit 11 includes a receiving module 110 and a determining module 111.
  • the determining unit 11 determines that the terminal does not restart or has been restarted after the receiving unit 10 receives the second keep-alive detecting message, and includes:
  • the receiving module 110 is configured to receive, after the receiving unit 10 receives the second keep-alive detecting message, an RRC connection request message sent by the terminal, where the RRC connection request message carries a re-establishment cause;
  • the determining module 111 is configured to: if the re-establishment cause received by the receiving module 110 indicates that the RRC connection request message is not triggered by the terminal restarting, determine that the terminal receives at the receiving unit 10 Not restarting after the second keep-alive detection message; if the re-establishment reason received by the receiving module 110 indicates that the RRC connection request message is triggered by the terminal restarting, determining the terminal After the receiving unit 10 receives the second keep-alive probe message, it has been restarted.
  • the determining unit 11 is further configured to receive the service at the receiving unit 10 After the data packet sent by the server, the data packet received by the receiving unit 10 is determined to be a service data packet; the sending unit 13 is further configured to send the service data packet received by the receiving unit 10 The text is sent to the terminal.
  • the network device is a base station or a core network device.
  • the network device in this embodiment may correspond to the network device in the method for processing the keep-alive detection message in the foregoing embodiment of FIG. 2 or FIG. 4, and the modules in the network device in this embodiment
  • the division and/or function are all for the implementation of the method flow shown in FIG. 2 or FIG. 4, and for brevity, no further details are provided herein.
  • the network device provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal receives the data packet on the network device After the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet) is not restarted, the network device can directly generate a probe response packet according to the first keep-alive probe packet, and then And sending the probe response packet to the server, that is, the method for processing the keep-alive detection packet provided by the embodiment of the present invention, whether the terminal receives the second keep-alive detection packet on the network device, whether the terminal is in the connected state or the idle state.
  • the network device proxy terminal responds to the server with the probe response packet in response to the keep-alive detection packet, thereby saving network equipment and Air interface resources between terminals.
  • an embodiment of the present invention provides a network device, which may include a processor 20, an interface circuit 21, a memory 22, and a system bus 23.
  • the memory 22 is configured to store computer execution instructions, the processor 20, the interface circuit 21 and the memory 22 are connected to each other through the system bus 23, and when the network device is running, the processor 20 executes The computer stored by the memory 22 executes an instruction to cause the network device to perform a method of processing a keep-alive probe message as shown in FIG. 2 or FIG.
  • the computer stored by the memory 22 executes an instruction to cause the network device to perform a method of processing a keep-alive probe message as shown in FIG. 2 or FIG.
  • FIG. 2 or FIG. 4 For a specific method for processing the keep-alive detection packet, refer to the related description in the foregoing embodiment shown in FIG. 2 or FIG. 4, and details are not described herein again.
  • the embodiment further provides a storage medium, which may include the storage Device 22.
  • the processor 20 can be a central processing unit (English: central processing unit, abbreviation: CPU).
  • the processor 20 can also be other general-purpose processors, digital signal processing (DSP), application specific integrated circuit (ASIC), field programmable gate array (English) : field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSP digital signal processing
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the processor 20 may be a dedicated processor, which may include at least one of a baseband processing chip, a radio frequency processing chip, and the like. Further, the dedicated processor may also include a chip having other dedicated processing functions of the network device.
  • the memory 22 may include a volatile memory (English: volatile memory) (English: random-access memory, abbreviation: RAM); the memory 22 may also include a non-volatile memory (English: Non-volatile memory, such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English) : solid-state drive, abbreviated: SSD); the memory 22 may also include a combination of the above types of memories.
  • ROM read-only memory
  • flash memory English: flash memory
  • HDD hard disk drive
  • SSD solid state drive
  • the system bus 23 can include a data bus, a power bus, a control bus, a signal status bus, and the like. For the sake of clarity in the present embodiment, various buses are illustrated as the system bus 23 in FIG.
  • the interface circuit 21 may specifically be a transceiver on a network device.
  • the transceiver can be a wireless transceiver.
  • the wireless transceiver can be an antenna of a network device or the like.
  • the processor 20 performs data transmission and reception with the other device, such as the terminal, through the interface circuit 21.
  • each step in the method flow shown in FIG. 2 or FIG. 4 can be implemented by the processor 20 in hardware form executing a computer-executed instruction in the form of software stored in the memory 22. To avoid repetition, we will not repeat them here.
  • the network device is a base station or a core network device.
  • the network device provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal receives the data packet on the network device After the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet) is not restarted, the network device can directly generate a probe response packet according to the first keep-alive probe packet, and then And sending the probe response packet to the server, that is, the method for processing the keep-alive detection packet provided by the embodiment of the present invention, whether the terminal receives the second keep-alive detection packet on the network device, whether the terminal is in the connected state or the idle state.
  • the network device proxy terminal responds to the server with the probe response packet in response to the keep-alive detection packet, thereby saving network equipment and Air interface resources between terminals.
  • the embodiment of the present invention provides a communication system, which may include the network device shown in FIG. 5 or FIG. 6 above; or the communication system may include the network device shown in FIG. 7 above.
  • a communication system which may include the network device shown in FIG. 5 or FIG. 6 above; or the communication system may include the network device shown in FIG. 7 above.
  • the communication system of the embodiment of the present invention may be a communication system as shown in FIG. 1.
  • the communication system may include a terminal, a base station, and a server.
  • the network device provided by the embodiment of the present invention may be a base station in the communication system as shown in FIG. 1 or a core network device (the network device is a base station in FIG. 1 and the core network device is not shown). It can be determined according to the actual application scenario, which is not limited by the embodiment of the present invention.
  • the embodiment of the present invention provides a communication system, where the communication system includes a network device, and if the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, After the network device does not restart after receiving the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device may directly report the first keep-alive probe according to the first keep-alive probe packet.
  • the method for processing the keep-alive detection packet provided by the embodiment, whether the terminal is in the connected state or the idle state, if the terminal does not restart after the network device receives the second keep-alive detection packet, the network device does not need to be protected again.
  • the live detection packet is sent to the terminal, and the network device proxy terminal returns a probe response message in response to the keep-alive detection packet to the server, thereby saving air interface resources between the network device and the terminal.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

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

Abstract

Embodiments of the present invention provide a method, apparatus and system for processing a keepalive probe packet, which relate to the field of communications and can save air-interface resources. The method comprises: a network device receives a data packet sent by a server; the network device determines the data packet as a first keepalive probe packet; the network device generates a probe response packet according to the first keepalive probe packet if the network device determines that a terminal is not restarted after the network device receives a second keepalive probe packet, wherein the second keepalive probe packet is a keepalive probe packet previous to the first keepalive probe packet; send the probe response packet to the server.

Description

一种处理保活探测报文的方法、装置及系统Method, device and system for processing keep-alive detection message 技术领域Technical field
本发明涉及通信领域,尤其涉及一种处理保活探测报文的方法、装置及系统。The present invention relates to the field of communications, and in particular, to a method, device, and system for processing keep-alive detection messages.
背景技术Background technique
随着通信技术的不断发展,终端能够支持的客户端的数量越来越多。当服务器需与和其对应的客户端进行通信时,服务器首先需获知该客户端是否处于在线状态。With the continuous development of communication technologies, the number of clients that terminals can support is increasing. When the server needs to communicate with its corresponding client, the server first needs to know whether the client is online.
通常,服务器可以通过向运行客户端的终端发送保活探测报文(也称心跳包)的方式判断该客户端是否处于在线状态。具体的,服务器将保活探测报文发送给移动管理实体(英文:mobile managenment entity,缩写:MME),由MME将该保活探测报文发送给服务通用分组无线服务技术支持节点(英文:serving general packet radio service support node,缩写:SGSN),如果SGSN检测该终端处于空闲态(英文:idle),则SGSN把该保活探测报文发送给寻呼控制器,由寻呼控制器寻呼该终端,使得该终端从空闲态转移到连接态(英文:connect)后其再将该保活探测报文发送给该终端响应。如果SGSN检测该终端处于连接态,则SGSN可直接将该保活探测报文发送给该终端响应。Generally, the server can determine whether the client is online by sending a keep-alive probe packet (also called a heartbeat packet) to the terminal running the client. Specifically, the server sends the keep-alive detection packet to the mobile management entity (English: mobile managementnment entity, abbreviation: MME), and the MME sends the keep-alive detection packet to the serving general packet radio service technical support node (English: serving The general packet radio service support node (abbreviation: SGSN), if the SGSN detects that the terminal is in an idle state (English: idle), the SGSN sends the keep-alive detection message to the paging controller, and the paging controller pages the The terminal, after the terminal is transferred from the idle state to the connected state (English: connect), sends the keep-alive probe message to the terminal response. If the SGSN detects that the terminal is in the connected state, the SGSN may directly send the keep-alive probe message to the terminal to respond.
然而,在上述检测客户端是否处于在线状态的过程中,由于SGSN会直接将保活探测报文发送给终端响应,因此该保活探测报文需要占用空口资源,尤其是终端上安装有多个客户端时,随着保活探测报文数量的增多,空口资源会被大量的占用。However, in the process of detecting whether the client is in the online state, the SGSN directly sends the keep-alive detection packet to the terminal, so the keep-alive detection packet needs to occupy the air interface resource, in particular, multiple terminals are installed on the terminal. On the client side, as the number of keep-alive probes increases, the air interface resources are occupied in large quantities.
发明内容Summary of the invention
本发明的实施例提供一种处理保活探测报文的方法、装置及系统,能够节省空口资源。Embodiments of the present invention provide a method, an apparatus, and a system for processing keep-alive detection messages, which can save air interface resources.
为达到上述目的,本发明的实施例采用如下技术方案: In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:
第一方面,本发明实施例提供一种处理保活探测报文的方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for processing a keep-alive detection message, where the method includes:
网络设备接收服务器发送的数据报文;The network device receives the data packet sent by the server;
所述网络设备确定所述数据报文为第一保活探测报文;Determining, by the network device, that the data packet is a first keep alive detection packet;
若所述网络设备确定终端在所述网络设备接收到第二保活探测报文之后没有重新启动,则所述网络设备根据所述第一保活探测报文生成探测响应报文,所述第二保活探测报文为所述第一保活探测报文的前一个保活探测报文;If the network device determines that the terminal does not restart after receiving the second keep-alive detection message, the network device generates a probe response message according to the first keep-alive detection message, where the The second keep-alive detection packet is the previous keep-alive detection packet of the first keep-alive detection packet;
所述网络设备将所述探测响应报文发送给所述服务器。The network device sends the probe response message to the server.
本发明实施例提供的处理保活探测报文的方法,当网络设备接收到服务器发送的数据报文,且网络设备确定该数据报文为第一保活探测报文之后,如果终端在网络设备接收到第二保活探测报文(即第一保活探测报文的前一个保活探测报文)之后没有重新启动,则网络设备可直接根据第一保活探测报文生成探测响应报文,然后再将该探测响应报文发送给服务器,即本发明实施例提供的处理保活探测报文的方法,无论终端处于连接态还是空闲态,如果终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备均无需再将保活探测报文发送给终端,而是由网络设备代理终端向服务器回复响应该保活探测报文的探测响应报文,从而节省网络设备与终端之间的空口资源。The method for processing the keep-alive detection packet provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal is in the network device After receiving the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device can directly generate the probe response packet according to the first keep-alive probe packet. And then sending the probe response message to the server, that is, the method for processing the keep-alive detection message provided by the embodiment of the present invention, whether the terminal is in the connected state or the idle state, if the terminal receives the second keep-alive detection on the network device After the packet is not restarted, the network device does not need to send the keep-alive detection packet to the terminal, but the network device proxy terminal replies to the server with the probe response packet in response to the keep-alive detection packet, thereby saving the network device. Air interface resources with the terminal.
进一步地,在实际应用中,当终端重新启动之后,终端与服务器之间原来建立的连接可能会无效,此时服务器可能会认为终端已经与服务器之间断开连接了。基于这种情况,本发明实施例提供的保活探测报文的处理方法中,网络设备还需要确定在其接收到第二保活探测报文之后终端是否重新启动过,如果终端没有重新启动过,则说明终端与服务器之间一直保持连接状态,即终端上运行的客户端一直处于在线状态,从而为了节省网络设备与终端之间的空口开销,可由网络设备直接根据其接收到的第一保活探测报文生成探测响应报文。如此,还能使得网络设备更加准确地代理终端向服务器 回复响应该保活探测报文的探测响应报文。Further, in an actual application, after the terminal is restarted, the originally established connection between the terminal and the server may be invalid, and the server may consider that the terminal has been disconnected from the server. Based on the situation, in the method for processing the keep-alive detection packet provided by the embodiment of the present invention, the network device needs to determine whether the terminal is restarted after receiving the second keep-alive detection packet, if the terminal has not been restarted. , the terminal and the server are always connected, that is, the client running on the terminal is always online, so that in order to save the air interface overhead between the network device and the terminal, the network device can directly receive the first security according to the The live probe packet generates a probe response packet. In this way, it also enables the network device to more accurately proxy the terminal to the server. Responding to the probe response message of the keep-alive probe message.
可选的,所述方法还包括:Optionally, the method further includes:
若所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动,则所述网络设备将所述第一保活探测报文发送给所述终端。If the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection packet, the network device sends the first keep-alive detection packet to the terminal .
本发明实施例中,如果网络设备确定终端在网络设备接收到第二保活探测报文之后已经重新启动过,则网络设备可认为终端与网络设备之间的连接已经发生变化,即在终端重新启动之前,终端与网络设备之间建立的连接已经为无效连接,所以这种情况下,网络设备不能代理终端向服务器回复响应第一保活探测报文的探测响应报文,而是由网络设备将该第一保活探测报文发送给终端,由终端向服务器回复响应该第一保活探测报文的探测响应报文。如此,能够保证服务器准确地获知终端上运行的客户端所处的状态。In the embodiment of the present invention, if the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection message, the network device may consider that the connection between the terminal and the network device has changed, that is, the terminal is re-established. Before the startup, the connection established between the terminal and the network device is an invalid connection. Therefore, in this case, the network device cannot reply to the probe response message of the first keep-alive detection packet to the server, but the network device The first keep-alive detection packet is sent to the terminal, and the terminal returns a probe response message in response to the first keep-alive detection packet to the server. In this way, it is possible to ensure that the server accurately knows the state of the client running on the terminal.
可选的,所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动或已经重新启动,可以通过下述任意一种可能的实现方式实现:Optionally, the network device determines that the terminal does not restart or has been restarted after the network device receives the second keep-alive detection packet, and may be implemented by any one of the following possible implementation manners:
一种可能的实现方式是:在所述网络设备接收到所述第二保活探测报文之后,所述网络设备接收所述终端发送的非接入层NAS消息;若所述NAS消息中没有携带附着请求消息,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动;若所述NAS消息中携带所述附着请求消息,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动。A possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a non-access stratum NAS message sent by the terminal; if the NAS message does not Carrying the attach request message, the network device determines that the terminal does not restart after the network device receives the second keep-alive probe message; if the NAS message carries the attach request message, the The network device determines that the terminal has been restarted after the network device receives the second keep-alive detection message.
另一种可能的实现方式是:在所述网络设备接收到所述第二保活探测报文之后,若所述网络设备没有接收到核心网设备发送的附着请求消息,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动,所述附着请求消息为所述终端发送给所述核心网设备的;在所述网络设备接收到所述第二保活探测报文之后,若所述网络设备接收到所述核心网设备发送的 所述附着请求消息,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动。Another possible implementation manner is: after the network device receives the second keep-alive detection message, if the network device does not receive the attach request message sent by the core network device, the network device determines The terminal does not restart after the network device receives the second keep-alive detection message, where the attach request message is sent by the terminal to the core network device; and the network device receives the After the second keep-alive probe message is received, if the network device receives the packet sent by the core network device And the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection message.
再一种可能的实现方式是:在所述网络设备接收到所述第二保活探测报文之后,所述网络设备接收所述终端发送的无线资源控制RRC连接请求消息,所述RRC连接请求消息中携带重建立原因;若所述重建立原因指示所述RRC连接请求消息不是由于所述终端重新启动触发的,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动;若所述重建立原因指示所述RRC连接请求消息是由于所述终端重新启动触发的,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动。A further possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a radio resource control RRC connection request message sent by the terminal, the RRC connection request The message carries a re-establishment cause; if the re-establishment cause indicates that the RRC connection request message is not triggered by the terminal restarting, the network device determines that the terminal receives the second at the network device After the keep-alive probe message is not restarted; if the re-establishment cause indicates that the RRC connection request message is triggered by the terminal restarting, the network device determines that the terminal receives the location on the network device The second keep-alive probe message has been restarted.
通过上述三种可能的实现方式中的任意一种可能的实现方式,网络设备可以确定终端在网络设备接收到第二保活探测报文之后是否已经重新启动(包括没有重新启动或已经重新启动)。如此,可以保证网络设备准确地获知终端是否已经重新启动的状态。The network device may determine whether the terminal has restarted after the network device receives the second keep-alive detection message (including no restart or has been restarted) by using any one of the foregoing possible implementation manners. . In this way, it is possible to ensure that the network device accurately knows whether the terminal has been restarted.
可选的,所述网络设备接收服务器发送的数据报文之后,所述方法还包括:Optionally, after the network device receives the data packet sent by the server, the method further includes:
所述网络设备确定所述数据报文为业务数据报文;Determining, by the network device, that the data packet is a service data packet;
所述网络设备将所述业务数据报文发送给所述终端。The network device sends the service data packet to the terminal.
本发明实施例中,如果网络设备确定其接收到的数据报文为业务数据报文,则网络设备可将该业务数据报文发送给终端,由终端对该业务数据报文进行处理,从而保证服务器向终端发送的业务数据报文终端能够正常接收到,进而完成服务器与终端之间的通信。In the embodiment of the present invention, if the network device determines that the data packet received by the network device is a service data packet, the network device may send the service data packet to the terminal, and the terminal processes the service data packet to ensure that the service data packet is processed by the terminal. The service data message terminal sent by the server to the terminal can be normally received, thereby completing communication between the server and the terminal.
第二方面,本发明实施例提供一种网络设备,所述网络设备包括:In a second aspect, an embodiment of the present invention provides a network device, where the network device includes:
接收单元,用于接收服务器发送的数据报文;a receiving unit, configured to receive a data packet sent by the server;
确定单元,用于确定所述接收单元接收的所述数据报文为第一保活探测报文;a determining unit, configured to determine that the data packet received by the receiving unit is a first keep alive detection packet;
生成单元,用于若所述确定单元确定终端在所述接收单元接收 到第二保活探测报文之后没有重新启动,则根据所述接收单元接收的所述第一保活探测报文生成探测响应报文,所述第二保活探测报文为所述第一保活探测报文的前一个保活探测报文;a generating unit, configured to: if the determining unit determines that the terminal receives at the receiving unit And after the second keep-alive detection packet is not restarted, generating a probe response packet according to the first keep-alive probe packet received by the receiving unit, where the second keep-alive probe packet is the first The previous keep-alive probe message of the keep-alive probe message;
发送单元,用于将所述生成单元生成的所述探测响应报文发送给所述服务器。And a sending unit, configured to send the probe response message generated by the generating unit to the server.
本发明实施例提供一种网络设备,当该网络设备接收到服务器发送的数据报文,且该网络设备确定该数据报文为第一保活探测报文之后,如果终端在该网络设备接收到第二保活探测报文(即第一保活探测报文的前一个保活探测报文)之后没有重新启动,则该网络设备可直接根据第一保活探测报文生成探测响应报文,然后再将该探测响应报文发送给服务器,即本发明实施例提供的处理保活探测报文的方法,无论终端处于连接态还是空闲态,如果终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备均无需再将保活探测报文发送给终端,而是由该网络设备代理终端向服务器回复响应该保活探测报文的探测响应报文,从而节省网络设备与终端之间的空口资源。The embodiment of the present invention provides a network device, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal receives the data packet on the network device, After the second keep-alive detection packet (that is, the previous keep-alive detection packet of the first keep-alive detection packet) is not restarted, the network device can directly generate a probe response packet according to the first keep-alive detection packet. Then, the probe response message is sent to the server, that is, the method for processing the keep-alive detection packet provided by the embodiment of the present invention, whether the terminal is in the connected state or the idle state, if the terminal receives the second keep-alive detection report on the network device After the file is not restarted, the network device does not need to send the keep-alive probe message to the terminal, but the network device proxy terminal returns a probe response message in response to the keep-alive probe message to the server, thereby saving network equipment. Air interface resources with the terminal.
可选的,所述发送单元,还用于若所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动,则将所述第一保活探测报文发送给所述终端。Optionally, the sending unit is further configured to: if the determining unit determines that the terminal has been restarted after the receiving unit receives the second keep-alive detecting message, the first keep-alive The probe message is sent to the terminal.
可选的,所述确定单元包括接收模块和确定模块,Optionally, the determining unit includes a receiving module and a determining module, where
所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:The determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, including:
所述接收模块,用于在所述接收单元接收到所述第二保活探测报文之后,接收所述终端发送的非接入层NAS消息;所述确定模块,用于若所述接收模块接收的所述NAS消息中没有携带附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动;若所述接收模块接收的所述NAS消息中携带所述附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动。 The receiving module is configured to: after the receiving unit receives the second keep-alive detecting message, receive a non-access stratum NAS message sent by the terminal; and the determining module is configured to: if the receiving module If the received NAS message does not carry the attach request message, it is determined that the terminal does not restart after receiving the second keep-alive probe message by the receiving unit; if the NAS message received by the receiving module And carrying the attach request message, determining that the terminal has been restarted after the receiving unit receives the second keep alive detection message.
可选的,所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:Optionally, the determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, and includes:
所述确定单元,用于在所述接收单元接收到所述第二保活探测报文之后,若所述接收单元没有接收到核心网设备发送的附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动,所述附着请求消息为所述终端发送给所述核心网设备的;在所述接收单元接收到所述第二保活探测报文之后,若所述接收单元接收到所述核心网设备发送的所述附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动。The determining unit is configured to: after the receiving unit receives the second keep-alive detecting message, if the receiving unit does not receive the attach request message sent by the core network device, determine that the terminal is in the Receiving, after receiving the second keep-alive detection message, the receiving unit does not restart, the attach request message is sent by the terminal to the core network device; and the second keep-alive detection is received by the receiving unit After the message, the receiving unit receives the attach request message sent by the core network device, and determines that the terminal has been restarted after the receiving unit receives the second keep-alive probe message.
可选的,所述确定单元包括接收模块和确定模块,Optionally, the determining unit includes a receiving module and a determining module, where
所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:The determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, including:
所述接收模块,用于在所述接收单元接收到所述第二保活探测报文之后,接收所述终端发送的无线资源控制RRC连接请求消息,所述RRC连接请求消息中携带重建立原因;所述确定模块,用于若所述接收模块接收的所述重建立原因指示所述RRC连接请求消息不是由于所述终端重新启动触发的,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动;若所述接收模块接收的所述重建立原因指示所述RRC连接请求消息是由于所述终端重新启动触发的,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动。The receiving module is configured to receive, after the receiving unit receives the second keep-alive detection message, a radio resource control RRC connection request message sent by the terminal, where the RRC connection request message carries a re-establishment cause The determining module, if the re-establishment cause received by the receiving module indicates that the RRC connection request message is not triggered by the terminal restarting, determining that the terminal receives the location at the receiving unit After the second keep-alive probe message is not restarted; if the re-establishment cause received by the receiving module indicates that the RRC connection request message is triggered by the terminal restarting, determining that the terminal is in the The receiving unit has restarted after receiving the second keep-alive detection message.
可选的,所述确定单元,还用于在所述接收单元接收服务器发送的数据报文之后,确定所述接收单元接收的所述数据报文为业务数据报文;所述发送单元,还用于将所述接收单元接收的所述业务数据报文发送给所述终端。Optionally, the determining unit is further configured to: after the receiving unit receives the data packet sent by the server, determining that the data packet received by the receiving unit is a service data packet; And sending the service data packet received by the receiving unit to the terminal.
可选的,所述网络设备为基站或核心网设备。Optionally, the network device is a base station or a core network device.
上述第二方面的各种可选方式带来的技术效果与上述第一方面中和其相对应的各种可选方式带来的技术效果相同,具体可参见上 述第一方面中对和其相对应的各种可选方式带来的技术效果的相关描述,此处不再赘述。The technical effects brought by the various optional manners of the foregoing second aspect are the same as those of the various alternatives in the first aspect and corresponding to the above, and may be specifically referred to The related descriptions of the technical effects brought by the various alternatives corresponding to the first aspect are not described herein again.
第三方面,本发明实施例提供一种网络设备,所述网络设备包括处理器、接口电路、存储器和系统总线;In a third aspect, an embodiment of the present invention provides a network device, where the network device includes a processor, an interface circuit, a memory, and a system bus.
所述存储器用于存储计算机执行指令,所述处理器、所述接口电路和所述存储器通过所述系统总线相互连接,当所述网络设备运行时,所述处理器执行所述存储器存储的所述计算机执行指令,以使所述网络设备执行如上述第一方面或第一方面的任意一种可选方式所述的处理保活探测报文的方法。The memory is configured to store computer execution instructions, the processor, the interface circuit, and the memory are connected to each other through the system bus, and when the network device is running, the processor executes the memory storage The computer executes the instructions to cause the network device to perform the method of processing the keep-alive detection message as described in the first aspect or the optional aspect of the first aspect.
第四方面,本发明实施例提供一种通信系统,所述通信系统包括如上述第二方面或第二方面的任意一种可选方式所述的网络设备;或者包括上述第三方面所述的网络设备。In a fourth aspect, the embodiment of the present invention provides a communication system, where the communication system includes the network device according to any one of the foregoing second aspect or the second aspect, or Internet equipment.
本发明实施例提供一种网络设备和通信系统,该通信系统中包括该网络设备,当该网络设备接收到服务器发送的数据报文,且该网络设备确定该数据报文为第一保活探测报文之后,如果终端在该网络设备接收到第二保活探测报文(即第一保活探测报文的前一个保活探测报文)之后没有重新启动,则该网络设备可直接根据第一保活探测报文生成探测响应报文,然后再将该探测响应报文发送给服务器,即本发明实施例提供的处理保活探测报文的方法,无论终端处于连接态还是空闲态,如果终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备均无需再将保活探测报文发送给终端,而是由该网络设备代理终端向服务器回复响应该保活探测报文的探测响应报文,从而节省网络设备与终端之间的空口资源。The embodiment of the present invention provides a network device and a communication system, where the network system includes the network device, and when the network device receives the data packet sent by the server, the network device determines that the data packet is the first keep-alive detection. After the packet is not restarted after the network device receives the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device can directly A keep-alive probe packet generates a probe response packet, and then sends the probe response packet to the server, that is, the method for processing the keep-alive probe packet provided by the embodiment of the present invention, whether the terminal is in a connected state or an idle state, if After the network device does not restart after receiving the second keep-alive detection packet, the network device does not need to send the keep-alive detection packet to the terminal, but the network device proxy terminal responds to the server with the keep-alive detection. The packet is detected by the response packet, thereby saving air interface resources between the network device and the terminal.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is some embodiments of the invention.
图1为本发明实施例提供的通信系统的架构示意图;1 is a schematic structural diagram of a communication system according to an embodiment of the present invention;
图2为本发明实施例提供的处理保活探测报文的方法示意图 一;FIG. 2 is a schematic diagram of a method for processing keep-alive detection packets according to an embodiment of the present invention; One;
图3为本发明实施例提供的数据报文的格式示意图;FIG. 3 is a schematic diagram of a format of a data packet according to an embodiment of the present disclosure;
图4为本发明实施例提供的处理保活探测报文的方法示意图二;4 is a second schematic diagram of a method for processing keep-alive detection packets according to an embodiment of the present invention;
图5为本发明实施例提供的网络设备的结构示意图一;FIG. 5 is a schematic structural diagram 1 of a network device according to an embodiment of the present disclosure;
图6为本发明实施例提供的网络设备的结构示意图二;FIG. 6 is a schematic structural diagram 2 of a network device according to an embodiment of the present disclosure;
图7为本发明实施例提供的网络设备的硬件示意图。FIG. 7 is a schematic diagram of hardware of a network device according to an embodiment of the present invention.
具体实施方式detailed description
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本文中字符“/”,一般表示前后关联对象是一种“或者”的关系。例如,A/B可以理解为A或者B。The term "and/or" in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and / or B, which may indicate that A exists separately, and both A and B exist, respectively. B these three situations. The character "/" in this article generally indicates that the contextual object is an "or" relationship. For example, A/B can be understood as A or B.
本发明的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一保活探测报文和第二保活探测报文等是用于区别不同的保活探测报文,而不是用于描述保活探测报文的特征顺序。The terms "first" and "second" and the like in the specification and claims of the present invention are used to distinguish different objects, and are not intended to describe a particular order of the objects. For example, the first keep-alive detection message and the second keep-alive detection message are used to distinguish different keep-alive detection messages, instead of describing the feature sequence of the keep-alive detection message.
在本发明的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个客户端是指两个或两个以上的客户端;多个核心网是指两个或两个以上的核心网等。In the description of the present invention, the meaning of "a plurality" means two or more unless otherwise indicated. For example, multiple clients refer to two or more clients; multiple core networks refer to two or more core networks and the like.
此外,本发明的描述中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括其他没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。Furthermore, the terms "comprises" and "comprising" and variations of the invention, as used in the description of the invention, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units is not limited to the listed steps or units, but optionally includes other steps or units not listed, or alternatively Other steps or units inherent to these processes, methods, products or devices are included.
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、接口、技术之类的具体细节,以便透切理解本发明。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中 也可以实现本发明。在其它情况中,省略对众所周知的装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, for purposes of illustration and description However, it will be apparent to those skilled in the art, in other embodiments without these specific details. The invention can also be implemented. In other instances, detailed descriptions of well-known devices, circuits, and methods are omitted so as not to obscure the description of the invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments.
本发明实施例提供的一种处理保活探测报文的方法可以应用于通信系统中,该通信系统可以为采用第二代移动通信技术的网络(简称2G网络)、采用第三代移动通信技术的网络(简称3G网络)、采用第四代移动通信技术的网络(简称4G网络)或采用第五代移动通信技术的网络(简称5G网络),本发明不作具体限定。A method for processing a keep-alive detection message according to an embodiment of the present invention may be applied to a communication system, where the communication system may be a second-generation mobile communication technology network (referred to as 2G network) and adopts a third-generation mobile communication technology. The network (referred to as 3G network), the network using the fourth generation mobile communication technology (referred to as 4G network) or the network using the fifth generation mobile communication technology (referred to as 5G network), the present invention is not specifically limited.
如图1所示,为本发明实施例提供的一种通信系统的架构示意图。在图1中,以网络设备是基站,终端是用户设备(英文:user equipment,缩写:UE),服务器是应用服务器为例进行示例性的说明。可选的,本发明实施例中的网络设备还可以是核心网设备等网络设备;终端还可以是其他类型的终端设备;服务器还可以是需与终端(即终端上运行的应用程序)进行通信的其他服务器。FIG. 1 is a schematic structural diagram of a communication system according to an embodiment of the present invention. In FIG. 1 , an example is described in which the network device is a base station, the terminal is a user equipment (English: user equipment, abbreviated as UE), and the server is an application server. Optionally, the network device in the embodiment of the present invention may also be a network device such as a core network device; the terminal may also be another type of terminal device; the server may also need to communicate with the terminal (ie, an application running on the terminal). Other servers.
具体的,终端是指向用户提供语音和/或数据连通性的设备(device),包括无线终端或有线终端。无线终端可以是具有无线连接功能的手持式设备、或连接到无线调制解调器的其他处理设备,经无线接入网与一个或多个核心网进行通信的移动终端。例如,无线终端可以是移动电话(或称为“蜂窝”电话)和具有移动终端的计算机。又如,无线终端也可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置。再如,无线终端可以为移动站(英文为:mobile station)、接入点(英文为:access point)或UE的一部分。具体的可根据实际应用场景确定,本发明实施例不作具体限定。Specifically, the terminal is a device that provides voice and/or data connectivity to the user, including a wireless terminal or a wired terminal. The wireless terminal can be a handheld device with wireless connectivity, or other processing device connected to a wireless modem, and a mobile terminal that communicates with one or more core networks via a wireless access network. For example, the wireless terminal can be a mobile phone (or "cellular" phone) and a computer with a mobile terminal. As another example, the wireless terminal can also be a portable, pocket, handheld, computer built-in or in-vehicle mobile device. For another example, the wireless terminal can be a mobile station (mobile station), an access point (English: access point), or a part of the UE. The specifics may be determined according to the actual application scenario, and are not specifically limited in the embodiment of the present invention.
基于如图1所示的通信系统,当应用服务器需与和其对应的客户端进行通信(例如,应用服务器需向该客户端,即应用程序发送数据)时,应用服务器首先需要获知该客户端是否处于在线状态,通常应用服务器可以通过向运行有该客户端的终端发送保活探测报 文(也称心跳包)的方式判断该客户端是否处于在线状态。当应用服务器向终端发送保活探测报文时,网络中的SGSN会将该保活探测报文发送给终端,由终端响应该保活探测报文,如果客户端处于在线状态,终端响应该保活探测报文之后,再经SGSN向应用服务器回复对该保活探测报文的探测响应报文,从而应用服务器在接收到该探测响应报文后可获知该客户端处于在线状态,此时,如果应用服务器需与该客户端进行通信,那么应用服务器可直接向该客户端发送数据。如果客户端处于离线状态,则终端就不会向服务器回复对该保活探测报文的探测响应报文,这样在预设时间后若服务器没有接收到终端回复的探测响应报文,则服务器可获知该客户端处于离线状态。Based on the communication system shown in FIG. 1, when the application server needs to communicate with its corresponding client (for example, the application server needs to send data to the client, ie, the application), the application server first needs to know the client. Whether it is online, usually the application server can send a keep-alive probe to the terminal running the client. The text (also known as the heartbeat packet) determines whether the client is online. When the application server sends the keep-alive detection packet to the terminal, the SGSN in the network sends the keep-alive detection packet to the terminal, and the terminal responds to the keep-alive detection packet. If the client is online, the terminal responds to the protection. After the packet is detected, the SGSN replies to the application server with the probe response packet of the keep-alive probe packet, so that the application server can learn that the client is online after receiving the probe response packet. If the application server needs to communicate with the client, the application server can send data directly to the client. If the client is offline, the terminal will not reply to the server with a probe response packet for the keep-alive probe packet, so that if the server does not receive the probe response packet replied by the terminal after the preset time, the server may Know that the client is offline.
然而,由于SGSN需将保活探测报文发送给终端响应,尤其是当终端处于连接态时,可认为终端上运行的客户端与和其对应的应用服务器之间保持连接状态,即客户端处于在线状态,因此如果在终端处于连接态时,SGSN仍然将保活探测报文发送给终端,由终端回复对该保活探测报文的探测响应报文,那么就会导致SGSN与终端之间的空口资源被占用,尤其是当客户端的数量越来越多时,空口资源会被大量的占用。However, since the SGSN needs to send the keep-alive probe message to the terminal response, especially when the terminal is in the connected state, it can be considered that the client running on the terminal maintains a connection state with the corresponding application server, that is, the client is in the connection state. The online status, so if the SGSN still sends the keep-alive probe message to the terminal when the terminal is in the connected state, and the terminal replies with the probe response message to the keep-alive probe message, the SGSN and the terminal are Air interface resources are occupied, especially when the number of clients is increasing, the air interface resources will be occupied a lot.
为了节省空口资源,基于本发明实施例提供的通信系统(例如如图1所示的通信系统),本发明实施例提供一种处理保活探测报文的方法,如图2所示,该方法可以包括:In order to save the air interface resources, the communication system provided by the embodiment of the present invention (for example, the communication system shown in FIG. 1), the embodiment of the present invention provides a method for processing a keep-alive detection message, as shown in FIG. Can include:
S101、服务器向网络设备发送数据报文。S101. The server sends a data packet to the network device.
S102、网络设备接收服务器发送的数据报文。S102. The network device receives a data packet sent by the server.
本发明实施例中,服务器向网络设备发送的数据报文也可以称为下行数据报文,该下行数据报文可以为保活探测报文(或者称为下行保活探测报文),也可以为业务数据报文(或者称为下行业务数据报文)。In the embodiment of the present invention, the data packet sent by the server to the network device may also be referred to as a downlink data packet, and the downlink data packet may be a keep-alive detection packet (or a downlink keep-alive detection packet), or It is a service data packet (or a downlink service data packet).
可选的,本发明实施例提供的网络设备可以为基站,也可以为核心网设备。当网络设备为基站时,服务器可向核心网设备发送数 据报文,由核心网设备将该数据报文转发给基站;当网络设备为核心网设备时,服务器可直接向该核心网设备发送数据报文。Optionally, the network device provided by the embodiment of the present invention may be a base station or a core network device. When the network device is a base station, the server can send the number to the core network device. According to the packet, the core network device forwards the data packet to the base station; when the network device is the core network device, the server can directly send the data packet to the core network device.
S103、网络设备确定该数据报文为第一保活探测报文。S103. The network device determines that the data packet is the first keepalive detection packet.
本实施例中,网络设备确定该数据报文为保活探测报文,此处该保活探测报文也可以称为第一保活探测报文。In this embodiment, the network device determines that the data packet is a keep-alive probe packet, where the keep-alive probe packet may also be referred to as a first keep-alive probe packet.
可选的,本发明实施例中,网络设备确定数据报文为第一保活探测报文的方法具体可以为下述的(1)至(5):Optionally, in the embodiment of the present invention, the method for determining, by the network device, that the data packet is the first keepalive detection packet may be the following (1) to (5):
(1)网络设备确定该数据报文携带确认(英文:acknowledgement,缩写:ACK)的标志;(2)网络设备确定该数据报文为不带数据净荷的数据报文或者该数据报文为带1个字节为00的无效数据净荷的数据报文;(3)网络设备确定该数据报文的数据序号为下一个需要发送的业务数据报文的数据序号减1;(4)网络设备确定ACK设置为确认序号有效(例如,ACK设置为1表示确认序号有效);(5)网络设备确定该数据报文的确认序号设置为服务器下一个期望收到的确认序号。(1) The network device determines that the data packet carries an acknowledgement (English: acknowledgement, abbreviation: ACK); (2) the network device determines that the data packet is a data packet without a data payload or the data packet is a data message with an invalid data payload of 1 byte; (3) the network device determines that the data sequence number of the data packet is the data sequence number of the next service data packet to be transmitted minus 1; (4) network The device determines that the ACK is set to confirm that the sequence number is valid (for example, the ACK is set to 1 to indicate that the acknowledgment sequence number is valid); (5) the network device determines that the acknowledgment sequence number of the data message is set to the next acknowledgment sequence number that the server expects to receive.
其中,上述网络设备确定该数据报文的数据序号为下一个需要发送的业务数据报文的数据序号减1,可以理解为:The network device determines that the data sequence number of the data packet is the data sequence number of the next service data packet to be sent minus one, which can be understood as:
网络设备确定该数据报文的数据序号为前一个已经确认发送成功的字节数减1。具体的,网络设备可以通过检测之前发送的携带ACK标志的上行业务数据报文,确定该数据报文的数据序号为该上行业务数据报文的确认序号减1。The network device determines that the data sequence number of the data packet is the number of bytes that have been confirmed to be successfully transmitted minus one. Specifically, the network device may determine that the data sequence number of the data packet is the acknowledgement sequence number of the uplink service data packet minus one by detecting the uplink service data packet that carries the ACK flag.
需要说明的是,如果网络设备接收到的数据报文同时满足上述(1)至(5),则网络设备可确定该数据报文为保活探测报文(即第一保活探测报文);如果网络设备接收到的数据报文不满足上述(1)至(5)中的至少一项,则网络设备确定该数据报文不是保活探测报文。It should be noted that, if the data packet received by the network device meets the foregoing (1) to (5), the network device may determine that the data packet is a keep-alive detection packet (ie, the first keep-alive detection packet). If the data packet received by the network device does not satisfy at least one of the foregoing (1) to (5), the network device determines that the data packet is not a keep-alive probe message.
进一步地,为了更好地理解上述网络设备确定其接收到的数据报文为保活探测报文,下面再对数据报文的格式进行示例性的说明。Further, in order to better understand that the network device determines that the received data packet is a keep-alive probe packet, the format of the data packet is exemplarily described below.
本发明实施例中的数据报文可以为传输控制协议/因特网协议 (英文:transmission control protocol/Internet protocol,缩写:TCP/IP)数据报文,该TCP/IP数据报文的格式如图3所示。如图3所示的TCP/IP数据报文包括IP报头、TCP报头和数据净荷三部分。下面分别对这三部分中的各个字段进行示例性的介绍。The data packet in the embodiment of the present invention may be a transmission control protocol/Internet protocol. (English: transmission control protocol/Internet protocol, abbreviation: TCP/IP) data message, the format of the TCP/IP data message is shown in Figure 3. The TCP/IP data packet shown in FIG. 3 includes three parts: an IP header, a TCP header, and a data payload. The following is an example of each of the three fields.
IP报头:IP header:
版本:指当前的协议版本号。例如可以为4,即IPv4。Version: refers to the current protocol version number. For example, it can be 4, which is IPv4.
头长:指IP报头首部占用的32比特(英文:bit)字的数目。Head length: refers to the number of 32-bit (English: bit) words occupied by the IP header.
服务类型(type of service,缩写:TOS):由8bit组成,具体包括3bit的优先权子字段,4bit的TOS子字段和1bit未用比特位(必须置0);其中,4bit的TOS子字段分别代表最小时延、最大吞吐量、最高可靠性和最小费用。Type of service (TOS): consists of 8 bits, including the 3-bit priority subfield, the 4-bit TOS subfield and the 1-bit unused bit (which must be set to 0). The 4bit TOS subfields are respectively Represents minimum latency, maximum throughput, maximum reliability, and minimum cost.
总长度:指整个数据报文的长度。Total length: refers to the length of the entire data packet.
标识:唯一地标识主机(即发送端,本发明实施例中为服务器)发送的每一份数据报文。ID: Each data packet sent by the host (ie, the sender, which is a server in the embodiment of the present invention) is uniquely identified.
标志:由3bit组成,具体包括1bit未使用,1bit设置是否允许分段,1bit指示是否还有一分段,用于路由器对数据报文分段。Flag: It consists of 3 bits, including 1bit unused, 1bit setting whether to allow segmentation, and 1bit indicating whether there is still a segment for router to segment data packets.
段偏移量:指明此分段在当前数据报文中的位置。Segment Offset: Indicates the location of this segment in the current data message.
生存时间(英文:time to live,缩写:TTL):设置了数据报文可以经过的最多路由器数。Time to live (English: time to live, abbreviation: TTL): Sets the maximum number of routers that data packets can pass.
协议代码:指明此数据报文属于哪一种传输过程,如TCP或用户数据报协议(英文:user datagram protocol,缩写:UDP)等。Protocol code: Indicates which transmission process the data message belongs to, such as TCP or user datagram protocol (abbreviation: UDP).
头校验和:只校验报头,即根据报头其他域内容生成一个校验和。Header checksum: Only verifies the header, that is, generates a checksum based on the contents of other fields in the header.
源端地址和目的端地址:指明源端和目的端的网络编号与主机号,即源端IP地址和目的端IP地址。Source address and destination address: Indicates the network number and host number of the source and destination, that is, the source IP address and the destination IP address.
TCP报头:TCP header:
源端口号和目的端口号:用于寻找发送端和接收端的应用进程。这两个值加上IP报头中的源端IP地址和目的端IP地址唯一确定一个TCP连接。 Source port number and destination port number: used to find the application process of the sender and receiver. These two values plus the source IP address and the destination IP address in the IP header uniquely identify a TCP connection.
数据序号:代表TCP连接第一个字节所属序号。具体的,在建立一个新的TCP连接时,主机选择一个初始序号,发送的第一个字节序号为该初始序号加1。Data sequence number: represents the serial number of the first byte of the TCP connection. Specifically, when establishing a new TCP connection, the host selects an initial sequence number, and the first byte sequence number sent is the initial sequence number plus one.
确认序号:代表正确接收到对端发送的字节数的序号。Confirmation sequence number: indicates the serial number of the number of bytes sent correctly by the peer.
头长:指TCP报头首部占用的32bit字的数目。Head length: refers to the number of 32-bit words occupied by the header of the TCP header.
保留:指预留的字段。Reserved: Refers to the reserved field.
紧急位(英文:urgent,缩写:URG):代表是否紧急指针有效。使一端可以告诉另一端有些具有某种方式的紧急数据(比如用户键入中断键或者用户放弃一个文件的传输时的数据)已经放置在普通的数据流中。Emergency position (English: urgent, abbreviation: URG): Indicates whether the emergency pointer is valid. Let one end tell the other end that there is some kind of urgent data (such as the data when the user types the interrupt key or the user abandons the transfer of a file) has been placed in the normal data stream.
ACK:代表是否确认序号有效。ACK: Indicates whether the serial number is valid.
传输(英文:push,缩写:PSH):代表是否接收方应该尽快将这个报文传输到应用层。Transmission (English: push, abbreviation: PSH): Indicates whether the receiver should transmit this message to the application layer as soon as possible.
重置(英文:reset,缩写:RST):代表是否重新建立连接。Reset (English: reset, abbreviation: RST): Indicates whether to re-establish the connection.
建立联机(英文:synchronous,缩写:SYN):代表是否用来发起一个连接。Establish online (English: synchronous, abbreviation: SYN): Indicates whether to initiate a connection.
结束(英文:finish,缩写:FIN):代表是否发送端完成发送任务。End (English: finish, abbreviation: FIN): Indicates whether the sender completes the sending task.
窗口字段:TCP的流量控制通过每一端声明的窗口大小提供,这个值是接收端期望接收的字节。Window field: TCP's flow control is provided by the window size declared at each end. This value is the byte that the receiver expects to receive.
包校验和:对TCP首部和TCP数据进行校验。Packet checksum: Verify the TCP header and TCP data.
紧急指针:和数据序号字段中的值相加表示紧急数据最后一个字节的序号。Emergency Pointer: Adds the value in the Data Sequence Number field to indicate the sequence number of the last byte of the urgent data.
数据净荷:表示TCP/IP数据报文的净荷,即指该TCP/IP数据报文需要传输的数据。Data payload: Indicates the payload of a TCP/IP data packet, that is, the data that the TCP/IP data packet needs to transmit.
本发明实施例中,上述网络设备确定其接收到的数据报文为第一保活探测报文的方法中,涉及到的ACK、数据净荷、数据序号、确认序号以及对其进行的具体设置等均可参见上述对TCP/IP数据报文中的相应字段的相关描述,此处不再赘述。 In the embodiment of the present invention, the network device determines, in the method that the received data packet is the first keep alive detection packet, the ACK, the data payload, the data sequence number, the confirmation sequence number, and the specific settings thereof. For details, refer to the related description of the corresponding fields in the TCP/IP data packet, and details are not described here.
S104、若网络设备确定终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备根据第一保活探测报文生成探测响应报文。S104. If the network device determines that the terminal does not restart after receiving the second keep-alive detection packet, the network device generates a probe response packet according to the first keep-alive detection packet.
其中,上述第一保活探测报文和第二保活探测报文为网络设备连续两次接收到的保活探测报文,且第二保活探测报文为第一保活探测报文的前一个保活探测报文。即第二保活探测报文是网络设备在接收第一保活探测报文之前最近一次接收到的保活探测报文;具体的,网络设备先接收到第二保活探测报文,然后网络设备再接收到第一保活探测报文。The first keep-alive detection packet and the second keep-alive detection packet are the keep-alive detection packets received by the network device twice, and the second keep-alive detection packet is the first keep-alive detection packet. The previous keep-alive probe message. The second keep-alive detection packet is the keep-alive detection packet received by the network device before receiving the first keep-alive detection packet. Specifically, the network device first receives the second keep-alive detection packet, and then the network The device receives the first keep-alive detection packet again.
在实际应用中,当终端重新启动之后,终端与服务器之间原来建立的连接可能会无效,此时网络设备可能会认为终端已经与服务器之间断开连接了。基于这种情况,本发明实施例提供的保活探测报文的处理方法中,网络设备还需要确定在其接收到第二保活探测报文之后终端是否重新启动过,如果终端没有重新启动过,则说明终端与服务器之间一直保持连接状态,即终端上运行的客户端一直处于在线状态,从而为了节省网络设备与终端之间的空口开销,可由网络设备直接根据其接收到的第一保活探测报文生成探测响应报文。如此,还能使得网络设备更加准确地代理终端向服务器回复响应该保活探测报文的探测响应报文。In an actual application, after the terminal is restarted, the original established connection between the terminal and the server may be invalid. At this time, the network device may think that the terminal has been disconnected from the server. Based on the situation, in the method for processing the keep-alive detection packet provided by the embodiment of the present invention, the network device needs to determine whether the terminal is restarted after receiving the second keep-alive detection packet, if the terminal has not been restarted. , the terminal and the server are always connected, that is, the client running on the terminal is always online, so that in order to save the air interface overhead between the network device and the terminal, the network device can directly receive the first security according to the The live probe packet generates a probe response packet. In this way, the network device can also make the proxy device more accurately return the probe response message to the server in response to the keep-alive probe message.
可选的,本发明实施例提供的处理保活探测报文的方法中,探测响应报文的格式与保活探测报文的格式相同。即探测响应报文的格式也可以参见如图3所示的TCP/IP数据报文的格式。Optionally, in the method for processing the keep-alive detection packet, the format of the probe response packet is the same as the format of the keep-alive probe packet. That is, the format of the probe response packet can also be seen in the format of the TCP/IP data packet as shown in FIG.
可选的,网络设备根据第一保活探测报文生成探测响应报文的方法具体可以为:Optionally, the method for the network device to generate the probe response packet according to the first keepalive detection packet may be:
网络设备生成一个新的数据报文之后,将数据报文中的ACK设置为1(即指示本数据报文携带的确认序号有效);将数据报文中的确认序号设置为其接收到的第一保活探测报文中的数据序号加1后的值;将数据报文中的数据序号设置为其接收到的第一保活探测报文中的确认序号;对于该数据报文中的其他字段的设置,网络设备 可以按照其之前接收到的数据报文的字段的内容设置,或者网络设备可以通过计算来获取该数据报文中的某些字段的值,然后网络设备再将计算的结果设置到相应的字段中,如此网络设备可以生成响应第一保活探测报文的探测响应报文。After the network device generates a new data packet, the ACK in the data packet is set to 1 (that is, the acknowledgment sequence number carried in the data packet is valid); the acknowledgment sequence number in the data packet is set to be the received acknowledgment number. The value of the data sequence number in the keep-alive detection message is incremented by one; the data sequence number in the data message is set to the acknowledgement sequence number in the first keep-alive probe message received; for other data packets Field settings, network devices The network device may set the value of the field of the data packet received by the network device, or the network device may obtain the value of some field in the data packet, and then the network device sets the calculated result to the corresponding field. Thus, the network device can generate a probe response message in response to the first keep-alive probe message.
示例性的,除数据报文中的ACK、确认序号和数据序号外,该数据报文中的版本、服务类型、标志、生存时间、协议代码、源端地址、目的端地址、源端口号、目的端口号、保留以及窗口字段等可以由网络设备设置为与其在某个时间段内接收到的上行业务数据报文中相对应的字段的内容相同;该数据报文中的段偏移量和URG等可以由网络设备设置为0;该数据报文中的头长、总长度、头校验和以及包校验和等可以由网络设备根据这些字段的具体含义通过计算得到,然后网络设备再按照计算的结果对该数据报文中的头长、总长度、头校验和以及包校验和等进行设置;该数据报文中的URG、PSH、RST、SYN以及FIN可以由网络设备设置为0等。Except for the ACK, the acknowledgment sequence number and the data sequence number in the data packet, the version, service type, flag, lifetime, protocol code, source address, destination address, source port number, The destination port number, the reserved, the window field, and the like may be set by the network device to be the same as the content of the corresponding field in the uplink service data packet received within a certain period of time; the segment offset and the segment in the data packet The URG or the like may be set to 0 by the network device; the header length, the total length, the header checksum, and the packet checksum in the data packet may be calculated by the network device according to the specific meaning of the fields, and then the network device According to the calculation result, the header length, the total length, the header checksum, and the packet checksum in the data packet are set; the URG, PSH, RST, SYN, and FIN in the data packet can be set by the network device. It is 0 and so on.
需要说明的是,由于上述IP报头中的标识在每个IP报头中唯一,因此本发明实施例中,网络设备代理终端生成的探测响应报文中的标识可能会和终端生成的上行业务数据报文(即终端需发送给服务器的业务数据报文)中携带的标识相同,为了防止服务器接收到两个具有相同标识的数据报文,本发明实施例中,网络设备在生成探测响应报文时,可以生成一个和其上一次接收到的上行业务数据报文中的标识差别比较大的随机数,然后再将该随机数设置为该探测响应报文的标识。It should be noted that, because the identifier in the IP header is unique in each IP header, in the embodiment of the present invention, the identifier in the probe response packet generated by the network device proxy terminal may be related to the uplink service datagram generated by the terminal. In the embodiment of the present invention, when the network device generates the probe response packet, the identifier is the same as the identifier of the traffic data packet sent by the terminal to the server. The random number corresponding to the identifier in the uplink service data packet received by the last time is generated, and then the random number is set as the identifier of the probe response message.
具体的,本发明实施例中,网络设备生成一个和其上一次接收到的上行业务数据报文中的标识差别比较大的随机数可以通过下述任意方法实现:Specifically, in the embodiment of the present invention, the random number generated by the network device and the identifier of the uplink service data packet received by the network device is relatively large, and can be implemented by any of the following methods:
(1)网络设备生成一个随机数后,将该随机数与其上一次接收到的上行业务数据报文中的标识进行对比,如果两者差别比较大(例如两者差值的绝对值大于或等于一个预设阈值,该预设的阈值可以根据实际使用需求进行设置,本发明不作具体限定),则将该随机数 作为探测响应报文的标识;如果两者差别比较小(例如两者差值的绝对值小于上述预设阈值),则重新生成一个随机数,直至两者差别比较大时,将最后一次生成的随机数作为探测响应报文的标识。(1) After the network device generates a random number, compare the random number with the identifier in the uplink service data packet received last time, if the difference between the two is relatively large (for example, the absolute value of the difference is greater than or equal to a preset threshold, which may be set according to actual usage requirements, which is not specifically limited by the present invention, and the random number is As the identifier of the probe response message; if the difference between the two is relatively small (for example, the absolute value of the difference between the two is less than the preset threshold), a random number is regenerated, until the difference between the two is relatively large, the last generated The random number is used as the identifier of the probe response message.
(2)网络设备生成多个随机数,并在该多个随机数中确定与其上一次接收到的上行业务数据报文中的标识差别最大的一个随机数(例如多个随机数中与该标识的差值的绝对值最大的随机数),然后网络设备再将该随机数作为探测响应报文的标识。(2) The network device generates a plurality of random numbers, and determines, in the plurality of random numbers, a random number having the largest difference from the identifier in the uplink service data packet received last time (for example, the identifier is included in the plurality of random numbers) The absolute value of the difference is the largest random number), and then the network device uses the random number as the identifier of the probe response message.
当然,本发明实施例中,网络设备生成一个和其上一次接收到的上行业务数据报文中的标识差别比较大的随机数的方法包括但不限于上述(1)和(2),即网络设备生成一个和其上一次接收到的上行业务数据报文中的标识差别比较大的随机数还可以通过其他方式实现,本发明实施例不再赘述。Certainly, in the embodiment of the present invention, the method for the network device to generate a random number that is relatively different from the identifier of the uplink service data packet received last time includes, but is not limited to, the foregoing (1) and (2), that is, the network. The device generates a random number that is different from the identifier of the uplink service data packet that is received by the device, and can be implemented in other manners, which is not described in the embodiment of the present invention.
可选的,对于网络设备确定终端在网络设备接收到第二保活探测报文之后没有重新启动的方法将在下述实施例中进行详细说明,此处不再赘述。Optionally, the method for determining, by the network device, that the terminal does not restart after the network device receives the second keep alive detection packet is described in detail in the following embodiments, and details are not described herein again.
S105、网络设备将探测响应报文发送给服务器。S105. The network device sends a probe response message to the server.
S106、服务器接收到网络设备发送的探测响应报文。S106. The server receives the probe response packet sent by the network device.
网络设备根据第一保活探测报文生成探测响应报文之后,网络设备可将该探测响应报文发送给服务器,当服务器接收到该探测响应报文后,服务器可获知客户端处于在线状态。After the network device generates the probe response packet according to the first keep-alive probe packet, the network device may send the probe response packet to the server. After receiving the probe response packet, the server may learn that the client is online.
本发明实施例提供的处理保活探测报文的方法,当网络设备接收到服务器发送的数据报文,且网络设备确定该数据报文为第一保活探测报文之后,如果终端在网络设备接收到第二保活探测报文(即第一保活探测报文的前一个保活探测报文)之后没有重新启动,则网络设备可直接根据第一保活探测报文生成探测响应报文,然后再将该探测响应报文发送给服务器,即本发明实施例提供的处理保活探测报文的方法,无论终端处于连接态还是空闲态,如果终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备均无需再将保活探测报文发送给终端,而是由网络设备代理终端向服 务器回复响应该保活探测报文的探测响应报文,从而节省网络设备与终端之间的空口资源。The method for processing the keep-alive detection packet provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal is in the network device After receiving the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device can directly generate the probe response packet according to the first keep-alive probe packet. And then sending the probe response message to the server, that is, the method for processing the keep-alive detection message provided by the embodiment of the present invention, whether the terminal is in the connected state or the idle state, if the terminal receives the second keep-alive detection on the network device After the packet is not restarted, the network device does not need to send the keep-alive probe packet to the terminal, but the network device proxy terminal sends the service to the terminal. The server responds to the probe response packet of the keep-alive probe packet, thereby saving air interface resources between the network device and the terminal.
可选的,结合图2,如图4所示,本发明实施例提供的处理保活探测报文的方法还可以包括:Optionally, in conjunction with FIG. 2, as shown in FIG. 4, the method for processing the keep-alive detection packet provided by the embodiment of the present invention may further include:
S107、若网络设备确定终端在网络设备接收到第二保活探测报文之后已经重新启动,则网络设备将第一保活探测报文发送给终端。S107. If the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection packet, the network device sends the first keep-alive detection packet to the terminal.
S108、终端接收网络设备发送的第一保活探测报文。S108. The terminal receives the first keep-alive detection packet sent by the network device.
需要说明的是,本发明实施例中,上述S104-S106和S107-S108择一执行;即在执行完S101-S103之后,执行S104-S106或者执行S107-S108。为了表示S104-S106和S107-S108择一执行,图4中将S104-S106和S107-S108均以虚线示意。It should be noted that, in the embodiment of the present invention, the above-mentioned S104-S106 and S107-S108 are alternatively executed; that is, after S101-S103 is executed, S104-S106 is executed or S107-S108 is executed. In order to indicate that S104-S106 and S107-S108 are alternatively performed, S104-S106 and S107-S108 are both shown in broken lines in FIG.
可选的,本发明实施例提供的处理保活探测报文的方法还可以包括:Optionally, the method for processing the keep-alive detection packet provided by the embodiment of the present invention may further include:
S109、终端根据第一保活探测报文生成探测响应报文。S109. The terminal generates a probe response packet according to the first keepalive detection packet.
S110、终端向网络设备发送探测响应报文。S110. The terminal sends a probe response packet to the network device.
S111、网络设备接收终端发送的探测响应报文。S111. The network device receives the probe response packet sent by the terminal.
S112、网络设备向服务器发送探测响应报文。S112. The network device sends a probe response message to the server.
S113、服务器接收网络设备发送的探测响应报文。S113. The server receives a probe response packet sent by the network device.
需要说明的是,本发明实施例中,上述网络设备向终端发送第一保活探测报文之后,终端对第一保活探测报文的处理,即上述S109-S113与通常终端响应服务器发送的保活探测报文的方法类似,本发明实施例不再详述。It should be noted that, in the embodiment of the present invention, after the network device sends the first keep-alive detection packet to the terminal, the terminal processes the first keep-alive detection packet, that is, the foregoing S109-S113 and the normal terminal response server send the packet. The method for keeping the probe packet is similar, and is not described in detail in the embodiment of the present invention.
本发明实施例中,如果网络设备确定终端在网络设备接收到第二保活探测报文之后已经重新启动过,则网络设备可认为终端与服务器之间的连接已经发生变化,即在终端重新启动之前,终端与服务器之间建立的连接已经为无效连接,所以这种情况下,网络设备不能代理终端向服务器回复响应第一保活探测报文的探测响应报文,而是由网络设备将该第一保活探测报文发送给终端,由终端向服务器回复响应该第一保活探测报文的探测响应报文。如此,能够 保证服务器准确地获知终端上运行的客户端所处的状态。In the embodiment of the present invention, if the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection packet, the network device may consider that the connection between the terminal and the server has changed, that is, restart the terminal. The connection established between the terminal and the server is already an invalid connection. In this case, the network device cannot reply to the probe response packet of the first keep-alive probe message to the server, but the network device The first keep-alive detection message is sent to the terminal, and the terminal returns a probe response message in response to the first keep-alive detection message to the server. So, can Ensure that the server accurately knows the state of the client running on the terminal.
可选的,本发明实施例提供的处理保活探测报文的方法中,网络设备确定终端在网络设备接收到第二保活探测报文之后没有重新启动或已经重新启动,具体可以通过下述任意一种方法实现:Optionally, in the method for processing the keep-alive detection packet, the network device determines that the terminal does not restart or has been restarted after the network device receives the second keep-alive detection packet, which may be specifically described below. Any method to achieve:
一种可能的实现方式是,在网络设备接收到第二保活探测报文之后,网络设备接收终端发送的非接入层(英文:non-access stratum,缩写:NAS)消息;若该NAS消息中没有携带附着请求消息,则网络设备确定终端在网络设备接收到第二保活探测报文之后没有重新启动;若该NAS消息中携带附着请求消息,则网络设备确定终端在网络设备接收到第二保活探测报文之后已经重新启动。A possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a non-access stratum (English: non-access stratum, abbreviation: NAS) message sent by the terminal; if the NAS message If the network device does not carry the attach request message, the network device determines that the terminal does not restart after the network device receives the second keep-alive probe message; if the NAS message carries the attach request message, the network device determines that the terminal receives the first The second keep-alive probe message has been restarted.
另一种可能的实现方式是,在网络设备接收到第二保活探测报文之后,若网络设备没有接收到核心网设备发送的附着请求消息,则网络设备确定终端在网络设备接收到第二保活探测报文之后没有重新启动,该附着请求消息为终端发送给核心网设备的;在网络设备接收到第二保活探测报文之后,若网络设备接收到核心网设备发送的该附着请求消息,则网络设备确定终端在网络设备接收到第二保活探测报文之后已经重新启动。Another possible implementation manner is: after the network device receives the second keep-alive probe message, if the network device does not receive the attach request message sent by the core network device, the network device determines that the terminal receives the second device on the network device. After the keepalive detection packet is not restarted, the attach request message is sent by the terminal to the core network device; after the network device receives the second keep alive detection packet, if the network device receives the attach request sent by the core network device The message, the network device determines that the terminal has restarted after the network device receives the second keep alive detection message.
再一种可能的实现方式是,在网络设备接收到第二保活探测报文之后,网络设备接收终端发送的无线资源控制(英文:radio resource control,缩写:RRC)连接请求消息,该RRC连接请求消息中携带重建立原因;若该重建立原因指示该RRC连接请求消息不是由于终端重新启动触发的,则网络设备确定终端在网络设备接收到第二保活探测报文之后没有重新启动;若该重建立原因指示该RRC连接请求消息是由于终端重新启动触发的,则网络设备确定终端在网络设备接收到第二保活探测报文之后已经重新启动。A further possible implementation manner is: after the network device receives the second keep-alive detection message, the network device receives a radio resource control (English: radio resource control, abbreviation: RRC) connection request message sent by the terminal, where the RRC connection The request message carries the re-establishment cause; if the re-establishment cause indicates that the RRC connection request message is not triggered by the terminal restarting, the network device determines that the terminal does not restart after receiving the second keep-alive detection message by the network device; The re-establishment cause indicates that the RRC connection request message is triggered by the terminal restarting, and the network device determines that the terminal has restarted after the network device receives the second keep-alive detection message.
本领域技术人员可以理解,上述网络设备确定终端在网络设备接收到第二保活探测报文之后没有重新启动或已经重新启动中,网络设备接收到第二保活探测报文之后的时间段是指:网络设备接收到第二保活探测报文之后,且网络设备执行S104之前的时间段。 A person skilled in the art may understand that the foregoing network device determines that the terminal does not restart or has restarted after the network device receives the second keep-alive detection message, and the time period after the network device receives the second keep-alive detection message is The time period after the network device receives the second keep-alive probe message, and the network device performs S104.
可选的,本发明实施例提供的处理保活探测报文的方法中,当网络设备接收到服务器发送的数据报文之后,如果网络设备确定该数据报文为业务数据报文,则网络设备可将该业务数据报文发送给终端,由终端对该业务数据报文进行处理,从而保证服务器向终端发送的业务数据报文终端能够正常接收到,进而完成服务器与终端之间的通信。Optionally, in the method for processing the keep-alive detection packet, when the network device receives the data packet sent by the server, if the network device determines that the data packet is a service data packet, the network device The service data packet can be sent to the terminal, and the service data packet is processed by the terminal, so that the service data packet terminal sent by the server to the terminal can be normally received, thereby completing communication between the server and the terminal.
如图5所示,本发明实施例提供一种网络设备,所述网络设备用于执行以上实施例所述的方法中的网络设备所执行的步骤。所述网络设备可以包括相应步骤所对应的模块。示例性的,所述网络设备包括:As shown in FIG. 5, an embodiment of the present invention provides a network device, where the network device is configured to perform the steps performed by the network device in the method in the foregoing embodiment. The network device may include a module corresponding to the corresponding step. Exemplarily, the network device includes:
接收单元10,用于接收服务器发送的数据报文;确定单元11,用于确定所述接收单元10接收的所述数据报文为第一保活探测报文;生成单元12,用于若所述确定单元11确定终端在所述接收单元10接收到第二保活探测报文之后没有重新启动,则根据所述接收单元10接收的所述第一保活探测报文生成探测响应报文,所述第二保活探测报文为所述第一保活探测报文的前一个保活探测报文;发送单元13,用于将所述生成单元12生成的所述探测响应报文发送给所述服务器。The receiving unit 10 is configured to receive a data packet sent by the server, and the determining unit 11 is configured to determine that the data packet received by the receiving unit 10 is a first keep-alive detecting packet, and the generating unit 12 is configured to: The determining unit 11 determines that the terminal does not restart after the receiving unit 10 receives the second keep-alive detecting message, and generates a probe response message according to the first keep-alive detecting message received by the receiving unit 10, The second keep-alive detection packet is the previous keep-alive detection packet of the first keep-alive detection packet, and the sending unit 13 is configured to send the probe response packet generated by the generating unit 12 to The server.
可选的,所述发送单元13,还用于若所述确定单元11确定所述终端在所述接收单元10接收到所述第二保活探测报文之后已经重新启动,则将所述第一保活探测报文发送给所述终端。Optionally, the sending unit 13 is further configured to: if the determining unit 11 determines that the terminal has been restarted after the receiving unit 10 receives the second keep-alive detecting message, A keep-alive detection message is sent to the terminal.
可选的,结合图5,如图6所示,所述确定单元11包括接收模块110和确定模块111,Optionally, in conjunction with FIG. 5, as shown in FIG. 6, the determining unit 11 includes a receiving module 110 and a determining module 111.
所述确定单元11确定所述终端在所述接收单元10接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:The determining unit 11 determines that the terminal does not restart or has been restarted after the receiving unit 10 receives the second keep-alive detecting message, and includes:
所述接收模块110,用于在所述接收单元10接收到所述第二保活探测报文之后,接收所述终端发送的NAS消息;所述确定模块111,用于若所述接收模块110接收的所述NAS消息中没有携带附 着请求消息,则确定所述终端在所述接收单元10接收到所述第二保活探测报文之后没有重新启动;若所述接收模块110接收的所述NAS消息中携带所述附着请求消息,则确定所述终端在所述接收单元10接收到所述第二保活探测报文之后已经重新启动。The receiving module 110 is configured to receive the NAS message sent by the terminal after the receiving unit 10 receives the second keep-alive detecting message, and the determining module 111 is configured to: if the receiving module 110 The received NAS message does not carry The request message is determined, the terminal is not restarted after the receiving unit 10 receives the second keep-alive detection message; if the NAS message received by the receiving module 110 carries the attach request message And determining that the terminal has been restarted after the receiving unit 10 receives the second keep-alive detection message.
可选的,所述确定单元11确定所述终端在所述接收单元10接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:Optionally, the determining unit 11 determines that the terminal does not restart or has been restarted after the receiving unit 10 receives the second keep-alive detection message, and includes:
所述确定单元11,用于在所述接收单元10接收到所述第二保活探测报文之后,若所述接收单元10没有接收到核心网设备发送的附着请求消息,则确定所述终端在所述接收单元10接收到所述第二保活探测报文之后没有重新启动,所述附着请求消息为所述终端发送给所述核心网设备的;在所述接收单元10接收到所述第二保活探测报文之后,若所述接收单元10接收到所述核心网设备发送的所述附着请求消息,则确定所述终端在所述接收单元10接收到所述第二保活探测报文之后已经重新启动。The determining unit 11 is configured to: after the receiving unit 10 receives the second keep-alive detecting message, if the receiving unit 10 does not receive the attach request message sent by the core network device, determine the terminal After the receiving unit 10 receives the second keep-alive detecting message, the attach request message is sent by the terminal to the core network device; and the receiving unit 10 receives the After the second keepalive detection message, if the receiving unit 10 receives the attach request message sent by the core network device, it is determined that the terminal receives the second keep-alive detection at the receiving unit 10 The message has been restarted afterwards.
可选的,结合图5,如图6所示,所述确定单元11包括接收模块110和确定模块111,Optionally, in conjunction with FIG. 5, as shown in FIG. 6, the determining unit 11 includes a receiving module 110 and a determining module 111.
所述确定单元11确定所述终端在所述接收单元10接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:The determining unit 11 determines that the terminal does not restart or has been restarted after the receiving unit 10 receives the second keep-alive detecting message, and includes:
所述接收模块110,用于在所述接收单元10接收到所述第二保活探测报文之后,接收所述终端发送的RRC连接请求消息,所述RRC连接请求消息中携带重建立原因;所述确定模块111,用于若所述接收模块110接收的所述重建立原因指示所述RRC连接请求消息不是由于所述终端重新启动触发的,则确定所述终端在所述接收单元10接收到所述第二保活探测报文之后没有重新启动;若所述接收模块110接收的所述重建立原因指示所述RRC连接请求消息是由于所述终端重新启动触发的,则确定所述终端在所述接收单元10接收到所述第二保活探测报文之后已经重新启动。The receiving module 110 is configured to receive, after the receiving unit 10 receives the second keep-alive detecting message, an RRC connection request message sent by the terminal, where the RRC connection request message carries a re-establishment cause; The determining module 111 is configured to: if the re-establishment cause received by the receiving module 110 indicates that the RRC connection request message is not triggered by the terminal restarting, determine that the terminal receives at the receiving unit 10 Not restarting after the second keep-alive detection message; if the re-establishment reason received by the receiving module 110 indicates that the RRC connection request message is triggered by the terminal restarting, determining the terminal After the receiving unit 10 receives the second keep-alive probe message, it has been restarted.
可选的,所述确定单元11,还用于在所述接收单元10接收服 务器发送的数据报文之后,确定所述接收单元10接收的所述数据报文为业务数据报文;所述发送单元13,还用于将所述接收单元10接收的所述业务数据报文发送给所述终端。Optionally, the determining unit 11 is further configured to receive the service at the receiving unit 10 After the data packet sent by the server, the data packet received by the receiving unit 10 is determined to be a service data packet; the sending unit 13 is further configured to send the service data packet received by the receiving unit 10 The text is sent to the terminal.
可选的,本发明实施例中,所述网络设备为基站或核心网设备。Optionally, in the embodiment of the present invention, the network device is a base station or a core network device.
可以理解,本实施例的网络设备可对应于上述如图2或图4所述的实施例的处理保活探测报文的方法中的网络设备,并且本实施例的网络设备中的各个模块的划分和/或功能等均是为了实现如图2或图4所示的方法流程,为了简洁,在此不再赘述。It can be understood that the network device in this embodiment may correspond to the network device in the method for processing the keep-alive detection message in the foregoing embodiment of FIG. 2 or FIG. 4, and the modules in the network device in this embodiment The division and/or function are all for the implementation of the method flow shown in FIG. 2 or FIG. 4, and for brevity, no further details are provided herein.
本发明实施例提供的网络设备,当该网络设备接收到服务器发送的数据报文,且该网络设备确定该数据报文为第一保活探测报文之后,如果终端在该网络设备接收到第二保活探测报文(即第一保活探测报文的前一个保活探测报文)之后没有重新启动,则该网络设备可直接根据第一保活探测报文生成探测响应报文,然后再将该探测响应报文发送给服务器,即本发明实施例提供的处理保活探测报文的方法,无论终端处于连接态还是空闲态,如果终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备均无需再将保活探测报文发送给终端,而是由该网络设备代理终端向服务器回复响应该保活探测报文的探测响应报文,从而节省网络设备与终端之间的空口资源。The network device provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal receives the data packet on the network device After the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet) is not restarted, the network device can directly generate a probe response packet according to the first keep-alive probe packet, and then And sending the probe response packet to the server, that is, the method for processing the keep-alive detection packet provided by the embodiment of the present invention, whether the terminal receives the second keep-alive detection packet on the network device, whether the terminal is in the connected state or the idle state. After the network device does not need to restart, the network device does not need to send the keep-alive detection packet to the terminal, but the network device proxy terminal responds to the server with the probe response packet in response to the keep-alive detection packet, thereby saving network equipment and Air interface resources between terminals.
如图7所示,本发明实施例提供一种网络设备,该网络设备可以包括:处理器20、接口电路21、存储器22和系统总线23。As shown in FIG. 7, an embodiment of the present invention provides a network device, which may include a processor 20, an interface circuit 21, a memory 22, and a system bus 23.
所述存储器22用于存储计算机执行指令,所述处理器20、所述接口电路21和所述存储器22通过所述系统总线23相互连接,当所述网络设备运行时,所述处理器20执行所述存储器22存储的所述计算机执行指令,以使所述网络设备执行如图2或图4所示的处理保活探测报文的方法。具体的处理保活探测报文的方法可参见上述如图2或图4所示的实施例中的相关描述,此处不再赘述。The memory 22 is configured to store computer execution instructions, the processor 20, the interface circuit 21 and the memory 22 are connected to each other through the system bus 23, and when the network device is running, the processor 20 executes The computer stored by the memory 22 executes an instruction to cause the network device to perform a method of processing a keep-alive probe message as shown in FIG. 2 or FIG. For a specific method for processing the keep-alive detection packet, refer to the related description in the foregoing embodiment shown in FIG. 2 or FIG. 4, and details are not described herein again.
本实施例还提供一种存储介质,该存储介质可以包括所述存储 器22。The embodiment further provides a storage medium, which may include the storage Device 22.
所述处理器20可以为中央处理器(英文:central processing unit,缩写:CPU)。所述处理器20还可以为其他通用处理器、数字信号处理器(英文:digital signal processing,简称DSP)、专用集成电路(英文:application specific integrated circuit,简称ASIC)、现场可编程门阵列(英文:field-programmable gate array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 20 can be a central processing unit (English: central processing unit, abbreviation: CPU). The processor 20 can also be other general-purpose processors, digital signal processing (DSP), application specific integrated circuit (ASIC), field programmable gate array (English) : field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
所述处理器20可以为专用处理器,该专用处理器可以包括基带处理芯片、射频处理芯片等中的至少一个。进一步地,该专用处理器还可以包括具有网络设备其他专用处理功能的芯片。The processor 20 may be a dedicated processor, which may include at least one of a baseband processing chip, a radio frequency processing chip, and the like. Further, the dedicated processor may also include a chip having other dedicated processing functions of the network device.
所述存储器22可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);所述存储器22也可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);所述存储器22还可以包括上述种类的存储器的组合。The memory 22 may include a volatile memory (English: volatile memory) (English: random-access memory, abbreviation: RAM); the memory 22 may also include a non-volatile memory (English: Non-volatile memory, such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English) : solid-state drive, abbreviated: SSD); the memory 22 may also include a combination of the above types of memories.
所述系统总线23可以包括数据总线、电源总线、控制总线和信号状态总线等。本实施例中为了清楚说明,在图7中将各种总线都示意为系统总线23。The system bus 23 can include a data bus, a power bus, a control bus, a signal status bus, and the like. For the sake of clarity in the present embodiment, various buses are illustrated as the system bus 23 in FIG.
所述接口电路21具体可以是网络设备上的收发器。该收发器可以为无线收发器。例如,无线收发器可以是网络设备的天线等。所述处理器20通过所述接口电路21与其他设备,例如终端之间进行数据的收发。The interface circuit 21 may specifically be a transceiver on a network device. The transceiver can be a wireless transceiver. For example, the wireless transceiver can be an antenna of a network device or the like. The processor 20 performs data transmission and reception with the other device, such as the terminal, through the interface circuit 21.
在具体实现过程中,上述如图2或图4所示的方法流程中的各步骤均可以通过硬件形式的处理器20执行存储器22中存储的软件形式的计算机执行指令实现。为避免重复,此处不再赘述。 In a specific implementation process, each step in the method flow shown in FIG. 2 or FIG. 4 can be implemented by the processor 20 in hardware form executing a computer-executed instruction in the form of software stored in the memory 22. To avoid repetition, we will not repeat them here.
可选的,本发明实施例中,所述网络设备为基站或核心网设备。Optionally, in the embodiment of the present invention, the network device is a base station or a core network device.
本发明实施例提供的网络设备,当该网络设备接收到服务器发送的数据报文,且该网络设备确定该数据报文为第一保活探测报文之后,如果终端在该网络设备接收到第二保活探测报文(即第一保活探测报文的前一个保活探测报文)之后没有重新启动,则该网络设备可直接根据第一保活探测报文生成探测响应报文,然后再将该探测响应报文发送给服务器,即本发明实施例提供的处理保活探测报文的方法,无论终端处于连接态还是空闲态,如果终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备均无需再将保活探测报文发送给终端,而是由该网络设备代理终端向服务器回复响应该保活探测报文的探测响应报文,从而节省网络设备与终端之间的空口资源。The network device provided by the embodiment of the present invention, after the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, if the terminal receives the data packet on the network device After the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet) is not restarted, the network device can directly generate a probe response packet according to the first keep-alive probe packet, and then And sending the probe response packet to the server, that is, the method for processing the keep-alive detection packet provided by the embodiment of the present invention, whether the terminal receives the second keep-alive detection packet on the network device, whether the terminal is in the connected state or the idle state. After the network device does not need to restart, the network device does not need to send the keep-alive detection packet to the terminal, but the network device proxy terminal responds to the server with the probe response packet in response to the keep-alive detection packet, thereby saving network equipment and Air interface resources between terminals.
本发明实施例提供一种通信系统,该通信系统可以包括上述如图5或图6所示的网络设备;或者该通信系统可以包括上述如图7所示的网络设备。对于网络设备的具体描述可参见上述如图5、如图6或如图7所示的实施例中对网络设备的相关描述,此处不再赘述。The embodiment of the present invention provides a communication system, which may include the network device shown in FIG. 5 or FIG. 6 above; or the communication system may include the network device shown in FIG. 7 above. For a detailed description of the network device, refer to the related description of the network device in the foregoing embodiment shown in FIG. 5, FIG. 6 or FIG. 7, and details are not described herein again.
可选的,本发明实施例的通信系统可以为如图1所示的通信系统。该通信系统中可以包括终端、基站和服务器。本发明实施例提供的网络设备可以为如图1所示的通信系统中的基站,也可以为核心网设备(图1中以网络设备是基站为例,未示出核心网设备),具体的可以根据实际应用场景确定,本发明实施例对此不作限定。Optionally, the communication system of the embodiment of the present invention may be a communication system as shown in FIG. 1. The communication system may include a terminal, a base station, and a server. The network device provided by the embodiment of the present invention may be a base station in the communication system as shown in FIG. 1 or a core network device (the network device is a base station in FIG. 1 and the core network device is not shown). It can be determined according to the actual application scenario, which is not limited by the embodiment of the present invention.
本发明实施例提供一种通信系统,该通信系统包括网络设备,当该网络设备接收到服务器发送的数据报文,且该网络设备确定该数据报文为第一保活探测报文之后,如果终端在该网络设备接收到第二保活探测报文(即第一保活探测报文的前一个保活探测报文)之后没有重新启动,则该网络设备可直接根据第一保活探测报文生成探测响应报文,然后再将该探测响应报文发送给服务器,即本发 明实施例提供的处理保活探测报文的方法,无论终端处于连接态还是空闲态,如果终端在网络设备接收到第二保活探测报文之后没有重新启动,则网络设备均无需再将保活探测报文发送给终端,而是由该网络设备代理终端向服务器回复响应该保活探测报文的探测响应报文,从而节省网络设备与终端之间的空口资源。The embodiment of the present invention provides a communication system, where the communication system includes a network device, and if the network device receives the data packet sent by the server, and the network device determines that the data packet is the first keep-alive detection packet, After the network device does not restart after receiving the second keep-alive probe packet (that is, the previous keep-alive probe packet of the first keep-alive probe packet), the network device may directly report the first keep-alive probe according to the first keep-alive probe packet. Generate a probe response message, and then send the probe response message to the server, that is, the hair The method for processing the keep-alive detection packet provided by the embodiment, whether the terminal is in the connected state or the idle state, if the terminal does not restart after the network device receives the second keep-alive detection packet, the network device does not need to be protected again. The live detection packet is sent to the terminal, and the network device proxy terminal returns a probe response message in response to the keep-alive detection packet to the server, thereby saving air interface resources between the network device and the terminal.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is illustrated. In practical applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the system, the device and the unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。 In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims (15)

  1. 一种处理保活探测报文的方法,其特征在于,所述方法包括:A method for processing a keep-alive detection message, the method comprising:
    网络设备接收服务器发送的数据报文;The network device receives the data packet sent by the server;
    所述网络设备确定所述数据报文为第一保活探测报文;Determining, by the network device, that the data packet is a first keep alive detection packet;
    若所述网络设备确定终端在所述网络设备接收到第二保活探测报文之后没有重新启动,则所述网络设备根据所述第一保活探测报文生成探测响应报文,所述第二保活探测报文为所述第一保活探测报文的前一个保活探测报文;If the network device determines that the terminal does not restart after receiving the second keep-alive detection message, the network device generates a probe response message according to the first keep-alive detection message, where the The second keep-alive detection packet is the previous keep-alive detection packet of the first keep-alive detection packet;
    所述网络设备将所述探测响应报文发送给所述服务器。The network device sends the probe response message to the server.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    若所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动,则所述网络设备将所述第一保活探测报文发送给所述终端。If the network device determines that the terminal has been restarted after the network device receives the second keep-alive detection packet, the network device sends the first keep-alive detection packet to the terminal .
  3. 根据权利要求2所述的方法,其特征在于,所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动或已经重新启动,通过下述方法实现:The method according to claim 2, wherein the network device determines that the terminal does not restart or has restarted after the network device receives the second keep-alive detection message, by using the following method achieve:
    在所述网络设备接收到所述第二保活探测报文之后,所述网络设备接收所述终端发送的非接入层NAS消息;After the network device receives the second keep-alive probe message, the network device receives the non-access stratum NAS message sent by the terminal;
    若所述NAS消息中没有携带附着请求消息,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动;If the NAS message does not carry the attach request message, the network device determines that the terminal does not restart after the network device receives the second keep-alive probe message;
    若所述NAS消息中携带所述附着请求消息,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动。If the NAS message carries the attach request message, the network device determines that the terminal has been restarted after the network device receives the second keep-alive probe message.
  4. 根据权利要求2所述的方法,其特征在于,所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动或已经重新启动,通过下述方法实现:The method according to claim 2, wherein the network device determines that the terminal does not restart or has restarted after the network device receives the second keep-alive detection message, by using the following method achieve:
    在所述网络设备接收到所述第二保活探测报文之后,若所述网络设备没有接收到核心网设备发送的附着请求消息,则所述网络设备确 定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动,所述附着请求消息为所述终端发送给所述核心网设备的;After the network device receives the second keep-alive probe message, if the network device does not receive the attach request message sent by the core network device, the network device does Determining that the terminal does not restart after the network device receives the second keep-alive detection message, where the attach request message is sent by the terminal to the core network device;
    在所述网络设备接收到所述第二保活探测报文之后,若所述网络设备接收到所述核心网设备发送的所述附着请求消息,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动。After the network device receives the second keep-alive probe message, if the network device receives the attach request message sent by the core network device, the network device determines that the terminal is in the The network device has restarted after receiving the second keep-alive probe message.
  5. 根据权利要求2所述的方法,其特征在于,所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动或已经重新启动,通过下述方法实现:The method according to claim 2, wherein the network device determines that the terminal does not restart or has restarted after the network device receives the second keep-alive detection message, by using the following method achieve:
    在所述网络设备接收到所述第二保活探测报文之后,所述网络设备接收所述终端发送的无线资源控制RRC连接请求消息,所述RRC连接请求消息中携带重建立原因;After the network device receives the second keep-alive detection message, the network device receives a radio resource control RRC connection request message sent by the terminal, where the RRC connection request message carries a re-establishment cause;
    若所述重建立原因指示所述RRC连接请求消息不是由于所述终端重新启动触发的,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后没有重新启动;If the re-establishment cause indicates that the RRC connection request message is not triggered by the terminal restarting, the network device determines that the terminal does not after the network device receives the second keep-alive detection message. Restart;
    若所述重建立原因指示所述RRC连接请求消息是由于所述终端重新启动触发的,则所述网络设备确定所述终端在所述网络设备接收到所述第二保活探测报文之后已经重新启动。If the re-establishment cause indicates that the RRC connection request message is triggered by the terminal restarting, the network device determines that the terminal has been after the network device receives the second keep-alive detection message. Restart.
  6. 根据权利要求1至5任意一项所述的方法,其特征在于,所述网络设备接收服务器发送的数据报文之后,所述方法还包括:The method according to any one of claims 1 to 5, wherein after the network device receives the data packet sent by the server, the method further includes:
    所述网络设备确定所述数据报文为业务数据报文;Determining, by the network device, that the data packet is a service data packet;
    所述网络设备将所述业务数据报文发送给所述终端。The network device sends the service data packet to the terminal.
  7. 一种网络设备,其特征在于,所述网络设备包括:A network device, where the network device includes:
    接收单元,用于接收服务器发送的数据报文;a receiving unit, configured to receive a data packet sent by the server;
    确定单元,用于确定所述接收单元接收的所述数据报文为第一保活探测报文;a determining unit, configured to determine that the data packet received by the receiving unit is a first keep alive detection packet;
    生成单元,用于若所述确定单元确定终端在所述接收单元接收到第二保活探测报文之后没有重新启动,则根据所述接收单元接收的所述第一保活探测报文生成探测响应报文,所述第二保活探测报文为所 述第一保活探测报文的前一个保活探测报文;a generating unit, configured to: if the determining unit determines that the terminal does not restart after receiving the second keep-alive detecting message, the detecting unit generates a probe according to the first keep-alive detecting message received by the receiving unit In response to the message, the second keep-alive probe message is The previous keep-alive detection message of the first keep-alive detection message;
    发送单元,用于将所述生成单元生成的所述探测响应报文发送给所述服务器。And a sending unit, configured to send the probe response message generated by the generating unit to the server.
  8. 根据权利要求7所述的网络设备,其特征在于,The network device according to claim 7, wherein
    所述发送单元,还用于若所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动,则将所述第一保活探测报文发送给所述终端。The sending unit is further configured to: if the determining unit determines that the terminal has been restarted after the receiving unit receives the second keep-alive detecting message, sending the first keep-alive detecting message To the terminal.
  9. 根据权利要求8所述的网络设备,其特征在于,所述确定单元包括接收模块和确定模块,The network device according to claim 8, wherein the determining unit comprises a receiving module and a determining module,
    所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:The determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, including:
    所述接收模块,用于在所述接收单元接收到所述第二保活探测报文之后,接收所述终端发送的非接入层NAS消息;The receiving module is configured to receive, after the receiving unit receives the second keep-alive detection message, a non-access stratum NAS message sent by the terminal;
    所述确定模块,用于若所述接收模块接收的所述NAS消息中没有携带附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动;若所述接收模块接收的所述NAS消息中携带所述附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动。The determining module is configured to: if the NAS message received by the receiving module does not carry an attach request message, determine that the terminal does not restart after the receiving unit receives the second keep-alive detecting message If the NAS message received by the receiving module carries the attach request message, it is determined that the terminal has been restarted after the receiving unit receives the second keep-alive detecting message.
  10. 根据权利要求8所述的网络设备,其特征在于,A network device according to claim 8, wherein
    所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:The determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, including:
    所述确定单元,用于在所述接收单元接收到所述第二保活探测报文之后,若所述接收单元没有接收到核心网设备发送的附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动,所述附着请求消息为所述终端发送给所述核心网设备的;在所述接收单元接收到所述第二保活探测报文之后,若所述接收单元接收到所述核心网设备发送的所述附着请求消息,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动。 The determining unit is configured to: after the receiving unit receives the second keep-alive detecting message, if the receiving unit does not receive the attach request message sent by the core network device, determine that the terminal is in the Receiving, after receiving the second keep-alive detection message, the receiving unit does not restart, the attach request message is sent by the terminal to the core network device; and the second keep-alive detection is received by the receiving unit After the message, the receiving unit receives the attach request message sent by the core network device, and determines that the terminal has been restarted after the receiving unit receives the second keep-alive probe message.
  11. 根据权利要求8所述的网络设备,其特征在于,所述确定单元包括接收模块和确定模块,The network device according to claim 8, wherein the determining unit comprises a receiving module and a determining module,
    所述确定单元确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动或已经重新启动,包括:The determining unit determines that the terminal does not restart or has been restarted after the receiving unit receives the second keep-alive detection message, including:
    所述接收模块,用于在所述接收单元接收到所述第二保活探测报文之后,接收所述终端发送的无线资源控制RRC连接请求消息,所述RRC连接请求消息中携带重建立原因;The receiving module is configured to receive, after the receiving unit receives the second keep-alive detection message, a radio resource control RRC connection request message sent by the terminal, where the RRC connection request message carries a re-establishment cause ;
    所述确定模块,用于若所述接收模块接收的所述重建立原因指示所述RRC连接请求消息不是由于所述终端重新启动触发的,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后没有重新启动;若所述接收模块接收的所述重建立原因指示所述RRC连接请求消息是由于所述终端重新启动触发的,则确定所述终端在所述接收单元接收到所述第二保活探测报文之后已经重新启动。Determining, by the determining module, if the re-establishment cause received by the receiving module indicates that the RRC connection request message is not triggered by the terminal restarting, determining that the terminal receives the After the second keepalive detection message is not restarted; if the reestablishment reason received by the receiving module indicates that the RRC connection request message is triggered by the terminal restarting, determining that the terminal is in the receiving The unit has restarted after receiving the second keep-alive probe message.
  12. 根据权利要求7至11任意一项所述的网络设备,其特征在于,A network device according to any one of claims 7 to 11, wherein
    所述确定单元,还用于在所述接收单元接收服务器发送的数据报文之后,确定所述接收单元接收的所述数据报文为业务数据报文;The determining unit is further configured to: after the receiving unit receives the data packet sent by the server, determine that the data packet received by the receiving unit is a service data packet;
    所述发送单元,还用于将所述接收单元接收的所述业务数据报文发送给所述终端。The sending unit is further configured to send the service data packet received by the receiving unit to the terminal.
  13. 根据权利要求7至12任意一项所述的网络设备,其特征在于,A network device according to any one of claims 7 to 12, characterized in that
    所述网络设备为基站或核心网设备。The network device is a base station or a core network device.
  14. 一种网络设备,其特征在于,包括处理器、接口电路、存储器和系统总线;A network device, comprising: a processor, an interface circuit, a memory, and a system bus;
    所述存储器用于存储计算机执行指令,所述处理器、所述接口电路和所述存储器通过所述系统总线相互连接,当所述网络设备运行时,所述处理器执行所述存储器存储的所述计算机执行指令,以使所述网络设备执行如权利要求1至6任意一项所述的处理保活探测报文的方法。 The memory is configured to store computer execution instructions, the processor, the interface circuit, and the memory are connected to each other through the system bus, and when the network device is running, the processor executes the memory storage The computer executes instructions to cause the network device to perform the method of processing a keep-alive probe message according to any one of claims 1 to 6.
  15. 一种通信系统,其特征在于,包括如权利要求7至13任意一项所述的网络设备;或者包括如权利要求14所述的网络设备。 A communication system, comprising: the network device according to any one of claims 7 to 13; or the network device according to claim 14.
PCT/CN2015/099974 2015-12-30 2015-12-30 Method, apparatus and system for processing keepalive probe packet WO2017113240A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/099974 WO2017113240A1 (en) 2015-12-30 2015-12-30 Method, apparatus and system for processing keepalive probe packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/099974 WO2017113240A1 (en) 2015-12-30 2015-12-30 Method, apparatus and system for processing keepalive probe packet

Publications (1)

Publication Number Publication Date
WO2017113240A1 true WO2017113240A1 (en) 2017-07-06

Family

ID=59224303

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/099974 WO2017113240A1 (en) 2015-12-30 2015-12-30 Method, apparatus and system for processing keepalive probe packet

Country Status (1)

Country Link
WO (1) WO2017113240A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637940A (en) * 2020-12-31 2021-04-09 南京佑川网络技术有限公司 Low-power-consumption equipment dormancy keep-alive system and method
CN112752296A (en) * 2019-10-30 2021-05-04 中移(苏州)软件技术有限公司 Data transmission method and device and electronic equipment
CN115604160A (en) * 2021-07-09 2023-01-13 腾讯科技(深圳)有限公司(Cn) Network detection processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101909059A (en) * 2010-07-30 2010-12-08 北京星网锐捷网络技术有限公司 Method and system for deleting residual client information and authentication server
CN102340754A (en) * 2011-09-23 2012-02-01 电信科学技术研究院 Data transmission and receiving methods and equipment
CN103686624A (en) * 2012-09-12 2014-03-26 中国移动通信集团公司 Message pushing method and device and service platform
CN104363579A (en) * 2014-10-31 2015-02-18 中国联合网络通信集团有限公司 Online application implementing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101909059A (en) * 2010-07-30 2010-12-08 北京星网锐捷网络技术有限公司 Method and system for deleting residual client information and authentication server
CN102340754A (en) * 2011-09-23 2012-02-01 电信科学技术研究院 Data transmission and receiving methods and equipment
CN103686624A (en) * 2012-09-12 2014-03-26 中国移动通信集团公司 Message pushing method and device and service platform
CN104363579A (en) * 2014-10-31 2015-02-18 中国联合网络通信集团有限公司 Online application implementing method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112752296A (en) * 2019-10-30 2021-05-04 中移(苏州)软件技术有限公司 Data transmission method and device and electronic equipment
CN112752296B (en) * 2019-10-30 2022-06-10 中移(苏州)软件技术有限公司 Data transmission method and device and electronic equipment
CN112637940A (en) * 2020-12-31 2021-04-09 南京佑川网络技术有限公司 Low-power-consumption equipment dormancy keep-alive system and method
CN112637940B (en) * 2020-12-31 2024-03-08 南京佑川网络技术有限公司 Low-power-consumption equipment dormancy keep-alive system and method
CN115604160A (en) * 2021-07-09 2023-01-13 腾讯科技(深圳)有限公司(Cn) Network detection processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US9906491B2 (en) Improving transmission efficiency of data frames by using shorter addresses in the frame header
WO2017107093A1 (en) Rrc link release method, device, and equipment
WO2014071564A1 (en) Proxy connection method and apparatus
CN107005341B (en) Out-of-order delivery of SDUs in a radio device
WO2018126364A1 (en) Communication method, terminal device, and network device
WO2013091510A1 (en) Data frame transmission method and device
WO2016197689A1 (en) Method, apparatus and system for processing packet
WO2014067487A1 (en) Processing method for preventing d2d transmission interference, user equipment and base station
EP3490293B1 (en) Data receiving method, data sending method, receiving device and system
WO2017113240A1 (en) Method, apparatus and system for processing keepalive probe packet
JP7476258B2 (en) Variable capacity data transmission in mobile communication networks
WO2019019150A1 (en) Data transmission method, terminal device and network device
WO2014135074A1 (en) Communication method, device and system in wireless local area network
WO2016172887A1 (en) Data transmission method, device, and system
US10499366B2 (en) Paging method and apparatus for distributed gateway
WO2017128185A1 (en) Method and terminal for controlling service connection
WO2015196936A1 (en) Message sending method, mobile broadband device and host
US20190239081A1 (en) Communication Method, Security Node Network Element, and Terminal
WO2016082222A1 (en) Sgw, mme, and paging method and system
CN107453998B (en) Method and device for transmitting message
WO2018176372A1 (en) Communication method, terminal apparatus, and access network apparatus
WO2018045521A1 (en) Method and device for transmitting signaling in wireless network
WO2014201693A1 (en) Power control method and device
WO2017185368A1 (en) Signalling transmission method and device
WO2017092021A1 (en) Method and apparatus for switching cell

Legal Events

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

Ref document number: 15911869

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15911869

Country of ref document: EP

Kind code of ref document: A1