Router network connection detection and prompt method and device, and computer storage medium
By periodically detecting multiple network domain names and combining DNS resolution results and network detection requests, the router LED lights are controlled to provide multiple prompts, solving the problem of network connectivity detection accuracy and efficiency in the prior art, achieving more accurate and Intuitive network status feedback.
Patent Information
- Application Number
- CN202411221124.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-20
AI Technical Summary
In the prior art, network connectivity detection has low accuracy and efficiency, and the prompt method is single, which cannot meet the diverse needs of users.
By obtaining multiple network domain names to be tested, sending DNS resolution requests and determining whether all resolution fails based on the resolution results. Combined with the network detection request, the router LED light is controlled to display various prompt methods, including always-on red light, flashing red light or The green light flashes, and the network connection status is determined based on the detection results.
It improves the accuracy and efficiency of network connectivity detection, and provides a variety of intuitive prompt methods, allowing users to understand network status more conveniently.
Smart Images

Figure CN119172284A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network connectivity detection, in particular to a method and device for detecting and prompting network connectivity of a router and a computer storage medium. Background Art
[0002] Routers provide home users with wired and wireless network access functions. When using routers, routers need to adjust device configurations or network services according to the connectivity of the network. Therefore, network connectivity detection of routers is very important for the use of routers and network service configuration. However, in actual applications, due to various reasons, such as network failure, device failure, configuration error, etc., network connection problems may occur, resulting in users being unable to access the network normally. Therefore, how to quickly and accurately detect network connectivity and promptly prompt users of network status has become a technical problem that needs to be solved. Traditional network connectivity detection methods usually rely on professional network management tools or commands, such as ping, traceroute, etc. Although these methods are accurate, they require users to have certain network knowledge, and the operation is relatively complicated, which is not suitable for ordinary users. In addition, traditional network connectivity detection methods can usually only detect a single network target, and cannot detect the connectivity of multiple network domain names at the same time. Moreover, the prompt method is single and cannot meet the diverse needs of users.
[0003] Therefore, there is an urgent need to provide a router network connectivity detection and prompt method, so as to improve the accuracy and efficiency of network connectivity detection, enrich the prompt mode, and enable users to understand the network status more intuitively and conveniently. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and computer storage medium for detecting and prompting network connectivity of a router, so as to solve the problems of low accuracy and efficiency of network connectivity detection and single prompting method in the prior art.
[0005] The present invention solves the above problems through the following technical solutions:
[0006] A method for detecting and prompting network connectivity of a router, the method comprising:
[0007] Obtain multiple network domain names to be tested, and send a DNS resolution request to a domain name server to obtain resolution results, wherein the multiple network domain names to be tested are added to the target router by the user;
[0008] Determining whether all of the multiple network domain names to be tested fail to be resolved according to the resolution result;
[0009] When the resolution of the plurality of network domain names to be tested fails within a preset time, a first control instruction is sent to the target router to control the LED light of the target router to give a prompt in a first prompting manner;
[0010] When one or more of the multiple network domain names to be tested are resolved successfully within a preset time, an IP address of the successfully resolved network domain name is obtained;
[0011] Send a detection request to the server corresponding to the IP address to obtain the detection result;
[0012] The network connection status is determined according to the detection result, and a second control instruction is sent to the target router to control the LED light of the target router to prompt in a second prompting manner.
[0013] Furthermore, when the resolution of the plurality of network domain names to be tested fails within a preset time, sending a first control instruction to the target router to control the LED light of the target router to prompt in a first prompting manner includes:
[0014] When the resolution of the plurality of network domain names to be tested fails within a preset time, the LED light of the target router is prompted in a first prompting manner, wherein the first prompting manner includes a permanently on red light, a flashing red light, or a flashing green light.
[0015] Further, sending a detection request to the server corresponding to the IP address to obtain a detection result; determining the network connection state according to the detection result, and sending a second control instruction to the target router to control the LED light of the target router to prompt in a second prompting manner includes:
[0016] Sending a detection request to the server corresponding to the IP address based on a preset detection protocol to obtain a response message, wherein the detection protocol includes ICMP, TCP, HTTP or HTTPS;
[0017] According to whether the response message is received, it is determined whether the network connection is abnormal, and a second control instruction is sent to the target router to control the LED light of the target router to prompt in a second prompting manner.
[0018] Further, judging whether the network connection is abnormal according to whether the response message is received, and sending a second control instruction to the target router to control the LED light of the target router to prompt in a second prompting manner includes:
[0019] When no response message is received within the preset time, it is determined that the network connection is abnormal, and the LED light of the target router is controlled to prompt in the first prompting manner;
[0020] When a response message is received within a preset time, it is determined that the network connection is normal, and the LED light of the target router is configured to be a permanently green light.
[0021] Furthermore, the method further comprises: repeatedly executing all the steps in the router network connectivity detection and prompting method according to a preset detection cycle.
[0022] Furthermore, the domain name server is a DNS server, and the DNS server processes the DNS resolution request to obtain the resolution result.
[0023] A router network connectivity detection and prompting device, comprising:
[0024] A domain name processing module obtains multiple network domain names to be tested and sends a DNS resolution request to a domain name server to obtain a resolution result. The multiple network domain names to be tested are added to the target router by the user.
[0025] A resolution result judgment module, for judging whether the resolution of the plurality of network domain names to be tested all fails according to the resolution result;
[0026] A failure prompt module, when the resolution of the plurality of network domain names to be tested fails within a preset time, sends a first control instruction to the target router to control the LED light of the target router to give a prompt in a preset prompting manner;
[0027] An IP address acquisition module, when one or more of the multiple network domain names to be tested are resolved successfully within a preset time, acquires the IP address of the successfully resolved network domain name;
[0028] A detection module sends a detection request to a server corresponding to the IP address to obtain a detection result;
[0029] The judgment and prompt module determines the network connection status according to the detection result, and sends a second control instruction to the target router to control the LED light of the target router to prompt according to the preset prompt mode.
[0030] A computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method for detecting and prompting the network connectivity of a router according to any one of claims 1 to 6 are implemented
[0031] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0032] (1) The present invention periodically detects multiple network domain names added by users. The present invention can evaluate network connectivity more comprehensively in a shorter time, thereby improving detection efficiency. At the same time, by combining the DNS resolution results and the results of the network detection request, the present invention can more accurately determine the network connection status, improving detection efficiency and accuracy.
[0033] (2) The present invention provides a variety of preset prompt modes based on the different display states of the router LED lights, which enriches the prompt modes and enables users to understand the network status more intuitively and conveniently. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0035] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the embodiments of the present invention are not limited thereto. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0036] In the following description, the terms "first\second\third" and the like are only used to distinguish similar objects and do not represent a specific order for the objects. It is understandable that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0037] Example:
[0038] Combined with Figure 1 As shown, a method for detecting and prompting network connectivity of a router, the method comprising:
[0039] Obtain multiple network domain names to be tested, and send a DNS resolution request to a domain name server to obtain resolution results, wherein the multiple network domain names to be tested are added to the target router by the user;
[0040] Determining whether all of the multiple network domain names to be tested fail to be resolved according to the resolution result;
[0041] When the resolution of the plurality of network domain names to be tested fails within a preset time, a first control instruction is sent to the target router to control the LED light of the target router to give a prompt in a first prompting manner;
[0042] When one or more of the multiple network domain names to be tested are resolved successfully within a preset time, an IP address of the successfully resolved network domain name is obtained;
[0043] Send a detection request to the server corresponding to the IP address to obtain the detection result;
[0044] The network connection status is determined according to the detection result, and a second control instruction is sent to the target router to control the LED light of the target router to prompt in a second prompting manner.
[0045] It should be noted that users can add multiple network domains they want to detect in the target router. These domains may be website addresses that users frequently visit, such as:
[0046] After the user adds these domain names to the router, the router will be responsible for the subsequent detection work.
[0047] Next, the router will send a DNS resolution request to the domain name server (DNS server is a server on the Internet responsible for converting domain names into IP addresses). For each domain name added by the user, the router will try to obtain its corresponding IP address. This is the first step in network connectivity detection, because knowing the IP address of the domain name is the prerequisite for trying to establish a network connection with it.
[0048] After sending the DNS resolution request, the router will determine whether all the domain names have failed to be resolved based on the resolution results. If all the added domain names cannot be resolved to IP addresses within the preset time, that is, the preset timeout time (for example, 5 seconds), the router will think that there may be a problem with the network. At this time, the router will notify the user of the possible abnormality of network connectivity through the first prompt method.
[0049] However, if at least one domain name is successfully resolved to an IP address, the router will try to establish a connection with the server corresponding to this IP address to further detect the connectivity of the network. For example, if "http: / / www.baidu.com" resolves to the IP address "192.0.2.1", the router will send a detection request to this IP address and wait for the server's response. The detection request can be based on a variety of preset detection protocols, such as ICMP (Internet Control Message Protocol), TCP (Transmission Control Protocol), HTTP (Hypertext Transfer Protocol) or HTTPS (secure version of HTTP), which are commonly used protocols in network communications. Then, the network connection is judged to be abnormal based on the detection results. If the detection result is not received within a preset time (for example, 3 seconds), the router will think that there is a problem with the network connection. On the contrary, if the detection result is received, the router will think that the network connection is normal, and the router will prompt in the corresponding prompt mode.
[0050] In summary, the router can automatically detect the connectivity of the network and provide users with intuitive prompts to feedback the detection results. In this way, users can understand the network status of the router at any time and make corresponding treatment measures.
[0051] As an implementation manner, when the multiple network domain names to be tested fail to be resolved within a preset time, sending a first control instruction to the target router to control the LED light of the target router to prompt in a first prompting manner includes:
[0052] When the resolution of the plurality of network domain names to be tested fails within a preset time, the LED light of the target router is prompted in a first prompting manner, wherein the first prompting manner includes a permanently on red light, a flashing red light, or a flashing green light.
[0053] It should be noted that when the system detects that multiple important network domain names cannot be resolved within a preset time (such as one minute or five minutes), it means that the network may have a fault or abnormality. In order to notify the user or administrator in time, the system will send a control command to the target router. The function of this command is to change the flashing mode or color of the LED light on the router to provide an intuitive visual prompt.
[0054] The first prompt mode includes a solid red light, a flashing red light, or a flashing green light. These different prompt modes can represent different meanings. For example, a solid red light may mean that the network cannot be connected at all, a flashing red light may mean that the network connection is unstable, and a flashing green light may mean that the network is trying to reconnect or recover. Through such visual prompts, users or administrators can quickly understand the current status of the network and take appropriate measures to troubleshoot and repair it.
[0055] For example, suppose a company's network system contains multiple important business domain names, which need to be resolved at all times to ensure the normal operation of the business. If for some reason, these domain names cannot be resolved within a short period of time, the company's network monitoring system will detect this problem and send a control command to the company's main router. After receiving the command, the router's LED light will start flashing in a specific way, such as flashing red, to prompt the company's IT department or network administrator to immediately check the network status, find out the problem and fix it.
[0056] As an implementation mode, sending a detection request to the server corresponding to the IP address to obtain a detection result; determining the network connection state according to the detection result, and sending a second control instruction to the target router to control the LED light of the target router to prompt in a second prompting manner includes:
[0057] Sending a detection request to the server corresponding to the IP address based on a preset detection protocol to obtain a response message, wherein the detection protocol includes ICMP, TCP, HTTP or HTTPS;
[0058] According to whether the response message is received, it is determined whether the network connection is abnormal, and a second control instruction is sent to the target router to control the LED light of the target router to prompt in a second prompting manner.
[0059] Further, judging whether the network connection is abnormal according to whether the response message is received, and sending a second control instruction to the target router to control the LED light of the target router to prompt in a second prompting manner includes:
[0060] When no response message is received within the preset time, it is determined that the network connection is abnormal, and the LED light of the target router is controlled to prompt in the first prompting manner;
[0061] When a response message is received within a preset time, it is determined that the network connection is normal, and the LED light of the target router is configured to be a permanently green light.
[0062] It should be noted that in this application, a detection request will be sent to the server corresponding to a specific IP address in order to obtain the response of the server and thus determine the status of the network connection. This detection process is based on a preset detection protocol, which includes ICMP (Internet Control Message Protocol) for sending error messages and other information that requires attention in an IP network, TCP (Transmission Control Protocol) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol, HTTP (Hypertext Transfer Protocol) is a transmission protocol for transmitting hypertext from a server to a local browser, or HTTPS (HTTP Secure) is a network protocol for encrypted transmission and identity authentication. Which protocol to choose depends on the type of service that needs to be detected and the network environment.
[0063] The system will determine whether the network connection is abnormal based on whether it receives a response message from the server. If no response message is received within the preset time, the system will consider that the network connection is abnormal and send a second control command to the target router. After receiving this command, the LED light of the router will prompt according to the first prompt method mentioned above, such as a solid red light, a flashing red light, or a flashing green light. The specific method depends on the design of the router and user needs. This prompt method can intuitively inform users or administrators that there may be problems with the network connection.
[0064] On the contrary, if the system receives a response message from the server within the preset time, the system will determine that the network connection is normal. In this case, the system will send another command to the target router to configure the router's LED light to be always green, indicating that the network connection is good.
[0065] For example, if the system needs to detect the connectivity of a web server, it may choose HTTP or HTTPS protocol to send the detection request. If the server does not respond within the preset time, the system's LED light may start flashing red, prompting the user that there may be a problem with the network connection. If the server responds to the detection request in time, the LED light will remain green, indicating that the network connection is normal. In this way, users can intuitively understand the current status of the network and take appropriate measures.
[0066] Furthermore, the method further comprises: repeatedly executing all the steps in the router network connectivity detection and prompting method according to a preset detection cycle.
[0067] It should be noted that, in addition to the previously described network connectivity detection and prompting method, this application will repeat all detection steps according to a preset detection cycle. This means that once the detection cycle is set, such as every hour or every day, the system will automatically detect network connectivity and give corresponding prompts based on the detection results.
[0068] For example, if you set the detection cycle to 9 am every day, the system will automatically perform all network connectivity detection steps at this time every day. It will try to resolve the preset network domain name, send a detection request to a specific IP address, and determine whether the network connection is normal based on the response. Then, the system will control the LED light of the router based on the detection results to give corresponding prompts.
[0069] In this way, users can ensure that their network connection is constantly monitored and be notified when problems occur. This is very useful for individuals and businesses that rely on the network for daily work, as it can help them detect and solve network problems in a timely manner, thereby reducing potential losses and inconveniences.
[0070] Furthermore, the domain name server is a DNS server, and the DNS server processes the DNS resolution request to obtain the resolution result.
[0071] It should be noted that "Domain Name Server" actually refers to DNS server. DNS, or Domain Name System, is a distributed database on the Internet used to map domain names and IP addresses to each other. Simply put, its role is to help us convert easy-to-remember domain names (such as www.baidu.com) into IP addresses that machines can understand (such as 192.0.2.1), so as to achieve network access. When we try to access a website, our computer or mobile phone and other devices will first send a DNS resolution request to the DNS server. After receiving this request, the DNS server will look up the corresponding mapping relationship between the domain name and the IP address in its database, and then return a resolution result to our device.
[0072] As another implementation of the present application, a router network connectivity detection and prompting device includes:
[0073] A domain name processing module obtains multiple network domain names to be tested and sends a DNS resolution request to a domain name server to obtain a resolution result. The multiple network domain names to be tested are added to the target router by the user.
[0074] A resolution result judgment module, for judging whether the resolution of the plurality of network domain names to be tested all fails according to the resolution result;
[0075] A failure prompt module, when the resolution of the plurality of network domain names to be tested fails within a preset time, sends a first control instruction to the target router to control the LED light of the target router to give a prompt in a preset prompting manner;
[0076] An IP address acquisition module, when one or more of the multiple network domain names to be tested are resolved successfully within a preset time, acquires the IP address of the successfully resolved network domain name;
[0077] A detection module sends a detection request to a server corresponding to the IP address to obtain a detection result;
[0078] The judgment and prompt module determines the network connection status according to the detection result, and sends a second control instruction to the target router to control the LED light of the target router to prompt according to the preset prompt mode.
[0079] As another embodiment of the present application, a computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting and prompting the network connectivity of a router according to any one of claims 1 to 6 are implemented.
[0080] Although the present invention is described herein with reference to the illustrative embodiments of the present invention, the above embodiments are only preferred embodiments of the present invention, and the embodiments of the present invention are not limited to the above embodiments. It should be understood that those skilled in the art can design many other modifications and embodiments, which will fall within the scope and spirit of the principles disclosed in this application.
Claims
1. A method for detecting and prompting network connectivity of a router, characterized in that: The method comprises: Obtain multiple network domain names to be tested, and send a DNS resolution request to a domain name server to obtain resolution results, wherein the multiple network domain names to be tested are added to the target router by the user; Determining whether all of the multiple network domain names to be tested fail to be resolved according to the resolution result; When the resolution of the plurality of network domain names to be tested fails within a preset time, a first control instruction is sent to the target router to control the LED light of the target router to give a prompt in a first prompting manner; When one or more of the multiple network domain names to be tested are resolved successfully within a preset time, an IP address of the successfully resolved network domain name is obtained; Send a detection request to the server corresponding to the IP address to obtain the detection result; The network connection status is determined according to the detection result, and a second control instruction is sent to the target router to control the LED light of the target router to prompt in a second prompting manner.
2. A method for detecting and prompting router network connectivity according to claim 1, characterized in that: When the resolution of the plurality of network domain names to be tested fails within a preset time, sending a first control instruction to the target router to control the LED light of the target router to prompt in a first prompting manner includes: When the resolution of the plurality of network domain names to be tested fails within a preset time, the LED light of the target router is prompted in a first prompting manner, wherein the first prompting manner includes a permanently on red light, a flashing red light, or a flashing green light.
3. A method for detecting and prompting router network connectivity according to claim 1, characterized in that: The sending of a detection request to the server corresponding to the IP address to obtain a detection result; determining the network connection state according to the detection result, and sending a second control instruction to the target router to control the LED light of the target router to prompt in a second prompting manner includes: Sending a detection request to the server corresponding to the IP address based on a preset detection protocol to obtain a response message, wherein the detection protocol includes ICMP, TCP, HTTP or HTTPS; According to whether the response message is received, it is determined whether the network connection is abnormal, and a second control instruction is sent to the target router to control the LED light of the target router to prompt in a second prompting manner.
4. A method for detecting and prompting router network connectivity according to claim 3, characterized in that: The determining whether the network connection is abnormal according to whether the response message is received, and sending a second control instruction to the target router to control the LED light of the target router to prompt in a second prompting manner includes: When no response message is received within the preset time, it is determined that the network connection is abnormal, and the LED light of the target router is controlled to prompt in the first prompting manner; When a response message is received within a preset time, it is determined that the network connection is normal, and the LED light of the target router is configured to be a permanently green light.
5. A method for detecting and prompting router network connectivity according to claim 1, characterized in that: The method further comprises: repeatedly executing all the steps in the router network connectivity detection and prompting method according to a preset detection cycle.
6. A method for detecting and prompting router network connectivity according to claim 1, characterized in that: The domain name server is a DNS server, and the DNS server processes the DNS resolution request to obtain the resolution result.
7. A router network connectivity detection and prompting device, characterized in that: include: A domain name processing module obtains multiple network domain names to be tested and sends a DNS resolution request to a domain name server to obtain a resolution result. The multiple network domain names to be tested are added to the target router by the user. A resolution result judgment module, for judging whether the resolution of the plurality of network domain names to be tested all fails according to the resolution result; A failure prompt module, when the resolution of the plurality of network domain names to be tested fails within a preset time, sends a first control instruction to the target router to control the LED light of the target router to give a prompt in a preset prompting manner; An IP address acquisition module, when one or more of the multiple network domain names to be tested are resolved successfully within a preset time, acquires the IP address of the successfully resolved network domain name; A detection module sends a detection request to a server corresponding to the IP address to obtain a detection result; The judgment and prompting module determines the network connection status according to the detection result, and sends a second control instruction to the target router to control the LED light of the target router to prompt according to the preset prompting method.
8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the router network connectivity detection and prompting method described in any one of claims 1 to 6 are implemented.
