[go: up one dir, main page]

CN114629822B - Link detection method, device, electronic equipment and storage medium - Google Patents

Link detection method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114629822B
CN114629822B CN202210406869.0A CN202210406869A CN114629822B CN 114629822 B CN114629822 B CN 114629822B CN 202210406869 A CN202210406869 A CN 202210406869A CN 114629822 B CN114629822 B CN 114629822B
Authority
CN
China
Prior art keywords
link
target
received
preset
response message
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
CN202210406869.0A
Other languages
Chinese (zh)
Other versions
CN114629822A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202210406869.0A priority Critical patent/CN114629822B/en
Publication of CN114629822A publication Critical patent/CN114629822A/en
Application granted granted Critical
Publication of CN114629822B publication Critical patent/CN114629822B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本公开涉及一种链路检测方法、装置、电子设备及存储介质,涉及通信技术领域,应用于路由器,路由器对应一个或多个链路,该方法包括:通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,目标链路为一个或多个链路中的任一链路。监测域名服务器根据DNS请求报文发送的DNS响应报文。在DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文。根据目标服务器对链路检测请求报文的响应,确定目标链路是否正常。本公开能够在进行链路检测的过程中,保证链路的正常通信功能,并提高链路检测的准确性。

The present disclosure relates to a link detection method, device, electronic device and storage medium, and relates to the field of communication technology, and is applied to a router, wherein the router corresponds to one or more links, and the method comprises: sending a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any one of the one or more links. Monitoring the DNS response message sent by the domain name server according to the DNS request message. When the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server. According to the response of the target server to the link detection request message, it is determined whether the target link is normal. The present disclosure can ensure the normal communication function of the link and improve the accuracy of link detection during the link detection process.

Description

链路检测方法、装置、电子设备及存储介质Link detection method, device, electronic device and storage medium

技术领域Technical Field

本公开涉及通信技术领域,尤其涉及一种链路检测方法、装置、电子设备及存储介质。The present disclosure relates to the field of communication technology, and in particular to a link detection method, device, electronic device and storage medium.

背景技术Background technique

路由器是家庭常用上网设备,随着带宽和技术的发展,路由器不仅仅可以使用单一链路进行上网,可以使用多链路进行连接互联网,使得带宽加倍,给用户带来更便捷快速的体验。目前,通常通过发送ICMP(英文:Internet Control Message Protocol,中文:因特网控制报文协议)报文来判断链路状态。但是,如果长期且高频率发送ICMP报文,服务器可能会将路由器的动作认定为一种“攻击”行为,从而采取不响应、拒绝服务等动作,影响正常的网络通信功能。并且,通过发送ICMP报文得到的检测结果正常的情况下,链路不一定是正常的,因此可能会造成误判,影响链路检测的准确性。Routers are commonly used home Internet access devices. With the development of bandwidth and technology, routers can not only use a single link to access the Internet, but also use multiple links to connect to the Internet, which doubles the bandwidth and brings users a more convenient and faster experience. At present, the link status is usually determined by sending ICMP (Internet Control Message Protocol) messages. However, if ICMP messages are sent for a long time and at a high frequency, the server may identify the router's actions as an "attack" behavior, and thus take actions such as non-response and denial of service, affecting normal network communication functions. In addition, when the detection result obtained by sending ICMP messages is normal, the link is not necessarily normal, so it may cause misjudgment and affect the accuracy of link detection.

发明内容Summary of the invention

为克服相关技术中存在的问题,本公开提供一种链路检测方法、装置、电子设备及存储介质。In order to overcome the problems existing in the related art, the present disclosure provides a link detection method, device, electronic device and storage medium.

根据本公开实施例的第一方面,提供一种链路检测方法,应用于路由器,所述路由器对应一个或多个链路;所述方法包括:According to a first aspect of an embodiment of the present disclosure, a link detection method is provided, which is applied to a router, and the router corresponds to one or more links; the method includes:

通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,所述目标链路为所述一个或多个链路中的任一链路;Sending a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any link among the one or more links;

监测所述域名服务器根据所述DNS请求报文发送的DNS响应报文;Monitoring the DNS response message sent by the domain name server according to the DNS request message;

在所述DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文;When the monitoring result of the DNS response message meets the preset abnormal condition, sending a link detection request message to the target server;

根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常。Determine whether the target link is normal according to the response of the target server to the link detection request message.

可选地,所述一个或多个链路包括一个链路,所述预设异常条件包括:Optionally, the one or more links include one link, and the preset abnormal condition includes:

在达到第一预设时间段后,接收到所述DNS响应报文的数量小于或等于第一预设数量阈值;或者,After a first preset time period, the number of the DNS response messages received is less than or equal to a first preset number threshold; or,

在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值。The DNS response message is received within the first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold.

可选地,所述方法还包括:Optionally, the method further comprises:

在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中正常响应报文的数量大于或者等于第三预设数量阈值的情况下,确定所述目标链路正常。When the DNS response message is received within the first preset time period and the number of normal response messages in the received DNS response message is greater than or equal to a third preset number threshold, it is determined that the target link is normal.

可选地,所述一个或多个链路包括多个链路,所述预设异常条件包括:Optionally, the one or more links include multiple links, and the preset abnormal condition includes:

在第二预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。The DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold.

可选地,所述方法还包括:Optionally, the method further comprises:

在所述第二预设时间段内接收到所述DNS响应报文,且所述DNS响应报文中正常响应报文的数量大于或者等于第五预设数量阈值的情况下,确定所述目标链路正常;或者,When the DNS response message is received within the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold, determining that the target link is normal; or,

在所述第二预设时间段内接收到所述DNS响应报文的数量小于或等于第六预设数量阈值的情况下,确定所述目标链路异常。When the number of the DNS response messages received within the second preset time period is less than or equal to a sixth preset number threshold, it is determined that the target link is abnormal.

可选地,所述方法还包括:Optionally, the method further comprises:

在所述目标链路异常的情况下,从所述多个链路中确定正常链路,并将所述目标链路上的目标流量转移至所述正常链路,以使所述目标链路停止进行数据传输。In the case that the target link is abnormal, a normal link is determined from the multiple links, and the target traffic on the target link is transferred to the normal link, so that the target link stops data transmission.

可选地,所述方法还包括:Optionally, the method further comprises:

在所述目标链路由异常切换为正常的情况下,将所述正常链路上的所述目标流量转移至所述目标链路,以使所述目标链路按照所述目标流量进行数据传输。When the target link is switched from abnormal to normal, the target traffic on the normal link is transferred to the target link, so that the target link performs data transmission according to the target traffic.

可选地,所述根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常包括:Optionally, determining whether the target link is normal according to a response of the target server to the link detection request message includes:

在第三预设时间段内接收到所述目标服务器根据所述链路检测请求报文发送的链路检测响应报文的情况下,确定所述目标链路正常;或者,In the case where a link detection response message sent by the target server according to the link detection request message is received within a third preset time period, determining that the target link is normal; or,

在达到所述第三预设时间段后,若未接收到所述目标服务器发送的所述链路检测响应报文的情况下,确定所述目标链路异常。After the third preset time period is reached, if the link detection response message sent by the target server is not received, it is determined that the target link is abnormal.

根据本公开实施例的第二方面,提供一种链路检测装置,应用于路由器,所述路由器对应一个或多个链路;所述装置包括:According to a second aspect of an embodiment of the present disclosure, a link detection device is provided, which is applied to a router, and the router corresponds to one or more links; the device includes:

第一发送模块,被配置为通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,所述目标链路为所述一个或多个链路中的任一链路;A first sending module is configured to send a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any link of the one or more links;

监测模块,被配置为监测所述域名服务器根据所述DNS请求报文发送的DNS响应报文;A monitoring module, configured to monitor a DNS response message sent by the domain name server according to the DNS request message;

第二发送模块,被配置为在所述DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文;A second sending module is configured to send a link detection request message to a target server when the monitoring result of the DNS response message meets a preset abnormal condition;

第一确定模块,被配置为根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常。The first determination module is configured to determine whether the target link is normal according to the response of the target server to the link detection request message.

可选地,所述一个或多个链路包括一个链路,所述预设异常条件包括:Optionally, the one or more links include one link, and the preset abnormal condition includes:

在达到第一预设时间段后,接收到所述DNS响应报文的数量小于或等于第一预设数量阈值;或者,After a first preset time period, the number of the DNS response messages received is less than or equal to a first preset number threshold; or,

在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值。The DNS response message is received within the first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold.

可选地,所述装置还包括:Optionally, the device further comprises:

