CN108540575B - Network request scheduling method and device - Google Patents

Network request scheduling method and device Download PDF

Info

Publication number
CN108540575B
CN108540575B CN201810394824.XA CN201810394824A CN108540575B CN 108540575 B CN108540575 B CN 108540575B CN 201810394824 A CN201810394824 A CN 201810394824A CN 108540575 B CN108540575 B CN 108540575B
Authority
CN
China
Prior art keywords
network
domain name
network request
request
level
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.)
Active
Application number
CN201810394824.XA
Other languages
Chinese (zh)
Other versions
CN108540575A (en
Inventor
罗熹之
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201810394824.XA priority Critical patent/CN108540575B/en
Publication of CN108540575A publication Critical patent/CN108540575A/en
Application granted granted Critical
Publication of CN108540575B publication Critical patent/CN108540575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling 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/62Establishing a time schedule for servicing the requests

Abstract

The embodiment of the application discloses a network request scheduling method and a network request scheduling device, wherein in the method, after a network request is obtained, a classification grade corresponding to a domain name included in the network request can be further obtained, and a sending mode of the network request is determined according to a request attribute grade in the classification grade; meanwhile, after the network request is sent, if the total response time length of the network request exceeds the time length of the request response total time length grade in the classification grade, the network request can be determined to be sent cancelled or delayed, so that the network request is prevented from occupying resources for sending the network request for a long time. The embodiment of the application divides the network request into more detailed dimensions based on the requested domain name, and can more reasonably and effectively schedule the transmission of the network request according to different conditions.

Description

Network request scheduling method and device
Technical Field
The present application relates to the field of internet technologies, and in particular, to a network request scheduling method and apparatus.
Background
With the development of the mobile internet, users may use various network-based applications, such as shopping-type applications, video-type applications, instant messaging-type applications, and the like. During the application use process of the network, an application client sends a network request to a server, and in some scenarios, the client simultaneously sends a plurality of network requests to the server.
In the prior art, a priority is generally set for the type of the network request, and the network requests are sequentially sent according to the priority order, so that the scheduling of the network requests is completed. However, the network requests are divided only by priority, and there is a problem that the network requests with high priority are blocked and queued, for example, a certain network request with low priority is in the process of obtaining the feedback of the server, the network request cannot be completed late due to the conditions such as network quality, and at this time, if there is a network request with high priority, the network request with high priority is blocked by the previous network request with low priority, and cannot be sent in time. Therefore, how to complete network request scheduling more reasonably and effectively is an urgent technical problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for scheduling a network request, so as to implement network request scheduling more reasonably and effectively.
In order to solve the above problem, the technical solution provided by the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a network request scheduling method, where the method includes:
acquiring a network request, wherein the network request comprises a domain name requested to be accessed;
obtaining a classification grade corresponding to the domain name, wherein the classification grade comprises a request attribute grade and a request response total duration grade;
determining a sending mode of the network request according to the request attribute level of the domain name;
after the network request is sent, acquiring the total response duration of the network request;
and if the total response duration of the network request is greater than the duration of the request response total duration grade corresponding to the domain name, determining the network request as cancel sending or postpone sending.
In some possible embodiments, the determining the sending mode of the network request according to the request attribute level of the domain name includes:
judging whether the current network speed accords with the network speed grade corresponding to the domain name;
if the current network speed accords with the network speed grade corresponding to the domain name, judging whether the current server delay accords with the server delay grade corresponding to the domain name; if the current network speed does not accord with the network speed grade corresponding to the domain name, determining the network request as cancel sending or postpone sending;
after judging whether the delay of the current server is in accordance with the server delay level corresponding to the domain name or not, if the delay of the current server is in accordance with the server delay level corresponding to the domain name, acquiring the importance level corresponding to the domain name; if the current server delay does not accord with the server delay grade corresponding to the domain name, determining the network request as cancel sending or postpone sending;
after the importance level corresponding to the domain name is obtained, when the importance level corresponding to the domain name is high, the network request is determined to be sent preferentially, and when the importance level corresponding to the domain name is low, the network request is determined to be sent normally.
In some possible embodiments, the classification level further includes a network status level.
In some possible embodiments, the method further comprises:
if the current network speed accords with the network speed grade of the domain name, judging whether the current network state is normal;
if the current network state is normal, executing the steps of judging whether the current server delay accords with the server delay grade corresponding to the domain name and the subsequent steps;
if the current network state is abnormal, acquiring the network state grade corresponding to the domain name;
if the network state grade corresponding to the domain name is abnormal for supporting the network state, executing the steps of judging whether the current server delay accords with the server delay grade corresponding to the domain name and the subsequent steps;
and if the network state level of the domain name is not normal, determining the network request as cancel transmission or postpone transmission.
In some possible embodiments, the method further comprises:
and when the network request is determined to be delayed to be sent, re-acquiring the network request after the preset time length is reached, and executing the classification grade and the subsequent steps of acquiring the domain name.
In a second aspect, an embodiment of the present application further provides a network request scheduling apparatus, where the apparatus includes:
the first acquisition module is used for acquiring a network request, wherein the network request comprises a domain name requested to be accessed;
the second obtaining module is used for obtaining a classification grade corresponding to the domain name, wherein the classification grade comprises a request attribute grade and a request response total duration grade;
the first determining module is used for determining the sending mode of the network request according to the classification level of the domain name;
the third obtaining module is used for obtaining the total response duration of the network request after the network request is sent;
and the second determining module is used for determining the network request as cancel sending or postpone sending if the total response duration of the network request is greater than the duration of the request response total duration grade corresponding to the domain name.
In some possible embodiments, the request attribute level includes a network speed level, a server latency level, and an importance level, and the first determination module includes:
the first judging unit is used for judging whether the current network speed accords with the network speed grade corresponding to the domain name;
a second judging unit, configured to judge whether the current server delay meets a server delay grade corresponding to the domain name if the current network speed meets the network speed grade corresponding to the domain name;
the first obtaining unit is used for obtaining the importance level corresponding to the domain name if the current server delay accords with the server delay level corresponding to the domain name after judging whether the current server delay accords with the server delay level corresponding to the domain name;
a first determining unit, configured to determine, after obtaining the importance level corresponding to the domain name, that the network request is to be sent preferentially when the importance level corresponding to the domain name is high, and determine that the network request is to be sent normally when the importance level corresponding to the domain name is low;
a second determining unit, configured to determine that the network request is to cancel sending or postpone sending if the current network speed does not meet the network speed level corresponding to the domain name;
a third determining unit, configured to determine that the network request is to cancel sending or postpone sending if the current server delay does not meet the server delay level corresponding to the domain name.
In some possible embodiments, the classification level includes a network status level in addition to a network speed level, a server latency level, an importance level, and a total duration level of the request response.
In some possible embodiments, the apparatus further comprises:
the first judgment module is used for judging whether the current network state is normal or not if the current network speed accords with the network speed grade of the domain name;
a first returning module, configured to return to the first obtaining unit if the current network state is normal, and execute a judgment on whether a current server delay meets a server delay level corresponding to the domain name;
a fourth obtaining module, configured to obtain a network state level corresponding to the domain name if the current network state is not normal;
a second returning module, configured to return to the first obtaining unit if the network state level corresponding to the domain name is abnormal to support the network state, and execute the judgment to determine whether the current server delay meets the server delay level corresponding to the domain name;
and the third determining module is used for determining the network request as cancel sending or postpone sending if the network state level of the domain name is not normal.
In some possible embodiments, the apparatus further comprises:
and the third returning module is used for returning to the first acquiring module after the network request is determined to be delayed to be sent and the preset time length is reached, executing to acquire the network request again and executing to acquire the classification level of the domain name.
Therefore, the embodiment of the application has the following beneficial effects:
the method and the device for sending the network request can determine the classification level corresponding to each server domain name in advance, after the network request is obtained, the classification level corresponding to the domain name included in the network request can be further obtained, and the classification level can define the sending mode of the network request under different conditions, so that the sending mode of the network request can be determined according to the request attribute level in the classification level; meanwhile, after the network request is sent, if the total response time length of the network request exceeds the time length of the request response total time length grade in the classification grade, the network request can be determined to be sent cancelled or delayed, so that the network request is prevented from occupying resources for sending the network request for a long time. The embodiment of the application divides the network request into more detailed dimensions based on the requested domain name, and can more reasonably and effectively schedule the transmission of the network request according to different conditions.
Drawings
Fig. 1 is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a network request scheduling method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another network request scheduling method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another network request scheduling method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a network request scheduling apparatus according to an embodiment of the present application.
Detailed Description
During the process of using the network application program by the user, based on the operation of the user on the application program, the application program client typically sends a network request to the server, so that the server performs corresponding task processing based on the network request. However, in general, the number of network requests that the application client needs to send to the server may be multiple, and the application client may send the network requests one by one, which may cause the application client to send unimportant network requests first and then send important network requests, thereby causing a problem that some more important network requests cannot be sent in time.
In the existing technical solution, priorities are generally set for types of network requests, and the network requests are sequentially sent to a server according to a priority order, specifically, a network request with a high priority is sent first, and a network request with a low priority is sent later, so as to complete scheduling of the network requests. However, the network requests are only divided according to the priority, the division granularity is coarse, and the problem that the network requests with high priority are blocked and queued exists. For example, in the process of obtaining the server feedback by a network request with a lower priority, the network request is not completed for a long time due to the conditions of network quality, longer server delay and the like, and at this time, the application client generates a network request with a higher priority, so that the network request with the higher priority is blocked by the previous network request with the lower priority, and the application client can only wait for the completion of the network request with the lower priority and then send the network request with the higher priority, thereby causing the network request with the higher priority to be unable to be sent in time, and reducing the user experience.
Therefore, the embodiment of the application provides a network request scheduling method, and the network request can be reasonably and effectively scheduled by performing finer-grained division on the network request. Specifically, the network request scheduling method provided in the embodiment of the present application may be applied to the exemplary application scenario shown in fig. 1, where the application scenario includes a client 101 and a server 102, and the network request scheduling method may include: the client 101 may obtain a network request generated based on a user's operation on the client 101, where the network request includes a domain name requested to be accessed, and obtain a classification level corresponding to the domain name, where the classification level includes a request attribute level, a total request response duration level, and the like, then the client 101 determines a sending manner of the network request according to the request attribute level corresponding to the obtained domain name, and sends the network request to the server 102 corresponding to the domain name according to the sending manner of the network request, after the client 101 sends the network request to the server 102, the client 101 obtains a total response duration of the network request, and determines whether the corresponding total duration of the network request is greater than the duration of the total request response duration level corresponding to the domain name, and if so, determines the sending manner of the network request as cancel sending or postpone sending, i.e., no longer sends the network request to the server 102 or defers for a period of time to send the network request to the server 102.
The sending mode of the network request is determined according to the request attribute grade corresponding to the domain name, and when the total response time length of the network request exceeds the total request response time length grade corresponding to the domain name, the network request is cancelled or delayed for a period of time to be sent again, so that the network request can be prevented from occupying resources for sending the network request for a long time, and the problem that the network request with high priority is blocked and queued due to the fact that the network request with low priority cannot be sent for a long time can be avoided, and the network request is more reasonably and effectively scheduled.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a network request scheduling method according to an embodiment of the present application, where the method specifically includes:
s201: a network request is obtained, the network request including a domain name for which access is requested.
Generally, when a user clicks a control, presses a page for a long time, and the like on a client, the client generates a corresponding network request based on the user operation, and sends the network request to a server to request the server to perform corresponding network task processing according to the network request. Then, before the client sends the network request to the server, the network request may be obtained first, so as to subsequently determine a sending manner of the network request.
In the process of transmitting a network request from a client to a server, the network node transmitting the network request determines to which server the network request needs to be transmitted, usually according to the domain name of the server included in the network request. Thus, the acquired network request typically includes the domain name of the server to which access is requested.
S202: and obtaining a classification grade corresponding to the domain name, wherein the classification grade comprises a request attribute grade and a request response total duration grade.
In the application embodiment, the domain name in the network request usually points to a certain server, and the server generally processes a certain type of network request, and the domain name in the network request may correspond to the type of the network request, so that scheduling of different types of network requests may be implemented by setting a classification level corresponding to the domain name.
As an example, the request attribute level in this embodiment may include a network speed level, a server delay level, and an importance level, and of course, other factors that affect the priority of network request transmission, such as a network status level representing a network congestion condition, may also be included, which is not limited herein.
The network speed level corresponding to the domain name is a level of network speed required for completing a network request including the domain name. Typically, different types of network requests are fulfilled, and different network speeds are usually required. For example, for a network request for acquiring a video file type, a video server is generally required to process the network request, and may require a large capacity of the acquired video file for a client, the video server generally requires a fast network speed in transmitting the video file to the client to reduce the time for completing the network request, otherwise, the network request may be blocked due to the long time for completing the network request. For the network request for obtaining the text file type, the server can transmit the text file to the client in a short time even if the network speed is slow because the text file capacity required by the client is small, so that the network speed generally required by the network request for obtaining the text file is not required to be too fast.
In some embodiments, since the network speed of a WIFI (Wireless local area network) network is faster than that of a 4G (the 4th Generation communication system) network, and the network speed of a 4G network is faster than that of a 3G (the 3th Generation communication system) network, the network speed classes corresponding to domain names may be divided into a WIFI class, a 4G class and a 3G class, which correspond to a faster, normal and slower network speed, respectively.
The server delay level corresponding to the domain name is a level that allows the server to respond to the maximum delay time of the network request, wherein the server is a server corresponding to the domain name included in the network request. In some embodiments, the server latency level may be divided by the length of time of the maximum latency. For example, the server latency level may be divided into a millisecond level, a second level and no limitation, and when the maximum latency duration for allowing the server to respond to the network request is calculated in units of milliseconds, the server latency level may be the millisecond level; when the maximum delay time of the server responding to the network request is calculated by taking seconds as a unit, the delay grade of the server can be second grade; and when the delay level of the server is unlimited, the delay of the network request is unlimited.
The importance level corresponding to the domain name is a level representing the importance level of the service requested by the network request to the user. In some embodiments, ranking may be performed by counting the importance of individual network requests to the user experience in the actual application. For example, the importance level may be divided into two levels of importance and unimportance, and when it is determined from the statistical result that the network request is important for the user experience, the importance level is heavy; when the network request is determined to be insignificant to the user experience based on the statistics, then the importance level is insignificant.
The total duration level of the request response corresponding to the domain name is the duration level allowing the network request to occupy the resource sending the network request. In some possible embodiments, the ranking may be based on a length of time that the network request is allowed to occupy the resource that sent the network request. For example, the total duration level of the request response may be divided into 5 seconds, 10 seconds, 30 seconds and no limitation, and if the duration allowing the network request to occupy the resource for sending the network request does not exceed 5 seconds, the total duration level of the request response is 5 seconds; if the time length of allowing the network request to occupy the resource for sending the network request exceeds 5 seconds but not 10 seconds, the total time length level of the request response is 10 seconds; if the time length of allowing the network request to occupy the resource for sending the network request exceeds 10 seconds but does not exceed 30 seconds, the total time length level of the request response is 30 seconds; if the time length of allowing the network request to occupy the resource for sending the network request exceeds 30 seconds, the total time length level of the request response is unlimited.
As an example, the classification level corresponding to each domain name may be preset, and after the network request is obtained, the request attribute level corresponding to the network request and the total request response duration level may be determined according to the domain name included in the network request. In some embodiments, a network speed level, a server delay level, an importance level, and the like corresponding to the network request may be specifically determined.
S203: and determining a sending mode of the network request according to the request attribute level corresponding to the domain name.
In one non-limiting example, the network request may be sent in a manner that includes: the method comprises four modes of preferential transmission, normal transmission, deferred transmission and cancellation of transmission. Wherein, the preferential transmission means that the network request is preferentially transmitted relative to other network requests; the normal transmission means that when the priority of each network request is relative, the network requests are transmitted according to a normal transmission sequence; the transmission postponing means that the network request is not transmitted temporarily, and the network request is transmitted after being postponed for a period of time; unsent means that the network request is no longer sent.
The network request is evaluated by using the classification level corresponding to the domain name, so that the priority degree of sending the network request can be determined, for the network request with higher priority degree, the sending mode can be preferential sending or normal sending, and for the network request with lower priority degree, the sending mode can be delayed sending or even cancel sending. That is, the transmission mode of the network request can be determined according to the classification level corresponding to the domain name.
For the specific implementation process of determining the sending mode of the network request, reference may be made to the related description in the subsequent embodiments, which is not described herein again.
S204: and after the network request is sent, acquiring the total response time length of the network request.
The total response duration of the network request refers to the total duration of the network request that is waited for the server to respond after the client sends the network request. In an exemplary embodiment, the timing may be started after the client sends the network request, and the timing is not stopped until the client obtains a feedback result sent by the server in response to the network request. The timing duration is the total response duration of the network request.
S205: and if the total response time length of the network request is greater than the time length of the request response total time length grade corresponding to the domain name included in the network request, determining the sending mode of the network request as cancel sending or delay sending.
It can be understood that the total request response duration level corresponding to the domain name included in the network request corresponds to the maximum duration that the client allows the network request to occupy the resource for sending the network request, if the total response duration of the network request exceeds the maximum duration that the client allows the client to occupy the resource for sending the network request, it indicates that the network request sent by the client does not receive the response of the server for a long time, the network request occupies the resource for sending the network request for too long, and in order not to block the sending of other network requests, the network request may be delayed for a certain time to be sent again or not be sent again. If the total response time of the network request does not exceed the maximum time of the resource which is allowed by the client to occupy and send the network request, the network request is normally completed.
Specifically, when the total response duration of the network request is greater than the duration of the total response duration level of the request, based on the user experience of the client, part of the more important network requests can be delayed to be sent, and the unimportant network requests can be cancelled to be sent. For example, when a user watches a video using a client, if the total response duration of a network request sent by the client is greater than the duration of the total response duration level of the request, for the network request sent by the client, the network request for acquiring the video that the user needs to watch is a relatively important network request, the sending mode of the network request may be deferred sending, and for the network requests for acquiring audience comments, video profiles and the like of the video, the sending mode of the network request is usually an unimportant network request, and the sending mode of the network request may be cancelled sending. Further, if it is determined that the sending mode of the network request is deferred sending, the network request may be re-acquired after the deferred time reaches a preset duration, and the acquiring of the classification level corresponding to the domain name of the network request and subsequent corresponding steps may be performed. The preset duration may be set manually by a technician according to an actual situation, or may be set by an algorithm program according to different network requests, which is not limited herein.
In an exemplary embodiment, when it is determined that the sending mode of the network request is deferred sending, timing may be performed on the network request, and a preset time duration for deferred sending of the network request is determined, and when the timed time duration reaches the preset time duration, the network request may be re-acquired, and steps S202 to S205 may be performed again until the network request is sent completely, or the sending mode of the network request is determined to be cancelled.
In this embodiment, the classification level corresponding to each server domain name may be predetermined, and after the network request is obtained, the classification level corresponding to the domain name included in the network request may be further obtained, so that the sending mode of the network request may be determined according to the request attribute level in the classification level; meanwhile, after the network request is sent, if the total response time length of the network request exceeds the time length of the request response total time length grade in the classification grade, the network request can be determined as cancel sending or delay sending, so that the network request is prevented from occupying resources for sending the network request for a long time. The embodiment of the application divides the network request into more detailed dimensions based on the requested domain name, and can more reasonably and effectively schedule the transmission of the network request according to different conditions.
In the foregoing embodiment, a simple description is given to determining the sending manner of the network request, and in an exemplary embodiment, the sending manner of the network request may be determined sequentially according to the network speed level, the server delay level, the importance level, and the total duration level of the request response in the classification level. Specifically, the present application further provides another embodiment of a network request scheduling method, wherein, in the embodiment, the specific implementation process for determining the sending method of the network request is described in detail in an exemplary manner, mainly according to the relevant contents of step S303 to step S307.
Referring to fig. 3, fig. 3 is a schematic flow chart illustrating another network request scheduling method according to an embodiment of the present application, where the method specifically includes:
s301: a network request is obtained, the network request including a domain name for which access is requested.
S302: and obtaining a classification grade corresponding to the domain name, wherein the classification grade comprises a network speed grade, a server delay grade, an importance grade and a total request response duration grade.
In this embodiment, steps S301 to S302 are similar to steps S201 to S202 in the previous embodiment, and reference may be made to the related description in the previous embodiment, which is not repeated herein.
S303: and judging whether the current network speed meets the network speed grade corresponding to the domain name, if so, executing step S304, and if not, executing step S310.
The speed of the current network speed may be related to the network where the client is located. Typically, the current network speed may be faster when the client is in a WIFI network relative to a 4G network, and may also be faster when the client is in a 4G network relative to a 3G network.
It will be appreciated that different types of network requests may generally need to match the corresponding network speed requirements, and if the current network speed is lower than the network speed matched with the network request, the time required for completing the network request will be greatly increased, and other network requests will be easily blocked. For example, for a network request for acquiring video content, after a client sends the network request to a video server and obtains a response of the video server, the video server sends corresponding video stream data to the client, if the current network environment is a 3G network, the transmission speed of the video stream data is slow, and especially when a video file required to be acquired by the client is large, it takes a long time (e.g., ten minutes, even several hours, etc.) to complete the network request by using the 3G network, which easily causes blocking of other network requests. However, for the network request for obtaining the video content profile, because the file of the video content profile is small, even if the current network environment is a 3G network, the network request can be completed in a short time, and generally no blocking is caused to other network requests.
Therefore, if the current network speed is the network speed in the 3G network, the network request for obtaining the video content profile can be transmitted and the judgment of the subsequent steps is performed, and the network request for obtaining the video is determined as postponing the transmission or even canceling the transmission. However, if the current network speed is the network speed of the WiFi network, the network request for obtaining the video can be completed in a short time due to the fast network speed of the WiFi network, so the network request for obtaining the video can be sent and the subsequent steps can be determined.
S304: and judging whether the current server delay accords with the server delay grade corresponding to the domain name, if so, executing step S305, and if not, executing step S310. It can be understood that even if the current network speed conforms to the network speed level corresponding to the domain name, in some scenarios, if the delay degree of the server is severe, the server may not respond to the network request for a long time, and thus the network request currently sent by the client may block the sending of other network requests. Therefore, in this embodiment, if the current network speed meets the network speed level corresponding to the domain name, it may be further determined whether the current server delay degree meets the server delay level corresponding to the domain name.
For example, in some scenarios, the response delay time of the server allowed by the partial network request can only be calculated in milliseconds, but if the delay degree of the current server exceeds the level, the server cannot respond to the network request within milliseconds, that is, the delay of the current server does not conform to the server delay level corresponding to the domain name, which means that the network request may block other network requests waiting to be sent.
Therefore, whether the current server delay accords with a plurality of server delay levels corresponding to the domain name or not can be judged, if yes, the subsequent steps are continued, and if not, the network request can be delayed from being sent or cancelled from being sent in order to avoid blocking the sending of other network requests.
S305: and acquiring the importance level corresponding to the domain name.
S306: and when the importance level corresponding to the domain name is high, determining the sending mode of the network request as the priority sending.
S307: and when the importance level corresponding to the domain name is low, determining the sending mode of the network request as normal sending.
It will be appreciated that in order to achieve a better user experience, network requests that are more important to the user will typically be sent with priority to meet the user's usage needs. For example, in a scenario where a user may want to watch a movie on a client, the content of the movie's profile is generally more important to the user than the content of comments made by other viewers to the movie, and accordingly, the network request for obtaining the movie content profile is more important to improve the user experience than the network request for obtaining the viewers ' comments, so that the sending mode of the network request for obtaining the movie content profile may be determined as the priority sending mode, and the sending mode of the network request for obtaining the viewers ' comments may be determined as the normal sending mode.
S308: and after the network request is sent, acquiring the total response time length of the network request.
S309: and judging whether the total response time length of the network request is greater than the time length of the request response total time length grade corresponding to the domain name included in the network request, and if so, executing the step S310.
S310: the transmission mode of the network request is determined as either a cancel transmission or a defer transmission.
It should be noted that, in the present embodiment, steps S308 to S310 are similar to steps S204 to S205 in the previous embodiment, and reference may be made to the related description in the previous embodiment, which is not repeated herein.
In the embodiment, the sending mode of the network request is determined in sequence according to various levels in the classification levels, the sending mode of the network request can be determined quickly and flexibly according to the actual network condition, the network request is prevented from occupying resources for sending the network request for a long time, the sending of other network requests is blocked, and the sending of the network request can be scheduled more reasonably and effectively by dividing the priority of the network request.
It should be noted that, the implementation processes of step S303 to step S307 in the above embodiment are only used to describe in detail the sending method of the network request, and are not used to limit the present invention. In fact, there are various sending modes for determining the network, for example, it may be determined whether the current server delay meets the server delay level corresponding to the domain name, and if yes, it may be determined whether the current network speed meets the network speed level corresponding to the domain name.
In addition, if network abnormality occurs in the network environment where the client is currently located, such as large network traffic, network congestion, and the like, the client may postpone sending or cancel sending the partial network request. Thus, in some possible embodiments, the classification level corresponding to the domain name may include a network status level in addition to a network speed level, a server latency level, an importance level, and a total duration level of the request response. Therefore, the application also provides another embodiment of a network request scheduling method.
Referring to fig. 4, fig. 4 is a schematic flow chart illustrating a network request scheduling method according to an embodiment of the present application, where the method specifically includes:
s401: a network request is obtained, the network request including a domain name for which access is requested.
S402: and obtaining classification levels corresponding to the domain name, wherein the classification levels comprise a network speed level, a server delay level, an importance level, a total request response duration level and a network state level.
In this embodiment, steps S401 to S402 are similar to steps S301 to S302 in the previous embodiment, and reference may be made to the related description in the previous embodiment, which is not repeated herein.
S403: and judging whether the current network speed meets the network speed grade corresponding to the domain name, if so, executing step S404, and if not, executing step S413.
S404: and judging whether the current network state is normal or not, if so, executing step S407, and if not, executing step S405.
In general, a network environment where a client is located is a normal state, but at a certain time period, conditions such as a large network traffic or a network congestion may exist in an environment network where the client is located, so that a network request sent by the client cannot be transmitted to a server, or a data loss exists in a process of transmitting the network request to the server, and at this time, the network state may be an abnormal state.
S405: and acquiring the network state grade corresponding to the domain name.
S406: and judging whether the network state level corresponding to the domain name is abnormal for supporting the network state, if so, executing step 407, and if not, executing step 413.
It should be noted that the network status level indicates whether to continue sending network requests when the network status is abnormal. In this embodiment, the network status level may be divided into two levels, which are abnormal network status supporting and abnormal network status non-supporting. If the network status level corresponding to the domain name is abnormal, indicating that the network request is still sent in the network environment with abnormal network status, the subsequent steps of steps S407 and S407 may be continuously executed. However, if the network status level corresponding to the domain name is not normal, indicating that the network request is not sent in the network environment with abnormal network status, the network request may be sent later or cancelled.
S407: and judging whether the current server delay accords with the server delay level corresponding to the domain name, if so, executing step S408, and if not, executing step S413.
S408: and acquiring the importance level corresponding to the domain name.
S409: and when the importance level corresponding to the domain name is high, determining the sending mode of the network request as the priority sending.
S410: and when the importance level corresponding to the domain name is low, determining the sending mode of the network request as normal sending.
S411: and after the network request is sent, acquiring the total response time length of the network request.
S414: and judging whether the total response time length of the network request is greater than the total response time length grade of the request corresponding to the domain name included in the network request, and if so, executing the step S413.
S413: the transmission mode of the network request is determined as either a cancel transmission or a defer transmission.
In this embodiment, steps S407 to S413 are similar to steps S304 to S310 in the previous embodiment, and reference may be made to the related description in the previous embodiment, which is not repeated herein.
In this embodiment, before sending the network request, the sending method of the network request is determined according to the current network state and the network state level corresponding to the domain name included in the network request, so as to further refine the division of the priority degree of sending the network request, thereby enabling the client to schedule the network request more reasonably and effectively.
In addition, an embodiment of the present application further provides a network request scheduling apparatus, as shown in fig. 5, the network request scheduling apparatus includes:
a first obtaining module 501, configured to obtain a network request, where the network request includes a domain name requested to be accessed;
a second obtaining module 502, configured to obtain a classification level corresponding to the domain name, where the classification level includes a request attribute level and a request response total duration level;
a first determining module 503, configured to determine a sending manner of the network request according to the request attribute level of the domain name;
a third obtaining module 504, configured to obtain a total response duration of the network request after the network request is sent;
a second determining module 505, configured to determine that the network request is cancelled or postponed to be sent if the total response duration of the network request is greater than the duration of the total request response duration level corresponding to the domain name.
In some possible embodiments, the request attribute levels include a network speed level, a server delay level, and an importance level, and the first determining module 503 includes:
the first judging unit is used for judging whether the current network speed accords with the network speed grade corresponding to the domain name;
a second judging unit, configured to judge whether the current server delay meets a server delay grade corresponding to the domain name if the current network speed meets the network speed grade corresponding to the domain name;
the first obtaining unit is used for obtaining the importance level corresponding to the domain name if the current server delay accords with the server delay level corresponding to the domain name after judging whether the current server delay accords with the server delay level corresponding to the domain name;
a first determining unit, configured to determine, after obtaining the importance level corresponding to the domain name, that the network request is to be sent preferentially when the importance level corresponding to the domain name is high, and determine that the network request is to be sent normally when the importance level corresponding to the domain name is low;
a second determining unit, configured to determine that the network request is to cancel sending or postpone sending if the current network speed does not meet the network speed level corresponding to the domain name;
a third determining unit, configured to determine that the network request is to cancel sending or postpone sending if the current server delay does not meet the server delay level corresponding to the domain name.
In some possible embodiments, the classification level includes a network status level in addition to a network speed level, a server latency level, an importance level, and a total duration level of the request response.
In some possible embodiments, the apparatus further comprises:
the first judgment module is used for judging whether the current network state is normal or not if the current network speed accords with the network speed grade of the domain name;
a first returning module, configured to return to the first obtaining unit if the current network state is normal, and execute a judgment on whether a current server delay meets a server delay level corresponding to the domain name;
a fourth obtaining module, configured to obtain a network state level corresponding to the domain name if the current network state is not normal;
a second returning module, configured to return to the first obtaining unit if the network state level corresponding to the domain name is abnormal to support the network state, and execute the judgment to determine whether the current server delay meets the server delay level corresponding to the domain name;
and the third determining module is used for determining the network request as cancel sending or postpone sending if the network state level of the domain name is not normal.
In some possible embodiments, the apparatus further comprises:
and the third returning module is used for returning to the first acquiring module after the network request is determined to be delayed to be sent and the preset time length is reached, executing to acquire the network request again and executing to acquire the classification level of the domain name.
The method and the device for sending the network request can determine the classification level corresponding to each server domain name in advance, after the network request is obtained, the classification level corresponding to the domain name included in the network request can be further obtained, and the classification level can define the sending mode of the network request under different conditions, so that the sending mode of the network request can be determined according to the request attribute level in the classification level; meanwhile, after the network request is sent, if the total response time length of the network request exceeds the total request response time length grade in the classification grade, the network request can be determined to be sent cancelled or delayed, so that the network request is prevented from occupying resources for sending the network request for a long time. The embodiment of the application divides the network request into more detailed dimensions based on the requested domain name, and can more reasonably and effectively schedule the transmission of the network request according to different conditions.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for network request scheduling, the method comprising:
acquiring a network request, wherein the network request comprises a domain name requested to be accessed;
obtaining a classification grade corresponding to the domain name, wherein the classification grade comprises a request attribute grade and a request response total duration grade;
determining a sending mode of the network request according to the request attribute level of the domain name, wherein the sending mode of the network request comprises the following steps: preferential transmission, normal transmission, deferred transmission, and cancellation of transmission;
after the network request is sent, acquiring the total response duration of the network request;
and if the total response duration of the network request is greater than the duration of the request response total duration grade corresponding to the domain name, determining the network request as cancel sending or postpone sending.
2. The method of claim 1, wherein the request attribute levels comprise a network speed level, a server latency level, and an importance level;
the determining the sending mode of the network request according to the request attribute level of the domain name comprises:
judging whether the current network speed accords with the network speed grade corresponding to the domain name;
if the current network speed accords with the network speed grade corresponding to the domain name, judging whether the current server delay accords with the server delay grade corresponding to the domain name; if the current network speed does not accord with the network speed grade corresponding to the domain name, determining the network request as cancel sending or postpone sending;
after judging whether the delay of the current server is in accordance with the server delay level corresponding to the domain name or not, if the delay of the current server is in accordance with the server delay level corresponding to the domain name, acquiring the importance level corresponding to the domain name; if the current server delay does not accord with the server delay grade corresponding to the domain name, determining the network request as cancel sending or postpone sending;
after the importance level corresponding to the domain name is obtained, when the importance level corresponding to the domain name is high, the network request is determined to be sent preferentially, and when the importance level corresponding to the domain name is low, the network request is determined to be sent normally.
3. The method of claim 2, wherein the classification level further comprises a network status level.
4. The method of claim 3, further comprising:
if the current network speed accords with the network speed grade of the domain name, judging whether the current network state is normal;
if the current network state is normal, executing the steps of judging whether the current server delay accords with the server delay grade corresponding to the domain name and the subsequent steps;
if the current network state is abnormal, acquiring the network state grade corresponding to the domain name;
if the network state grade corresponding to the domain name is abnormal for supporting the network state, executing the steps of judging whether the current server delay accords with the server delay grade corresponding to the domain name and the subsequent steps;
and if the network state level of the domain name is not normal, determining the network request as cancel transmission or postpone transmission.
5. The method according to any one of claims 1-4, further comprising:
and when the network request is determined to be delayed to be sent, re-acquiring the network request after the preset time length is reached, and executing the classification grade and the subsequent steps of acquiring the domain name.
6. A network request scheduling apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a network request, wherein the network request comprises a domain name requested to be accessed;
the second obtaining module is used for obtaining a classification grade corresponding to the domain name, wherein the classification grade comprises a request attribute grade and a request response total duration grade;
a first determining module, configured to determine a sending manner of the network request according to the request attribute level of the domain name, where the sending manner of the network request includes: preferential transmission, normal transmission, deferred transmission, and cancellation of transmission;
the third obtaining module is used for obtaining the total response duration of the network request after the network request is sent;
and the second determining module is used for determining the network request as cancel sending or postpone sending if the total response duration of the network request is greater than the duration of the request response total duration grade corresponding to the domain name.
7. The apparatus of claim 6, wherein the request attribute levels comprise a network speed level, a server latency level, and an importance level, and wherein the first determining module comprises:
the first judging unit is used for judging whether the current network speed accords with the network speed grade corresponding to the domain name;
a second judging unit, configured to judge whether the current server delay meets a server delay grade corresponding to the domain name if the current network speed meets the network speed grade corresponding to the domain name;
the first obtaining unit is used for obtaining the importance level corresponding to the domain name if the current server delay accords with the server delay level corresponding to the domain name after judging whether the current server delay accords with the server delay level corresponding to the domain name;
a first determining unit, configured to determine, after obtaining the importance level corresponding to the domain name, that the network request is to be sent preferentially when the importance level corresponding to the domain name is high, and determine that the network request is to be sent normally when the importance level corresponding to the domain name is low;
a second determining unit, configured to determine that the network request is to cancel sending or postpone sending if the current network speed does not meet the network speed level corresponding to the domain name;
a third determining unit, configured to determine that the network request is to cancel sending or postpone sending if the current server delay does not meet the server delay level corresponding to the domain name.
8. The apparatus of claim 7, wherein the classification level further comprises a network status level.
9. The apparatus of claim 8, further comprising:
the first judgment module is used for judging whether the current network state is normal or not if the current network speed accords with the network speed grade of the domain name;
a first returning module, configured to return to the first obtaining unit if the current network state is normal, and execute a judgment on whether a current server delay meets a server delay level corresponding to the domain name;
a fourth obtaining module, configured to obtain a network state level corresponding to the domain name if the current network state is not normal;
a second returning module, configured to return to the first obtaining unit if the network state level corresponding to the domain name is abnormal to support the network state, and execute the judgment to determine whether the current server delay meets the server delay level corresponding to the domain name;
and the third determining module is used for determining the network request as cancel sending or postpone sending if the network state level of the domain name is not normal.
10. The apparatus according to any one of claims 6-9, further comprising:
and the third returning module is used for returning to the first acquiring module after the network request is determined to be delayed to be sent and the preset time length is reached, executing to acquire the network request again and executing to acquire the classification level of the domain name.
CN201810394824.XA 2018-04-27 2018-04-27 Network request scheduling method and device Active CN108540575B (en)

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 CN108540575A (en) 2018-09-14
CN108540575B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (7)

* Cited by examiner, † Cited by third party
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN108540575A (en) 2018-09-14

Similar Documents

Publication Publication Date Title
CN107391271B (en) Message queue system-based delayed task triggering method and device
US8797971B2 (en) Method and device for sending a buffer status report
CN110858843B (en) Service request processing method and device and computer readable storage medium
CN110471749B (en) Task processing method, device, computer readable storage medium and computer equipment
CN108540575B (en) Network request scheduling method and device
US20210243136A1 (en) Method, device and system for resource allocation
US20170013608A1 (en) Pucch resource allocation method, network side device and communications system
US11025709B2 (en) Load processing method and apparatus
CN113364697A (en) Flow control method, device, equipment and computer readable storage medium
JP6189545B2 (en) Network application parallel scheduling to reduce power consumption
WO2013068925A2 (en) Method and apparatus for controlling wireless devices
CN109922120B (en) Method and terminal for improving DNS availability
CN114640630B (en) Flow control method, device, equipment and readable storage medium
CN109121219B (en) Method and device for sending scheduling request, storage medium and terminal
CN113835905B (en) Message queue load balancing method and device, electronic equipment and medium
CN115344350A (en) Node equipment of cloud service system and resource processing method
CN109062706B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
CN114296897A (en) Method and device for sending advertisement request
CN111491323B (en) IAB-based method and device for reserving uplink transmission resources
CN111867111B (en) Method and device for scheduling equipment
CN109062707B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
CN113268327A (en) Transaction request processing method and device and electronic equipment
CN112399470A (en) LoRa communication method, LoRa gateway, LoRa system and computer readable storage medium
US20230156768A1 (en) Method and device for stopping sending schedule request
US11063871B2 (en) Communication apparatus, communication method, non-transitory recording medium, and communication system

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