CN109951549A - Network page access method, device and computer-readable storage medium - Google Patents
Network page access method, device and computer-readable storage medium Download PDFInfo
- Publication number
- CN109951549A CN109951549A CN201910211948.4A CN201910211948A CN109951549A CN 109951549 A CN109951549 A CN 109951549A CN 201910211948 A CN201910211948 A CN 201910211948A CN 109951549 A CN109951549 A CN 109951549A
- Authority
- CN
- China
- Prior art keywords
- tested
- normal state
- access
- web page
- target
- 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
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了一种网络页面的访问方法,所述网络页面的访问方法包括以下步骤:检测到网络页面访问异常时,获取各个待测IP;向各个所述待测IP发送探测请求;接收所述待测IP的反馈结果,将所述反馈结果中为正常状态的所述待测IP确定目标IP;将当前网络页面的访问入口切换为所述目标IP。本发明还公开了一种网络页面的访问装置及计算机可读存储介质。通过应用系统中植入的软件开发工具包探测出待测IP中正常状态的目标IP,并将该目标IP作为当前网络页面的访问入口,当前用户的业务请求则会通过该目标IP来完成,无需等待域名系统缓存。实现网络页面访问失败时,IP地址的快速切换,保障用户能够及时访问页面。
The invention discloses a method for accessing a network page. The method for accessing a network page includes the following steps: when an abnormality in accessing a network page is detected, obtain each IP to be tested; send a detection request to each of the IP to be tested; receive all the IPs to be tested; The feedback result of the IP to be tested is determined, and the IP to be tested that is in a normal state in the feedback result is determined as a target IP; the access entry of the current network page is switched to the target IP. The invention also discloses a network page access device and a computer-readable storage medium. Through the software development kit embedded in the application system, the target IP in the normal state of the IP to be tested is detected, and the target IP is used as the access entry of the current network page, and the current user's service request will be completed through the target IP. No need to wait for DNS caching. When the network page access fails, the IP address can be quickly switched to ensure that the user can access the page in time.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及网络页面的访问方法、装置及计算机可读存储介质。The present invention relates to the field of communication technologies, and in particular, to a method, an apparatus, and a computer-readable storage medium for accessing a web page.
背景技术Background technique
在用户访问网页过程中,一旦出现公网链路问题、跨网访问、网络策略设置以及服务端配置变更等状况时,则会导致用户访问的服务端节点IP不可达或应用错误,页面无法访问。When a user accesses a web page, once the public network link problem, cross-network access, network policy setting and server configuration change occur, the IP address of the server node accessed by the user is unreachable or the application is wrong, and the page cannot be accessed. .
由于,用户是通过域名访问页面的,当服务端IP应用异常时,通常需要刷新域名系统(Domain Name System,简称DNS)缓存获取正确的IP或者是等待服务端异常恢复。导致页面异常恢复的耗时长,用户无法及时访问页面。Since the user accesses the page through the domain name, when the server IP application is abnormal, it is usually necessary to refresh the Domain Name System (DNS) cache to obtain the correct IP or wait for the abnormal recovery of the server. As a result, the abnormal recovery of the page takes a long time, and the user cannot access the page in time.
上述内容仅用于辅助理解本发明的技术方案,并不代表承认上述内容是现有技术。The above content is only used to assist the understanding of the technical solutions of the present invention, and does not mean that the above content is the prior art.
发明内容SUMMARY OF THE INVENTION
本发明的主要目的在于提供一种网络页面的访问方法、装置及计算机可读存储介质,旨在解决当服务端IP应用异常时,通常需要刷新域名系统缓存获取正确的IP或者是等待服务端异常恢复。导致页面异常恢复的耗时长,用户无法及时访问页面的技术问题。The main purpose of the present invention is to provide a network page access method, device and computer-readable storage medium, which aims to solve the problem that when the server IP application is abnormal, it is usually necessary to refresh the domain name system cache to obtain the correct IP or wait for the server to be abnormal. recover. A technical problem that causes the abnormal recovery of the page to take a long time, and the user cannot access the page in time.
为实现上述目的,本发明提供一种网络页面的访问方法,所述网络页面的访问方法包括以下步骤:In order to achieve the above object, the present invention provides a method for accessing a web page, and the method for accessing the web page includes the following steps:
检测到网络页面访问异常时,获取各个待测IP;When an abnormal access to a web page is detected, each IP to be tested is obtained;
向各个所述待测IP发送探测请求;Send a probe request to each of the IPs to be tested;
接收所述待测IP的反馈结果,将所述反馈结果中为正常状态的所述待测IP确定目标IP;Receive the feedback result of the IP to be tested, and determine the target IP of the IP to be tested that is in a normal state in the feedback result;
将当前网络页面的访问入口切换为所述目标IP。Switch the access entry of the current web page to the target IP.
可选地,所述获取各个待测IP的步骤包括:Optionally, the step of obtaining each IP to be tested includes:
获取预设IP列表;Get a list of preset IPs;
在所述IP列表的各组IP中各选取一个IP作为所述待测IP。One IP is selected from each group of IPs in the IP list as the IP to be tested.
可选地,所述接收所述待测IP的反馈结果,并根据所述反馈结果确定目标IP的步骤包括:Optionally, the step of receiving the feedback result of the IP to be tested and determining the target IP according to the feedback result includes:
接收所述待测IP的反馈结果;receiving the feedback result of the IP to be tested;
判断是否存在多个所述反馈结果为正常状态;judging whether there are multiple feedback results that are in a normal state;
当存在多个所述反馈结果为正常状态时,获取所述正常状态的反馈结果中探测请求的往返时间;When there are multiple feedback results that are in the normal state, acquiring the round-trip time of the probe request in the feedback results of the normal state;
将所述往返时间最小的IP作为所述目标IP;Use the IP with the smallest round-trip time as the target IP;
当仅存在一个所述反馈结果为正常状态时,将所述反馈结果为正常状态的所述待测IP作为所述目标IP。When only one of the feedback results is in a normal state, the IP to be tested whose feedback result is in a normal state is used as the target IP.
可选地,所述获取所述正常状态的反馈结果中的探测请求往返时间的步骤之后,还包括:Optionally, after the step of acquiring the round-trip time of the probe request in the feedback result of the normal state, the method further includes:
获取各个待测IP的往返时间修正值;Obtain the round-trip time correction value of each IP to be tested;
根据所述往返时间修正值更新所述待测IP的往返时间,并在所述往返时间更新后将更新后的所述往返时间最小的IP作为所述目标IP。The round-trip time of the IP to be tested is updated according to the round-trip time correction value, and after the round-trip time is updated, the updated IP with the smallest round-trip time is used as the target IP.
可选地,所述判断是否存在多个所述反馈结果为正常状态的步骤之后,还包括:Optionally, after the judging whether there are multiple steps of the feedback result being a normal state, the method further includes:
当所述反馈结果中均不存在所述正常状态时,等待域名系统缓存;When the normal state does not exist in the feedback results, wait for the domain name system to cache;
在检测到所述域名系统缓存结束后,采用所述域名系统中的IP访问网络页面。After detecting that the caching of the domain name system is over, use the IP in the domain name system to access the web page.
可选地,所述判断是否存在多个所述反馈结果为正常状态的步骤之后,还包括:Optionally, after the judging whether there are multiple steps of the feedback result being a normal state, the method further includes:
当所述反馈结果中均不存在所述正常状态时,发送提示信息,以提示当前无正常IP。When the normal state does not exist in the feedback results, prompt information is sent to prompt that there is currently no normal IP.
此外,为实现上述目的,本发明还提供一种网络页面的访问装置,其特征在于,所述网络页面的访问装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的网络页面的访问程序,所述网络页面的访问程序被所述处理器执行时实现如上所述的网络页面的访问方法的步骤。In addition, in order to achieve the above object, the present invention also provides a device for accessing a network page, characterized in that the device for accessing a network page includes: a memory, a processor, and a device stored in the memory and available on the processor An access program for a web page running on the web page, when the web page access program is executed by the processor, implements the steps of the web page access method described above.
此外,为实现上述目的,本发明还提供一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有网络页面的访问程序,所述网络页面的访问程序被处理器执行时实现如上所述的网络页面的访问方法的步骤。In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an access program for a web page, and the access program for the web page is executed by a processor When implementing the steps of the access method for the network page as described above.
本发明实施例提出的一种网络页面的访问方法、装置及计算机可读存储介质,当检测到网络页面访问异常时,软件开发工具包调取各个待测IP,并同时向各个待测IP发送探测请求。移动终端向各个待测IP的服务端发送预设代码的探测请求后,服务端根据探测请求反馈给移动终端反馈结果。当反馈结果为正常状态时,表明该服务端可用,则将反馈该反馈结果的待测IP作为目标IP。进而将当前网络页面的访问入口切换为该目标IP。通过应用系统中植入的软件开发工具包探测出待测IP中正常状态的目标IP,并将该目标IP作为当前网络页面的访问入口,当前用户的业务请求则会通过该目标IP来完成,无需等待域名系统缓存。实现网络页面访问失败时,IP地址的快速切换,保障用户能够及时访问页面。A method, device, and computer-readable storage medium for accessing a web page proposed by an embodiment of the present invention, when abnormal web page access is detected, the software development toolkit retrieves each IP to be tested, and simultaneously sends a message to each IP to be tested Probe request. After the mobile terminal sends the detection request of the preset code to the server of each IP to be tested, the server feeds back the result to the mobile terminal according to the detection request. When the feedback result is in a normal state, it indicates that the server is available, and the IP to be tested that feeds back the feedback result is used as the target IP. Then, the access entry of the current network page is switched to the target IP. Through the software development kit embedded in the application system, the target IP in the normal state of the IP to be tested is detected, and the target IP is used as the access entry of the current network page, and the current user's service request will be completed through the target IP. No need to wait for DNS caching. When the network page access fails, the IP address can be quickly switched to ensure that the user can access the page in time.
附图说明Description of drawings
图1是本发明实施例方案涉及的硬件运行环境的终端结构示意图;1 is a schematic diagram of a terminal structure of a hardware operating environment involved in an embodiment of the present invention;
图2为本发明网络页面的访问方法第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of a method for accessing a web page according to the present invention;
图3为本发明网络页面的访问方法设计的IP列表示意图;Fig. 3 is the IP list schematic diagram of the access method design of the network page of the present invention;
图4为本发明网络页面的访问第二实施例中接收所述待测IP的反馈结果,并根据所述反馈结果确定目标IP的步骤的细化流程示意图。FIG. 4 is a detailed flow chart of the steps of receiving the feedback result of the IP to be tested and determining the target IP according to the feedback result in the second embodiment of the network page access of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
本发明实施例的主要解决方案是:The main solutions of the embodiments of the present invention are:
检测到网络页面访问异常时,获取各个待测IP;When an abnormal access to a web page is detected, each IP to be tested is obtained;
向各个所述待测IP发送探测请求;Send a probe request to each of the IPs to be tested;
接收所述待测IP的反馈结果,将所述反馈结果中为正常状态的所述待测IP确定目标IP;Receive the feedback result of the IP to be tested, and determine the target IP of the IP to be tested that is in a normal state in the feedback result;
将当前网络页面的访问入口切换为所述目标IP。Switch the access entry of the current web page to the target IP.
由于现有技术中用户是通过域名访问页面的,当服务端IP应用异常时,通常需要刷新域名系统缓存获取正确的IP或者是等待服务端异常恢复。导致页面异常恢复的耗时长,用户无法及时访问页面。Since users access pages through domain names in the prior art, when the server IP application is abnormal, it is usually necessary to refresh the domain name system cache to obtain the correct IP or wait for the abnormal recovery of the server. As a result, the abnormal recovery of the page takes a long time, and the user cannot access the page in time.
本发明提供一种解决方案,当检测到网络页面访问异常时,软件开发工具包调取各个待测IP,并同时向各个待测IP发送探测请求。移动终端向各个待测IP的服务端发送预设代码的探测请求后,服务端根据探测请求反馈给移动终端反馈结果。当反馈结果为正常状态时,表明该服务端可用,则将反馈该反馈结果的待测IP作为目标IP。进而将当前网络页面的访问入口切换为该目标IP。通过应用系统中植入的软件开发工具包探测出待测IP中正常状态的目标IP,并将该目标IP作为当前网络页面的访问入口,当前用户的业务请求则会通过该目标IP来完成,无需等待域名系统缓存。实现网络页面访问失败时,IP地址的快速切换,保障用户能够及时访问页面。The present invention provides a solution. When an abnormality of network page access is detected, the software development toolkit retrieves each IP to be tested, and simultaneously sends a detection request to each IP to be tested. After the mobile terminal sends the detection request of the preset code to the server of each IP to be tested, the server feeds back the result to the mobile terminal according to the detection request. When the feedback result is in a normal state, it indicates that the server is available, and the IP to be tested that feeds back the feedback result is used as the target IP. Then, the access entry of the current network page is switched to the target IP. Through the software development kit embedded in the application system, the target IP in the normal state of the IP to be tested is detected, and the target IP is used as the access entry of the current network page, and the current user's service request will be completed through the target IP. No need to wait for DNS caching. When the network page access fails, the IP address can be quickly switched to ensure that the user can access the page in time.
如图1所示,图1是本发明实施例方案涉及的硬件运行环境的终端结构示意图。As shown in FIG. 1 , FIG. 1 is a schematic diagram of a terminal structure of a hardware operating environment involved in an embodiment of the present invention.
本发明实施例终端可以是PC,也可以是智能手机、平板电脑、电子书阅读器、便携计算机等具有网页访问功能的可移动式终端设备。The terminal in the embodiment of the present invention may be a PC, and may also be a mobile terminal device with a webpage access function, such as a smart phone, a tablet computer, an e-book reader, and a portable computer.
如图1所示,该终端可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1 , the terminal may include: a processor 1001 , such as a CPU, a network interface 1004 , a user interface 1003 , a memory 1005 , and a communication bus 1002 . Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. Optionally, the network interface 1004 may include a standard wired interface and a wireless interface (eg, a WI-FI interface). The memory 1005 may be high-speed RAM memory, or may be non-volatile memory, such as disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .
本领域技术人员可以理解,图1中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the terminal structure shown in FIG. 1 does not constitute a limitation on the terminal, and may include more or less components than the one shown, or combine some components, or arrange different components.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及网络页面的访问程序。As shown in FIG. 1 , the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a program for accessing a network page.
在图1所示的终端中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的网络页面的访问程序,并执行以下操作:In the terminal shown in FIG. 1 , the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client (client) and perform data communication with the client; and the processor 1001 can be used to invoke an access program for a web page stored in memory 1005, and perform the following operations:
检测到网络页面访问异常时,获取各个待测IP;When an abnormal access to a web page is detected, each IP to be tested is obtained;
向各个所述待测IP发送探测请求;Send a probe request to each of the IPs to be tested;
接收所述待测IP的反馈结果,将所述反馈结果中为正常状态的所述待测IP确定目标IP;Receive the feedback result of the IP to be tested, and determine the target IP of the IP to be tested that is in a normal state in the feedback result;
将当前网络页面的访问入口切换为所述目标IP。Switch the access entry of the current web page to the target IP.
进一步地,处理器1001可以调用存储器1005中存储的网络页面的访问程序,还执行以下操作:Further, the processor 1001 can call the access program of the network page stored in the memory 1005, and also perform the following operations:
获取预设IP列表;Get a list of preset IPs;
在所述IP列表的各组IP中各选取一个IP作为所述待测IP。One IP is selected from each group of IPs in the IP list as the IP to be tested.
进一步地,处理器1001可以调用存储器1005中存储的网络页面的访问程序,还执行以下操作:Further, the processor 1001 can call the access program of the network page stored in the memory 1005, and also perform the following operations:
接收所述待测IP的反馈结果;receiving the feedback result of the IP to be tested;
判断是否存在多个所述反馈结果为正常状态;judging whether there are multiple feedback results that are in a normal state;
当存在多个所述反馈结果为正常状态时,获取所述正常状态的反馈结果中探测请求的往返时间;When there are multiple feedback results that are in the normal state, acquiring the round-trip time of the probe request in the feedback results of the normal state;
将所述往返时间最小的IP作为所述目标IP;Use the IP with the smallest round-trip time as the target IP;
当仅存在一个所述反馈结果为正常状态时,将所述反馈结果为正常状态的所述待测IP作为所述目标IP。When only one of the feedback results is in a normal state, the IP to be tested whose feedback result is in a normal state is used as the target IP.
进一步地,处理器1001可以调用存储器1005中存储的网络页面的访问程序,还执行以下操作:Further, the processor 1001 can call the access program of the network page stored in the memory 1005, and also perform the following operations:
获取各个待测IP的往返时间修正值;Obtain the round-trip time correction value of each IP to be tested;
根据所述往返时间修正值更新所述待测IP的往返时间,并在所述往返时间更新后将更新后的所述往返时间最小的IP作为所述目标IP。The round-trip time of the IP to be tested is updated according to the round-trip time correction value, and after the round-trip time is updated, the updated IP with the smallest round-trip time is used as the target IP.
进一步地,处理器1001可以调用存储器1005中存储的网络页面的访问程序,还执行以下操作:Further, the processor 1001 can call the access program of the network page stored in the memory 1005, and also perform the following operations:
当所述反馈结果中均不存在所述正常状态时,等待域名系统缓存;When the normal state does not exist in the feedback results, wait for the domain name system to cache;
在检测到所述域名系统缓存结束后,采用所述域名系统中的IP访问网络页面。After detecting that the caching of the domain name system is over, use the IP in the domain name system to access the web page.
进一步地,处理器1001可以调用存储器1005中存储的网络页面的访问程序,还执行以下操作:Further, the processor 1001 can call the access program of the network page stored in the memory 1005, and also perform the following operations:
当所述反馈结果中均不存在所述正常状态时,发送提示信息,以提示当前无正常IP。When the normal state does not exist in the feedback results, prompt information is sent to prompt that there is currently no normal IP.
参照图2,本发明网络页面的访问方法第一实施例,所述网络页面的访问方法包括:Referring to FIG. 2, the first embodiment of a method for accessing a web page of the present invention, the method for accessing a web page includes:
步骤S10,检测到网络页面访问异常时,获取各个待测IP。In step S10, each IP to be tested is acquired when it is detected that the access to the network page is abnormal.
步骤S20,向各个所述待测IP发送探测请求。Step S20, sending a probe request to each of the IPs to be tested.
用户在浏览网页时,一旦出现公网链路问题、跨网访问、网络策略设置以及服务端配置变更等状况时,则会导致用户访问的服务端节点IP不可达或应用错误,页面无法访问。本发明提供的网络页面的访问方法所涉及的终端为计算机、智能手机等移动终端,在所述移动终端内上预先加载有相关的应用系统,包括但不限于APP或者网页系统等,在所述应用系统内植入软件开发工具包(Software Development Kit,简称SDK)。在所述软件开发工具包中预设由多个服务端IP组成的IP列表。When a user browses a web page, once the public network link problem, cross-network access, network policy setting and server configuration change occur, the IP address of the server node accessed by the user will be unreachable or the application error will occur, and the page cannot be accessed. The terminal involved in the method for accessing a web page provided by the present invention is a mobile terminal such as a computer and a smart phone, and a related application system, including but not limited to an APP or a web page system, is preloaded on the mobile terminal. A software development kit (Software Development Kit, SDK for short) is implanted in the application system. An IP list consisting of multiple server IPs is preset in the software development kit.
例如图3中所示的IP列表示意图。在IP列表中的IP分为多个组,每组中的两个或多个IP为相互匹配的IP。For example, the schematic diagram of the IP list shown in FIG. 3 . The IPs in the IP list are divided into multiple groups, and two or more IPs in each group are IPs that match each other.
用户打开应用系统,浏览网络页面时,移动终端获取网络页面的访问状态,当检测到网络页面访问异常时,软件开发工具包调取各个待测IP,并同时向各个待测IP发送探测请求。When the user opens the application system and browses the web page, the mobile terminal obtains the access status of the web page. When an abnormal web page access is detected, the software development kit calls each IP to be tested, and sends a probe request to each IP to be tested at the same time.
其中,所述待测IP为预设的IP列表中的IP。待测IP可以包含IP列表中的所有IP,也可以是IP列表中的部分IP。Wherein, the IP to be tested is an IP in a preset IP list. The IP to be tested can include all IPs in the IP list, or part of the IPs in the IP list.
此外,由于IP列表中每组IP相互匹配,同组的IP中,若有一个IP异常不可使用,则同组的其他IP也不可使用。同时,为了能够探测到可用的IP,保证待测IP的数量足够多。所以,待测IP的获取方法可以是,在预设IP列表的各组IP中各取一个IP作为待测IP进行探测,从而实现既能最大限度的提供可用的IP,又能够减少探测的待测IP数量,提高探测效率。In addition, because each group of IPs in the IP list matches each other, if one IP in the same group is abnormally unavailable, other IPs in the same group are also unavailable. At the same time, in order to detect available IPs, ensure that the number of IPs to be tested is sufficient. Therefore, the method for obtaining the IP to be tested may be to select one IP from each group of IPs in the preset IP list as the IP to be tested for detection, so as to provide the available IP to the maximum extent and reduce the need for detection. Measure the number of IPs to improve detection efficiency.
步骤S30,接收所述待测IP的反馈结果,将所述反馈结果中为正常状态的所述待测IP确定目标IP;Step S30, receiving the feedback result of the IP to be tested, and determining the target IP of the IP to be tested that is in a normal state in the feedback result;
步骤S40,将当前网络页面的访问入口切换为所述目标IP。Step S40, switching the access entry of the current web page to the target IP.
移动终端向各个待测IP的服务端发送预设代码的探测请求后,服务端根据探测请求反馈给移动终端反馈结果,反馈结果包括往返时间(RTT)和状态码。状态码包括正常状态和异常状态的代码。当反馈结果的状态码为正常状态时,表明该服务端可用,则将反馈该反馈结果的待测IP作为目标IP。进而将当前网络页面的访问入口切换为该目标IP。通过应用系统中植入的软件开发工具包探测出待测IP中正常状态的目标IP,并将该目标IP作为当前网络页面的访问入口,当前用户的业务请求则会通过该目标IP来完成,无需等待域名系统缓存。实现网络页面访问失败时,IP地址的快速切换,保障用户能够及时访问页面。After the mobile terminal sends a detection request with a preset code to the server of each IP to be tested, the server feeds back the result to the mobile terminal according to the detection request, and the feedback result includes a round-trip time (RTT) and a status code. Status codes include codes for normal states and abnormal states. When the status code of the feedback result is normal, it indicates that the server is available, and the IP to be tested that feeds back the feedback result is used as the target IP. Then, the access entry of the current network page is switched to the target IP. Through the software development kit embedded in the application system, the target IP in the normal state of the IP to be tested is detected, and the target IP is used as the access entry of the current network page, and the current user's service request will be completed through the target IP. No need to wait for DNS caching. When the network page access fails, the IP address can be quickly switched to ensure that the user can access the page in time.
在本实施例中,当检测到网络页面访问异常时,软件开发工具包调取各个待测IP,并同时向各个待测IP发送探测请求。移动终端向各个待测IP的服务端发送预设代码的探测请求后,服务端根据探测请求反馈给移动终端反馈结果。当反馈结果为正常状态时,表明该服务端可用,则将反馈该反馈结果的待测IP作为目标IP。进而将当前网络页面的访问入口切换为该目标IP。通过应用系统中植入的软件开发工具包探测出待测IP中正常状态的目标IP,并将该目标IP作为当前网络页面的访问入口,当前用户的业务请求则会通过该目标IP来完成,无需等待域名系统缓存。实现网络页面访问失败时,IP地址的快速切换,保障用户能够及时访问页面。In this embodiment, when an abnormality in accessing a web page is detected, the software development toolkit retrieves each IP to be tested, and simultaneously sends a detection request to each IP to be tested. After the mobile terminal sends the detection request of the preset code to the server of each IP to be tested, the server feeds back the result to the mobile terminal according to the detection request. When the feedback result is in a normal state, it indicates that the server is available, and the IP to be tested that feeds back the feedback result is used as the target IP. Then, the access entry of the current network page is switched to the target IP. Through the software development kit embedded in the application system, the target IP in the normal state of the IP to be tested is detected, and the target IP is used as the access entry of the current network page, and the current user's service request will be completed through the target IP. No need to wait for DNS caching. When the network page access fails, the IP address can be quickly switched to ensure that the user can access the page in time.
参照图4,本发明网络页面的访问方法第二实施例,基于上述第一实施例,所述步骤S30包括:Referring to FIG. 4 , the second embodiment of the method for accessing a web page of the present invention, based on the first embodiment described above, the step S30 includes:
步骤S31,接收所述待测IP的反馈结果。Step S31, receiving the feedback result of the IP to be tested.
步骤S32,判断是否存在多个所述反馈结果为正常状态。Step S32, judging whether there are multiple feedback results that are in a normal state.
步骤S33,当存在多个所述反馈结果为正常状态时,获取所述正常状态的反馈结果中探测请求的往返时间。Step S33, when there are multiple feedback results that are in a normal state, obtain the round-trip time of the probe request in the feedback results of the normal state.
步骤S34,将所述往返时间最小的IP作为所述目标IP。Step S34, taking the IP with the smallest round-trip time as the target IP.
步骤S35,当仅存在一个所述反馈结果为正常状态时,将所述反馈结果为正常状态的所述待测IP作为所述目标IP。Step S35, when only one of the feedback results is in a normal state, the IP to be tested whose feedback result is in a normal state is used as the target IP.
在接收到待测IP基于探测请求反馈的反馈结果后,获取该反馈结果中的往返时间以及状态码,状态码分为正常状态和异常状态,可能存在多个正常状态的待测IP。因此,在确定目标IP时,首先判断是否存在多个反馈结果为正常状态的待测IP,当存在多个反馈结果为正常状态时,再获取为正常状态的反馈结果中的往返时间。往返时间越短,表面该待测IP的服务端处理业务请求的能力越高,则将往返时间最小的待测IP作为目标IP,提高网页响应速度。当仅存在一个反馈结果为正常状态时,直接将该正常状态的待测IP作为目标IP。After receiving the feedback result of the IP to be tested based on the probe request, obtain the round-trip time and status code in the feedback result. The status code is divided into normal state and abnormal state, and there may be multiple IPs to be tested in normal state. Therefore, when determining the target IP, it is first determined whether there are multiple IPs to be tested whose feedback results are in the normal state, and when there are multiple feedback results that are in the normal state, the round-trip time in the feedback results in the normal state is obtained. The shorter the round-trip time, the higher the ability of the server of the IP to be tested to process service requests. The IP to be tested with the smallest round-trip time is used as the target IP to improve the response speed of the web page. When only one feedback result is in a normal state, the IP to be tested in the normal state is directly used as the target IP.
此外,若所有反馈结果中的状态码均为异常状态,不存在正常状态的待测IP,则控制应用系统继续等待域名系统缓存,在域名系统缓存结束后,根据域名系统缓存结果,从域名系统中获取可用IP,采用此IP进行网页访问,保证网络页面能够访问成功。进一步,在不存在正常状态的反馈结果时,可以生成提示信息,提醒用户当前应用系统中没有可用的IP,请用户耐心等待域名系统缓存,避免页面长时间异常,用户不明状况,离开页面。In addition, if the status codes in all the feedback results are abnormal and there is no normal IP to be tested, the control application system will continue to wait for the DNS cache. Obtain an available IP from the Internet, and use this IP to access the web page to ensure that the web page can be accessed successfully. Further, when there is no feedback result of normal state, a prompt message can be generated to remind the user that there is no available IP in the current application system, and the user is requested to wait patiently for the domain name system to cache, so as to avoid the page being abnormal for a long time, the user is unknown, and the user leaves the page.
进一步的,对各个待测IP预先设置往返时间修正值,在移动终端获取到状态码为正常状态的各个待测IP反馈的往返时间后,采用各自的往返时间修正值将待测IP的往返时间进行修正。取修正后的往返时间最小的IP作为目标IP。其中,往返时间的修正操作可以是将待测IP的真实往返时间加上往返时间修正值,也可以是将真实往返时间乘以往返时间修正值作为修正后的往返时间,还可以是其他修正方法,在此不做限定。Further, a round-trip time correction value is preset for each IP to be tested, and after the mobile terminal obtains the round-trip time fed back by each IP to be tested whose status code is in a normal state, the round-trip time of the IP to be tested is calculated using the respective round-trip time correction value. Make corrections. Take the IP with the smallest modified round-trip time as the destination IP. The round-trip time correction operation may be adding the real round-trip time of the IP to be tested plus the round-trip time correction value, or multiplying the real round-trip time by the round-trip time correction value as the corrected round-trip time, or other correction methods. , which is not limited here.
例如,当修正方式为真实往返时间加上往返时间修正值时,检测到三个待测IP的状态码均为正常状态,该三个待测IP地址分别为ID1,ID2和ID3,其中,ID1预设的往返时间修正值为0ms,ID2预设的往返时间修正值为200ms,ID3预设的往返时间修正值为100ms。获取到的ID1真实的往返时间为200ms,ID2真实的往返时间为100ms,ID3真实的往返时间为200ms。则修正后ID1的往返时间为200ms,ID2的往返时间为300ms,ID3的往返时间为300ms,即取ID1作为目标IP。For example, when the correction method is the real round-trip time plus the round-trip time correction value, it is detected that the status codes of the three IP addresses to be tested are all normal, and the three IP addresses to be tested are ID1, ID2 and ID3, among which, ID1 The preset round-trip time correction value is 0ms, the preset round-trip time correction value of ID2 is 200ms, and the preset round-trip time correction value of ID3 is 100ms. The obtained real round-trip time of ID1 is 200ms, the real round-trip time of ID2 is 100ms, and the real round-trip time of ID3 is 200ms. Then the round-trip time of ID1 after correction is 200ms, the round-trip time of ID2 is 300ms, and the round-trip time of ID3 is 300ms, that is, ID1 is taken as the target IP.
各个待测IP地址的往返时间修正值可根据各个待测IP地址对应的IDC机房的运行成本及各个IP地址的RTT分布确定;例如可设置为IP地址对应的IDC机房的运行成本越高,则对应的往返延时修正值越大,或者IP地址的真实往返延时越小,则对应的往返延时修正值越大,还可以综合IDC机房的运行成本及各个IP地址的RTT分布进行设置。通过IP地址修正值的修正,使得应用程序对应的各个IP地址接入的终端数量均衡。The round-trip time correction value of each IP address to be tested can be determined according to the operating cost of the IDC room corresponding to each IP address to be tested and the RTT distribution of each IP address; for example, it can be set to the higher the operating cost of the IDC room corresponding to the IP address, the The larger the corresponding round-trip delay correction value is, or the smaller the real round-trip delay of the IP address is, the larger the corresponding round-trip delay correction value will be. It can also be set based on the operating cost of the IDC room and the RTT distribution of each IP address. Through the correction of the IP address correction value, the number of terminals accessed by each IP address corresponding to the application program is balanced.
在本实施例中,在接收到待测IP基于探测请求反馈的反馈结果后,获取该反馈结果中的往返时间以及状态码,状态码分为正常状态和异常状态,可能存在多个正常状态的待测IP。因此,在确定目标IP时,首先判断是否存在多个反馈结果为正常状态的待测IP,当存在多个反馈结果为正常状态时,再获取为正常状态的反馈结果中的往返时间。往返时间越短,表面该待测IP的服务端处理业务请求的能力越高,则将往返时间最小的待测IP作为目标IP,提高网页响应速度。当仅存在一个反馈结果为正常状态时,直接将该正常状态的待测IP作为目标IP。同一时刻网络页面只需要一个访问接口,因此目标IP只有一个,本实施例中的技术方案可有效避免在存在多个正常状态的反馈结果时,程序无法选定目标IP,造成网络页面不能够及时访问成功的现象发生,为用户提供良好的页面访问环境。In this embodiment, after receiving the feedback result of the IP to be tested based on the probe request feedback, the round-trip time and status code in the feedback result are obtained. The status code is divided into a normal state and an abnormal state, and there may be multiple normal states. IP to be tested. Therefore, when determining the target IP, it is first determined whether there are multiple IPs to be tested whose feedback results are in the normal state, and when there are multiple feedback results that are in the normal state, the round-trip time in the feedback results in the normal state is obtained. The shorter the round-trip time, the higher the ability of the server of the IP to be tested to process service requests. The IP to be tested with the smallest round-trip time is used as the target IP to improve the response speed of the web page. When only one feedback result is in a normal state, the IP to be tested in the normal state is directly used as the target IP. The network page only needs one access interface at the same time, so there is only one target IP. The technical solution in this embodiment can effectively prevent the program from being unable to select the target IP when there are multiple feedback results of the normal state, resulting in the network page being unable to be timely. The phenomenon of successful access occurs, providing users with a good page access environment.
此外,本发明实施例还提出一种网络页面的访问装置,所述网络页面的访问装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的网络页面的访问程序,所述网络页面的访问程序被所述处理器执行时实现如上各个实施例所述的网络页面的访问方法的步骤。In addition, an embodiment of the present invention also provides a device for accessing a network page, where the device for accessing a network page includes: a memory, a processor, and access to a network page stored in the memory and running on the processor The program, when the program for accessing the network page is executed by the processor, implements the steps of the method for accessing the network page described in the above embodiments.
此外,本发明实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有网络页面的访问程序,所述网络页面的访问程序被处理器执行时实现如上各个实施例所述的网络页面的访问方法的步骤。In addition, an embodiment of the present invention also provides a computer-readable storage medium, where an access program for a network page is stored on the computer-readable storage medium, and the access program for the network page is executed by a processor. The steps of the method for accessing the web page described above.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or system comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or system. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or system that includes the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on such understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disk), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields , are similarly included in the scope of patent protection of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910211948.4A CN109951549B (en) | 2019-03-19 | 2019-03-19 | Network page access method, device and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910211948.4A CN109951549B (en) | 2019-03-19 | 2019-03-19 | Network page access method, device and computer-readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109951549A true CN109951549A (en) | 2019-06-28 |
CN109951549B CN109951549B (en) | 2022-07-12 |
Family
ID=67011096
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910211948.4A Active CN109951549B (en) | 2019-03-19 | 2019-03-19 | Network page access method, device and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109951549B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111131442A (en) * | 2019-12-19 | 2020-05-08 | 广州品唯软件有限公司 | Webpage data monitoring method, terminal equipment and readable storage medium |
CN111866124A (en) * | 2020-07-17 | 2020-10-30 | 北京金山云网络技术有限公司 | Method, device, server and machine-readable storage medium for accessing webpage |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140192675A1 (en) * | 2013-01-07 | 2014-07-10 | Verizon Patent And Licensing Inc. | Method and apparatus for internet protocol (ip) logical wire security |
CN106357841A (en) * | 2016-11-02 | 2017-01-25 | 腾讯科技(深圳)有限公司 | Domain name resolution method, device and system |
CN106850813A (en) * | 2017-02-14 | 2017-06-13 | 合网络技术(北京)有限公司 | Network service address changing method and device |
CN108173976A (en) * | 2016-12-07 | 2018-06-15 | 腾讯科技(深圳)有限公司 | Domain name analytic method and device |
CN109120746A (en) * | 2018-09-30 | 2019-01-01 | 新华三技术有限公司 | Method for network address translation, device and address-translating device |
US20190052576A1 (en) * | 2010-04-01 | 2019-02-14 | Cloudflare, Inc. | Internet-based proxy security services |
CN109347947A (en) * | 2018-10-15 | 2019-02-15 | 郑州云海信息技术有限公司 | A load balancing method, domain name server and cluster nas server |
-
2019
- 2019-03-19 CN CN201910211948.4A patent/CN109951549B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190052576A1 (en) * | 2010-04-01 | 2019-02-14 | Cloudflare, Inc. | Internet-based proxy security services |
US20140192675A1 (en) * | 2013-01-07 | 2014-07-10 | Verizon Patent And Licensing Inc. | Method and apparatus for internet protocol (ip) logical wire security |
CN106357841A (en) * | 2016-11-02 | 2017-01-25 | 腾讯科技(深圳)有限公司 | Domain name resolution method, device and system |
CN108173976A (en) * | 2016-12-07 | 2018-06-15 | 腾讯科技(深圳)有限公司 | Domain name analytic method and device |
CN106850813A (en) * | 2017-02-14 | 2017-06-13 | 合网络技术(北京)有限公司 | Network service address changing method and device |
CN109120746A (en) * | 2018-09-30 | 2019-01-01 | 新华三技术有限公司 | Method for network address translation, device and address-translating device |
CN109347947A (en) * | 2018-10-15 | 2019-02-15 | 郑州云海信息技术有限公司 | A load balancing method, domain name server and cluster nas server |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111131442A (en) * | 2019-12-19 | 2020-05-08 | 广州品唯软件有限公司 | Webpage data monitoring method, terminal equipment and readable storage medium |
CN111131442B (en) * | 2019-12-19 | 2023-04-07 | 广州品唯软件有限公司 | Webpage data monitoring method, terminal equipment and readable storage medium |
CN111866124A (en) * | 2020-07-17 | 2020-10-30 | 北京金山云网络技术有限公司 | Method, device, server and machine-readable storage medium for accessing webpage |
CN111866124B (en) * | 2020-07-17 | 2022-06-24 | 北京金山云网络技术有限公司 | Method, device, server and machine-readable storage medium for accessing webpage |
Also Published As
Publication number | Publication date |
---|---|
CN109951549B (en) | 2022-07-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112073405B (en) | Webpage data loading method and device, computer equipment and storage medium | |
CN104580406B (en) | A kind of method and apparatus of synchronous logging state | |
JP6256896B2 (en) | Page redirection method, routing device, terminal device and system | |
CN110929202B (en) | Page request failure processing method and device and computer equipment | |
CN110519409B (en) | Domain name dynamic configuration method, device, equipment and storage medium | |
US8738711B2 (en) | System and method for redirecting client-side storage operations | |
US9565161B2 (en) | Automatically replacing localhost as hostname in URL with fully qualified domain name or IP address | |
CN113206785B (en) | Network request method and device, terminal equipment, storage medium | |
CN107613037B (en) | Domain name redirection method and system | |
CN109688280A (en) | Request processing method, request processing equipment, browser and storage medium | |
CN110324184B (en) | Service expansion and migration method, apparatus, system, device and readable storage medium | |
WO2020088170A1 (en) | Domain name system configuration method and related apparatus | |
CN109951549B (en) | Network page access method, device and computer-readable storage medium | |
CN106302384A (en) | DNS message processing method and device | |
CN110674435A (en) | Page access method, server, terminal, electronic equipment and readable storage medium | |
US9973587B2 (en) | Web page pushing method and apparatus, and terminal | |
CN106708881B (en) | Interactive method and device based on network file system | |
CN107682271B (en) | Method and device for generating routing line | |
CN105721251A (en) | Reconfigurable testing pile service method and system | |
US8805987B1 (en) | Ensuring a cookie-less namespace | |
CN113783843B (en) | Domain name scheduling method, device, equipment and readable storage medium based on cloud WAF | |
US9705790B2 (en) | Information processing apparatus, communication system, and communication method | |
CN114285856B (en) | IPV4 external link access method and device | |
CN108667769B (en) | Method and device for tracing the source of a domain name | |
CN113271326A (en) | Network protocol address scheduling method and device and electronic equipment |
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 |