第二确定模块,被配置为在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中正常响应报文的数量大于或者等于第三预设数量阈值的情况下,确定所述目标链路正常。The second determination module is configured to determine that the target link is normal when the DNS response message is received within the first preset time period and the number of normal response messages in the received DNS response message is greater than or equal to a third preset number threshold.

可选地,所述一个或多个链路包括多个链路,所述预设异常条件包括:Optionally, the one or more links include multiple links, and the preset abnormal condition includes:

在第二预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。The DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold.

可选地,所述第二确定模块,还被配置为:Optionally, the second determining module is further configured to:

在所述第二预设时间段内接收到所述DNS响应报文,且所述DNS响应报文中正常响应报文的数量大于或者等于第五预设数量阈值的情况下,确定所述目标链路正常;或者,When the DNS response message is received within the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold, determining that the target link is normal; or,

在所述第二预设时间段内接收到所述DNS响应报文的数量小于或等于第六预设数量阈值的情况下,确定所述目标链路异常。When the number of the DNS response messages received within the second preset time period is less than or equal to a sixth preset number threshold, it is determined that the target link is abnormal.

可选地,所述装置还包括:Optionally, the device further comprises:

转移模块,被配置为在所述目标链路异常的情况下,从所述多个链路中确定正常链路,并将所述目标链路上的目标流量转移至所述正常链路,以使所述目标链路停止进行数据传输。The transfer module is configured to determine a normal link from the multiple links when the target link is abnormal, and transfer the target traffic on the target link to the normal link, so that the target link stops transmitting data.

可选地,所述转移模块,还被配置为:Optionally, the transfer module is further configured to:

在所述目标链路由异常切换为正常的情况下,将所述正常链路上的所述目标流量转移至所述目标链路,以使所述目标链路按照所述目标流量进行数据传输。When the target link is switched from abnormal to normal, the target traffic on the normal link is transferred to the target link, so that the target link performs data transmission according to the target traffic.

可选地,所述第一确定模块被配置为:Optionally, the first determining module is configured to:

在第三预设时间段内接收到所述目标服务器根据所述链路检测请求报文发送的链路检测响应报文的情况下,确定所述目标链路正常;或者,In the case where a link detection response message sent by the target server according to the link detection request message is received within a third preset time period, determining that the target link is normal; or,

在达到所述第三预设时间段后,若未接收到所述目标服务器发送的所述链路检测响应报文的情况下,确定所述目标链路异常。After the third preset time period is reached, if the link detection response message sent by the target server is not received, it is determined that the target link is abnormal.

根据本公开实施例的第三方面,提供一种电子设备,应用于路由器,所述路由器对应一个或多个链路;包括:According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, which is applied to a router, and the router corresponds to one or more links; the electronic device includes:

处理器;processor;

用于存储处理器可执行指令的存储器;a memory for storing processor-executable instructions;

其中,所述处理器被配置为:Wherein, the processor is configured to:

通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,所述目标链路为所述一个或多个链路中的任一链路;Sending a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any link among the one or more links;

监测所述域名服务器根据所述DNS请求报文发送的DNS响应报文;Monitoring the DNS response message sent by the domain name server according to the DNS request message;

在所述DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文;When the monitoring result of the DNS response message meets the preset abnormal condition, sending a link detection request message to the target server;

根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常。Determine whether the target link is normal according to the response of the target server to the link detection request message.

根据本公开实施例的第四方面,提供一种计算机可读存储介质,其上存储有计算机程序指令,该程序指令被处理器执行时实现本公开第一方面所提供的链路检测方法的步骤。According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the link detection method provided in the first aspect of the present disclosure are implemented.

本公开的实施例提供的技术方案可以包括以下有益效果:The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

本公开应用于路由器,路由器对应一个或多个链路,该方法首先通过待检测的目标链路向目标域名对应的域名服务器发送域名系统DNS请求报文,其中目标链路为一个或多个链路中的任一链路。之后监测域名服务器根据DNS请求报文发送的DNS响应报文。在DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文,并根据目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常。本公开先通过待检测的目标链路发送DNS请求报文,在DNS响应报文的监测结果满足预设异常条件的情况下,再向目标服务器发送链路检测请求报文,从而确定所述目标链路是否正常,能够在进行链路检测的过程中,保证链路的正常通信功能,并提高链路检测的准确性。The present disclosure is applied to a router, and the router corresponds to one or more links. The method first sends a domain name system DNS request message to a domain name server corresponding to a target domain name through a target link to be detected, wherein the target link is any link of one or more links. Then, the DNS response message sent by the domain name server according to the DNS request message is monitored. When the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, and whether the target link is normal is determined based on the response of the target server to the link detection request message. The present disclosure first sends a DNS request message through a target link to be detected, and when the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, thereby determining whether the target link is normal. In the process of link detection, the normal communication function of the link can be guaranteed, and the accuracy of link detection can be improved.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

图1是根据一示例性实施例示出的一种链路检测方法的流程图;FIG1 is a flow chart of a link detection method according to an exemplary embodiment;

图2是根据一示例性实施例示出的另一种链路检测方法的流程图;FIG2 is a flow chart showing another link detection method according to an exemplary embodiment;

图3是根据一示例性实施例示出的另一种链路检测方法的流程图;FIG3 is a flow chart showing another link detection method according to an exemplary embodiment;

图4是根据一示例性实施例示出的另一种链路检测方法的流程图;FIG4 is a flow chart showing another link detection method according to an exemplary embodiment;

图5是根据一示例性实施例示出的另一种链路检测方法的流程图;FIG5 is a flow chart showing another link detection method according to an exemplary embodiment;

图6是根据一示例性实施例示出的另一种链路检测方法的流程图;FIG6 is a flow chart showing another link detection method according to an exemplary embodiment;

图7是根据一示例性实施例示出的一种链路检测装置的框图;FIG7 is a block diagram of a link detection device according to an exemplary embodiment;

图8是根据一示例性实施例示出的另一种链路检测装置的框图;FIG8 is a block diagram of another link detection device according to an exemplary embodiment;

图9是根据一示例性实施例示出的另一种链路检测装置的框图;FIG9 is a block diagram showing another link detection device according to an exemplary embodiment;

图10是根据一示例性实施例示出的一种电子设备的框图。Fig. 10 is a block diagram of an electronic device according to an exemplary embodiment.

具体实施方式Detailed ways

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

需要说明的是,本申请中所有获取信号、信息或数据的动作都是在遵照所在地国家相应的数据保护法规政策的前提下,并获得由相应装置所有者给予授权的情况下进行的。It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

在介绍本公开所示出的一种链路检测方法、装置、电子设备及存储介质之前,首先对本公开的应用场景进行介绍。Before introducing a link detection method, device, electronic device, and storage medium shown in the present disclosure, the application scenario of the present disclosure is first introduced.

本公开的应用场景可以是路由器的链路检测过程,由于在长期且高频率发送ICMP报文的情况下,服务器可能会将路由器的动作认定为一种“攻击”行为,从而采取不响应、拒绝服务等动作,影响正常的网络通信功能。并且,在域名服务器异常的情况下,即使网络为正常,用户也无法正常使用网络,例如无法打开网页等常用服务。因此,通过发送ICMP报文得到的检测结果正常的情况下,网络是不一定是正常的,因此可能会造成误判,影响链路检测的准确性。The application scenario of the present disclosure can be the link detection process of a router. Due to the long-term and high-frequency sending of ICMP messages, the server may identify the action of the router as an "attack" behavior, and thus take actions such as non-response and denial of service, affecting the normal network communication function. In addition, in the case of an abnormal domain name server, even if the network is normal, users cannot use the network normally, for example, they cannot open common services such as web pages. Therefore, when the detection result obtained by sending ICMP messages is normal, the network is not necessarily normal, which may cause misjudgment and affect the accuracy of link detection.

图1是根据一示例性实施例示出的一种链路检测方法的流程图,如图1所示,该方法用于路由器,路由器对应一个或多个链路,可以包括以下步骤:FIG. 1 is a flow chart of a link detection method according to an exemplary embodiment. As shown in FIG. 1 , the method is used for a router, and the router corresponds to one or more links, and may include the following steps:

在步骤S101中,通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS(英文:Domain Name System,中文:域名系统)请求报文,目标链路为一个或多个链路中的任一链路。In step S101, a domain name system DNS (English: Domain Name System, Chinese: Domain Name System) request message is sent to a domain name server corresponding to one or more target domain names through a target link to be detected, and the target link is any link of the one or more links.

