CN108540575A - A kind of network request dispatching method and device - Google Patents
A kind of network request dispatching method and device Download PDFInfo
- Publication number
- CN108540575A CN108540575A CN201810394824.XA CN201810394824A CN108540575A CN 108540575 A CN108540575 A CN 108540575A CN 201810394824 A CN201810394824 A CN 201810394824A CN 108540575 A CN108540575 A CN 108540575A
- Authority
- CN
- China
- Prior art keywords
- grade
- network
- domain name
- network request
- request
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- 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/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0894—Packet rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/62—Establishing a time schedule for servicing the requests
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the present application discloses a kind of network request dispatching method and device, in this method, after getting network request, the classification grade corresponding to the domain name that the network request includes can further be got, and according to the request attribute grade in classification grade, determine the sending method of the network request;Simultaneously after network request transmission, if the response total duration of the network request has been more than the duration of the request response total duration grade in classification grade, network request can also be determined as cancelling sending or postponing and sent, occupy the resource for sending network request for a long time to avoid network request.The embodiment of the present application has carried out network request based on requested domain name the division of thinner dimension, can be more rationally and effectively scheduled to the transmission of network request for different situations.
Description
Technical field
This application involves Internet technical fields, and in particular to a kind of network request dispatching method and device.
Background technology
With the development of mobile Internet, user can use various network-based application programs, such as shopping class application
Program, video class application program, instant messaging class application program etc..During the application program use of network, using journey
Sequence client can send network request to server, and client can concurrent multiple networks be asked simultaneously to server in some scenes
It asks.
In the prior art, priority is arranged in the type that can be generally directed to network request, according to priority orders to network
Request is sent successively, to complete the scheduling to network request.But only network request is divided with priority, it can deposit
The problem of the network request of high priority is blocked queuing, such as the network request of a certain low priority is anti-in acquisition server
During feedback, because causing the network request that can not slowly complete situations such as network quality, at this time if there is high priority
Network request, then the network request of the high priority can be blocked by the network request of previous low priority, can not send in time.Cause
How this, more rationally and effectively complete network request scheduling and be a technical problem to be solved urgently.
Invention content
In view of this, a kind of network request dispatching method of the embodiment of the present application offer and device, more rationally have to realize
Complete network request scheduling in effect ground.
To solve the above problems, technical solution provided by the embodiments of the present application is as follows:
In a first aspect, the embodiment of the present application provides a kind of network request dispatching method, this method includes:
Network request is obtained, the network request includes the domain name for asking to access;
The corresponding classification grade of domain name is obtained, the classification grade includes that request attribute grade and request response are total
Duration grade;
According to the request attribute grade of domain name, the sending method of the network request is determined;
After network request transmission, the response total duration of the network request is obtained;
If the response total duration of the network request be more than domain name it is corresponding request response total duration grade when
It is long, then the network request is determined as cancelling sending or postponing sending.
In some possible embodiments, the request attribute grade includes network speed grade, server delay etc.
Grade and importance rate, the request attribute grade according to domain name, determine the sending method of the network request, wrap
It includes:
Judge whether current network speed meets the corresponding network speed grade of domain name;
If the current network speed meets the corresponding network speed grade of domain name, judge that current server is delayed
Whether domain name corresponding server delay grade is met;If it is corresponding that the current network speed does not meet domain name
The network request then is determined as cancelling sending or postponing sending by network speed grade;
After judging whether current server delay meets the corresponding server delay grade of domain name, if described work as
Preceding server delay meets the corresponding server delay grade of domain name, obtains the corresponding importance rate of domain name;Such as
The delay of fruit current server does not meet the corresponding server delay grade of domain name, then is determined as cancelling by the network request
It sends or postpones and send;
After obtaining the corresponding importance rate of domain name, when the corresponding importance rate of domain name is height, then will
The network request is determined as preferentially sending, when the corresponding importance rate of domain name be it is low, then it is the network request is true
It is set to normal transmission.
In some possible embodiments, the classification grade further includes network state grade.
In some possible embodiments, the method further includes:
If the current network speed meets the network speed grade of domain name, judge current network state whether just
Often;
If the current network state is normal, execution is described to judge whether current server delay meets domain name pair
The server delay grade and subsequent step answered;
If the current network state is abnormal, the corresponding network state grade of domain name is obtained;
If the corresponding network state grade of domain name is to support network state abnormal, the current clothes of the judgement are executed
Whether business device delay meets the corresponding server delay grade of domain name and subsequent step;
If the network state grade of domain name is not support that network state is abnormal, the network request is determined
It is sent to cancel sending or postponing.
In some possible embodiments, the method further includes:
It is sent when the network request to be determined as postponing, after reaching preset duration, reacquires the network request, and
Execute the classification grade and subsequent step for obtaining domain name.
Second aspect, the embodiment of the present application also provides a kind of network request dispatching device, which includes:
First acquisition module, for obtaining network request, the network request includes the domain name for asking to access;
Second acquisition module, for obtaining the corresponding classification grade of domain name, the classification grade includes request attribute
Grade and request response total duration grade;
First determining module determines the sending method of the network request for the classification grade according to domain name;
Third acquisition module, for after network request transmission, obtaining the response total duration of the network request;
Second determining module, if the response total duration for the network request is more than the corresponding request of domain name and rings
The duration of total duration grade is answered, then the network request is determined as cancelling sending or postponing sending.
In some possible embodiments, request attribute hierarchical network speed class, server delay grade and again
The property wanted grade, the first determining module include:
First judging unit, for judging whether current network speed meets the corresponding network speed grade of domain name;
Second judgment unit, if meeting the corresponding network speed grade of domain name for the current network speed,
Judge whether current server delay meets the corresponding server delay grade of domain name;
First acquisition unit, for judging whether current server delay meets the corresponding server delay of domain name
After grade, if current server delay meets the corresponding server delay grade of domain name, domain name pair is obtained
The importance rate answered;
First determination unit is used for after obtaining the corresponding importance rate of domain name, when domain name is corresponding heavy
The property wanted grade be height, then the network request is determined as preferentially sending, when the corresponding importance rate of domain name be it is low, then
The network request is determined as normally sending;
Second determination unit, if not meeting corresponding network speed of domain name etc. for the current network speed
The network request then is determined as cancelling sending or postponing sending by grade;
Third determination unit, if not meeting corresponding server delay of domain name etc. for current server delay
The network request then is determined as cancelling sending or postponing sending by grade.
In some possible embodiments, classification grade is in addition to including network speed grade, server delay grade, again
The property wanted grade and request response total duration grade, further include network state grade.
In some possible embodiments, which further includes:
First judgment module judges if meeting the network speed grade of domain name for the current network speed
Whether current network state is normal;
First returns to module, if normal for the current network state, returns to the first acquisition unit, executes
Judge whether current server delay meets the corresponding server delay grade of domain name;
It is corresponding network-like to obtain domain name if abnormal for the current network state for 4th acquisition module
State grade;
Second returns to module, if being to support network state abnormal for the corresponding network state grade of domain name,
The first acquisition unit is then returned to, execution is described to judge whether current server delay meets the corresponding server of domain name
Be delayed grade;
Third determining module, if the network state grade for domain name is not support that network state is abnormal,
The network request is determined as cancelling to send or postpone and is sent.
In some possible embodiments, which further includes:
Third returns to module, for when the network request is determined as postponement transmission, after reaching preset duration, returning
First acquisition module executes and reacquires the network request, and executes the classification grade for obtaining domain name.
It can be seen that the embodiment of the present application has the advantages that:
The embodiment of the present application can predefine the corresponding classification grade of each server domain name, get network request
Afterwards, then the classification grade corresponding to the domain name that the network request includes can be further got, which can determine
The sending method of adopted network request in varied situations, therefore can be according to the request attribute grade in classification grade, determining should
The sending method of network request;Simultaneously after network request transmission, if the response total duration of the network request has been more than classification
Network request can also be determined as cancelling sending or postponing sending by the duration of the request response total duration grade in grade,
Occupy the resource for sending network request for a long time to avoid network request.The embodiment of the present application is based on requested domain name to network
Request has carried out the division of thinner dimension, can more rationally and effectively be adjusted to the transmission of network request for different situations
Degree.
Description of the drawings
Fig. 1 is a kind of exemplary application schematic diagram of a scenario provided by the embodiments of the present application;
Fig. 2 is a kind of flow diagram of network request dispatching method provided by the embodiments of the present application;
Fig. 3 is the flow diagram of another network request dispatching method provided by the embodiments of the present application;
Fig. 4 is the flow diagram of another network request dispatching method provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of network request dispatching device provided by the embodiments of the present application.
Specific implementation mode
During user uses web application, the operation based on user to the application program, application program visitor
Family end would generally send network request to server, so that server, which is based on the network request, carries out corresponding task processing.
But under normal conditions, it may be multiple, and application program that application client, which needs the network request sent to server,
Client may be to send network request one by one, and application client may be caused first to send unessential network in this way and asked
It asks, then sends important network request, to which the network request for causing part important is unable to get asking of sending in time
Topic.
In existing technical solution, generally can be directed to network request type be arranged priority, according to priority orders according to
Secondary transmission network request to server, the specially high network request of priority is preferentially sent, the lower network request of priority
Transmission is postponed, the scheduling to network request is completed with this.But only network request is divided with priority, it divides
Granularity is thicker, can there are problems that the network request of high priority is blocked queuing.For example, the network in a lower priority is asked
Ask obtain server feedback during, because of situations such as network quality, server delay it is longer cause the network request long when
Between do not complete, and application client generates the higher network request of priority at this time, then the priority is higher
Network request can be blocked by the lower network request of previous priority, and application client can only wait for the lower net of priority
After the completion of network request, the higher network request of the priority is retransmited, to cause the higher network request of priority can not be by
It sends in time, reduces user experience.
For this purpose, the embodiment of the present application provides a kind of network request dispatching method, by carrying out more particulate to network request
The division of degree, can rationally, effectively complete scheduling to network request.Specifically, network provided by the embodiments of the present application is asked
Dispatching method is asked to can be applied in exemplary application scene shown in FIG. 1, which includes client 101 and service
Device 102, the network request dispatching method may include:Client 101 can obtain the operation to the client 101 based on user
The network request generated, which includes the domain name for asking to access, and obtains the corresponding classification grade of the domain name,
In, which includes request attribute grade and request response total duration grade etc., and then, client 101 is according to acquisition
The corresponding request attribute grade of domain name, determine the sending method of the network request, and according to the sending method of the network request
Send the network request to the corresponding server 102 of the domain name, client 101 after sending the network request to server 102,
The response total duration of the network request is obtained, and judges whether the corresponding total duration of the network request asks more than the domain name is corresponding
The duration of response total duration grade is sought, sends or pushes away if it is greater, then the sending method of the network request is determined as cancelling
It is tardy to send, i.e., no longer the network request is sent to server 102 or postpone a period of time again to the transmission of server 102 network
Request.
By according to the corresponding request attribute grade of domain name, determining the sending method of network request, and work as network request
Response total duration be more than domain name it is corresponding request response total duration grade duration when, cancel send the network request or
It postpones and retransmits the network request for a period of time, so as to avoid network request from occupying the money of transmission network request for a long time
Source, can also avoid due to low priority network request for a long time can not complete to send, caused by high priority network
The problem of request is blocked queuing, to which realization is more reasonable, is effectively scheduled to the transmission of network request.
In order to make the above objects, features, and advantages of the present application more apparent, below in conjunction with the accompanying drawings and it is specific real
Mode is applied to be described in further detail the embodiment of the present application.
Also referring to Fig. 2, Fig. 2 shows a kind of flow signals of network request dispatching method in the embodiment of the present application
Figure, this method can specifically include:
S201:Network request is obtained, which includes the domain name for asking to access.
Under normal conditions, when user carries out the operations such as click control, the long-press page on the client, client can be based on
The operation of user and generate corresponding network request, and the network request can be sent to server, with request server according to
The network request carries out corresponding network task processing.It then, can be with before the network request is sent to server by client
The network request is first obtained, in order to subsequently determine the sending method of the network request.
And during network request is by client transmissions to server, the network node for transmitting the network request is usual
It is to determine that the network request needs which server be transferred to according to the domain name of server included in network request.
Therefore, the network request of acquisition generally includes the domain name of the server to be asked to access.
S202:The corresponding classification grade of the domain name is obtained, which includes request attribute grade and request response
Total duration grade.
In applying for embodiment, the domain name in network request is generally directed towards a certain server, which generally handles certain
The network request of one type, then the domain name in network request can correspond to the type of the network request, therefore can pass through setting
The corresponding classification grade of domain name is realized and is scheduled to different type network request.
As an example, the request attribute grade in the present embodiment may include network speed grade, server delay
Grade and importance rate, it is of course also possible to which the factor of the degree of priority sent comprising other influence network requests, such as characterizes
Network state grade of network congestion situation etc., does not limit herein.
Wherein, the corresponding network speed grade of domain name refers to completing to include the network speed needed for the network request of the domain name
Spend the grade of speed.Under normal conditions, different types of network request is completed, the commonly required network speed wanted is also different.Than
Such as, for obtaining the network request of video file type, it usually needs video server handles the network request, and may
Since the capacity of the video file obtained needed for client is larger, video server by the video file transfer to client
In the process, the faster network speed of usual demand with reduce complete the network request time otherwise asked due to completing the network
The time asked is longer, is likely to result in the blocking to other network requests.And for obtaining the network request of text file type,
Since the text file capacity needed for client is smaller, even if network speed is slower, server can also within a short period of time by
This article this document is transferred to client, therefore, for obtaining the network request of text file, commonly required network speed
Degree does not need to be too fast.
In some embodiments, due to the network of WIFI (Wireless Fidelity, WLAN) network speed
Degree, than the network speed of 4G (the 4th Generation communication system, forth generation communication system) network
Soon, network speed ratio 3G (the 3th Generation communication system, the third generation communication of 4G networks
System) network network speed it is fast, therefore, can by the corresponding network speed grade classification of domain name be WiFi grades, 4G grades
And 3G grades, correspond to that network speed is very fast, normal and slower three grades respectively.
The corresponding server delay grade of domain name refers to that server is allowed to respond the maximum delay duration of the network request
Grade, wherein the server is the server corresponding to the domain name that network request includes.In some embodiments, Ke Yili
Server delay grade is divided with the time length of maximum delay.For example, server delay grade can be divided into
Millisecond, the second grade and it is unlimited, when allow server response to network ask maximum delay duration be to be carried out as unit of millisecond
When calculating, server delay grade can be Millisecond;When the maximum delay duration of server response to network request is to be with the second
When unit is calculated, server delay grade can be second grade;When server delay grade be it is unlimited, then to network request
Delay is without limiting.
The corresponding importance rate of domain name refers to the significance level for characterizing the requested service of network request for user
Grade.It in some embodiments, can be by each network request in statistics practical application for the importance of user experience
To carry out grade classification.For example, importance rate can be divided into important and inessential two grades, when true according to statistical result
Determine network request it is important for user experience when, then importance rate is attached most importance to;When determining network request according to statistical result
When inessential for user experience, then importance rate is inessential.
The corresponding request response total duration grade of domain name refers to that network request is allowed to occupy the resource for sending network request
Duration grade.It in some possible embodiments, can be according to the resource for allowing network request occupancy transmission network request
Time span carries out grade classification.For example, request response total duration grade can be divided into 5 seconds, 10 seconds, 30 seconds and unlimited,
If the duration that network request occupies the resource for sending network request is allowed to be no more than 5 seconds, it is 5 to ask response total duration grade
Second;If the duration that network request occupies the resource for sending network request is allowed to be more than 5 seconds but be no more than 10 seconds, ask to respond
Total duration grade is 10 seconds;If the duration that network request occupies the resource for sending network request is allowed to be more than 10 seconds but be no more than
30 seconds, then it is 30 seconds to ask response total duration grade;If allowing the duration that network request occupies the resource for sending network request super
30 seconds are spent, then it is unlimited to ask response total duration grade.
As an example, the corresponding classification grade of each domain name can be pre-set, then after getting network request,
It can be according to the domain name included by network request, when determining the corresponding request attribute grade of the network request and total request response
Long grade.In some embodiments, the corresponding network speed grade of the network request, server delay etc. can specifically be determined
Grade and importance rate etc..
S203:According to the corresponding request attribute grade of domain name, the sending method of network request is determined.
In a kind of infinite example, the sending method of network request may include:It is preferential to send, normally send, push away
It is tardy to send and cancel four kinds of modes of transmission.Wherein, preferential send refers to, relative to other network requests, preferentially sending the net
Network is asked;Normal send refers to, when the degree of priority of each network request is suitable, the net is sent according to normal transmission sequence
Network is asked;It refers to not sending the network request temporarily to postpone transmission, and the network request is retransmited after postponing a period of time;Cancel
Transmission refers to not retransmiting the network request.
The network request is assessed using domain name corresponding classification grade, it may be determined that send the excellent of the network request
First degree, for the higher network request of degree of priority, sending method can be preferential transmission or normally send, and for
The lower network request of degree of priority, sending method can be to postpone sending even to cancel sending.That is, being corresponded to according to domain name
Classification grade, it may be determined that the sending method of network request.
Specific implementation process for the sending method for determining network request, is referred to correlation in subsequent embodiment and retouches
It states, details are not described herein.
S204:After network request transmission, the response total duration of network request is obtained.
Wherein, the response total duration of the network request refers to that waiting for server responds after client sends the network request
The total duration of the network request.In a kind of illustrative embodiment, can client send network request after, start into
Row timing just stops carrying out timing until when client acquisition server responds the feedback result sent after the network request.
Then, timing duration is the response total duration of the network request.
S205:If the response total duration of network request, the request corresponding to the domain name for including more than the network request is rung
The duration of total duration grade is answered, then the sending method of the network request is determined as cancelling sending or postponing sending.
It is appreciated that the request corresponding to the domain name that the network request includes responds total duration grade, client is corresponded to
Allow the network request to occupy the maximum time for the resource for sending network request, if the response total duration of the network request, surpasses
Having crossed client allows it to occupy the maximum time for the resource for sending network request, then shows that the network transmitted by client is asked
The response for not obtaining server for a long time is asked, the resource time which occupies transmission network request is long, and in order to
Do not block the transmission of other network requests, can postpone and retransmit the network request for a period of time or do not retransmit the network
Request.If the response total duration of the network request, being not above client allows it to occupy the resource for sending network request
Maximum time, represent the network request and normally completed.
Specifically, when the response total duration of network request is more than the duration of request response total duration grade, it is based on user
To the usage experience of client, partly more important network request can be postponed and be sent, and unessential network is asked
It asks, transmission can be cancelled.For example, when user watches video using client, if the sound for the network request that client is sent
It answers total duration to be more than the duration of request response total duration grade, then for the network request that client is sent, obtains user
The network request of required viewing video is relatively important network request, and the sending method of such network request can be pushed away
It is tardy to send, and the network requests such as viewer reviews, video profile for obtaining the video, usually unessential network request,
Its sending method can cancel sending.Further, if it is determined that the sending method of network request is when postponing sending, then may be used
After reaching preset duration with the time in postponement, the network request is reacquired, and executes the domain name pair for obtaining the network request
The classification grade and follow-up corresponding steps answered.Wherein, preset duration can be manually set according to actual conditions by technical staff,
Can also be by algorithm routine according to the different sets itselfs of network request, this is not restricted.
It, can be with needle when the sending method for determining network request is to postpone sending in a kind of illustrative embodiment
Timing is carried out to the network request, and determines the preset duration of the postponed transmission of the network request, when timing duration reaches default
When duration, then the network request can be reacquired, execute step S202 again to step 205, until the network request is completed
It sends or the sending method of the network request is determined as cancelling transmission.
In the present embodiment, it may be predetermined that the corresponding classification grade of each server domain name is getting network request
Afterwards, then the classification grade corresponding to the domain name that the network request includes can be further got, therefore can be according to classification
Request attribute grade in grade, determines the sending method of the network request;Simultaneously after network request transmission, if the network
The response total duration of request has been more than the duration of the request response total duration grade in classification grade, then can be true by network request
It is set to cancellation and sends or postpone transmission, occupies the resource for sending network request for a long time to avoid network request.The application is real
The division that example has carried out network request based on requested domain name thinner dimension is applied, more can rationally be had for different situations
Effect ground is scheduled the transmission of network request.
In above-described embodiment, for determining that the sending method of network request has carried out simple introduction, a kind of exemplary
Specific implementation mode in, can be successively according to network speed grade, server delay grade, importance etc. in classification grade
Grade and request response total duration grade are determined the sending method of the network request.Specifically, present invention also provides
The embodiment of another network request dispatching method, wherein the related content of the step S303 to step S307 in the present embodiment, weight
Point is to determining that the specific implementation process of the sending method of network request is illustratively described in detail.
The flow signal of another network request dispatching method in the embodiment of the present application is shown also referring to Fig. 3, Fig. 3
Figure, this method can specifically include:
S301:Network request is obtained, which includes the domain name for asking to access.
S302:The corresponding classification grade of the domain name is obtained, which includes network speed grade, server delay etc.
Grade, importance rate and request response total duration grade.
In the present embodiment, step S301 to step S302 is similar to step S202 with the step S201 in a upper embodiment,
The associated description in an embodiment is can refer to, details are not described herein.
S303:Judge whether current network speed meets the corresponding network speed grade of the domain name, if so, executing step
S304, if not, executing step S310.
The speed of current network speed may be related with the network residing for client.Under normal conditions, relative to 4G networks,
When client is in WIFI network, current network speed may faster, and relative to 3G network, when client is in 4G networks
When, current network speed may also be faster.
It is appreciated that different types of network request may usually need to match corresponding network speed requirement, if currently
When network speed is less than network request institute matched network speed, completing the time needed for the network request will significantly increase
Add, is easy that other network requests are caused to block.For example, the network request for obtaining video content, client is by the net
After network request is sent to video server and obtains the response of video server, video server can will correspondingly video stream data
It is sent to client, if current network conditions are 3G network, the transmission speed of video data stream can be relatively slow, especially client
When the video file obtained needed for end is larger, longer time (such as ten a few minutess can be occupied by completing the network request using 3G network
Clock, even a few houres etc.), it be easy to cause the obstruction to other network requests.But for obtaining the net of video content brief introduction
Network is asked, since the file of video content brief introduction is smaller, even if current network conditions can be completed if being 3G network in the short period
The network request usually will not cause to block to other network requests.
Therefore, if current network speed is the network speed under 3G network, the network of video content brief introduction is obtained
Request can send and carry out the judgement of subsequent step, and the network request for obtaining video is determined as postponing sending and is even taken
Disappear transmission.But if current network speed be WiFi network under network speed when, due to WiFi network network speed compared with
Soon, obtaining the network request of video can also complete within a short period of time, and therefore, obtaining the network request of video can send simultaneously
Carry out the judgement of subsequent step.
S304:Judge whether current server delay meets the corresponding server delay grade of the domain name, if so, executing
Step S305, if not, executing step S310.It is appreciated that even if current network speed meets the corresponding network speed of domain name
Grade, but in some scenes, if the delay degree of server is more serious, server may not respond to for a long time
Network request, the network request so as to cause client currently transmitted block the transmission of other network requests.Therefore, originally
In embodiment, if current network speed meets the corresponding network speed grade of the domain name, it can further judge currently to take
Whether business device delay degree meets the corresponding server delay grade of the domain name.
For example, in some scenes, subnetwork asks server response delay time allowed can only be with millisecond
It is calculated for unit, but if current server delay degree is more than the rank, server can not respond in millisecond
The network request namely current server delay do not meet the corresponding server delay grade of the domain name, represent the network request
The network requests to be sent such as other may be blocked.
Therefore, it is possible to judge that whether current server delay, which meets the domain name, corresponds to multiple server delay grades, if
Meet, then continue subsequent step, but if do not met, it, can be in order to avoid blocking the transmission of other network requests
It postpones and sends the network request either cancellation transmission network request.
S305:Obtain the corresponding importance rate of the domain name.
S306:When the corresponding importance rate of domain name be height, then the sending method of network request is determined as preferentially sending.
S307:When the corresponding importance rate of domain name be it is low, then the sending method of network request is determined as normally sending.
It is appreciated that in order to reach better user experience, it will usually by network request even more important for users
It is preferential to send, to meet the use demand of user.For example, in a kind of scene, user may wish to watch electricity on the client
Shadow, then for a user, the brief introduction content of the film are usually more important for the comment content of the film than other spectators,
Correspondingly, obtaining the network request of movie contents brief introduction, for the network request for obtaining viewer reviews, used for improving
Therefore the sending method for the network request for obtaining movie contents brief introduction can be determined as preferentially by the importance higher of family experience
It sends, and obtains the sending method of the network request of viewer reviews, be determined as normally sending.
S308:After network request transmission, the response total duration of network request is obtained.
S309:Judge the response total duration of network request, if asking corresponding to the domain name for including more than the network request
The duration of response total duration grade is sought, if so, executing step S310.
S310:The sending method of the network request is determined as cancelling to send or postpone and is sent.
It is noted that in the present embodiment, step S308 to step S310 and step S204 in a upper embodiment to step
Rapid S205 is similar, can refer to the associated description in an embodiment, details are not described herein.
It is true by being carried out successively to the sending method of network request according to the various grades in classification grade in the present embodiment
It is fixed, the sending method of the network request can quickly, be flexibly determined according to real network situation, avoid network request it is long when
Between occupy send network request resource, block the transmission of other network requests, pass through to send network request preferential journey
Degree has carried out the division of thinner dimension, can be more rationally and effectively scheduled to the transmission of network request.
It should be noted that in above-described embodiment step S303 to step S307 implementation process, be only used for being described in detail
The sending method for determining network request, is not intended to limit the present invention.In fact, determine the sending method of network there are a variety of,
For example, can first judge whether current server delay meets the corresponding server delay grade of domain name, if it is determined that after meeting,
Judge whether current network speed meets corresponding network speed grade of domain name etc. again.
In addition, if Network Abnormal occurs in the network environment that client is presently in, for example network flow is big, network congestion
Deng, then client can postpone transmission or cancel transmitting portion network request.Therefore, in some possible embodiments,
The corresponding classification grade of domain name is in addition to may include network speed grade, server delay grade, importance rate and request
It responds except total duration grade, can also include network state grade.For this purpose, present invention also provides another network request tune
The embodiment of degree method.
A kind of flow signal of network request dispatching method in the embodiment of the present application is shown also referring to Fig. 4, Fig. 4
Figure, this method can specifically include:
S401:Network request is obtained, which includes the domain name for asking to access.
S402:The corresponding classification grade of the domain name is obtained, which includes network speed grade, server delay etc.
Grade, importance rate, request response total duration grade and network state grade.
In the present embodiment, step S401 to step S402 is similar to step S302 with the step S301 in a upper embodiment,
The associated description in an embodiment is can refer to, details are not described herein.
S403:Judge whether current network speed meets the corresponding network speed grade of the domain name, if so, executing step
S404, if not, executing step S413.
S404:Judge whether current network state is normal, if so, S407 is thened follow the steps, if not, thening follow the steps
S405。
Under normal conditions, the network environment residing for client is normal condition, but may be in certain time period, client
There may be situations such as larger network flow or network congestion in residing environment network, the network for causing client to send
Request can not be transmitted to server or network request during being transmitted to server there are situations such as loss of data, this
When, network state may be abnormal state.
S405:Obtain the corresponding network state grade of the domain name.
S406:Judge whether the corresponding network state grade of the domain name is to support network state abnormal, if so, executing
Step S407, if not, executing step S413.
It should be noted that network state grade, characterizes when network state is abnormal state, if continue to send
Network request.In the present embodiment, network state grade can be divided into two grades, respectively support network state it is abnormal with
And do not support that network state is abnormal.If the corresponding network state grade of domain name is to support network state abnormal, show this
Network request network state be abnormal network environment under still sent, then can continue to execute step S407 and
The subsequent step of S407.But if the corresponding network state grade of domain name is not support that network state is abnormal, show in net
Network state is not sent to the network request in abnormal network environment, then can postpone and retransmit the net for a period of time
Network asks or cancels to send the network request.
S407:Judge whether current server delay meets the corresponding server delay grade of the domain name, if so, executing
Step S408, if not, executing step S413.
S408:Obtain the corresponding importance rate of the domain name.
S409:When the corresponding importance rate of domain name be height, then the sending method of network request is determined as preferentially sending.
S410:When the corresponding importance rate of domain name be it is low, then the sending method of network request is determined as normally sending.
S411:After network request transmission, the response total duration of network request is obtained.
S414:Judge the response total duration of network request, if asking corresponding to the domain name for including more than the network request
Response total duration grade is sought, if it is greater, then executing step S413.
S413:The sending method of network request is determined as cancelling to send or postpone and is sent.
In the present embodiment, step S407 to step S413 is similar to step S310 with the step S304 in a upper embodiment,
The associated description in an embodiment is can refer to, details are not described herein.
In the present embodiment, before sending network request, include also according to current network state and the network request
The corresponding network state grade of domain name, determines the sending method of the network request, has further refined to sending network request
The division of degree of priority, so that client is more rationally effective to the scheduling for sending network request.
In addition, the embodiment of the present application also provides a kind of network request dispatching devices, as shown in figure 5, the network request tune
Spending device includes:
First acquisition module 501, for obtaining network request, the network request includes the domain name for asking to access;
Second acquisition module 502, for obtaining the corresponding classification grade of domain name, the classification grade includes that request belongs to
Property grade and request response total duration grade;
First determining module 503 determines the transmission of the network request for the request attribute grade according to domain name
Mode;
Third acquisition module 504, when the response for after network request transmission, obtaining the network request is total
It is long;
Second determining module 505, if the response total duration for the network request is more than, domain name is corresponding to ask
The duration of response total duration grade is sought, then the network request is determined as cancelling sending or postponing sending.
In some possible embodiments, the request attribute grade includes network speed grade, server delay etc.
Grade and importance rate, the first determining module 503 include:
First judging unit, for judging whether current network speed meets the corresponding network speed grade of domain name;
Second judgment unit, if meeting the corresponding network speed grade of domain name for the current network speed,
Judge whether current server delay meets the corresponding server delay grade of domain name;
First acquisition unit is judging whether current server delay meets the corresponding server delay grade of domain name
Afterwards, if meeting the corresponding server delay grade of domain name for current server delay, domain name pair is obtained
The importance rate answered;
First determination unit is used for after obtaining the corresponding importance rate of domain name, when domain name is corresponding heavy
The property wanted grade be height, then the network request is determined as preferentially sending, when the corresponding importance rate of domain name be it is low, then
The network request is determined as normally sending;
Second determination unit, if not meeting corresponding network speed of domain name etc. for the current network speed
The network request then is determined as cancelling sending or postponing sending by grade;
Third determination unit, if not meeting corresponding server delay of domain name etc. for current server delay
The network request then is determined as cancelling sending or postponing sending by grade.
In some possible embodiments, classification grade is in addition to including network speed grade, server delay grade, again
Further include network state grade except the property wanted grade and request response total duration grade.
In some possible embodiments, which further includes:
First judgment module judges if meeting the network speed grade of domain name for the current network speed
Whether current network state is normal;
First returns to module, if normal for the current network state, returns to the first acquisition unit, executes
Judge whether current server delay meets the corresponding server delay grade of domain name;
It is corresponding network-like to obtain domain name if abnormal for the current network state for 4th acquisition module
State grade;
Second returns to module, if being to support network state abnormal for the corresponding network state grade of domain name,
The first acquisition unit is then returned to, execution is described to judge whether current server delay meets the corresponding server of domain name
Be delayed grade;
Third determining module, if the network state grade for domain name is not support that network state is abnormal,
The network request is determined as cancelling to send or postpone and is sent.
In some possible embodiments, which further includes:
Third returns to module, for when the network request is determined as postponement transmission, after reaching preset duration, returning
First acquisition module executes and reacquires the network request, and executes the classification grade for obtaining domain name.
The embodiment of the present application can predefine the corresponding classification grade of each server domain name, get network request
Afterwards, then the classification grade corresponding to the domain name that the network request includes can be further got, which can determine
The sending method of adopted network request in varied situations, therefore can be according to the request attribute grade in classification grade, determining should
The sending method of network request;Simultaneously after network request transmission, if the response total duration of the network request has been more than classification
Request in grade responds total duration grade, and network request can also be determined as to cancelling sending or postponing sending, to avoid
Network request occupies the resource for sending network request for a long time.The embodiment of the present application be based on requested domain name to network request into
It has gone the division of thinner dimension, more rationally and effectively the transmission of network request can be scheduled for different situations.
It should be noted that each embodiment is described by the way of progressive in this specification, each embodiment emphasis is said
Bright is all difference from other examples, and just to refer each other for identical similar portion between each embodiment.For reality
For applying system or device disclosed in example, since it is corresponded to the methods disclosed in the examples, so fairly simple, the phase of description
Place is closed referring to method part illustration.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one
Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation
There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain
Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables professional and technical personnel in the field to realize or use the application.
Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein
General Principle can in other embodiments be realized in the case where not departing from spirit herein or range.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest range caused.
Claims (10)
1. a kind of network request dispatching method, which is characterized in that the method includes:
Network request is obtained, the network request includes the domain name for asking to access;
The corresponding classification grade of domain name is obtained, the classification grade includes request attribute grade and request response total duration
Grade;
According to the request attribute grade of domain name, the sending method of the network request is determined;
After network request transmission, the response total duration of the network request is obtained;
If the response total duration of the network request is more than the duration of the corresponding request response total duration grade of domain name,
The network request is determined as cancelling to send or postpone and is sent.
2. according to the method described in claim 1, it is characterized in that, the request attribute grade includes network speed grade, clothes
Business device delay grade and importance rate;
The request attribute grade according to domain name determines the sending method of the network request, including:
Judge whether current network speed meets the corresponding network speed grade of domain name;
If the current network speed meets the corresponding network speed grade of domain name, whether current server delay is judged
Meet the corresponding server delay grade of domain name;If the current network speed does not meet the corresponding network of domain name
The network request then is determined as cancelling sending or postponing sending by speed class;
After judging whether current server delay meets the corresponding server delay grade of domain name, if the current clothes
Business device delay meets the corresponding server delay grade of domain name, obtains the corresponding importance rate of domain name;If worked as
Preceding server delay does not meet the corresponding server delay grade of domain name, then the network request is determined as cancelling sending
Or it postpones and sending;
It, then will be described when the corresponding importance rate of domain name is height after obtaining the corresponding importance rate of domain name
Network request is determined as preferentially sending, when the corresponding importance rate of domain name be it is low, then the network request is determined as
It is normal to send.
3. according to the method described in claim 2, it is characterized in that, the classification grade further includes network state grade.
4. according to the method described in claim 3, it is characterized in that, the method further includes:
If the current network speed meets the network speed grade of domain name, judge whether current network state is normal;
If the current network state is normal, executes and described judge current server to be delayed whether to meet domain name corresponding
Server delay grade and subsequent step;
If the current network state is abnormal, the corresponding network state grade of domain name is obtained;
If the corresponding network state grade of domain name is to support network state abnormal, the judgement current server is executed
Whether delay meets the corresponding server delay grade of domain name and subsequent step;
If the network state grade of domain name is not support that network state is abnormal, the network request is determined as taking
Disappear transmission or postponement transmission.
5. according to claim 1-4 any one of them methods, which is characterized in that the method further includes:
It is sent when the network request to be determined as postponing, after reaching preset duration, reacquires the network request, and execute
The classification grade and subsequent step for obtaining domain name.
6. a kind of network request dispatching device, which is characterized in that described device includes:
First acquisition module, for obtaining network request, the network request includes the domain name for asking to access;
Second acquisition module, for obtaining the corresponding classification grade of domain name, the classification grade includes request attribute grade
And request response total duration grade;
First determining module determines the sending method of the network request for the request attribute grade according to domain name;
Third acquisition module, for after network request transmission, obtaining the response total duration of the network request;
Second determining module, if the response total duration for the network request is more than domain name, corresponding request response is total
The network request then is determined as cancelling sending or postponing sending by the duration of duration grade.
7. wanting the device described in 6 according to right, which is characterized in that the request attribute grade includes network speed grade, service
Device delay grade and importance rate, first determining module include:
First judging unit, for judging whether current network speed meets the corresponding network speed grade of domain name;
Second judgment unit judges if meeting the corresponding network speed grade of domain name for the current network speed
Whether current server delay meets the corresponding server delay grade of domain name;
First acquisition unit, for judging whether current server delay meets the corresponding server delay grade of domain name
Afterwards, if current server delay meets the corresponding server delay grade of domain name, it is corresponding to obtain domain name
Importance rate;
First determination unit is used for after obtaining the corresponding importance rate of domain name, when the corresponding importance of domain name
Grade be height, then the network request is determined as preferentially sending, when the corresponding importance rate of domain name be it is low, then by institute
Network request is stated to be determined as normally sending;
Second determination unit, if not meeting the corresponding network speed grade of domain name for the current network speed,
The network request is determined as cancelling to send or postpone and is sent;
Third determination unit, if not meeting the corresponding server delay grade of domain name for current server delay,
The network request is determined as cancelling to send or postpone and is sent.
8. wanting the device described in 7 according to right, which is characterized in that the classification grade further includes network state grade.
9. wanting the device described in 8 according to right, which is characterized in that described device further includes:
First judgment module judges current if meeting the network speed grade of domain name for the current network speed
Whether network state is normal;
First returns to module, if normal for the current network state, return to the first acquisition unit, executes judgement
Whether current server delay meets the corresponding server delay grade of domain name;
4th acquisition module obtains corresponding network state of domain name etc. if abnormal for the current network state
Grade;
Second returns to module, if being to support network state abnormal for the corresponding network state grade of domain name, returns
The first acquisition unit is returned, execution is described to judge whether current server delay meets the corresponding server delay of domain name
Grade;
Third determining module, if the network state grade for domain name is not support that network state is abnormal, by institute
Network request is stated to be determined as cancelling transmission or postponing sending.
10. according to claim 6-9 any one of them devices, which is characterized in that described device further includes:
Third returns to module, for when the network request is determined as postponement transmission, after reaching preset duration, returning to first
Acquisition module executes and reacquires the network request, and executes the classification grade for obtaining domain name.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810394824.XA CN108540575B (en) | 2018-04-27 | 2018-04-27 | Network request scheduling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810394824.XA CN108540575B (en) | 2018-04-27 | 2018-04-27 | Network request scheduling method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108540575A true CN108540575A (en) | 2018-09-14 |
CN108540575B CN108540575B (en) | 2021-07-20 |
Family
ID=63479586
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810394824.XA Active CN108540575B (en) | 2018-04-27 | 2018-04-27 | Network request scheduling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108540575B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112004058A (en) * | 2020-08-25 | 2020-11-27 | 重庆紫光华山智安科技有限公司 | Intelligent resource allocation method, device and equipment for multi-level domain monitoring system |
CN112121413A (en) * | 2020-09-30 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Response method, system, device, terminal and medium of function service |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007113744A1 (en) * | 2006-04-03 | 2007-10-11 | Koninklijke Philips Electronics N.V. | A device and a method for power scheduling of data requests |
CN102833872A (en) * | 2011-06-16 | 2012-12-19 | 中兴通讯股份有限公司 | Service access method and system and terminal |
CN103259870A (en) * | 2013-05-31 | 2013-08-21 | 北京京东尚科信息技术有限公司 | Method and system of Web application service |
CN103995674A (en) * | 2014-04-17 | 2014-08-20 | 华为技术有限公司 | Method, device and equipment for processing access requests |
CN104506642A (en) * | 2014-12-30 | 2015-04-08 | 深圳市兰丁科技有限公司 | Client message efficient transceiving and processing method and system |
CN105474173A (en) * | 2013-10-01 | 2016-04-06 | 英特尔公司 | Concurrent network application scheduling for reduced power consumption |
CN107391268A (en) * | 2016-05-17 | 2017-11-24 | 阿里巴巴集团控股有限公司 | service request processing method and device |
-
2018
- 2018-04-27 CN CN201810394824.XA patent/CN108540575B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007113744A1 (en) * | 2006-04-03 | 2007-10-11 | Koninklijke Philips Electronics N.V. | A device and a method for power scheduling of data requests |
CN102833872A (en) * | 2011-06-16 | 2012-12-19 | 中兴通讯股份有限公司 | Service access method and system and terminal |
CN103259870A (en) * | 2013-05-31 | 2013-08-21 | 北京京东尚科信息技术有限公司 | Method and system of Web application service |
CN105474173A (en) * | 2013-10-01 | 2016-04-06 | 英特尔公司 | Concurrent network application scheduling for reduced power consumption |
CN103995674A (en) * | 2014-04-17 | 2014-08-20 | 华为技术有限公司 | Method, device and equipment for processing access requests |
CN104506642A (en) * | 2014-12-30 | 2015-04-08 | 深圳市兰丁科技有限公司 | Client message efficient transceiving and processing method and system |
CN107391268A (en) * | 2016-05-17 | 2017-11-24 | 阿里巴巴集团控股有限公司 | service request processing method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112004058A (en) * | 2020-08-25 | 2020-11-27 | 重庆紫光华山智安科技有限公司 | Intelligent resource allocation method, device and equipment for multi-level domain monitoring system |
CN112004058B (en) * | 2020-08-25 | 2022-03-11 | 重庆紫光华山智安科技有限公司 | Intelligent resource allocation method, device and equipment for multi-level domain monitoring system |
CN112121413A (en) * | 2020-09-30 | 2020-12-25 | 腾讯科技(深圳)有限公司 | Response method, system, device, terminal and medium of function service |
Also Published As
Publication number | Publication date |
---|---|
CN108540575B (en) | 2021-07-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107391271B (en) | Message queue system-based delayed task triggering method and device | |
CA2471594C (en) | Method and apparatus for web farm traffic control | |
CN102640125B (en) | Distributed content storage and retrieval | |
CN107707964A (en) | The method and apparatus for predicting video content temperature | |
US20230049501A1 (en) | Service processing method and apparatus, and storage medium | |
US20160205511A1 (en) | Categorized Location Identification Based on Historical Locations of a User Device | |
CN110505155A (en) | Request degradation processing method, device, electronic equipment and storage medium | |
EP2677703A2 (en) | Method and device for scheduling queue | |
WO2014194869A1 (en) | Request processing method, device and system | |
US10277529B2 (en) | Visualization of computer resource quotas | |
CN103873513B (en) | Adaptive method for down loading and system | |
US20140143777A1 (en) | Resource Scheduling Method and Device | |
CN109348264B (en) | Video resource sharing method and device, storage medium and electronic equipment | |
CN110677684B (en) | Video processing method, video access method, distributed storage method and distributed video access system | |
US10063601B2 (en) | Client identification for enforcing computer resource quotas | |
CN110401697A (en) | A kind of method, system and the equipment of concurrent processing HTTP request | |
CN108471385B (en) | Flow control method and device for distributed system | |
CN108540575A (en) | A kind of network request dispatching method and device | |
CN105635124A (en) | Flow control method and device | |
CN107633102A (en) | A kind of method, apparatus, system and equipment for reading metadata | |
CN109213560A (en) | A kind of method and apparatus of information page presentation | |
CN110191362B (en) | Data transmission method and device, storage medium and electronic equipment | |
CN104980480A (en) | Data information sharing method and data information sharing device | |
CN108829735A (en) | Synchronous method, device, server and the storage medium of parallel executive plan | |
CN109660589A (en) | Request processing method and device, 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 |