CN111917581B - Communication connection maintenance method, device, equipment and storage medium - Google Patents

Communication connection maintenance method, device, equipment and storage medium Download PDF

Info

Publication number
CN111917581B
CN111917581B CN202010755209.4A CN202010755209A CN111917581B CN 111917581 B CN111917581 B CN 111917581B CN 202010755209 A CN202010755209 A CN 202010755209A CN 111917581 B CN111917581 B CN 111917581B
Authority
CN
China
Prior art keywords
maintenance
detection
target server
period
communication connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010755209.4A
Other languages
Chinese (zh)
Other versions
CN111917581A (en
Inventor
陈锡华
向金如
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Happycast Technology Co Ltd
Original Assignee
Shenzhen Happycast Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Happycast Technology Co Ltd filed Critical Shenzhen Happycast Technology Co Ltd
Priority to CN202010755209.4A priority Critical patent/CN111917581B/en
Publication of CN111917581A publication Critical patent/CN111917581A/en
Application granted granted Critical
Publication of CN111917581B publication Critical patent/CN111917581B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0833Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for reduction of network energy consumption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes

Abstract

The invention relates to the field of information communication, and discloses a method, a device, equipment and a storage medium for maintaining communication connection. The method comprises the following steps: sending an acquisition request of a communication maintenance period to a target server to be maintained, and judging whether the communication maintenance period exists in the target server; if the communication maintenance period exists in the target server, setting the communication maintenance period as a period for presetting communication connection maintenance between a target client and the target server; if the communication maintenance period does not exist in the target server, generating a detection maintenance period based on a preset period detection algorithm, and setting the detection maintenance period as a period for maintaining the communication connection between the target client and the target server.

Description

Communication connection maintenance method, device, equipment and storage medium
Technical Field
The present invention relates to the field of information communication, and in particular, to a method, an apparatus, a device, and a storage medium for maintaining communication connection.
Background
The communication network is combined with the computer technology to form the internet technology of the third industrial revolution, and brings huge changes to the world. In computer networks, communication networks have been gaining attention as an important part. Increasing the transmission speed of communication networks and reducing the maintenance cost of communication networks are the research directions that are continuously paid attention to in the technical field.
In an application of maintaining a communication connection, an NAT (Network Address Translation) device is used to assign an IP Address to a client, and a communication connection interactive packet is used to maintain the communication connection. However, the current maintenance scheme needs to dynamically detect the maintenance period each time, which causes a large power consumption of the battery, and a maintenance technology for reducing the power consumption of the battery is needed.
Disclosure of Invention
The invention mainly aims to solve the technical problem that the electric energy consumption of a battery for maintaining communication connection in the prior art is overlarge.
The first aspect of the present invention provides a method for maintaining a communication connection, where the method for maintaining a communication connection includes:
sending an acquisition request of a communication maintenance period to a target server to be maintained, and judging whether the communication maintenance period exists in the target server;
if the communication maintenance period exists in the target server, setting the communication maintenance period as a period for presetting communication connection maintenance between a target client and the target server;
if the communication maintenance period does not exist in the target server, generating a detection maintenance period based on a preset period detection algorithm, and setting the detection maintenance period as a period for maintaining the communication connection between the target client and the target server.
Optionally, in a first implementation manner of the first aspect of the present invention, the sending an acquisition request of a communication maintenance cycle to a target server to be maintained, and determining whether the communication maintenance cycle exists in the target server includes:
establishing communication connection with a target server to be maintained;
sending an acquisition request of a communication maintenance period to the target server, and receiving request feedback information;
and analyzing data in the request feedback information, and judging whether the communication maintenance period exists in the target server.
Optionally, in a second implementation manner of the first aspect of the present invention, the obtaining a detection maintenance period based on a preset period detection algorithm includes:
reading a preset detection timer, and setting the detection time length of the detection timer;
judging whether data transmission exists between the target server and the detection time length;
if data transmission exists, setting the duration in the detection timer as the detection duration, and detecting again;
if the data transmission does not exist, sending a maintenance data packet to the target server;
and setting the detection duration as a detection maintenance period based on the receiving reply condition of the target server to the maintenance data packet.
Optionally, in a third implementation form of the first aspect of the invention,
the setting the probe duration to a probe maintenance period based on the reply to the maintenance data packet received by the target server includes:
judging whether the target server receives and replies to the maintenance data packet;
if not, reestablishing the communication connection with the target server, reducing the value of the detection duration, and setting the duration in the detection timer to be the reduced detection duration;
and if the reply is received, setting the detection duration as a detection maintenance period according to the reply record of the data packet.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the setting, according to the reply record of receiving the data packet, the detection duration as the detection maintenance period includes:
judging whether a data packet sent by the target server is replied or not according to the reply record of the data packet;
if the last sent data packet is replied, increasing the value of the detection duration, and setting the duration in the detection timer to be the increased detection duration;
and if the last sent data packet is not replied, setting the detection time length as a detection maintenance period.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the setting the probe maintenance period as a period of maintaining a communication connection between the target client and the target server includes:
analyzing the communication connection between the target client and the target server to acquire the attribute information of the communication connection, wherein the attribute information comprises: the IP and port number corresponding to the communication connection;
matching attribute information corresponding to the communication connection with restriction information in a preset update restriction list, wherein the restriction information comprises: IP and port number corresponding to the update restriction list;
judging whether the limitation information and the attribute information have matched IP and/or port numbers;
if the IP and/or port number matched with the limiting information and the attribute information exists, deleting the data of the detection maintenance period to prevent the maintenance of the communication connection;
and if the IP and/or the port number which are matched with the limiting information and the attribute information do not exist, sending the setting information of the detection maintenance period to the target client so as to set the period for sending the maintenance data packet of the target client.
Optionally, in a sixth implementation manner of the first aspect of the present invention, after the setting the probe maintenance period as a period of maintaining a communication connection between the target client and the target server, the method further includes:
and sending the setting request of the detection maintenance period to the target server so as to set the detection maintenance period as the communication maintenance period of the target server.
A second aspect of the present invention provides a communication connection maintenance apparatus, including:
the system comprises a judging module, a communication maintenance module and a communication maintenance module, wherein the judging module is used for sending an acquisition request of a communication maintenance cycle to a target server to be maintained and judging whether the communication maintenance cycle exists in the target server;
the setting module is used for setting the communication maintenance period as a period for presetting the communication connection maintenance between the target client and the target server if the communication maintenance period exists in the target server;
and the generating module is used for generating a detection maintenance period based on a preset period detection algorithm if the communication maintenance period does not exist in the target server, and setting the detection maintenance period as a period for maintaining the communication connection between the target client and the target server.
A third aspect of the present invention provides a maintenance apparatus for a communication connection, including: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line; the at least one processor invokes the instructions in the memory to cause the maintenance device of the communication connection to perform the maintenance method of the communication connection described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-described method of maintaining a communication connection.
Drawings
Fig. 1 is a schematic diagram of a first embodiment of a method for maintaining a communication connection according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a second embodiment of a method for maintaining a communication connection according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a third embodiment of a method for maintaining a communication connection according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an embodiment of a maintenance device for communication connection in an embodiment of the present invention;
FIG. 5 is a schematic diagram of another embodiment of a maintenance device for communication connection in an embodiment of the present invention;
fig. 6 is a schematic diagram of an embodiment of a maintenance device for communication connection in the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for maintaining communication connection.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of a method for maintaining a communication connection in the embodiment of the present invention includes:
101. sending an acquisition request of a communication maintenance period to a target server to be maintained, and judging whether the target server has the communication maintenance period;
in this embodiment, a request for sending and acquiring a target server based on a TCP/IP protocol is received, information returned by the target server is received, a communication maintenance period exists in the returned information, which indicates that a maintenance period exists, and if the maintenance period does not exist in the returned information, the maintenance period does not exist in the target server. And if the acquisition request is sent and the return information is not received, the acquisition request is sent again.
102. If the communication maintenance period exists in the target server, setting the communication maintenance period as a period for presetting communication connection maintenance between the target client and the target server;
in this embodiment, when the communication maintenance cycle is read as {200s }, it is explained that the communication maintenance cycle is 200 seconds, and a packet for maintaining a communication connection is transmitted once every 200 seconds, and the maintenance cycle for connecting to a destination server is set to 200 seconds.
103. And if the communication maintenance period does not exist in the target server, generating a detection maintenance period based on a preset period detection algorithm, and setting the detection maintenance period as the period for maintaining the communication connection between the target client and the target server.
In this embodiment, the period detection algorithm mainly sends an information maintenance packet of a detection period duration, then determines whether there is a communication connection with the target server after the detection period duration, and if so, prolongs the detection period duration. And then sending a detection time length of the extended maintenance period again, judging whether the communication connection of the target server still exists after the detection time length, and if not, reducing the detection time length and continuously approaching the maximum detection time length. When the detection period of the previous period has no communication connection and the maintenance period of the detection duration of the current period has communication connection, the detection period of the current period is considered as the required detection maintenance period. The obtained probe maintenance period is then taken as a period of communication connection maintenance.
In the embodiment of the invention, the length of the maintenance period is determined by detecting the maximum maintenance period of the maintenance period, so that the problem of overlarge battery power consumption caused by the fact that the communication connection needs to be detected and maintained dynamically every time in the prior art is solved.
Referring to fig. 2, a second embodiment of the method for maintaining a communication connection according to the embodiment of the present invention includes:
201. establishing communication connection with a target server to be maintained;
in this embodiment, the communication connection is established with the target server according to the TCP/IP protocol, or the communication connection may be established with the target server using the UDP protocol.
202. Sending an acquisition request of a communication maintenance period to a target server, and receiving request feedback information;
in this embodiment, { require circle } is sent to the target server, and the target server sends { circle: 781s, then getting the data of feedback information.
203. Analyzing data in the request feedback information, and judging whether a communication maintenance period exists in the target server;
in this embodiment, if the feedback information is { Nell }, it is indicated that there is no information maintenance period, and if the feedback information is { circle: 781s indicates a communication maintenance period of 781 seconds.
204. If the communication maintenance period exists in the target server, setting the communication maintenance period as a period for presetting communication connection maintenance between the target client and the target server;
the method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
205. If the communication maintenance period does not exist in the target server, reading a preset detection timer, and setting the detection time length of the detection timer;
in the present embodiment, the probe timer is used to calculate the time of transmission, for example, the probe timer sets the probe duration to 454 seconds.
206. Judging whether data transmission exists between the target server and the target server in the detection duration;
in this embodiment, it is determined whether or not there is data transmission and whether or not data transmission is performed with the target server in 454 seconds.
207. If data transmission exists, setting the duration in the detection timer as the detection duration, and detecting again;
in this embodiment, if there is data transmission, the periodic exploration is not needed, the probing duration is continuously set to 454 seconds, and parallel probing is performed.
208. If the data transmission does not exist, sending a maintenance data packet to a target server;
in this embodiment, if there is no data transmission, the { circle hurt } maintenance packet is sent to the target server.
209. Judging whether the target server receives a reply maintenance data packet or not;
in this embodiment, the receiving information fed back by the target server is received, and if there is no feedback information, the maintenance data packet is not received. If the feedback information exists, the target server receives the maintenance data packet and carries out timely feedback.
210. If not, reestablishing the communication connection with the target server, reducing the value of the detection duration, and setting the duration in the detection timer to be the reduced detection duration;
in this embodiment, when there is no feedback information, it indicates that the NAT (Network Address Translation) has already retracted the IP Address, and needs to determine the communication connection again. After determining a new communication connection, the time is reduced to 452 seconds from 454 seconds, and 452 seconds is taken as the detection time.
211. If the reply is received, judging whether a data packet sent on the target server is replied or not according to the reply record of the data packet;
in this embodiment, if there is received feedback information, the history in the destination server is read, and whether there is another case where the packet is received is determined.
212. If the last sent data packet is replied, increasing the value of the detection duration, and setting the duration in the detection timer to be the increased detection duration;
in the present embodiment, if the data packet of the maintenance cycle of the previous communication connection is recovered, 454 seconds is increased by 2 seconds, and 456 seconds is used as a new probing duration for re-probing.
213. If the last sent data packet is not replied, setting the detection duration as a detection maintenance period;
in this embodiment, if the last transmitted packet does not reply, it indicates that the previous communication connection is abnormal and the current communication connection is normal, and 454 seconds is taken as the probe maintenance cycle.
214. And setting the detection maintenance period as the period of maintaining the communication connection between the target client and the target server.
The method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the embodiment of the invention, the length of the maintenance period is determined by detecting the maximum maintenance period of the maintenance period, so that the problem of overlarge battery power consumption caused by the fact that the communication connection needs to be detected and maintained dynamically every time in the prior art is solved.
Referring to fig. 3, a third embodiment of the method for maintaining a communication connection according to the embodiment of the present invention includes:
301. sending an acquisition request of a communication maintenance period to a target server to be maintained, and judging whether the target server has the communication maintenance period;
the method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
302. If the communication maintenance period exists in the target server, setting the communication maintenance period as a period for presetting communication connection maintenance between the target client and the target server;
the method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
303. If the communication maintenance period does not exist in the target server, generating a detection maintenance period based on a preset period detection algorithm;
the method embodiment described in this embodiment is similar to the first embodiment, and reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
304. Analyzing the communication connection between the target client and the target server, and acquiring attribute information of the communication connection, wherein the attribute information comprises: IP and port number corresponding to communication connection;
in the present embodiment, from IP: 125, xx.232.xx port number: 20, to IP: ra.232.gh port number: attribute information, where form is information of the target client and to is information of the target server.
305. Matching attribute information corresponding to the communication connection with restriction information in a preset update restriction list, wherein the restriction information comprises: updating the IP and the port number corresponding to the restriction list;
in this embodiment, the update list is restricted from having { port number: 54. 26, IP: nell } are matched with each other.
306. Judging whether the limitation information and the attribute information have matched IP and/or port numbers;
in this embodiment, the matching manner may use a regular matching manner to match the characters of the information.
307. If the IP and/or the port number matched with the limiting information and the attribute information exist, deleting the data of the detection maintenance period to prevent the maintenance of the communication connection;
in this embodiment, the update list is restricted from having { port number: 54. 21, IP: nell port number 21 is restricted from use, the probe maintenance period data is deleted, so that the communication connection is terminated.
308. If the limitation information and the attribute information do not have matched IP and/or port numbers, sending the setting information of the detection maintenance period to the target client so as to set the period for sending the maintenance data packet of the target client;
in this embodiment, the probe maintenance period of 454 seconds is sent to the IP: 125, xx.232, xx, and then 454 seconds is set as the packet transmission period of the target client.
309. And sending the setting request of the detection maintenance period to the target server for setting the detection maintenance period as the communication maintenance period of the target server.
In this embodiment, the setting of the probe maintenance period of 454 seconds is set as the communication maintenance period stored inside the server, so as to facilitate the acquisition of the next period of maintenance period.
In the embodiment of the invention, the length of the maintenance period is determined by detecting the maximum maintenance period of the maintenance period, so that the problem of overlarge battery power consumption caused by the fact that the communication connection needs to be detected and maintained dynamically every time in the prior art is solved.
With reference to fig. 4, the method for maintaining a communication connection in an embodiment of the present invention is described above, and a maintenance apparatus for a communication connection in an embodiment of the present invention is described below, where an embodiment of the maintenance apparatus for a communication connection in an embodiment of the present invention includes:
a determining module 401, configured to send an acquisition request of a communication maintenance period to a target server to be maintained, and determine whether the communication maintenance period exists in the target server;
a setting module 402, configured to set the communication maintenance period as a period for presetting communication connection maintenance between a target client and the target server if the communication maintenance period exists in the target server;
a generating module 403, configured to generate a detection maintenance period based on a preset period detection algorithm if the communication maintenance period does not exist in the target server, and set the detection maintenance period as a period for maintaining the communication connection between the target client and the target server.
In the embodiment of the invention, the length of the maintenance period is determined by detecting the maximum maintenance period of the maintenance period, so that the problem of overlarge battery power consumption caused by the fact that the communication connection needs to be detected and maintained dynamically every time in the prior art is solved.
Referring to fig. 5, another embodiment of the maintenance apparatus for communication connection according to the embodiment of the present invention includes:
a determining module 401, configured to send an acquisition request of a communication maintenance period to a target server to be maintained, and determine whether the communication maintenance period exists in the target server;
a setting module 402, configured to set the communication maintenance period as a period for presetting communication connection maintenance between a target client and the target server if the communication maintenance period exists in the target server;
a generating module 403, configured to generate a detection maintenance period based on a preset period detection algorithm if the communication maintenance period does not exist in the target server, and set the detection maintenance period as a period for maintaining the communication connection between the target client and the target server.
The determining module 401 is specifically configured to:
establishing communication connection with a target server to be maintained;
sending an acquisition request of a communication maintenance period to the target server, and receiving request feedback information;
and analyzing data in the request feedback information, and judging whether the communication maintenance period exists in the target server.
Wherein the generating module 403 comprises:
a reading unit 4031, configured to read a preset detection timer, and set a detection duration of the detection timer;
a determining unit 4032, configured to determine whether there is data transmission with the target server in the probe duration;
an adding unit 4033, configured to increase a value of the probe duration if there is data transmission, and set the duration in the probe timer to be the increased probe duration;
a sending unit 4034, configured to send a maintenance data packet to the target server if there is no data transmission;
a setting unit 4035, configured to set the probe duration as a probe maintenance period based on a receiving condition of the target server for the maintenance data packet.
The setting unit 4035 is specifically configured to:
judging whether the target server receives the maintenance data packet or not;
if not, reestablishing the communication connection with the target server, reducing the value of the detection duration, and setting the duration in the detection timer to be the reduced detection duration;
and if so, setting the detection duration as a detection maintenance period according to the receiving record of the data packet.
Wherein the setting unit 4035 may further specifically be configured to:
judging whether a receiving history record of the data packet exists in the receiving record of the target server;
if the historical records exist, setting the detection duration as a detection maintenance period;
and if no history record exists, increasing the value of the detection duration, and setting the duration in the detection timer to be the increased detection duration.
The generating module 403 may be further specifically configured to:
analyzing the communication connection between the target client and the target server to acquire the attribute information of the communication connection, wherein the attribute information comprises: the IP and port number corresponding to the communication connection;
matching attribute information corresponding to the communication connection with restriction information in a preset update restriction list, wherein the restriction information comprises: IP and port number corresponding to the update restriction list;
judging whether the limitation information and the attribute information have matched IP and/or port numbers;
if the IP and/or port number matched with the limiting information and the attribute information exists, deleting the data of the detection maintenance period to prevent the maintenance of the communication connection;
and if the IP and/or the port number which are matched with the limiting information and the attribute information do not exist, sending the setting information of the detection maintenance period to the target client so as to set the period for sending the maintenance data packet of the target client.
The apparatus for maintaining a communication connection further includes a sending module 404, where the sending module 404 is specifically configured to:
and sending the setting request of the detection maintenance period to the target server so as to set the detection maintenance period as the communication maintenance period of the target server.
In the embodiment of the invention, the length of the maintenance period is determined by detecting the maximum maintenance period of the maintenance period, so that the problem of overlarge battery power consumption caused by the fact that the communication connection needs to be detected and maintained dynamically every time in the prior art is solved.
Fig. 4 and 5 describe the maintenance device of the communication connection in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the maintenance device of the communication connection in the embodiment of the present invention is described in detail from the perspective of the hardware processing.
Fig. 6 is a schematic structural diagram of a communicatively connected maintenance device 600 according to an embodiment of the present invention, which may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) for storing applications 633 or data 632. Memory 620 and storage medium 630 may be, among other things, transient or persistent storage. The program stored on the storage medium 630 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the communicatively coupled maintenance device 600. Further, the processor 610 may be configured to communicate with the storage medium 630 to perform a series of instruction operations in the storage medium 630 on the communicatively coupled maintenance device 600.
The communication connection-based maintenance device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input-output interfaces 660, and/or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the communicatively coupled maintenance device configuration shown in FIG. 6 does not constitute a limitation of a communicatively coupled maintenance device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the method for maintaining a communication connection.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (5)

1. A method for maintaining a communication connection, comprising the steps of:
sending an acquisition request of a communication maintenance period to a target server to be maintained, and judging whether the communication maintenance period exists in the target server;
if the communication maintenance period exists in the target server, setting the communication maintenance period as a period for presetting communication connection maintenance between a target client and the target server;
if the communication maintenance period does not exist in the target server, generating a detection maintenance period based on a preset period detection algorithm, and setting the detection maintenance period as a period for maintaining the communication connection between the target client and the target server;
the sending of the request for obtaining the communication maintenance period to the target server to be maintained and the judging whether the communication maintenance period exists in the target server include:
establishing communication connection with a target server to be maintained;
sending an acquisition request of a communication maintenance period to the target server, and receiving request feedback information;
analyzing data in the request feedback information, and judging whether the communication maintenance period exists in the target server;
the generating of the detection maintenance cycle based on the preset cycle detection algorithm comprises:
reading a preset detection timer, setting detection time, and assigning the detection time to the time of the detection timer;
judging whether data transmission exists between the target server and the detection timer in the duration of the detection timer;
if data transmission exists, assigning the detection duration to the duration of the detection timer, and detecting again; if the data transmission does not exist, sending a maintenance data packet to the target server;
setting the detection duration as a detection maintenance period based on the reply condition of the target server to the maintenance data packet;
the setting the probe duration to a probe maintenance period based on the reply condition of the target server to the maintenance data packet includes:
judging whether the target server replies the maintenance data packet or not;
if not, reestablishing the communication connection with the target server, reducing the numerical value of the detection duration, and assigning the reduced detection duration to the duration of the detection timer;
if so, setting the detection duration as a detection maintenance period according to the reply history of the maintenance data packet;
the setting the detection duration to be the detection maintenance period according to the reply history of the maintenance data packet includes:
judging whether the target server replies to the last sent maintenance data packet or not according to the reply history of the maintenance data packet;
if the last sent maintenance data packet is replied, increasing the value of the detection duration, and assigning the increased detection duration to the duration of the detection timer;
if the last sent maintenance data packet is not replied, setting the detection duration as a detection maintenance period;
the setting the probe maintenance period as a period for maintaining the communication connection between the target client and the target server includes:
analyzing the communication connection between the target client and the target server to acquire the attribute information of the communication connection, wherein the attribute information comprises: an IP address and a port number corresponding to the communication connection;
matching attribute information corresponding to the communication connection with restriction information in a preset update restriction list, wherein the restriction information comprises: the IP address and the port number corresponding to the update limit list;
judging whether the limitation information and the attribute information have matched IP addresses and/or port numbers;
if the IP address and/or the port number matched with the limiting information and the attribute information exist, deleting the data of the detection maintenance period to prevent the maintenance of the communication connection;
and if the IP address and/or the port number which are matched with the limiting information and the attribute information do not exist, sending the setting information of the detection maintenance period to the target client so as to set the period of sending the maintenance data packet of the target client.
2. The method according to claim 1, wherein after the setting the probe maintenance period as the period for maintaining the communication connection between the target client and the target server, the method further comprises:
and sending the setting request of the detection maintenance period to the target server so as to set the detection maintenance period as the communication maintenance period of the target server.
3. A maintenance device for a communication connection, the maintenance device comprising:
the system comprises a judging module, a communication maintenance module and a communication maintenance module, wherein the judging module is used for sending an acquisition request of a communication maintenance cycle to a target server to be maintained and judging whether the communication maintenance cycle exists in the target server;
the setting module is used for setting the communication maintenance period as a period for presetting the communication connection maintenance between the target client and the target server if the communication maintenance period exists in the target server;
a generating module, configured to generate a detection maintenance period based on a preset period detection algorithm if the communication maintenance period does not exist in the target server, and set the detection maintenance period as a period for maintaining communication connection between the target client and the target server;
wherein, the judging module is specifically configured to:
establishing communication connection with a target server to be maintained;
sending an acquisition request of a communication maintenance period to the target server, and receiving request feedback information;
analyzing data in the request feedback information, and judging whether the communication maintenance period exists in the target server;
wherein the generating module comprises:
the reading unit is used for reading a preset detection timer, setting detection time length and assigning the detection time length to the time length of the detection timer;
the judging unit is used for judging whether data transmission exists between the target server and the detection timer in the duration of the detection timer;
the increasing unit is used for assigning the detection duration to the duration of the detection timer and detecting again if data transmission exists;
a sending unit, configured to send a maintenance data packet to the target server if there is no data transmission;
the setting unit is used for setting the detection duration as a detection maintenance period based on the reply condition of the target server to the maintenance data packet;
wherein the setting unit is specifically configured to:
judging whether the target server replies the maintenance data packet or not;
if not, reestablishing the communication connection with the target server, reducing the numerical value of the detection duration, and assigning the reduced detection duration to the duration of the detection timer;
if so, setting the detection duration as a detection maintenance period according to the reply history of the maintenance data packet;
wherein, the setting unit may further specifically be configured to:
judging whether the target server replies to the last sent maintenance data packet or not according to the reply history of the maintenance data packet;
if the last sent maintenance data packet is replied, increasing the value of the detection duration, and assigning the increased detection duration to the duration of the detection timer;
if the last sent maintenance data packet is not replied, setting the detection duration as a detection maintenance period;
wherein, the generating module may be further specifically configured to:
analyzing the communication connection between the target client and the target server to acquire the attribute information of the communication connection, wherein the attribute information comprises: an IP address and a port number corresponding to the communication connection;
matching attribute information corresponding to the communication connection with restriction information in a preset update restriction list, wherein the restriction information comprises: the IP address and the port number corresponding to the update limit list;
judging whether the limitation information and the attribute information have matched IP addresses and/or port numbers;
if the IP address and/or the port number matched with the limiting information and the attribute information exist, deleting the data of the detection maintenance period to prevent the maintenance of the communication connection;
and if the IP address and/or the port number which are matched with the limiting information and the attribute information do not exist, sending the setting information of the detection maintenance period to the target client so as to set the period of sending the maintenance data packet of the target client.
4. A communicatively connected maintenance device, comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invoking the instructions in the memory to cause the maintenance device of the communication connection to perform the maintenance method of the communication connection of any of claims 1-2.
5. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method of maintaining a communication connection according to any one of claims 1-2.
CN202010755209.4A 2020-07-31 2020-07-31 Communication connection maintenance method, device, equipment and storage medium Active CN111917581B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010755209.4A CN111917581B (en) 2020-07-31 2020-07-31 Communication connection maintenance method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010755209.4A CN111917581B (en) 2020-07-31 2020-07-31 Communication connection maintenance method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111917581A CN111917581A (en) 2020-11-10
CN111917581B true CN111917581B (en) 2021-09-14

Family

ID=73287462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010755209.4A Active CN111917581B (en) 2020-07-31 2020-07-31 Communication connection maintenance method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111917581B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8375134B2 (en) * 2009-06-08 2013-02-12 Microsoft Corporation Determining an efficient keep-alive interval for a network connection
CN103209089B (en) * 2012-01-17 2016-06-08 华为技术有限公司 The acquisition methods of heart beat cycle and terminal, server
CN104135460B (en) * 2013-05-03 2017-11-24 华为软件技术有限公司 A kind of push channel keepalive method and push server
CN104243719B (en) * 2013-06-08 2017-09-01 中国移动通信集团公司 The heart beat cycle of long connection determines mthods, systems and devices in mobile communications network
CN104270263B (en) * 2014-09-19 2018-02-23 大唐移动通信设备有限公司 A kind of maintaining method and system of TCP connections

Also Published As

Publication number Publication date
CN111917581A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
US20130332456A1 (en) Method and system for detecting operating systems running on nodes in communication network
CN113890879B (en) Load balancing method and device for data access, computer equipment and medium
US20100091684A1 (en) System and Method for Discovery of Dynamically Assigned Information Handling System IP Addresses
CN113676563B (en) Scheduling method, device, equipment and storage medium of content distribution network service
CN104980446A (en) Detection method and system for malicious behavior
CN111221700B (en) Cluster node state monitoring method, device, equipment and readable storage medium
CN100499524C (en) Method and device for maintaining DHCP safety property list by detecting customer terminal
CN109474718A (en) Domain name analytic method and device
CN109729176A (en) Network request method and device
CN112839054A (en) Network attack detection method, device, equipment and medium
CN111667141A (en) Pending task case processing method, device, equipment and storage medium
CN111224829B (en) Method and device for accessing external node to block chain network, and block chain network
CN103220298A (en) Windows Virtual machine remote detecting method
CN111917581B (en) Communication connection maintenance method, device, equipment and storage medium
JP7228712B2 (en) Abnormal host monitoring
CN110995542B (en) Network state detection method, system and related equipment
CN107040617B (en) Data processing method and device
CN114490100A (en) Message queue telemetry transmission load balancing method and device and server
CN116346473B (en) Calling link identification method, equipment, storage medium and computer program product
CN110113446B (en) Client addressing method, device and system
Hammoudi et al. Load balancing in the cloud using specialization
CN109495602B (en) Method and device for processing network access abnormity
CN111177717A (en) Malicious process identification method and device, electronic device and storage medium
CN112231408B (en) Data integration method and device, electronic equipment and storage medium
CN109302390A (en) A kind of leak detection method and device

Legal Events

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