举例来说,路由器可以包括一个或多个端口,端口例如可以为WAN(英文:WideArea Network,中文:广域网)口,每个端口可以对应一个链路,每个链路可以分别与网络连接。当路由器对应一个链路时,可以重复对每条链路进行检测,当路由器对应多个链路时,可以周期性地对路由器的所有链路或指定的多个链路进行检测。首先可以在预设的域名列表中确定一个或多个目标域名,并通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送DNS请求报文,其中,目标链路为一个或多个链路中的任一链路。如果目标域名为一个,可以重复向该目标域名对应的域名服务器发送DNS请求报文。如果目标域名为多个,可以依次向多个目标域名对应的域名服务器发送DNS请求报文,其中,每个目标域名对应的域名服务器可以相同也可以不同,即多个目标域名对应的一个域名服务器,也可以对应多个域名服务器,本公开对此不作具体限定。For example, the router may include one or more ports, and the port may be, for example, a WAN (English: Wide Area Network, Chinese: Wide Area Network) port, each port may correspond to a link, and each link may be connected to the network respectively. When the router corresponds to one link, each link may be repeatedly detected, and when the router corresponds to multiple links, all links of the router or multiple specified links may be periodically detected. First, one or more target domain names may be determined in a preset domain name list, and a DNS request message may be sent to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any link in the one or more links. If the target domain name is one, a DNS request message may be repeatedly sent to a domain name server corresponding to the target domain name. If the target domain name is multiple, a DNS request message may be sent to domain name servers corresponding to multiple target domain names in sequence, wherein the domain name server corresponding to each target domain name may be the same or different, that is, one domain name server corresponding to multiple target domain names may also correspond to multiple domain name servers, and the present disclosure does not specifically limit this.

在步骤S102中,监测域名服务器根据DNS请求报文发送的DNS响应报文。In step S102, the DNS response message sent by the domain name server according to the DNS request message is monitored.

在步骤S103中,在DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文。In step S103, when the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server.

示例的,在向每个目标域名对应的域名服务器发送DNS请求报文之后,可以监测域名服务器根据DNS请求报文发送的DNS响应报文。由于域名服务器可以根据DNS请求报文,按照DNS协议生成DNS响应报文,因此可以根据DNS响应报文是否正常来确定目标链路是否为正常。如果DNS响应报文的监测结果满足预设异常条件,表示路由器无法通过目标链路与域名服务器进行正常通信,目标链路可能出现异常,那么可以向目标服务器发送链路检测请求报文,再次检测目标链路的状态。For example, after sending a DNS request message to the domain name server corresponding to each target domain name, the DNS response message sent by the domain name server according to the DNS request message can be monitored. Since the domain name server can generate a DNS response message according to the DNS protocol based on the DNS request message, it is possible to determine whether the target link is normal based on whether the DNS response message is normal. If the monitoring result of the DNS response message meets the preset abnormal condition, it means that the router cannot communicate normally with the domain name server through the target link, and the target link may be abnormal, then a link detection request message can be sent to the target server to detect the status of the target link again.

在路由器包括一个链路的情况下,预设异常条件可以是在达到第一预设时间段后,接收到DNS响应报文的数量小于或等于第一预设数量阈值。预设异常条件也可以是在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值。预设异常条件还可以是上述两个条件的结合,本公开对此不作具体限定。如果DNS响应报文的监测结果不满足预设异常条件,例如在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中正常响应报文的数量大于或者等于第三预设数量阈值,那么可以确定目标链路正常。In the case where the router includes one link, the preset abnormal condition may be that after reaching a first preset time period, the number of DNS response messages received is less than or equal to a first preset number threshold. The preset abnormal condition may also be that a DNS response message is received within the first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold. The preset abnormal condition may also be a combination of the above two conditions, which is not specifically limited in the present disclosure. If the monitoring result of the DNS response message does not meet the preset abnormal condition, for example, a DNS response message is received within the first preset time period, and the number of normal response messages in the received DNS response message is greater than or equal to a third preset number threshold, then it can be determined that the target link is normal.

在路由器包括多个链路的情况下,预设异常条件可以是在第二预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。如果DNS响应报文的监测结果不满足预设异常条件,例如,在第二预设时间段内接收到DNS响应报文,且DNS响应报文中正常响应报文的数量大于或者等于第五预设数量阈值,那么确定目标链路正常。又例如,如果在第二预设时间段内接收到DNS响应报文的数量小于或等于第六预设数量阈值,那么可以确定目标链路异常。In the case where the router includes multiple links, the preset abnormal condition may be that a DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold. If the monitoring result of the DNS response message does not meet the preset abnormal condition, for example, a DNS response message is received within the second preset time period, and the number of normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold, then it is determined that the target link is normal. For another example, if the number of DNS response messages received within the second preset time period is less than or equal to a sixth preset number threshold, then it can be determined that the target link is abnormal.

在步骤S104中,根据目标服务器对链路检测请求报文的响应,确定目标链路是否正常。In step S104, it is determined whether the target link is normal according to the response of the target server to the link detection request message.

示例的,在向目标服务器发送链路检测请求报文之后,可以根据目标服务器对链路检测请求报文的响应,确定目标链路是否正常。具体的,如果在第三预设时间段内接收到目标服务器发送的链路,表示路由器与目标服务器之间的网络畅通,那么可以确定目标链路正常,其中,链路检测响应报文可以理解为链路检测请求报文对应的响应报文。如果在达到第三预设时间段后,未接收到链路检测响应报文,表示路由器与目标服务器之间的网络不通,那么可以确定目标链路异常。For example, after sending a link detection request message to the target server, it can be determined whether the target link is normal based on the target server's response to the link detection request message. Specifically, if a link sent by the target server is received within a third preset time period, it means that the network between the router and the target server is unobstructed, then it can be determined that the target link is normal, wherein the link detection response message can be understood as a response message corresponding to the link detection request message. If a link detection response message is not received after reaching the third preset time period, it means that the network between the router and the target server is not accessible, then it can be determined that the target link is abnormal.

需要说明的是,如果在第三预设时间段内接收到所述目标服务器根据所述链路检测请求报文发送的链路检测响应报文,表示目标链路的网络通信功能正常,那么可以确定目标域名对应的域名服务器异常,导致域名服务器无法接收DNS响应报文,或接收到的DNS响应报文异常。It should be noted that if a link detection response message is received by the target server in response to the link detection request message within the third preset time period, indicating that the network communication function of the target link is normal, then it can be determined that the domain name server corresponding to the target domain name is abnormal, resulting in the domain name server being unable to receive the DNS response message, or the received DNS response message is abnormal.

这样,先向目标域名对应的域名服务器发送DNS请求报文,在DNS响应报文的监测结果满足预设异常条件的情况下,再向目标服务器发送链路检测请求报文,从而确定所述目标链路是否正常,能够避免长期且高频率发送ICMP报文,导致服务器不响应、拒绝服务的问题,使得在进行链路检测的过程中,可以保证链路的正常通信功能。并且通过发送DNS请求报文和发送ICMP报文两种检测方式对链路进行检测,能够提高链路检测的准确性。In this way, a DNS request message is first sent to the domain name server corresponding to the target domain name, and when the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server to determine whether the target link is normal, which can avoid the problem of long-term and high-frequency sending of ICMP messages, resulting in server non-response and denial of service, so that the normal communication function of the link can be guaranteed during the link detection process. And by detecting the link in two detection methods, sending DNS request messages and sending ICMP messages, the accuracy of link detection can be improved.

综上所述,本公开应用于路由器,路由器对应一个或多个链路,该方法首先通过待检测的目标链路向目标域名对应的域名服务器发送域名系统DNS请求报文,其中目标链路为一个或多个链路中的任一链路。之后监测域名服务器根据DNS请求报文发送的DNS响应报文。在DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文,并根据目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常。本公开先通过待检测的目标链路发送DNS请求报文,在DNS响应报文的监测结果满足预设异常条件的情况下,再向目标服务器发送链路检测请求报文,从而确定所述目标链路是否正常,能够在进行链路检测的过程中,保证链路的正常通信功能,并提高链路检测的准确性。In summary, the present disclosure is applied to a router, and the router corresponds to one or more links. The method first sends a domain name system DNS request message to a domain name server corresponding to a target domain name through a target link to be detected, wherein the target link is any link of one or more links. Then, the DNS response message sent by the domain name server according to the DNS request message is monitored. When the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, and based on the response of the target server to the link detection request message, it is determined whether the target link is normal. The present disclosure first sends a DNS request message through a target link to be detected, and when the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, thereby determining whether the target link is normal. In the process of link detection, the normal communication function of the link can be guaranteed, and the accuracy of link detection can be improved.

