CN111314181A - Network connectivity diagnosis method, device, terminal and storage medium - Google Patents
Network connectivity diagnosis method, device, terminal and storage medium Download PDFInfo
- Publication number
- CN111314181A CN111314181A CN202010200181.8A CN202010200181A CN111314181A CN 111314181 A CN111314181 A CN 111314181A CN 202010200181 A CN202010200181 A CN 202010200181A CN 111314181 A CN111314181 A CN 111314181A
- Authority
- CN
- China
- Prior art keywords
- network
- target server
- detection
- request
- abnormal
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000003745 diagnosis Methods 0.000 title abstract description 20
- 238000001514 detection method Methods 0.000 claims abstract description 127
- 230000002159 abnormal effect Effects 0.000 claims abstract description 48
- 230000004044 response Effects 0.000 claims description 18
- 238000002405 diagnostic procedure Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 6
- 230000005856 abnormality Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The disclosure provides a network connectivity diagnosis method, a network connectivity diagnosis device, a terminal and a storage medium. The network connectivity diagnosis method is used for a terminal and comprises the following steps: determining whether the network request of the target server fails, and detecting the application layer request after the network request fails; if the application layer requests the detection result to be abnormal, network detection with a target server is carried out; if the network detection result is abnormal, the network equipment is detected; if the detection result of the network equipment is normal, performing state detection on a target server; and (5) integrating all detection results to determine the reason of the network request failure and sending prompt information. The embodiment of the disclosure optimizes the logic sequence for executing each detection step, sequentially executes corresponding detection according to the preset logic sequence, and gradually and deeply judges comprehensively according to the detection result, thereby helping the user to quickly and accurately determine the reason of network request failure.
Description
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for diagnosing network connectivity.
Background
In the process of using application software, an intelligent terminal such as a mobile phone needs to exchange data with a remote server, so that the intelligent terminal needs to be connected with the remote server. In the use process of the mobile phone, sometimes even if the network connection is displayed on the mobile phone, the request cannot be sent to the server, and the user cannot know the real reason of the connection failure with the server.
Disclosure of Invention
In order to solve the existing problems, the present disclosure provides a network connectivity diagnosis method, apparatus, terminal, and storage medium.
The present disclosure adopts the following technical solutions.
In some embodiments, the present disclosure provides a network connectivity diagnostic method for a terminal, including:
determining whether the network request to the target server failed;
detecting an application layer request after the network request fails;
if the application layer request detection result is abnormal, network detection with a target server is carried out;
if the network detection result is abnormal, network equipment detection is carried out;
if the detection result of the equipment in the network is normal, detecting the state of the target server;
all detection results are integrated to determine the reason of network request failure and send prompt information
In some embodiments, the present disclosure provides a network connectivity diagnostic apparatus for a terminal, including:
a determining unit for determining whether the network request to the target server fails;
the detection unit is used for detecting the application layer request after the network request fails;
the detection unit is also used for carrying out network detection with a target server if the detection result requested by the application layer is abnormal;
the detection unit is also used for detecting network equipment if the network detection result is abnormal;
the detection unit is also used for detecting the state of the target server if the detection result of the network equipment is normal;
and the prompting unit is used for integrating all detection results to determine the reason of the network request failure and sending out prompting information.
In some embodiments, the present disclosure provides a terminal comprising: at least one memory and at least one processor;
the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory to execute the method.
In some embodiments, the present disclosure provides a storage medium for storing program code for performing the above-described method.
The network connectivity diagnosis method provided by the embodiment of the disclosure can detect the application layer request after the network request fails; if the detection result requested by the application layer is abnormal, performing network detection with the target server; if the result of the network detection is abnormal, the network equipment detection is carried out; if the detection result of the network equipment is normal, performing state detection on the target server; the method optimizes the logic sequence of executing each detection step, sequentially executes corresponding detection according to the preset logic sequence, and gradually deeply and comprehensively judges according to the detection result to help a user quickly and accurately determine the reason of the network request failure.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
Fig. 1 is a flowchart of a network connectivity diagnosis method according to an embodiment of the present disclosure.
Fig. 2 is a block diagram of a network connectivity diagnostic apparatus according to an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that various steps recited in method embodiments of the present disclosure may be performed in parallel and/or in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a" or "an" in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
The embodiment of the disclosure provides a network connectivity diagnosis method, which is used for a terminal, and the terminal in the embodiment of the disclosure can be a mobile phone, a tablet or a computer and other network-connectable equipment. As shown in fig. 1, fig. 1 is a flowchart of a network connectivity diagnosis method according to an embodiment of the present disclosure, including the following steps:
s11: determining whether the network request to the target server failed;
in embodiments of the present disclosure, a network request failure may refer to a failure to successfully establish a network connection with a target server. In the event of a network request failure, data cannot be sent to or received from the target server.
S12: detecting an application layer request after the network request fails;
in the embodiment, the application layer is the top layer of the seven-layer protocol of the network, so if the target server can respond to the request of the application layer, the network state is normal and the target server state is normal, and the network request failure occurred before is probably caused by the network fluctuation for a short time only, and without any processing, i.e. if the result of the detection of the application layer request is normal, no other detection is needed, and S16 can be directly executed.
S13: if the application layer requests the detection result to be abnormal, network detection with a target server is carried out;
in this embodiment, if the application layer request fails, it indicates that there is a high possibility of a failure in the network link (network), and then a network detection is performed, and if the result of the network detection is normal, it indicates that there is a network that can communicate with the target server, and at this time, S16 can be directly performed without performing other detections.
S14: if the result of the network detection is abnormal, the network equipment detection is performed;
in this embodiment, when the result of the network detection is abnormal, it indicates that there is a problem in the network link between the terminal and the target server, and usually the terminal and the target server are not directly connected but are connected after forwarding through a plurality of network devices. If there is a problem with the network device, S16 may be directly performed.
S15: if the detection result of the network equipment is normal, performing state detection on the target server;
in the present embodiment, the possibility of failure of the terminal network and the network device has been eliminated by performing S12-S15, and therefore the most probable cause of failure of the network request is the abnormality of the target server status, and thus the target server status detection is required.
S16: and (5) integrating all detection results to determine the reason of the network request failure and sending prompt information.
In the embodiment of the present disclosure, the sent prompt message is used to indicate the reason for the network request failure, for example, the prompt message may indicate whether the network request failure is caused by the network status abnormality, the network request failure is caused by the network device abnormality, or the network request failure is caused by the target server status abnormality. In the embodiment provided by the disclosure, after a network request fails, according to preset logic steps, whether a network state is abnormal or not is determined, whether a network device is abnormal or not is determined, whether a target server is abnormal or not is determined, whether the next detection is executed depends on the result of the previous detection instead of executing various detections blindly, corresponding detections are sequentially executed according to a preset logic sequence, and the detection results are gradually deeply and comprehensively judged, so that a user is helped to quickly and accurately determine the reason of the network request failure, and the user experience is improved.
In some embodiments of the present disclosure, performing application layer request detection comprises: sending an http request to the target server; if the response of the target server to the http request is received, the result of the application layer request detection is normal; and if the response of the target server to the http request is not received, the detection result of the application layer request is abnormal.
In this embodiment, the http (Hyper Text Transfer Protocol) request may be a get request or a post request. The http request belongs to a request of an application layer, so that the influence caused by network fluctuation is avoided, the http request can be sent to the target server for multiple times, and the http detection result is determined according to multiple response results. If the http request detection result is normal, the network state is normal and the target server state is normal, and the reason for the network request failure may be accidental network fluctuation.
In some embodiments of the present disclosure, performing network detection with a target server includes: sending a display back request to a target server; if the response of the target server to the echoing request is received within a preset time length, the result of the network detection is normal; and if the response of the target server to the echoing request is not received within the preset time length, the result of the network detection is abnormal.
In this embodiment, the Ping command may be used to send a playback request to the target server, and if the target server receives the playback request, the target server may automatically reply and return a response to the playback request. The Ping command is in the application layer, and corresponds to an application program, but directly uses ICMP (Internet Control Message Protocol) of the network layer, and when a response to the echo request can be received, it indicates that the network state is normal.
In some embodiments of the present disclosure, performing network device detection includes: carrying out route tracing, and marking each network device passing from the terminal to the target server; determining whether each network device is abnormal; if the states of the network devices are normal, the detection result of the network device is normal; and if the state of any one network device is abnormal, the detection result of the network device is abnormal.
In this embodiment, when the echo request is sent to the target server but no response is received, it indicates that the network link from the terminal to the target server is at least partially interrupted, and there may be a network device that has a failure, and therefore, it is necessary to perform route tracing. The direct connection is not between the terminal and the target server, the network link between the terminal and the target server needs to pass through a plurality of network devices, namely, the data sent from the terminal needs to be forwarded by the plurality of network devices in sequence to reach the target server, therefore, when the terminal cannot establish the network connection with the target server, the routing tracking is needed to be carried out for the reason that a certain one or a plurality of network devices are failed, and the marking of each network device comprises the following steps: sending data to each network device detects the ip address and response time to each network device to determine whether any network device has failed. When the terminal is a terminal equipped with a windows system, a tracert command in the console can be adopted for carrying out route tracking, and if the terminal is a terminal equipped with a linux system, a traceroute command can be adopted for carrying out route tracking. Optionally, the return result sent by the route chase includes ip addresses and response times of the network devices. For example, if the terminal is connected to the target server sequentially through the router a and the router b, and the access timeout of the router b is found after the routing tracking is adopted, it is assumed that the router b is abnormal and cannot normally access the target server.
In some embodiments of the present disclosure, performing target server state detection includes: trying to connect a preset public website; and if the preset public website is successfully connected, determining that the state of the target server is abnormal.
In some embodiments of the present disclosure, the preset public website refers to a website with higher stability, such as an official website of a government, and a server corresponding to the website basically does not fail, so as long as the network state is normal, the public website can be accessed, and therefore, after successfully connecting to the preset public website, it is indicated that the reason for the network request failure is that the server state is abnormal, but not the network state is abnormal.
In some embodiments of the present disclosure, performing target server state detection further includes: after the target server is determined to be abnormal, acquiring a domain name server address; and judging whether domain hijacking occurs according to the acquired domain name server address.
When a user accesses a network, the user often accesses the network not by directly adopting an ip address, but by adopting a domain name access mode, a corresponding relationship between a domain name and the ip address is stored in a domain name server, and when domain name hijacking occurs, the terminal is connected to an illegal domain name server, so that the ip address corresponding to the domain name cannot be correctly obtained, but a false ip address is obtained, and a target server cannot be accessed. Optionally, after determining that domain hijacking occurs, the domain name server address is modified to a preset domain name server address.
In some embodiments of the present disclosure, performing target server state detection further includes: if the domain name hijacking does not occur, acquiring all uniform resource locators corresponding to the target server; attempting to connect to the respective uniform resource locators of the target server.
In some embodiments of the present disclosure, the target server may be deployed in multiple machine rooms, and therefore, one target server may correspond to multiple uniform resource locators, and when the target server cannot be normally accessed, only part of the uniform resource locators of the target server may be normally accessed, and at this time, by accessing each uniform resource locator of the target server, it may be known whether the machine room in which the target server is deployed cannot be accessed or part of the machine room cannot be accessed.
In some embodiments of the present disclosure, determining whether the network request to the target server failed comprises: and if n successive attempts to connect the target server fail, determining that the network request fails, wherein n is a positive integer not less than 1. In this embodiment, the terminal fails to establish a connection with the target server n consecutive times and recognizes that the network request has failed.
In some embodiments of the present disclosure, determining whether the network request to the target server failed comprises: and if the preset instruction is received, determining that the network request fails. In this embodiment, the terminal and the target server may be capable of being normally connected, this embodiment may be applied to a case where other terminals cannot access the target server, and when other terminals cannot access the target server, in order to accurately determine the reason why other terminals cannot access the target server, the target server may send a preset instruction to the terminal, so that the terminal detects whether the terminal can normally connect the target server, thereby helping to determine the reason why other terminals cannot connect the target server.
Some embodiments of the present disclosure further provide a composition diagram of a network connectivity diagnostic apparatus, where the network connectivity diagnostic apparatus in this embodiment is used for a terminal, as shown in fig. 2, the network connectivity diagnostic apparatus includes:
a determining unit for determining whether the network request to the target server fails;
the detection unit is used for detecting the application layer request after the network request fails;
the detection unit is also used for carrying out network detection with a target server if the detection result requested by the application layer is abnormal;
the detection unit is also used for detecting the network equipment if the network detection result is abnormal;
the detection unit is also used for detecting the state of the target server if the detection result of the network equipment is normal;
and the prompting unit is used for integrating all detection results to determine the reason of the network request failure and sending out prompting information.
For the embodiments of the apparatus, since they correspond substantially to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described apparatus embodiments are merely illustrative, wherein the modules described as separate modules may or may not be separate. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The network connectivity diagnosis method and apparatus of the present disclosure have been described above based on the embodiments and application examples. In addition, the present disclosure also provides a terminal and a storage medium, which are described below.
Referring now to fig. 3, a schematic diagram of an electronic device (e.g., a terminal device or server) 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device 800 may include a processing means (e.g., central processing unit, graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM 802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods of the present disclosure as described above.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a network connectivity diagnosis method for a terminal, including:
determining whether the network request of the target server fails, and detecting the application layer request after the network request fails;
if the application layer request detection result is abnormal, network detection with a target server is carried out;
if the network detection result is abnormal, network equipment detection is carried out;
if the detection result of the network equipment is normal, performing state detection on a target server;
according to one or more embodiments of the present disclosure, a network connectivity diagnosis method for performing application layer request detection is provided, including:
sending an http request to the target server;
if the response of the target server to the http request is received, the result of the application layer request detection is normal;
and if the response of the target server to the http request is not received, the detection result of the application layer request is abnormal.
According to one or more embodiments of the present disclosure, a network connectivity diagnosis method for performing network detection with a target server is provided, including:
sending a display back request to a target server;
if the response of the target server to the echoing request is received within a preset time length, the result of the network detection is normal;
and if the response of the target server to the echoing request is not received within the preset time length, the result of the network detection is abnormal.
According to one or more embodiments of the present disclosure, a network connectivity diagnosis method for network device detection is provided, including:
carrying out route tracing, and marking each network device passing from the terminal to the target server;
determining whether each network device is abnormal;
if the states of the network devices are normal, the detection result of the network device is normal;
and if the state of any one network device is abnormal, the detection result of the network device is abnormal.
According to one or more embodiments of the present disclosure, a network connectivity diagnosis method for performing target server status detection is provided, including:
trying to connect a preset public website;
and if the preset public website is successfully connected, determining that the state of the target server is abnormal.
According to one or more embodiments of the present disclosure, a network connectivity diagnosis method for detecting a state of a target server is provided, which further includes:
after the target server is determined to be abnormal, acquiring a domain name server address;
and judging whether domain hijacking occurs according to the acquired domain name server address.
According to one or more embodiments of the present disclosure, a network connectivity diagnosis method for detecting a state of a target server is provided, which further includes:
if the domain name hijacking does not occur, acquiring all uniform resource locators corresponding to the target server;
attempting to connect to the respective uniform resource locators of the target server.
According to one or more embodiments of the present disclosure, there is provided a network connectivity diagnosis method for determining whether a network request to a target server fails, including:
if the target server fails to be connected for n times continuously, determining that the network request fails, wherein n is a positive integer not less than 1;
or,
and if the preset instruction is received, determining that the network request fails.
According to one or more embodiments of the present disclosure, there is provided a network connectivity diagnosis apparatus for a terminal, including:
a determining unit for determining whether the network request to the target server fails;
the detection unit is used for detecting the application layer request after the network request fails;
the detection unit is also used for carrying out network detection with a target server if the detection result requested by the application layer is abnormal;
the detection unit is also used for detecting network equipment if the network detection result is abnormal;
the detection unit is also used for detecting the state of the target server if the detection result of the network equipment is normal;
and the prompting unit is used for integrating all detection results to determine the reason of the network request failure and sending out prompting information.
According to one or more embodiments of the present disclosure, there is provided a terminal including: at least one memory and at least one processor;
wherein the at least one memory is configured to store program code, and the at least one processor is configured to call the program code stored in the at least one memory to perform the method of any one of the above.
According to one or more embodiments of the present disclosure, there is provided a storage medium for storing program code for performing the above-described method.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims (11)
1. A network connectivity diagnostic method for a terminal, comprising:
determining whether the network request to the target server failed;
detecting an application layer request after the network request fails;
if the application layer request detection result is abnormal, network detection with a target server is carried out;
if the network detection result is abnormal, network equipment detection is carried out;
if the detection result of the network equipment is normal, performing state detection on a target server;
and (5) integrating all detection results to determine the reason of the network request failure and sending prompt information.
2. The method of claim 1, wherein performing application layer request detection comprises:
sending an http request to the target server;
if the response of the target server to the http request is received, the result of the application layer request detection is normal;
and if the response of the target server to the http request is not received, the detection result of the application layer request is abnormal.
3. The method of claim 1, wherein the performing network connectivity with the target server comprises:
sending a display back request to a target server;
if the response of the target server to the echoing request is received within a preset time length, the result of the network detection is normal;
and if the response of the target server to the echoing request is not received within the preset time length, the result of the network detection is abnormal.
4. The network connectivity diagnostic method of claim 1, wherein performing network device detection comprises:
carrying out route tracing, and marking each network device passing from the terminal to the target server;
determining whether each network device is abnormal;
if the states of the network devices are normal, the detection result of the network device is normal;
and if the state of any one network device is abnormal, the detection result of the network device is abnormal.
5. The method of claim 1, wherein performing target server state detection comprises:
trying to connect a preset public website;
and if the preset public website is successfully connected, determining that the state of the target server is abnormal.
6. The network connectivity diagnostic method of claim 5, wherein performing target server state detection further comprises:
after the target server is determined to be abnormal, acquiring a domain name server address;
and judging whether domain hijacking occurs according to the acquired domain name server address.
7. The network connectivity diagnostic method of claim 6, wherein performing target server state detection further comprises:
if the domain name hijacking does not occur, acquiring all uniform resource locators corresponding to the target server;
attempting to connect to the respective uniform resource locators of the target server.
8. The network connectivity diagnostic method of claim 1, wherein determining whether the network request to the target server failed comprises:
if the target server fails to be connected for n times continuously, determining that the network request fails, wherein n is a positive integer not less than 1;
or,
and if the preset instruction is received, determining that the network request fails.
9. A network connectivity diagnostic apparatus for a terminal, comprising:
a determining unit for determining whether the network request to the target server fails;
the detection unit is used for detecting the application layer request after the network request fails;
the detection unit is also used for carrying out network detection with a target server if the detection result requested by the application layer is abnormal;
the detection unit is also used for detecting network equipment if the network detection result is abnormal;
the detection unit is also used for detecting the state of the target server if the detection result of the network equipment is normal;
and the prompting unit is used for integrating all detection results to determine the reason of the network request failure and sending out prompting information.
10. A terminal, comprising:
at least one memory and at least one processor;
wherein the at least one memory is configured to store program code and the at least one processor is configured to invoke the program code stored in the at least one memory to perform the method of any of claims 1 to 9.
11. A storage medium for storing program code for performing the method of any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010200181.8A CN111314181B (en) | 2020-03-20 | 2020-03-20 | Network connectivity diagnosis method, device, terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010200181.8A CN111314181B (en) | 2020-03-20 | 2020-03-20 | Network connectivity diagnosis method, device, terminal and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111314181A true CN111314181A (en) | 2020-06-19 |
CN111314181B CN111314181B (en) | 2022-06-24 |
Family
ID=71162346
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010200181.8A Active CN111314181B (en) | 2020-03-20 | 2020-03-20 | Network connectivity diagnosis method, device, terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111314181B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112671822A (en) * | 2020-10-20 | 2021-04-16 | 北京字跳网络技术有限公司 | Service request processing method, device, storage medium, server and system |
CN112954723A (en) * | 2021-02-23 | 2021-06-11 | 上海汉图科技有限公司 | Network diagnosis method and device |
CN113067753A (en) * | 2021-04-01 | 2021-07-02 | 北京有竹居网络技术有限公司 | Method, device, equipment and storage medium for detecting connectivity of mobile data link |
CN113259152A (en) * | 2021-04-19 | 2021-08-13 | 北京奇艺世纪科技有限公司 | Network diagnosis method, network diagnosis device, electronic equipment and storage medium |
CN114006845A (en) * | 2020-07-14 | 2022-02-01 | 芜湖美的厨卫电器制造有限公司 | Control method and control device for household appliance, household appliance and storage medium |
CN114693313A (en) * | 2022-03-21 | 2022-07-01 | 北京环宇博亚科技有限公司 | Identification code-based warehousing equipment detection method and device, electronic equipment and medium |
CN115914065A (en) * | 2022-12-06 | 2023-04-04 | 中国联合网络通信集团有限公司 | Terminal self-service diagnosis method, device, equipment and medium |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130128751A1 (en) * | 2011-11-23 | 2013-05-23 | Avaya Inc. | Multi-layer network diagnostic tracing |
CN104518926A (en) * | 2014-12-05 | 2015-04-15 | 深圳天珑无线科技有限公司 | Mobile terminal and network connection diagnosis method thereof |
CN105763564A (en) * | 2016-04-19 | 2016-07-13 | 成都知道创宇信息技术有限公司 | DNS hijacking detection method |
CN106027284A (en) * | 2016-04-29 | 2016-10-12 | 乐视控股(北京)有限公司 | Network fault diagnosis method and device |
CN106603378A (en) * | 2015-10-19 | 2017-04-26 | 北京慧点科技有限公司 | Network detection method for instant messaging software |
CN106817279A (en) * | 2017-01-13 | 2017-06-09 | 山东浪潮商用系统有限公司 | A kind of broadband-based network detecting method |
CN106844073A (en) * | 2017-01-24 | 2017-06-13 | 腾讯科技(深圳)有限公司 | A kind of method of diagnostic application, diagnostic clients end and system |
CN107154959A (en) * | 2016-03-02 | 2017-09-12 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of the access network address |
CN107846330A (en) * | 2017-12-18 | 2018-03-27 | 深圳创维数字技术有限公司 | A kind of network fault detecting method, terminal and computer-readable medium |
US20180198890A1 (en) * | 2017-01-11 | 2018-07-12 | Citrix Systems, Inc. | Systems and methods for improving the performance of a computer network using multiplexed application layer streams of network traffic |
CN108632112A (en) * | 2018-04-12 | 2018-10-09 | 腾讯科技(深圳)有限公司 | Network detecting method, device, computer readable storage medium and computer equipment |
CN108667646A (en) * | 2018-03-22 | 2018-10-16 | 北京奇艺世纪科技有限公司 | network access method and device |
CN109714209A (en) * | 2018-12-29 | 2019-05-03 | 中国科学院计算技术研究所 | A kind of diagnostic method and system of website visiting failure |
CN109787951A (en) * | 2018-11-22 | 2019-05-21 | 北京奇艺世纪科技有限公司 | A kind of network data access method, device and electronic equipment |
-
2020
- 2020-03-20 CN CN202010200181.8A patent/CN111314181B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130128751A1 (en) * | 2011-11-23 | 2013-05-23 | Avaya Inc. | Multi-layer network diagnostic tracing |
CN104518926A (en) * | 2014-12-05 | 2015-04-15 | 深圳天珑无线科技有限公司 | Mobile terminal and network connection diagnosis method thereof |
CN106603378A (en) * | 2015-10-19 | 2017-04-26 | 北京慧点科技有限公司 | Network detection method for instant messaging software |
CN107154959A (en) * | 2016-03-02 | 2017-09-12 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of the access network address |
CN105763564A (en) * | 2016-04-19 | 2016-07-13 | 成都知道创宇信息技术有限公司 | DNS hijacking detection method |
CN106027284A (en) * | 2016-04-29 | 2016-10-12 | 乐视控股(北京)有限公司 | Network fault diagnosis method and device |
US20180198890A1 (en) * | 2017-01-11 | 2018-07-12 | Citrix Systems, Inc. | Systems and methods for improving the performance of a computer network using multiplexed application layer streams of network traffic |
CN106817279A (en) * | 2017-01-13 | 2017-06-09 | 山东浪潮商用系统有限公司 | A kind of broadband-based network detecting method |
CN106844073A (en) * | 2017-01-24 | 2017-06-13 | 腾讯科技(深圳)有限公司 | A kind of method of diagnostic application, diagnostic clients end and system |
CN107846330A (en) * | 2017-12-18 | 2018-03-27 | 深圳创维数字技术有限公司 | A kind of network fault detecting method, terminal and computer-readable medium |
CN108667646A (en) * | 2018-03-22 | 2018-10-16 | 北京奇艺世纪科技有限公司 | network access method and device |
CN108632112A (en) * | 2018-04-12 | 2018-10-09 | 腾讯科技(深圳)有限公司 | Network detecting method, device, computer readable storage medium and computer equipment |
CN109787951A (en) * | 2018-11-22 | 2019-05-21 | 北京奇艺世纪科技有限公司 | A kind of network data access method, device and electronic equipment |
CN109714209A (en) * | 2018-12-29 | 2019-05-03 | 中国科学院计算技术研究所 | A kind of diagnostic method and system of website visiting failure |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114006845A (en) * | 2020-07-14 | 2022-02-01 | 芜湖美的厨卫电器制造有限公司 | Control method and control device for household appliance, household appliance and storage medium |
CN112671822A (en) * | 2020-10-20 | 2021-04-16 | 北京字跳网络技术有限公司 | Service request processing method, device, storage medium, server and system |
CN112671822B (en) * | 2020-10-20 | 2022-06-17 | 北京字跳网络技术有限公司 | Service request processing method, device, storage medium, server and system |
CN112954723A (en) * | 2021-02-23 | 2021-06-11 | 上海汉图科技有限公司 | Network diagnosis method and device |
CN113067753A (en) * | 2021-04-01 | 2021-07-02 | 北京有竹居网络技术有限公司 | Method, device, equipment and storage medium for detecting connectivity of mobile data link |
CN113259152A (en) * | 2021-04-19 | 2021-08-13 | 北京奇艺世纪科技有限公司 | Network diagnosis method, network diagnosis device, electronic equipment and storage medium |
CN114693313A (en) * | 2022-03-21 | 2022-07-01 | 北京环宇博亚科技有限公司 | Identification code-based warehousing equipment detection method and device, electronic equipment and medium |
CN114693313B (en) * | 2022-03-21 | 2022-09-20 | 北京环宇博亚科技有限公司 | Identification code-based warehousing equipment detection method and device, electronic equipment and medium |
CN115914065A (en) * | 2022-12-06 | 2023-04-04 | 中国联合网络通信集团有限公司 | Terminal self-service diagnosis method, device, equipment and medium |
CN115914065B (en) * | 2022-12-06 | 2024-05-14 | 中国联合网络通信集团有限公司 | Terminal self-help diagnosis method, device, equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN111314181B (en) | 2022-06-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111314181B (en) | Network connectivity diagnosis method, device, terminal and storage medium | |
CN111694674B (en) | Message distribution processing method, device, equipment and storage medium | |
CN109284470B (en) | Page window communication method and device | |
US20230124149A1 (en) | Method and apparatus for establishing multimedia call, and electronic device | |
US20240291875A1 (en) | Method, apparatus, device and medium for processing group information | |
CN110674481B (en) | Account registration method, device, equipment and storage medium of application program | |
CN115622963A (en) | Message detection method, device, equipment and medium based on industrial switch | |
CN114095899A (en) | Communication signal detection method and device, electronic equipment and computer readable medium | |
CN114938713A (en) | WLAN perception measurement method and device, electronic equipment and storage medium | |
CN112882948A (en) | Stability testing method, device and system for application and storage medium | |
CN110896569B (en) | Bullet screen automatic reconnection method, storage medium, electronic equipment and system | |
CN113296911B (en) | Cluster calling method, cluster calling device, electronic equipment and readable storage medium | |
CN115643628A (en) | Method, device, readable medium and electronic equipment for connecting wireless network | |
CN113079550B (en) | Mobile terminal control method and device and electronic equipment | |
WO2018169364A1 (en) | Electronic device and method for providing emergency call, and server therefor | |
CN114430364A (en) | Information display method and device, electronic equipment and computer readable medium | |
CN114257632A (en) | Disconnection reconnection method and device, electronic equipment and readable storage medium | |
CN105119927A (en) | Message sending, receiving method and terminal and message sending system | |
CN110633566A (en) | Intrusion detection method, device, terminal equipment and medium | |
CN112306858A (en) | Test method and device and electronic equipment | |
CN114398098B (en) | Application script execution method, device, electronic equipment and computer readable medium | |
CN114172946B (en) | Request result sending method, device, electronic equipment and computer readable medium | |
CN114866466B (en) | Device communication method, device, electronic device and readable storage medium | |
CN117294745B (en) | Network connection state information sending method, device, electronic equipment and medium | |
CN118338264B (en) | Data forwarding method and device, vehicle-mounted equipment and vehicle |
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 | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230425 Address after: Room 802, Information Building, 13 Linyin North Street, Pinggu District, Beijing, 101299 Patentee after: Beijing youzhuju Network Technology Co.,Ltd. Address before: No. 715, 7th floor, building 3, 52 Zhongguancun South Street, Haidian District, Beijing 100081 Patentee before: Beijing infinite light field technology Co.,Ltd. |
|
TR01 | Transfer of patent right |