CDN intelligent scheduling method for reducing abnormality of client request network
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a CDN intelligent scheduling method for reducing network abnormality of a client request.
Background
In the era of mobile internet explosion, the use frequency of mobile phone APP has replaced the PC end, and then network access initiated by the mobile end also fills the whole network.
At present, the mobile terminal initiates internet requests to involve a plurality of network problems, because of the diversity of networks where users are located, severe tests are provided for HTTP establishment and communication, such as link timeout, read-write timeout, handshake error and the like, in order to solve the problems, some cloud service providers generally provide CDN services to solve the network problems, the principle is basically that the nearby access is kept, but in order to achieve the principle goal of the nearby access, a plurality of technical supports, such as intelligent scheduling of DNS, are needed in the back, if the intelligent scheduling is established on the premise that the intelligent scheduling is relatively accurate, the problem is generally not solved, but the IDC machine room of the cloud service provider is limited, cannot cover the national field, even is thinned to the city, the district and the county level, so that the generated result can have cross-city or cross-province conditions, so that the network of mobile phone users can have great negative influence, as a client using cloud service can also consider the situation of network coverage by using a plurality of cloud service providers to cover the network as much as possible, the network of the mobile phone users needs to be better than the situation of the network users, and the network needs to be better and better to be different from the network users, and the network needs to be better distinguished.
Disclosure of Invention
The invention aims to provide a CDN intelligent scheduling method for reducing network abnormality of a client request, so as to solve the problems in the background technology.
In order to achieve the purpose, the invention provides the following technical scheme that the CDN intelligent scheduling method for reducing the abnormality of a client request network comprises the following specific steps:
Step one, data collection (client reporting)
When the client side generates network errors, reporting the errors immediately;
Step two, data analysis (server analysis)
1. Collecting enough sample size, archiving according to rules at the minute level, calculating the error rate of each domain name, and if the error rate exceeds a preset threshold value, trying to switch service providers to change the network quality;
Analyzing regional characteristics, and if the characteristics are obvious, actively pushing DNS addresses resolved by a nearby region according to the collected client information, so as to improve the current regional network problem;
analyzing the network quality condition, and when the domain name characteristics are obvious, the server-side intelligent pushing client-side performs domain name switching, which is equivalent to switching cloud service providers;
When network connection is abnormal or read-write is abnormal, intelligent decision is conducted, and when the threshold is triggered, a high-quality domain name (the operator) client is pushed to switch;
2. A single service can provide a plurality of domain names, and each domain name corresponds to different cloud service providers respectively, so that the collected data is ensured to have comparability;
Step three, DNS analysis
The original DNS analysis can search the local cache preferentially, if the local cache is directly used, the local cache is not searched localDNS, the DNS analysis service of a manufacturer is adopted preferentially after optimization, and if the local cache is not analyzed, the original path is returned;
Fourth, error early warning capability
When the automatic strategy is still over the threshold after correction, early warning is given to prompt manual intervention;
Manually deciding to select a cloud service provider;
Step five, manual decision making
And analyzing the data of the instrument panel to provide a decision basis.
Preferably, in the step one, the interface data dimension is defined to include device basic information, IP, region, request time, longitude and latitude, error type, domain name, network type, response time, and status code.
Preferably, the network error of the client in the first step includes DNS resolution error, which is an error when domain name resolution is performed.
Preferably, in the first step, when the user initiates the request and cannot connect to the server, the error message is reported, and meanwhile, the interface data is collected.
Preferably, if the trigger in the step two reaches the threshold and the CDN uses more users concentrated in the same service provider, the feature meets the condition of the switching service provider, and the client is notified to switch to another cloud service provider.
Preferably, in the second step, the server cannot be accessed due to the large-area fault of the CDN, and meanwhile, when the user accesses the server that is resolved to the server that is failed due to the problems of local DNS cache, the client retries the address for a limited time, and after the user cannot access, the IP address obtained by resolving is added to the temporary blacklist, and is synchronized to the server, so that the user is guaranteed to be told not to use the IP when the server is pushed and switched.
Preferably, in the second step, when the user initiates the request, the cloud service provider will call the service to obtain the optimal IP address instead of directly accessing the domain name, but because of the cache of the interface itself, a small amount of invalid IPs will be generated, resulting in network access errors, and at this time, the client will enter the failure processing flow, temporarily clear the IPs, and put into the temporary blacklist.
Preferably, in the third step, the dns needs to update the cache after the resolution is completed, and the domain name resolution result cached before is cleared to acquire the latest domain name resolution result again.
Preferably, in the fifth step, the data includes key indexes including error rate, response time, domain name switching frequency, etc.
The beneficial effects of the invention are as follows:
When a user cannot connect to a server, error information is reported, and when a certain sample size is accumulated, a server side can analyze and calculate in real time, analyze the regional distribution situation of the error type, if the threshold value is triggered, the server side can switch to other cloud service providers to change the network situation of the user, the link timeout error rate is reduced, if the number of connection timeout nodes is too large, the client side is informed of removing the DNS node in a local cache, the error probability is reduced, the problem of network connection timeout is solved, weak network users can be distinguished and analyzed according to different factors such as regional distribution, the network type of the user, and the like, the network use situation of other users is optimized, if a small number of users cross-network situations occur, reading and writing are slow or even overtime, if obvious distribution characteristics can be extracted, the server side can carry out push adjustment according to the network situation of the cloud service providers which is optimal at the moment, and can enter a fault processing flow when the CDN is in a large area and the DNS is wrong, and the network quality of the user is ensured.
Drawings
FIG. 1 is a schematic illustration of a business process of the present invention;
FIG. 2 is a schematic diagram of a request processing procedure according to the present invention;
Fig. 3 is a schematic diagram of a DNS resolution process according to the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1 to 3, the embodiment of the present invention provides a CDN intelligent scheduling method for reducing network anomalies requested by a client, which specifically includes the following steps:
Step one, data collection (client reporting)
When the client side generates network errors, reporting the errors immediately;
Step two, data analysis (server analysis)
1. Collecting enough sample size, archiving according to rules at the minute level, calculating the error rate of each domain name, and if the error rate exceeds a preset threshold value, trying to switch service providers to change the network quality;
Analyzing regional characteristics, and if the characteristics are obvious, actively pushing DNS addresses resolved by a nearby region according to the collected client information, so as to improve the current regional network problem;
analyzing the network quality condition, and when the domain name characteristics are obvious, the server-side intelligent pushing client-side performs domain name switching, which is equivalent to switching cloud service providers;
When network connection is abnormal or read-write is abnormal, intelligent decision is conducted, and when the threshold is triggered, a high-quality domain name (the operator) client is pushed to switch;
2. A single service can provide a plurality of domain names, and each domain name corresponds to different cloud service providers respectively, so that the collected data is ensured to have comparability;
Step three, DNS analysis
The original DNS analysis can search the local cache preferentially, if the local cache is directly used, the local cache is not searched localDNS, the DNS analysis service of a manufacturer is adopted preferentially after optimization, and if the local cache is not analyzed, the original path is returned;
Fourth, error early warning capability
When the automatic strategy is still over the threshold after correction, early warning is given to prompt manual intervention;
Manually deciding to select a cloud service provider;
Step five, manual decision making
And analyzing the data of the instrument panel to provide a decision basis.
By collecting data of the client with network errors, service provider switching can be automatically performed according to the condition of network error rate, so that good network quality of a user is ensured, when network connection of the client is abnormal or reading and writing are abnormal, after the threshold is triggered, a high-quality domain name is automatically provided for the client, the network quality of the user is ensured, when the requirements still cannot be met after strategy correction, early warning is triggered, and manual intervention is allowed to select cloud service providers to ensure stability and reliability of service.
The interface data dimension in the first step is defined to include basic information of equipment, IP, region, request time, longitude and latitude, error type, domain name, network type, response time and status code.
By collecting the data of each aspect, the error rate of each domain name can be calculated more accurately.
Wherein, the network error of the client in the first step includes DNS resolution error, which is an error occurring when domain name resolution is performed.
DNS resolution errors are caused by DNS server failures, domain name resolution errors, and the like.
In the first step, when a user initiates a request and cannot connect to a server, error information is reported, and meanwhile, interface data are collected.
Through the collection of interface data, the cloud service providers can be automatically switched among the cloud service providers, so that the network quality of the APP request of the mobile phone user is improved.
If the trigger is triggered to the threshold value in the second step, and the CDN uses more users concentrated in the same service provider, the feature meets the condition of switching the service provider, and the client is notified to switch to other cloud service providers.
And the client is notified to switch to other cloud service providers to change the network condition of the user, so that the link timeout error rate is reduced.
In the second step, the server cannot be accessed due to the large-area faults of the CDN, meanwhile, when users access the servers with faults which are resolved due to the problems of local DNS cache and the like, the client retries the addresses for a limited time, after the clients cannot access the addresses, the resolved IP addresses are added into a temporary blacklist and synchronized to the servers, so that the users are guaranteed to be told not to use the IP when the servers are pushed and switched.
The client retries the blacklist every 5 minutes, and if the client recovers, the client removes the blacklist from the blacklist, so that the IP is ensured to be valid.
In the second step, when a user initiates a request, the cloud service provider invokes the service to acquire an optimal IP address to replace direct domain name access, but because of the cache of the interface itself, a small amount of invalid IPs can be generated, so that network access errors occur, and at the moment, the client enters a fault processing flow, temporarily clears the IPs and puts the IPs into a temporary blacklist.
After the client is put into the temporary blacklist, the client can periodically retry to release, so that the effective analysis result used by the user is ensured to the maximum extent.
In the third step, dns needs to update the cache after the resolution is completed, the domain name resolution result cached before is cleared, and the latest domain name resolution result is obtained again.
By preferentially adopting dns analytic service of manufacturers, the method has the advantages that the accuracy and timeliness of analysis are guaranteed with high probability, and a user can acquire an optimal access path.
The data in the fifth step comprises key indexes such as error rate, response time, domain name switching frequency and the like.
By analyzing the data, rich basis is provided for decision making, and data support can be provided for future scheduling policy optimization.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.