在一种应用场景中,一个或多个链路包括一个链路,预设异常条件包括:In an application scenario, the one or more links include a link, and the preset abnormal conditions include:

在达到第一预设时间段后,接收到DNS响应报文的数量小于或等于第一预设数量阈值。或者,After the first preset time period has passed, the number of DNS response messages received is less than or equal to the first preset number threshold. Or,

在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值。A DNS response message is received within a first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold.

示例的,路由器可以包括一个链路,如果在达到第一预设时间段后,接收到DNS响应报文的数量小于或等于第一预设数量阈值,那么可以确定满足预设异常条件。以目标域名为1个为例,第一预设数量阈值可以是1,在达到第一预设时间段后,如果未接收到DNS响应报文,即接收到DNS响应报文的数量为0,那么可以确定满足预设异常条件,如果接收到1个DNS响应报文,那么可以确定不满足预设异常条件。以目标域名为10个为例,第一预设数量阈值例如可以是8,在达到第一预设时间段后,如果接收到的DNS响应报文的数量小于或等于8,那么可以确定满足预设异常条件,如果接收到的DNS响应报文的数量大于8,那么可以确定不满足预设异常条件。For example, the router may include a link, and if the number of DNS response messages received after reaching a first preset time period is less than or equal to a first preset number threshold, it can be determined that the preset abnormal condition is met. Taking the target domain name as 1 as an example, the first preset number threshold may be 1. After reaching the first preset time period, if no DNS response message is received, that is, the number of DNS response messages received is 0, it can be determined that the preset abnormal condition is met. If 1 DNS response message is received, it can be determined that the preset abnormal condition is not met. Taking the target domain name as 10 as an example, the first preset number threshold may be 8, for example. After reaching the first preset time period, if the number of DNS response messages received is less than or equal to 8, it can be determined that the preset abnormal condition is met. If the number of DNS response messages received is greater than 8, it can be determined that the preset abnormal condition is not met.

或者,如果在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值,那么也可以确定满足预设异常条件,其中,异常响应报文可以理解为,不符合DNS协议的DNS响应报文。以目标域名为1个为例,第二预设数量阈值可以是1,在第一预设时间段内接收到1个异常响应报文,那么可以确定满足预设异常条件,在第一预设时间段内未接收到异常响应报文,即接收到的异常响应报文的数量为0,那么可以确定不满足预设异常条件。以目标域名为20个为例,第二预设数量阈值例如可以是3,在达到第一预设时间段后,如果接收到的异常响应报文的数量大于或等于3,那么可以确定满足预设异常条件,如果接收到的异常响应报文的数量小于3,那么可以确定不满足预设异常条件。例如,如果接收到5个异常响应报文,那么可以确定满足预设异常条件,如果接收到1个异常响应报文,那么可以确定不满足预设异常条件。Alternatively, if a DNS response message is received within the first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to the second preset number threshold, then it can also be determined that the preset abnormal condition is met, wherein the abnormal response message can be understood as a DNS response message that does not comply with the DNS protocol. Taking the target domain name as 1 as an example, the second preset number threshold can be 1, and if 1 abnormal response message is received within the first preset time period, then it can be determined that the preset abnormal condition is met. If no abnormal response message is received within the first preset time period, that is, the number of abnormal response messages received is 0, then it can be determined that the preset abnormal condition is not met. Taking the target domain name as 20 as an example, the second preset number threshold can be 3, for example, after reaching the first preset time period, if the number of abnormal response messages received is greater than or equal to 3, then it can be determined that the preset abnormal condition is met, and if the number of abnormal response messages received is less than 3, then it can be determined that the preset abnormal condition is not met. For example, if 5 abnormal response messages are received, then it can be determined that the preset abnormal condition is met, and if 1 abnormal response message is received, then it can be determined that the preset abnormal condition is not met.

图2是根据一示例性实施例示出的另一种链路检测方法的流程图,如图2所示,该方法还可以包括:FIG. 2 is a flow chart showing another link detection method according to an exemplary embodiment. As shown in FIG. 2 , the method may further include:

在步骤S105中,在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中正常响应报文的数量大于或者等于第三预设数量阈值的情况下,确定目标链路正常。In step S105, when a DNS response message is received within a first preset time period and the number of normal response messages in the received DNS response messages is greater than or equal to a third preset number threshold, it is determined that the target link is normal.

示例的,在路由器包括一个链路的情况下,如果在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中正常响应报文的数量大于或者等于第三预设数量阈值,那么可以确定目标链路正常,其中,正常响应报文可以理解为,符合DNS协议的DNS响应报文。以目标域名为1个为例,第三预设数量阈值可以是1,在第一预设时间段内接收到1个正常响应报文,那么可以确定目标链路正常。以目标域名为20个为例,第三预设数量阈值例如可以是18,在达到第一预设时间段后,如果接收到正常响应报文的数量大于或等于18,那么可以确定目标链路正常。例如,如果接收到19个正常响应报文,那么可以确定目标链路正常。For example, in the case where the router includes one link, if a DNS response message is received within a first preset time period, and the number of normal response messages in the received DNS response message is greater than or equal to a third preset number threshold, then the target link can be determined to be normal, wherein a normal response message can be understood as a DNS response message that complies with the DNS protocol. Taking the target domain name as 1 as an example, the third preset number threshold can be 1, and 1 normal response message is received within the first preset time period, then the target link can be determined to be normal. Taking the target domain name as 20 as an example, the third preset number threshold can be 18, for example, and after reaching the first preset time period, if the number of normal response messages received is greater than or equal to 18, then the target link can be determined to be normal. For example, if 19 normal response messages are received, then the target link can be determined to be normal.

在另一种应用场景中,一个或多个链路包括多个链路,预设异常条件包括:In another application scenario, the one or more links include multiple links, and the preset abnormal conditions include:

在第二预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。A DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold.

示例的,路由器可以包括多个链路,在路由器包括多个链路的情况下,如果在第二预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值,那么可以确定满足预设异常条件。以目标域名为1个为例,第二预设数量阈值可以是1,在第二预设时间段内接收到1个异常响应报文,那么可以确定满足预设异常条件,在第二预设时间段内未接收到异常响应报文,那么可以确定不满足预设异常条件。以目标域名为15个为例,第二预设数量阈值例如可以是2,在达到第一预设时间段后,如果接收到的异常响应报文大于或等于2,那么可以确定满足预设异常条件,如果接收到的异常响应报文小于2,那么可以确定不满足预设异常条件。例如,如果接收到3个异常响应报文,那么可以确定满足预设异常条件,如果接收到1个异常响应报文,那么可以确定不满足预设异常条件。For example, the router may include multiple links. In the case where the router includes multiple links, if a DNS response message is received within the second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to the fourth preset number threshold, then it can be determined that the preset abnormal condition is met. Taking the target domain name as 1 as an example, the second preset number threshold can be 1, and if 1 abnormal response message is received within the second preset time period, then it can be determined that the preset abnormal condition is met. If no abnormal response message is received within the second preset time period, then it can be determined that the preset abnormal condition is not met. Taking the target domain name as 15 as an example, the second preset number threshold can be 2, for example, after reaching the first preset time period, if the received abnormal response message is greater than or equal to 2, then it can be determined that the preset abnormal condition is met. If the received abnormal response message is less than 2, then it can be determined that the preset abnormal condition is not met. For example, if 3 abnormal response messages are received, then it can be determined that the preset abnormal condition is met. If 1 abnormal response message is received, then it can be determined that the preset abnormal condition is not met.

图3是根据一示例性实施例示出的另一种链路检测方法的流程图,如图3所示,该方法还可以包括:FIG. 3 is a flow chart of another link detection method according to an exemplary embodiment. As shown in FIG. 3 , the method may further include:

在步骤S106中,在第二预设时间段内接收到DNS响应报文,且DNS响应报文中正常响应报文的数量大于或者等于第五预设数量阈值的情况下,确定目标链路正常。或者,In step S106, if a DNS response message is received within the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to the fifth preset number threshold, it is determined that the target link is normal.

在步骤S107中,在第二预设时间段内接收到DNS响应报文的数量小于或等于第六预设数量阈值的情况下,确定目标链路异常。In step S107, when the number of DNS response messages received within the second preset time period is less than or equal to a sixth preset number threshold, it is determined that the target link is abnormal.

