Search

CN-116346579-B - Method, device and equipment for degrading network link

CN116346579BCN 116346579 BCN116346579 BCN 116346579BCN-116346579-B

Abstract

The invention relates to a method, a device and equipment for degrading a network link, belonging to the technical field of Internet. The method comprises the steps of acquiring an access request of a client, calling a status interface, testing the connection speed of a current network line according to the access request, judging whether the current network line fails, wherein the current network line comprises a conventional gateway domain name line and a standby escape domain name line, determining a status code of the status interface if the current network line fails, wherein the status code comprises a gateway status code and an http status code, and switching the current network line to a target network line according to the status code. When the network line breaks down, the current network line is switched according to the condition of the status code, so that the problem that the whole link cannot be used due to the network line fault in the existing network access link scheme is solved, the whole network link is unblocked under the conditions of lower cost, shorter time and no need of changing deployment, and the stability of a software system is ensured.

Inventors

  • LIU DAYONG

Assignees

  • 上海中通吉网络技术有限公司

Dates

Publication Date
20260508
Application Date
20230419

Claims (6)

  1. 1. A method of network link degradation, comprising: Acquiring an access request of a client; Calling a status interface, and testing the connection speed of a current network line according to the access request to judge whether the current network line fails, wherein the current network line comprises a conventional gateway domain name line and a standby escape domain name line; If the current network line fails, determining a status code of a status interface, wherein the status code comprises a gateway status code and an http status code; switching the current network line to a target network line according to the status code, including: When the http status code is a code corresponding to the failure of a network operator or a single-machine room, calling the status interface, testing the connection speed of the conventional gateway domain name line, and selecting the conventional gateway domain name line with the highest response speed as a first target network line; And when the gateway status code is the code corresponding to the fault of the gateway, calling the status interface, testing the connection speed of the standby escape domain name line, selecting the standby escape domain name line with the highest response speed as a second target network line, and switching the current network line to the second target network line.
  2. 2. The method according to claim 1, wherein the method further comprises: And if the conventional gateway domain name line and the standby escape domain name line are not available, switching the client to an offline mode, and storing the operation data to the local.
  3. 3. The method according to claim 2, wherein the method further comprises: automatically starting a background timer after the current network line triggers switching or the client enters an offline mode; and controlling the background timer to access the status interface according to a preset time interval, and testing the connection speed of the conventional gateway domain name line.
  4. 4. The method of claim 1, wherein the regular gateway domain name line comprises a first preset number of default CDN three-wire domain names and a second preset number of combined gateway domain names, wherein the combined gateway domain names are formed by arranging and combining a plurality of operators with a plurality of machine rooms.
  5. 5. An apparatus for network link degradation, comprising: The request acquisition module is used for acquiring the access request of the client; The speed testing module is used for calling a status interface, testing the connection speed of the current network line according to the access request and judging whether the current network line fails or not, wherein the current network line comprises a conventional gateway domain name line and a standby escape domain name line; the status code determining module is used for determining the status code of the status interface if the current network line fails, wherein the status code comprises a gateway status code and an http status code; The system comprises a state interface, a line switching module, a current network line switching module and a first target network line, wherein the state code is used for switching the current network line to the target network line according to the state code; And when the gateway status code is the code corresponding to the fault of the gateway, calling the status interface, testing the connection speed of the standby escape domain name line, selecting the standby escape domain name line with the highest response speed as a second target network line, and switching the current network line to the second target network line.
  6. 6. An apparatus for network link degradation, comprising: one or more memories having executable programs stored thereon; one or more processors configured to execute the executable program in the memory to implement the steps of the method of any one of claims 1-4.

Description

Method, device and equipment for degrading network link Technical Field The invention belongs to the technical field of Internet, and particularly relates to a method, a device and equipment for degrading a network link. Background With the rapid development of mobile networks, the quality of service problem of software systems has been increasingly focused. The shortage of resources, the investment of expensive equipment, the increasing number of users and the like all have hindered the development of software systems, and the wider mobility requirements and the higher requirements of people on service quality and business have forced the stability of the software systems to be continuously developed. At this time, the stability of the software system is ensured by the existing network equipment, resources and capacity, so that the average service quality of the software system is improved to the maximum extent, and a system stability guarantee scheme for improving the benefit is generated. In the existing network access link scheme, generally, clients such as APP, PC, applet and the like actively request domain names, after DNS domain name resolution, a target host IP is found and then reaches a target gateway through network operator lines (mobile, telecom and Unicom), the target gateway forwards the request to a main service, and finally the main service responds and responds to the clients. Therefore, the existing network access link scheme has a problem that the entire link is not usable due to the failure of the network line. Disclosure of Invention Therefore, the invention provides a method, a device and equipment for degrading a network link, which are helpful to solve the problem that the whole link is unusable due to the failure of a network line in the existing network access link scheme. In order to achieve the above purpose, the invention adopts the following technical scheme: In a first aspect, the present invention provides a method for degrading a network link, including: Acquiring an access request of a client; Calling a status interface, and testing the connection speed of a current network line according to the access request to judge whether the current network line fails, wherein the current network line comprises a conventional gateway domain name line and a standby escape domain name line; If the current network line fails, determining a status code of a status interface, wherein the status code comprises a gateway status code and an http status code; and switching the current network line to a target network line according to the state code. Further, the switching the current network line to the target network line according to the status code includes: When the http status code is a first preset error code, performing a connection speed test on the conventional gateway domain name line, and switching the current network line to a first target network line; And when the gateway state code is a second preset error code, performing connection speed test on the standby escape domain name line, and switching the current network line to a second target network line. Further, the first preset error code is a code corresponding to the fault of the network operator or the single computer, and Performing a connection speed test on the conventional gateway domain name line, and switching the current network line to a first target network line, including: calling the status interface, performing connection speed test on the conventional gateway domain name line, and selecting the conventional gateway domain name line with the highest response speed as the first target network line; And switching the current network line to the first target network line. Further, the second preset error code is a code corresponding to the fault of the gateway, and Performing a connection speed test on the standby escape domain name line, and switching the current network line to a second target network line, including: Calling the status interface, performing connection speed test on the standby escape domain name line, and selecting the standby escape domain name line with the highest response speed as the second target network line; And switching the current network line to the second target network line. Further, the method further comprises: And if the conventional gateway domain name line and the standby escape domain name line are not available, switching the client to an offline mode, and storing the operation data to the local. Further, the method further comprises: automatically starting a background timer after the current network line triggers switching or the client enters an offline mode; and controlling the background timer to access the status interface according to a preset time interval, and testing the connection speed of the conventional gateway domain name line. Further, the conventional gateway domain name line comprises a first preset number of default CDN three-wire domain names and a sec