示例的,在路由器包括多个链路的情况下,如果在第二预设时间段内接收到DNS响应报文,且DNS响应报文中正常响应报文的数量大于或者等于第五预设数量阈值,那么确定目标链路正常。以目标域名为1个为例,第五预设数量阈值可以是1,在第二预设时间段内接收到1个正常响应报文,那么可以确定目标链路正常。以目标域名为18个为例,第五预设数量阈值例如可以是16,在达到第二预设时间段后,如果接收到的正常响应报文大于或等于16,那么可以确定目标链路正常。例如,在达到第二预设时间段后,如果接收到17个正常响应报文,那么可以确定目标链路正常。For example, in the case where the router includes multiple links, if a DNS response message is received within the second preset time period, and the number of normal response messages in the DNS response message is greater than or equal to the fifth preset number threshold, then the target link is determined to be normal. Taking the target domain name as 1 as an example, the fifth preset number threshold can be 1, and 1 normal response message is received within the second preset time period, then the target link can be determined to be normal. Taking the target domain name as 18 as an example, the fifth preset number threshold can be 16, for example, after reaching the second preset time period, if the normal response message received is greater than or equal to 16, then the target link can be determined to be normal. For example, after reaching the second preset time period, if 17 normal response messages are received, then the target link can be determined to be normal.

如果在第二预设时间段内接收到DNS响应报文的数量小于或等于第六预设数量阈值,表示目标链路无法正常进行数据传输,由于在路由器包括多个链路的情况下,如果一条链路无法正常进行数据传输,会导致网络卡顿或数据丢失,因此可以直接将目标链路确定为异常。以目标域名为1个为例,第六预设数量阈值可以是1,在达到第二预设时间段后,如果未接收到DNS响应报文,那么可以确定目标链路异常。以目标域名为12个为例,第六预设数量阈值例如可以是10,在达到第二预设时间段后,如果接收到的DNS响应报文的数量小于或等于10,那么可以确定目标链路异常。例如,在达到第二预设时间段后,如果接收到8个正常响应报文,那么可以确定目标链路异常。If the number of DNS response messages received within the second preset time period is less than or equal to the sixth preset number threshold, it means that the target link cannot perform data transmission normally. Since the router includes multiple links, if one link cannot perform data transmission normally, it will cause network jamming or data loss. Therefore, the target link can be directly determined to be abnormal. Taking the target domain name as 1 as an example, the sixth preset number threshold can be 1. After reaching the second preset time period, if no DNS response message is received, then the target link can be determined to be abnormal. Taking the target domain name as 12 as an example, the sixth preset number threshold can be 10, for example. After reaching the second preset time period, if the number of DNS response messages received is less than or equal to 10, then the target link can be determined to be abnormal. For example, after reaching the second preset time period, if 8 normal response messages are received, then the target link can be determined to be abnormal.

图4是根据一示例性实施例示出的另一种链路检测方法的流程图,如图4所示,该方法还可以包括:FIG. 4 is a flow chart showing another link detection method according to an exemplary embodiment. As shown in FIG. 4 , the method may further include:

在步骤S108中,在目标链路异常的情况下,从多个链路中确定正常链路,并将目标链路上的目标流量转移至正常链路,以使目标链路停止进行数据传输。In step S108, when the target link is abnormal, a normal link is determined from multiple links, and the target traffic on the target link is transferred to the normal link, so that the target link stops data transmission.

示例的,在路由器包括多个链路的情况下,如果确定目标链路异常,表示目标链路无法进行数据传输,在多链路传输的过程中,可能会产生数据丢失并影响用户正常使用网络的问题,因此可以从多个链路中确定正常链路,并将目标链路上的目标流量转移至正常链路,从而使得目标链路停止进行数据传输,并且使得路由器的其它正常链路可以传输原本在目标链路上传输的数据,保证在目标链路发生异常的时候,用户仍然可以正常使用网络,避免了出现网络卡顿或数据丢失的情况。可以将目标链路上的目标流量平均分配给多个正常链路,以目标流量为W、正常链路为3个为例,可以将给每个正常链路分配W/3的流量。也可以预先指定分配给每个正常链路的比例,按照指定的比例将目标流量分配给每个正常链路,本公开对此不作具体限定。For example, in the case where the router includes multiple links, if it is determined that the target link is abnormal, it means that the target link cannot perform data transmission. In the process of multi-link transmission, data loss may occur and affect the user's normal use of the network. Therefore, a normal link can be determined from multiple links, and the target traffic on the target link is transferred to the normal link, so that the target link stops performing data transmission, and other normal links of the router can transmit the data originally transmitted on the target link, ensuring that when the target link is abnormal, the user can still use the network normally, avoiding the situation of network jamming or data loss. The target traffic on the target link can be evenly distributed to multiple normal links. Taking the target traffic as W and the normal links as 3 as an example, W/3 of the traffic can be allocated to each normal link. The ratio allocated to each normal link can also be pre-specified, and the target traffic is allocated to each normal link according to the specified ratio. The present disclosure does not make specific limitations on this.

需要说明的是,可以对路由器的多个链路进行周期性检测,在每个检测周期内,可以对所有链路依次进行检测,也可以对指定链路进行检测。可以在确定目标链路异常之后,立即将目标链路上的流量转移至正常链路,其中,正常链路为在当前时刻之前最近一次的检测结果为正常的链路。也可以在每个检测周期结束之后,将当前检测周期内检测出的异常的链路上的流量转移至正常链路,其中,正常链路为当前检测周期内检测结果为正常的链路。本公开对此不作具体限定。It should be noted that multiple links of the router can be periodically detected. In each detection cycle, all links can be detected in sequence, or a specified link can be detected. After determining that the target link is abnormal, the traffic on the target link can be immediately transferred to a normal link, wherein the normal link is a link with a normal detection result before the current moment. It is also possible that after each detection cycle ends, the traffic on the abnormal link detected in the current detection cycle can be transferred to a normal link, wherein the normal link is a link with a normal detection result in the current detection cycle. The present disclosure does not make specific limitations on this.

图5是根据一示例性实施例示出的另一种链路检测方法的流程图,如图5所示,该方法还可以包括:FIG. 5 is a flow chart of another link detection method according to an exemplary embodiment. As shown in FIG. 5 , the method may further include:

在步骤S109中,在目标链路由异常切换为正常的情况下,将正常链路上的目标流量转移至目标链路,以使目标链路按照目标流量进行数据传输。In step S109, when the target link is switched from abnormal to normal, the target traffic on the normal link is transferred to the target link, so that the target link performs data transmission according to the target traffic.

示例的,在确定目标链路为正常的情况下,获取目标链路上一次的检测结果。如果目标链路上一次的检测结果为异常,表示目标链路由异常切换为正常,那么可以将之前转移到正常链路上的目标流量转移回目标链路,使得目标链路可以重新按照目标流量进行数据传输。这样,在目标链路由异常切换为正常之后,目标链路对应的目标流量能够自动转移到目标链路,使得目标链路可以自动恢复正常通信。For example, when the target link is determined to be normal, the last detection result of the target link is obtained. If the last detection result of the target link is abnormal, indicating that the target link has switched from abnormal to normal, then the target traffic previously transferred to the normal link can be transferred back to the target link, so that the target link can transmit data according to the target traffic again. In this way, after the target link switches from abnormal to normal, the target traffic corresponding to the target link can be automatically transferred to the target link, so that the target link can automatically resume normal communication.

图6是根据一示例性实施例示出的另一种链路检测方法的流程图,如图6所示,步骤104可以通过以下步骤来实现:FIG. 6 is a flow chart showing another link detection method according to an exemplary embodiment. As shown in FIG. 6 , step 104 may be implemented by the following steps:

在步骤S1041中,在第三预设时间段内接收到目标服务器根据链路检测请求报文发送的链路检测响应报文的情况下,确定目标链路正常。或者,In step S1041, when a link detection response message sent by the target server according to the link detection request message is received within the third preset time period, it is determined that the target link is normal.

在步骤S1042中,在达到第三预设时间段后,若未接收到目标服务器发送的链路检测响应报文的情况下,确定目标链路异常。In step S1042, after the third preset time period is reached, if no link detection response message sent by the target server is received, it is determined that the target link is abnormal.

示例的,在将链路检测请求报文发送到目标服务器之后,可以确定在第三预设时间段内,是否接收到目标服务器根据链路检测请求报文发送的链路检测响应报文。如果在第三预设时间段内接收到链路检测响应报文,表示路由器与目标服务器之间的网络畅通,那么可以确定目标链路正常。如果在达到第三预设时间段后,未接收到链路检测响应报文,表示路由器与目标服务器之间的网络不通,那么可以确定目标链路异常。For example, after sending a link detection request message to the target server, it can be determined whether a link detection response message sent by the target server according to the link detection request message is received within a third preset time period. If a link detection response message is received within the third preset time period, it means that the network between the router and the target server is unobstructed, and then it can be determined that the target link is normal. If a link detection response message is not received after the third preset time period is reached, it means that the network between the router and the target server is not accessible, and then it can be determined that the target link is abnormal.

需要说明的是,目标服务器是预先指定的服务器,目标服务器可以为一个,也可以为多个。如果目标服务器为多个,那么可以在第三预设时间段内接收到的链路检测响应报文的数量大于或等于第七预设数量阈值的情况下,确定目标链路正常。并在第三预设时间段内接收到的链路检测响应报文的数量小于第七预设数量阈值的情况下,确定目标链路异常。以目标服务器的数量为10个、第七预设数量阈值为8个为例,如果在第三预设时间段内接收到的链路检测响应报文的数量大于或等于8,那么可以确定目标链路正常。如果在第三预设时间段内接收到的链路检测响应报文的数量小于8,那么可以确定目标链路异常。It should be noted that the target server is a pre-designated server, and the target server can be one or more. If there are multiple target servers, then the target link can be determined to be normal when the number of link detection response messages received within the third preset time period is greater than or equal to the seventh preset number threshold. And when the number of link detection response messages received within the third preset time period is less than the seventh preset number threshold, the target link is determined to be abnormal. Taking the number of target servers as 10 and the seventh preset number threshold as 8 as an example, if the number of link detection response messages received within the third preset time period is greater than or equal to 8, then the target link can be determined to be normal. If the number of link detection response messages received within the third preset time period is less than 8, then the target link can be determined to be abnormal.

综上所述,本公开应用于路由器,路由器对应一个或多个链路,该方法首先通过待检测的目标链路向目标域名对应的域名服务器发送域名系统DNS请求报文,其中目标链路为一个或多个链路中的任一链路。之后监测域名服务器根据DNS请求报文发送的DNS响应报文。在DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文,并根据目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常。本公开先通过待检测的目标链路发送DNS请求报文,在DNS响应报文的监测结果满足预设异常条件的情况下,再向目标服务器发送链路检测请求报文,从而确定所述目标链路是否正常,能够在进行链路检测的过程中,保证链路的正常通信功能,并提高链路检测的准确性。In summary, the present disclosure is applied to a router, and the router corresponds to one or more links. The method first sends a domain name system DNS request message to a domain name server corresponding to a target domain name through a target link to be detected, wherein the target link is any link of one or more links. Then, the DNS response message sent by the domain name server according to the DNS request message is monitored. When the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, and based on the response of the target server to the link detection request message, it is determined whether the target link is normal. The present disclosure first sends a DNS request message through a target link to be detected, and when the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, thereby determining whether the target link is normal. In the process of link detection, the normal communication function of the link can be guaranteed, and the accuracy of link detection can be improved.

图7是根据一示例性实施例示出的一种链路检测装置的框图,如图7所示,应用于路由器,路由器对应一个或多个链路。该装置200包括:FIG7 is a block diagram of a link detection device according to an exemplary embodiment. As shown in FIG7 , the device is applied to a router, and the router corresponds to one or more links. The device 200 includes:

第一发送模块201,被配置为通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,目标链路为一个或多个链路中的任一链路。The first sending module 201 is configured to send a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, where the target link is any link of the one or more links.

监测模块202,被配置为监测域名服务器根据DNS请求报文发送的DNS响应报文。The monitoring module 202 is configured to monitor the DNS response message sent by the domain name server according to the DNS request message.

第二发送模块203,被配置为在DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文。The second sending module 203 is configured to send a link detection request message to the target server when the monitoring result of the DNS response message meets a preset abnormal condition.

第一确定模块204,被配置为根据目标服务器对链路检测请求报文的响应,确定目标链路是否正常。The first determination module 204 is configured to determine whether the target link is normal according to the response of the target server to the link detection request message.

在一种应用场景中,一个或多个链路包括一个链路,预设异常条件包括:In an application scenario, the one or more links include a link, and the preset abnormal conditions include:

在达到第一预设时间段后,接收到DNS响应报文的数量小于或等于第一预设数量阈值。或者,After the first preset time period has passed, the number of DNS response messages received is less than or equal to the first preset number threshold. Or,

在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值。A DNS response message is received within a first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold.

图8是根据一示例性实施例示出的另一种链路检测装置的框图,如图8所示,该装置200还包括:FIG8 is a block diagram of another link detection device according to an exemplary embodiment. As shown in FIG8 , the device 200 further includes:

第二确定模块205,被配置为在第一预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中正常响应报文的数量大于或者等于第三预设数量阈值的情况下,确定目标链路正常。The second determination module 205 is configured to determine that the target link is normal when a DNS response message is received within a first preset time period and the number of normal response messages in the received DNS response messages is greater than or equal to a third preset number threshold.

在另一种应用场景中,一个或多个链路包括多个链路,预设异常条件包括:In another application scenario, the one or more links include multiple links, and the preset abnormal conditions include:

在第二预设时间段内接收到DNS响应报文,且接收到的DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。A DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold.

在另一种应用场景中,第二确定模块205,还被配置为:In another application scenario, the second determining module 205 is further configured to:

在第二预设时间段内接收到DNS响应报文,且DNS响应报文中正常响应报文的数量大于或者等于第五预设数量阈值的情况下,确定目标链路正常。或者,If a DNS response message is received within the second preset time period, and the number of normal response messages in the DNS response message is greater than or equal to the fifth preset number threshold, it is determined that the target link is normal.

在第二预设时间段内接收到DNS响应报文的数量小于或等于第六预设数量阈值的情况下,确定目标链路异常。When the number of DNS response messages received within the second preset time period is less than or equal to a sixth preset number threshold, it is determined that the target link is abnormal.

图9是根据一示例性实施例示出的另一种链路检测装置的框图,如图9所示,该装置200还包括:FIG. 9 is a block diagram of another link detection device according to an exemplary embodiment. As shown in FIG. 9 , the device 200 further includes:

转移模块206,被配置为在目标链路异常的情况下,从多个链路中确定正常链路,并将目标链路上的目标流量转移至正常链路,以使目标链路停止进行数据传输。The transfer module 206 is configured to determine a normal link from multiple links when the target link is abnormal, and transfer the target traffic on the target link to the normal link, so that the target link stops transmitting data.

在另一种应用场景中,转移模块206,还被配置为:In another application scenario, the transfer module 206 is further configured to:

在目标链路由异常切换为正常的情况下,将正常链路上的目标流量转移至目标链路,以使目标链路按照目标流量进行数据传输。When the target link switches from abnormal to normal, the target traffic on the normal link is transferred to the target link, so that the target link transmits data according to the target traffic.

在另一种应用场景中,第一确定模块204被配置为:In another application scenario, the first determining module 204 is configured to:

在第三预设时间段内接收到目标服务器根据链路检测请求报文发送的链路检测响应报文的情况下,确定目标链路正常。或者,When a link detection response message is received from the target server according to the link detection request message within the third preset time period, it is determined that the target link is normal.

在达到第三预设时间段后,若未接收到目标服务器发送的链路检测响应报文的情况下,确定目标链路异常。After the third preset time period is reached, if no link detection response message sent by the target server is received, it is determined that the target link is abnormal.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

综上所述,本公开应用于路由器,路由器对应一个或多个链路,该方法首先通过待检测的目标链路向目标域名对应的域名服务器发送域名系统DNS请求报文,其中目标链路为一个或多个链路中的任一链路。之后监测域名服务器根据DNS请求报文发送的DNS响应报文。在DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文,并根据目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常。本公开先通过待检测的目标链路发送DNS请求报文,在DNS响应报文的监测结果满足预设异常条件的情况下,再向目标服务器发送链路检测请求报文,从而确定所述目标链路是否正常,能够在进行链路检测的过程中,保证链路的正常通信功能,并提高链路检测的准确性。In summary, the present disclosure is applied to a router, and the router corresponds to one or more links. The method first sends a domain name system DNS request message to a domain name server corresponding to a target domain name through a target link to be detected, wherein the target link is any link of one or more links. Then, the DNS response message sent by the domain name server according to the DNS request message is monitored. When the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, and based on the response of the target server to the link detection request message, it is determined whether the target link is normal. The present disclosure first sends a DNS request message through a target link to be detected, and when the monitoring result of the DNS response message meets the preset abnormal condition, a link detection request message is sent to the target server, thereby determining whether the target link is normal. In the process of link detection, the normal communication function of the link can be guaranteed, and the accuracy of link detection can be improved.

本公开还提供一种计算机可读存储介质,其上存储有计算机程序指令,该程序指令被处理器执行时实现本公开提供的链路检测方法的步骤。The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the link detection method provided by the present disclosure are implemented.

图10是根据一示例性实施例示出的一种电子设备300的框图。例如,电子设备300可以被提供为一服务器。参照图10,电子设备300包括处理组件322,其进一步包括一个或多个处理器,以及由存储器332所代表的存储器资源,用于存储可由处理组件322的执行的指令,例如应用程序。存储器332中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件322被配置为执行指令,以执行上述链路检测方法。FIG10 is a block diagram of an electronic device 300 according to an exemplary embodiment. For example, the electronic device 300 may be provided as a server. Referring to FIG10 , the electronic device 300 includes a processing component 322, which further includes one or more processors, and a memory resource represented by a memory 332 for storing instructions executable by the processing component 322, such as an application. The application stored in the memory 332 may include one or more modules, each of which corresponds to a set of instructions. In addition, the processing component 322 is configured to execute instructions to perform the above-mentioned link detection method.

电子设备300还可以包括一个电源组件326被配置为执行电子设备300的电源管理,一个有线或无线网络接口350被配置为将电子设备300连接到网络,和一个输入输出(I/O)接口358。电子设备300可以操作基于存储在存储器332的操作系统,例如WindowsServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。The electronic device 300 may further include a power supply component 326 configured to perform power management of the electronic device 300, a wired or wireless network interface 350 configured to connect the electronic device 300 to a network, and an input/output (I/O) interface 358. The electronic device 300 may operate based on an operating system stored in the memory 332, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or the like.

在另一示例性实施例中,还提供一种计算机程序产品,该计算机程序产品包含能够由可编程的装置执行的计算机程序,该计算机程序具有当由该可编程的装置执行时用于执行上述的链路检测方法的代码部分。In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device. The computer program has a code portion for executing the above link detection method when executed by the programmable device.

本领域技术人员在考虑说明书及实践本公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1.一种链路检测方法,其特征在于,应用于路由器,所述路由器对应一个或多个链路;所述方法包括:1. A link detection method, characterized in that it is applied to a router, and the router corresponds to one or more links; the method comprises: 通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,所述目标链路为所述一个或多个链路中的任一链路;Sending a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any link among the one or more links; 监测所述域名服务器根据所述DNS请求报文发送的DNS响应报文;Monitoring the DNS response message sent by the domain name server according to the DNS request message; 在所述DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文;When the monitoring result of the DNS response message meets the preset abnormal condition, sending a link detection request message to the target server; 根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常;Determining whether the target link is normal according to the response of the target server to the link detection request message; 在所述一个或多个链路包括一个链路的情况下,所述预设异常条件包括:In the case where the one or more links include one link, the preset abnormal condition includes: 在达到第一预设时间段后,接收到所述DNS响应报文的数量小于或等于第一预设数量阈值;或者,After a first preset time period, the number of the DNS response messages received is less than or equal to a first preset number threshold; or, 在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值;The DNS response message is received within the first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold; 在所述一个或多个链路包括多个链路的情况下,所述预设异常条件包括:In the case where the one or more links include multiple links, the preset abnormal condition includes: 在第二预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。The DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中正常响应报文的数量大于或者等于第三预设数量阈值的情况下,确定所述目标链路正常。When the DNS response message is received within the first preset time period and the number of normal response messages in the received DNS response message is greater than or equal to a third preset number threshold, it is determined that the target link is normal. 3.根据权利要求1所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1, characterized in that the method further comprises: 在所述第二预设时间段内接收到所述DNS响应报文,且所述DNS响应报文中正常响应报文的数量大于或者等于第五预设数量阈值的情况下,确定所述目标链路正常;或者,When the DNS response message is received within the second preset time period and the number of normal response messages in the DNS response message is greater than or equal to a fifth preset number threshold, determining that the target link is normal; or, 在所述第二预设时间段内接收到所述DNS响应报文的数量小于或等于第六预设数量阈值的情况下,确定所述目标链路异常。When the number of the DNS response messages received within the second preset time period is less than or equal to a sixth preset number threshold, it is determined that the target link is abnormal. 4.根据权利要求1所述的方法,其特征在于,所述方法还包括:4. The method according to claim 1, characterized in that the method further comprises: 在所述目标链路异常的情况下,从所述多个链路中确定正常链路,并将所述目标链路上的目标流量转移至所述正常链路,以使所述目标链路停止进行数据传输。In the case that the target link is abnormal, a normal link is determined from the multiple links, and the target traffic on the target link is transferred to the normal link, so that the target link stops data transmission. 5.根据权利要求4所述的方法,其特征在于,所述方法还包括:5. The method according to claim 4, characterized in that the method further comprises: 在所述目标链路由异常切换为正常的情况下,将所述正常链路上的所述目标流量转移至所述目标链路,以使所述目标链路按照所述目标流量进行数据传输。When the target link is switched from abnormal to normal, the target traffic on the normal link is transferred to the target link, so that the target link performs data transmission according to the target traffic. 6.根据权利要求1至5任一项所述的方法,其特征在于,所述根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常包括:6. The method according to any one of claims 1 to 5, characterized in that determining whether the target link is normal according to the response of the target server to the link detection request message comprises: 在第三预设时间段内接收到所述目标服务器根据所述链路检测请求报文发送的链路检测响应报文的情况下,确定所述目标链路正常;或者,In the case where a link detection response message sent by the target server according to the link detection request message is received within a third preset time period, determining that the target link is normal; or, 在达到所述第三预设时间段后,若未接收到所述目标服务器发送的所述链路检测响应报文的情况下,确定所述目标链路异常。After the third preset time period is reached, if the link detection response message sent by the target server is not received, it is determined that the target link is abnormal. 7.一种链路检测装置,其特征在于,应用于路由器,所述路由器对应一个或多个链路;所述装置包括:7. A link detection device, characterized in that it is applied to a router, and the router corresponds to one or more links; the device comprises: 第一发送模块,被配置为通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,所述目标链路为所述一个或多个链路中的任一链路;A first sending module is configured to send a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any link of the one or more links; 监测模块,被配置为监测所述域名服务器根据所述DNS请求报文发送的DNS响应报文;A monitoring module, configured to monitor a DNS response message sent by the domain name server according to the DNS request message; 第二发送模块,被配置为在所述DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文;A second sending module is configured to send a link detection request message to a target server when the monitoring result of the DNS response message meets a preset abnormal condition; 第一确定模块,被配置为根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常;A first determination module is configured to determine whether the target link is normal according to a response of the target server to the link detection request message; 在所述一个或多个链路包括一个链路的情况下,所述预设异常条件包括:In the case where the one or more links include one link, the preset abnormal condition includes: 在达到第一预设时间段后,接收到所述DNS响应报文的数量小于或等于第一预设数量阈值;或者,After a first preset time period, the number of the DNS response messages received is less than or equal to a first preset number threshold; or, 在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值;The DNS response message is received within the first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold; 在所述一个或多个链路包括多个链路的情况下,所述预设异常条件包括:In the case where the one or more links include multiple links, the preset abnormal condition includes: 在第二预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。The DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold. 8.一种电子设备,其特征在于,应用于路由器,所述路由器对应一个或多个链路;包括:8. An electronic device, characterized in that it is applied to a router, and the router corresponds to one or more links; comprising: 处理器;processor; 用于存储处理器可执行指令的存储器;a memory for storing processor-executable instructions; 其中,所述处理器被配置为:Wherein, the processor is configured to: 通过待检测的目标链路向一个或多个目标域名对应的域名服务器发送域名系统DNS请求报文,所述目标链路为所述一个或多个链路中的任一链路;Sending a domain name system DNS request message to a domain name server corresponding to one or more target domain names through a target link to be detected, wherein the target link is any link among the one or more links; 监测所述域名服务器根据所述DNS请求报文发送的DNS响应报文;Monitoring the DNS response message sent by the domain name server according to the DNS request message; 在所述DNS响应报文的监测结果满足预设异常条件的情况下,向目标服务器发送链路检测请求报文;When the monitoring result of the DNS response message meets the preset abnormal condition, sending a link detection request message to the target server; 根据所述目标服务器对所述链路检测请求报文的响应,确定所述目标链路是否正常;Determining whether the target link is normal according to the response of the target server to the link detection request message; 在所述一个或多个链路包括一个链路的情况下,所述预设异常条件包括:In the case where the one or more links include one link, the preset abnormal condition includes: 在达到第一预设时间段后,接收到所述DNS响应报文的数量小于或等于第一预设数量阈值;或者,After a first preset time period, the number of the DNS response messages received is less than or equal to a first preset number threshold; or, 在所述第一预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第二预设数量阈值;The DNS response message is received within the first preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a second preset number threshold; 在所述一个或多个链路包括多个链路的情况下,所述预设异常条件包括:In the case where the one or more links include multiple links, the preset abnormal condition includes: 在第二预设时间段内接收到所述DNS响应报文,且接收到的所述DNS响应报文中异常响应报文的数量大于或者等于第四预设数量阈值。The DNS response message is received within a second preset time period, and the number of abnormal response messages in the received DNS response message is greater than or equal to a fourth preset number threshold. 9.一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,该程序指令被处理器执行时实现权利要求1至6中任一项所述方法的步骤。9. A computer-readable storage medium having computer program instructions stored thereon, wherein the program instructions implement the steps of the method according to any one of claims 1 to 6 when executed by a processor.
CN202210406869.0A 2022-04-18 2022-04-18 Link detection method, device, electronic equipment and storage medium Active CN114629822B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210406869.0A CN114629822B (en) 2022-04-18 2022-04-18 Link detection method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210406869.0A CN114629822B (en) 2022-04-18 2022-04-18 Link detection method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114629822A CN114629822A (en) 2022-06-14
CN114629822B true CN114629822B (en) 2024-06-11

Family

ID=81905314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210406869.0A Active CN114629822B (en) 2022-04-18 2022-04-18 Link detection method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114629822B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115051942A (en) * 2022-06-23 2022-09-13 北京小米移动软件有限公司 Link detection method, device, network equipment, storage medium and chip
CN115242615B (en) * 2022-06-29 2023-04-14 北京聚通达科技股份有限公司 Server operation management method, device, electronic device and storage medium
CN115460664A (en) * 2022-08-30 2022-12-09 中国船舶集团有限公司第七一六研究所 Terminal self-adaptive communication switching method of multiple communication systems
CN117997804A (en) * 2022-11-01 2024-05-07 中兴通讯股份有限公司 Link state detection method and device, electronic equipment and storage medium
CN117354196B (en) * 2023-12-06 2024-03-12 广州通则康威科技股份有限公司 Link detection method and device based on network interface

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1808998A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Method of detection and maintenance of PPP link
WO2016082588A1 (en) * 2014-11-26 2016-06-02 中兴通讯股份有限公司 Link connectivity checking method and apparatus
CN106790340A (en) * 2016-04-25 2017-05-31 新华三技术有限公司 A kind of link scheduling method and device
CN107743079A (en) * 2017-09-29 2018-02-27 网宿科技股份有限公司 Line detection method, device and computer-readable storage medium
CN109842566A (en) * 2019-01-10 2019-06-04 杭州迪普科技股份有限公司 A kind of dns resolution method and device
CN109889499A (en) * 2019-01-17 2019-06-14 Oppo广东移动通信有限公司 Message sending method and related device
WO2019161541A1 (en) * 2018-02-23 2019-08-29 Nokia Technologies Oy Network security
WO2020103159A1 (en) * 2018-11-23 2020-05-28 华为技术有限公司 Message transmitting and receiving method and apparatus
CN111586085A (en) * 2019-02-15 2020-08-25 丛林网络公司 Load balancing endpoint selection for client devices accessing endpoints via network
CN112260903A (en) * 2020-10-29 2021-01-22 杭州迪普科技股份有限公司 Link monitoring method and device
CN112468474A (en) * 2020-11-19 2021-03-09 哈尔滨工业大学(威海) Active detection method for resolution abnormity of recursive domain name server
CN112751728A (en) * 2020-12-29 2021-05-04 杭州迪普科技股份有限公司 Link health state monitoring method and device
CN114363288A (en) * 2021-12-16 2022-04-15 北京华耀科技有限公司 Message processing method and device, link load balancing equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10412107B2 (en) * 2017-03-22 2019-09-10 Microsoft Technology Licensing, Llc Detecting domain name system (DNS) tunneling based on DNS logs and network data

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1808998A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Method of detection and maintenance of PPP link
WO2016082588A1 (en) * 2014-11-26 2016-06-02 中兴通讯股份有限公司 Link connectivity checking method and apparatus
CN106790340A (en) * 2016-04-25 2017-05-31 新华三技术有限公司 A kind of link scheduling method and device
CN107743079A (en) * 2017-09-29 2018-02-27 网宿科技股份有限公司 Line detection method, device and computer-readable storage medium
WO2019161541A1 (en) * 2018-02-23 2019-08-29 Nokia Technologies Oy Network security
WO2020103159A1 (en) * 2018-11-23 2020-05-28 华为技术有限公司 Message transmitting and receiving method and apparatus
CN109842566A (en) * 2019-01-10 2019-06-04 杭州迪普科技股份有限公司 A kind of dns resolution method and device
CN109889499A (en) * 2019-01-17 2019-06-14 Oppo广东移动通信有限公司 Message sending method and related device
CN111586085A (en) * 2019-02-15 2020-08-25 丛林网络公司 Load balancing endpoint selection for client devices accessing endpoints via network
CN112260903A (en) * 2020-10-29 2021-01-22 杭州迪普科技股份有限公司 Link monitoring method and device
CN112468474A (en) * 2020-11-19 2021-03-09 哈尔滨工业大学(威海) Active detection method for resolution abnormity of recursive domain name server
CN112751728A (en) * 2020-12-29 2021-05-04 杭州迪普科技股份有限公司 Link health state monitoring method and device
CN114363288A (en) * 2021-12-16 2022-04-15 北京华耀科技有限公司 Message processing method and device, link load balancing equipment and storage medium

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
基于信息熵的DNS拒绝服务攻击的检测研究;严芬;丁超;殷新春;;计算机科学;20150315(03);全文 *
基于通信行为分析的DNS隧道木马检测方法;罗友强;刘胜利;颜猛;武东英;;浙江大学学报(工学版);20170915(09);全文 *
基于链路响应的负载均衡网络实现;鞠洪尧;;齐齐哈尔大学学报(自然科学版);20090515(03);全文 *
链路跟踪在多出口网络链路互备中的应用研究;井浩;张;李军怀;;计算机工程;20070720(14);全文 *
鞠洪尧 ; .基于链路响应的负载均衡网络实现.齐齐哈尔大学学报(自然科学版).2009,(03),全文. *

Also Published As

Publication number Publication date
CN114629822A (en) 2022-06-14

Similar Documents

Publication Publication Date Title
CN114629822B (en) Link detection method, device, electronic equipment and storage medium
US8856884B2 (en) Method, apparatus, signals, and medium for managing transfer of data in a data network
CN108471369B (en) Network dialing method, device and storage medium
KR100405054B1 (en) Method for collecting a network performance information, Computer readable medium storing the same, and an analysis System and Method for network performance
CN111935108A (en) Cloud data security access control method and device, electronic device and storage medium
CN111082996B (en) Automatic configuration method, device and medium for in-band monitoring software
Kim et al. DYSWIS: Crowdsourcing a home network diagnosis
CN103080913B (en) Method and management device for discovering communication devices connected to communication network
CN116192768B (en) A method, device, equipment and storage medium for determining a maximum transmission unit
US11683327B2 (en) Demand management of sender of network traffic flow
CN113676369B (en) Network quality analysis method, data receiving server and storage medium
EP3971748A1 (en) Network connection request method and apparatus
Cisco 11.0(9)BT Caveats/11.0(10)BT Modifications
Cisco 11.0(9)BT Caveats/11.0(10)BT Modifications
EP1479191A1 (en) System for intercepting network access and method thereof
Cisco 10.3(1) Caveats/10.3(2) Modifications
Cisco 10.3(1) Caveats/10.3(2) Modifications
Cisco 10.3(1) Caveats/10.3(2) Modifications
Cisco 10.3(1) Caveats/10.3(2) Modifications
Cisco 11.0(9)BT Caveats/11.0(10)BT Modifications
Cisco 11.0(9)BT Caveats/11.0(10)BT Modifications
Cisco Cisco IOS Software Release 10.3 Caveats
Cisco Cisco IOS Software Release 11.1, 11.1AA and 11.1CA Caveats
Cisco 11.1(8)IA Caveats/11.1(9)IA Modifications
Cisco 11.1(8)IA Caveats/11.1(9)IA Modifications

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