CN109104480A - A kind of processing method and processing device of network request - Google Patents

A kind of processing method and processing device of network request Download PDF

Info

Publication number
CN109104480A
CN109104480A CN201810886272.4A CN201810886272A CN109104480A CN 109104480 A CN109104480 A CN 109104480A CN 201810886272 A CN201810886272 A CN 201810886272A CN 109104480 A CN109104480 A CN 109104480A
Authority
CN
China
Prior art keywords
network request
estimated
response
request
network
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
Application number
CN201810886272.4A
Other languages
Chinese (zh)
Other versions
CN109104480B (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201810886272.4A priority Critical patent/CN109104480B/en
Publication of CN109104480A publication Critical patent/CN109104480A/en
Application granted granted Critical
Publication of CN109104480B publication Critical patent/CN109104480B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements

Abstract

The embodiment of the present application discloses a kind for the treatment of method and apparatus of network request, wherein, processing method include: obtain in network request pre-set response priority parameters and the network request first can consumable stock number, according to the response priority parameters of network request and the estimated consumed resource of network request, determine the response grade of network request, when the response grade of network request reaches preset threshold, delay disposal is carried out to network request, i.e. selectively delay disposal priority level is low, the big network request of consumed resource, to guarantee that server can prioritize processing priority level height, the lesser network request of consumed resource, network service quality and user experience are promoted to maximize, realize the processing rationally and effectively completed to network request.

Description

A kind of processing method and processing device of network request
Technical field
This application involves Internet technical fields, and in particular to a kind of processing method and processing device of network request.
Background technique
It with the fast development of Internet technology and becomes increasingly popular, the resource that networking products are capable of providing is more and more richer Richness, user's amount of access are also increasing.This makes storage and processing ability in website application server, bandwidth resources item Under part, the performance of application server is increasingly difficult to ensure.A series of problems, such as big data quantity, high concurrent access, frequent delay machine The response efficiency of application service is seriously affected.In particular with the appearance of the new technologies such as containerization, serviceization, existing application clothes Business device processing capacity has been difficult to adapt to user's requirements for access of extensive high concurrent.Rely solely on improving physical hardware configuration or Person increases the means of clustered node, and not only input cost is high, but also can not fundamentally improve the performance of service response.
In the prior art, in the case that server stress increases severely, the client received can not be handled in server When the network request of transmission, the network request received can be carried out by downgrade processing, this kind of side based on the mode of random rejection Formula realizes that process is simple, has certain remission effect to server stress.But this kind of mode can not Logistics networks service quality And user experience, therefore, how more reasonable effectively complete is a technical problem to be solved urgently the processing of network request.
Summary of the invention
In view of this, the embodiment of the present application provides a kind of processing method and processing device of network request, it is more reasonable to realize Effectively complete the processing to network request.
To solve the above problems, technical solution provided by the embodiments of the present application is as follows:
A kind of processing method of network request, which comprises
Obtain network request;
Read the pre-set response priority parameters for including in the network request;
Calculate the estimated consumed resource of the network request;
According to the response priority parameters of the network request and the estimated consumed resource of the network request, determine The response grade of the network request;
If the response grade of the network request reaches preset threshold, delay disposal is carried out to the network request.
In one possible implementation, the estimated consumed resource for calculating the network request, comprising:
The estimated memory source for obtaining the estimated processor resource consumption and the network request of the network request disappears Consumption;
The estimated memory source of the estimated processor resource consumption of the network request and the network request is consumed Amount is added, and obtains the estimated consumed resource of the network request.
In one possible implementation, the estimated processor resource consumption for obtaining the network request and institute State the estimated memory source consumption of network request, comprising:
Actual processor consumed resource of network request during historical responses is obtained, the reality is calculated Estimated processor resource consumption of the average value of border processor resource consumption as the network request;
Actual memory consumed resource of network request during historical responses is obtained, the reality is calculated Estimated memory source consumption of the average value of memory source consumption as the network request.
In one possible implementation, the response priority parameters according to the network request and the net The estimated consumed resource of network request, determines the response grade of the network request, comprising:
The estimated consumed resource of the response priority parameters of the network request and the network request is added Power summation, obtains the response grade of the network request.
In one possible implementation, described by the response priority parameters of the network request and the network The estimated consumed resource of request is weighted summation, obtains the response grade of the network request, comprising:
By the response priority parameters of the network request it is inverted after be multiplied with the first weighted value, obtain the first parameter Value;
The estimated consumed resource of the network request is multiplied divided by after normalized parameter with the second weighted value, obtains Two parameter values, the normalized parameter are the maximum value in the estimated consumed resource of each network request;
First parameter value is added with second parameter value, obtains the response grade of the network request.
In one possible implementation, the method also includes:
If the response grade of the network request is not up to preset threshold, the network request is sent to corresponding ask Execute server is asked to be executed.
In one possible implementation, after the acquisition network request, the method also includes:
Whether need to carry out the delay disposal of network request according to current server load judgment;
If necessary to carry out the delay disposal of network request, include in the execution reading network request sets in advance The response priority parameters and subsequent step set;
If you do not need to carrying out the delay disposal of network request, the network request is sent to corresponding request and executes clothes Business device is executed.
A kind of processing unit of network request, described device include:
Acquiring unit, for obtaining network request;
Reading unit, for reading the pre-set response priority parameters for including in the network request;
Computing unit, for calculating the estimated consumed resource of the network request;
Determination unit, for according to the response priority parameters of the network request and the estimated money of the network request Source consumption determines the response grade of the network request;
Processing unit, if the response grade for the network request reaches preset threshold, to the network request into Row delay disposal.
In one possible implementation, the computing unit specifically includes:
Subelement is obtained, for obtaining the estimated processor resource consumption and the network request of the network request It is expected that memory source consumption;
Computation subunit, for by the pre- of the estimated processor resource consumption of the network request and the network request It counts memory source consumption to be added, obtains the estimated consumed resource of the network request.
In one possible implementation, the acquisition subelement specifically includes:
First obtains subelement, disappears for obtaining actual processor resource of network request during historical responses Estimated processor resource of the average value as the network request of the actual processor consumed resource is calculated in consumption Consumption;
Second obtains subelement, for obtaining actual memory resource consumption of network request during historical responses Amount, the average value that the actual memory consumed resource is calculated are consumed as the estimated memory source of the network request Amount.
In one possible implementation, the determination unit is specifically used for, and the response of the network request is preferential The estimated consumed resource of grade parameter and the network request is weighted summation, obtains the response etc. of the network request Grade.
In one possible implementation, the determination unit specifically includes:
First computation subunit, for by the response priority parameters of the network request it is inverted after with the first weighted value It is multiplied, obtains the first parameter value;
Second computation subunit, for by the estimated consumed resource of the network request divided by after normalized parameter with Two weighted values are multiplied, and obtain the second parameter value, and the normalized parameter is in the estimated consumed resource of each network request Maximum value;
Third computation subunit obtains the network for first parameter value to be added with second parameter value The response grade of request.
In one possible implementation, described device further include:
First transmission unit, if the response grade for the network request is not up to preset threshold, by the network Request is sent to corresponding request execute server and is executed.
In one possible implementation, described device further include:
Judging unit, for whether being needed to carry out net according to current server load judgment after obtaining network request The delay disposal of network request;
Trigger unit, if the judging result for the judging unit is the delay disposal for needing to carry out network request, Triggering executes the reading unit and reads pre-set response priority parameters for including in the network request and subsequent Step;
Second transmission unit, if the judging result for the judging unit is if you do not need to carrying out network request The network request is sent to corresponding request execute server and executed by delay disposal.
A kind of computer readable storage medium is stored with instruction in the computer readable storage medium storing program for executing, works as described instruction When running on the terminal device, so that the terminal device executes the processing method of above-mentioned network request.
A kind of computer program product, when the computer program product is run on the terminal device, so that the terminal Equipment executes the processing method of above-mentioned network request.
It can be seen that the embodiment of the present application has the following beneficial effects:
The embodiment of the present application obtains pre-set response priority parameters and the network request in network request first Can consumable stock number, according to the response priority parameters of network request and the estimated consumed resource of network request, really The response grade for making network request carries out at delay network request when the response grade of network request reaches preset threshold Reason, i.e., the network request that selectively delay disposal priority level is low, consumed resource is big, to guarantee that server can be excellent First processing priority grade height, the lesser network request of consumed resource, promote network service quality and user's body to maximize It tests, realizes the processing rationally and effectively completed to network request.
Detailed description of the invention
Fig. 1 is the block schematic illustration of exemplary application scene provided by the embodiments of the present application;
Fig. 2 is a kind of network request processing method flow chart provided by the embodiments of the present application;
Fig. 3 is a kind of exemplary process diagram of network request processing method provided by the embodiments of the present application;
Fig. 4 is a kind of estimated consumed resource method flow diagram for calculating network request provided by the embodiments of the present application;
Fig. 5 is that a kind of acquisition provided by the embodiments of the present application responds rank method flow chart;
Fig. 6 is the exemplary process diagram of the processing method of another network request provided by the embodiments of the present application;
Fig. 7 is a kind of processing unit structure chart of network request provided by the embodiments of the present application.
Specific embodiment
In order to make the above objects, features, and advantages of the present application more apparent, with reference to the accompanying drawing and it is specific real Mode is applied to be described in further detail the embodiment of the present application.
Technical solution provided by the present application for ease of understanding will carry out letter to the research background of technical scheme below Unitary declaration.
Inventor has found in the technique study to traditional alleviation server stress, when server is in increased pressure Under state, can not in time processing terminal send network request when, under normal conditions based on the mode of random rejection, will receive Network request carry out downgrade processing, that is, delay disposal network request, to alleviate server stress.However, based on The mode of machine refusal does not account for the priority of heterogeneous networks request, services significance level and respond the network request to service The influence factors such as the resource consumption of device, may result in that priority is high, low in resources consumption network request is rejected, and some excellent The network request that first grade is low, resource consumption is high is handled by server response, so that core business provided by the server Service quality and user experience can not ensure.
Based on this, the application implementation provides a kind of processing method and processing device of network request, first acquisition network request In pre-set response priority parameters and the network request can consumable stock number, it is excellent according to the response of network request The estimated consumed resource of first grade parameter and network request determines the response grade of network request, when the sound of network request It answers grade to reach preset threshold, delay disposal is carried out to network request, i.e., selectively delay disposal priority level is low, resource The big network request of consumption, to guarantee that server can prioritize processing priority level height, the lesser net of consumed resource Network request promotes network service quality and user experience to maximize, realizes the processing rationally and effectively completed to network request.
Referring to Fig. 1, which is the block schematic illustration of exemplary application scene provided by the embodiments of the present application.Wherein, this Shen Please the network request processing method that provides of embodiment can be applied to server 20, server 20 can receive the transmission of terminal 10 Network request, and pre-set response priority parameters are read from received network request, while calculating the network request To the estimated consumed resource of server 20, then according to the response priority parameters of network request and it is expected that consumed resource Determine the response grade of network request, to judge that the network request is carried out at delay when responding grade greater than preset threshold Reason improves the service quality of server core business to alleviate the load of server.
Wherein, network request refers to that user passes through the service request that terminal 10 is sent to server, for example, user wants to lead to When crossing certain the electric business platform of login of terminal 10, terminal 10 is sent according to trigger action of the user on 10 page of terminal to server 20 Logging request, be also possible to terminal 10 and asked according to trigger action of the user in terminal page to the purchase that server 20 is sent It asks.It is, of course, also possible to include file transmission request and transmission e-mail request etc., class of the present embodiment to network request Type is without limiting.
It will be understood by those skilled in the art that block schematic illustration shown in FIG. 1 is only that presently filed embodiment can be An example being wherein achieved, the scope of application of the application embodiment are not limited by any aspect of the frame.
It should be noted that the terminal 10 in the embodiment of the present application can be existing, researching and developing or research and develop in the future , can by it is any type of wiredly and/or wirelessly connection (for example, Wi-Fi, LAN, honeycomb, coaxial cable etc.) realize with Any user equipment of the interaction of server 20, including but not limited to: existing, researching and developing or research and development in the future intelligent hands Machine, non-smart mobile phone, tablet computer, laptop PC, desktop personal computer, minicomputer, medium-sized calculating Machine, mainframe computer etc..It is also to be noted that in the embodiment of the present application server 20 can be it is existing, researching and developing An or example of research and development, application service that information recommendation can be provided a user equipment in the future.The embodiment party of the application Formula is unrestricted in this regard.
Technical solution provided by the present application for ease of understanding, below in conjunction with attached drawing to network provided by the embodiments of the present application The processing method of request is described in detail.
Referring to fig. 2, which is a kind of network request processing method flow chart provided by the embodiments of the present application, as shown in Fig. 2, This method may include:
S201: network request is obtained.
Under normal conditions, when the operation such as click control, long-pressing page is carried out in terminal client mounted as user, Client can the operation based on user and generate corresponding network request, and the network request can be sent to server, to ask Server is asked to execute corresponding processing according to the network request.In the present embodiment, when the net that server is sent in response terminal Before network request, available network request, so that the relevant information according to the network request determines whether to respond the network Request.Wherein, network request may include transport protocol, request password, request time stamp and cryptographically in request data etc. Hold, wherein request password and timestamp are distorted for preventing network request from being attacked, cryptographically request data can be used for characterizing The service for needing server to provide.
S202: the pre-set response priority parameters for including in network request are read.
It may include pre-set response priority parameters in the present embodiment, in network request, in order to be asked based on network The response priority processing network request asked, needs to read the response priority parameters in network request.
In practical applications, can in advance in server disparate networks request carry out response priority setting, by The form that tag label is arranged in network request presets the response priority of network request, and when specific implementation can ask according to network Significance level and/or sensible factor is asked to carry out response priority setting, for example, needing real-time Transmission for voice, video etc. The corresponding response priority of network request is high, and the corresponding response of Email network request lower for time-sensitive is preferential Grade is lower, to can prioritize processing preferential when server receives video network request and electronic mail network request simultaneously The higher network request of grade, guarantees service quality and user experience.
Response priority pre-set in network request can be identified using response priority parameters, specific It can use the response priority of character mark server when realization, for example, 1 mark highest priority, 0.5 mark medium priority Grade, 0.1 mark lowest priority.In practical applications, the grade and not of response priority can be arranged according to different situations Same response priority parameters, the embodiment of the present application is to the grade of response priority and the form of expression of response priority parameters Without limiting.
S203: the estimated consumed resource of network request is calculated.
In the present embodiment, when server obtains the network request that client is sent, estimated response network request is needed When, to the consumed resource of server.Wherein, when consumed resource may include server process network request, CPU The consumed resource of (Central Processing Unit, central processing unit) and the consumed resource of memory, about calculating The specific implementation of the estimated consumed resource of network request will illustrate in subsequent embodiment.
It should be noted that the present embodiment between S202 and S203 execution sequence without limit, actually answering In, S202 can be first carried out and execute S203 again, S203 can also be first carried out and execute S202 again, it can also be by S202 and S203 It is parallel to execute.
S204: according to the response priority parameters of network request and the estimated consumed resource of network request, net is determined The response grade of network request.
In the present embodiment, before the network request that server response terminal is sent, it is thus necessary to determine that the sound of the network request Grade is answered, which according to the response priority parameters of network request and can respond the network request to server It is expected that consumed resource is determined.Then the response grade of network request is to the significance level of network request and it is expected that shared With the comprehensive evaluation index of resource, server can decide whether the network request that makes an immediate response according to the response grade.
Wherein, about according to the response priority parameters of network request and it is expected that consumed resource determines network request The specific implementation of response grade will illustrate in subsequent embodiment.
S205: if the response grade of network request reaches preset threshold, delay disposal is carried out to network request.
In the present embodiment, when the response grade of network request is greater than or equal to preset threshold, it is believed that the network is asked The response priority asked is lower and larger to the consumed resource of server, can be by the net for the pressure for alleviating server Network request, which is added in delay queue, to be lined up, delay disposal network request, so that server can prioritize processing response Priority height and the network request low to server resource consumption, to ensure maximized promotion service response.Wherein, it presets Threshold value can be empirical value constant, and for identifying the upper limit threshold of response grade, preset threshold can be according to actual use situation It is configured, the present embodiment is to the setting of preset threshold without limiting.
In addition, the present embodiment can also send out network request when the response grade of network request is not up to preset threshold Corresponding request execute server is given to be executed.
It is understood that showing the sound of the network request when the response grade of network request is not up to preset threshold Answer priority higher and lower to server resource consumption, therefore, server can be handled in time the network request, improve clothes The response efficiency of business device, promotes user experience.In the actual process of network request, which can be sent to Corresponding request execute server is executed, and is executed for example, logging request is sent to login service device, be will acquire video Request is sent to video server execution etc..
As can be seen from the above embodiments, the embodiment of the present application obtains pre-set response priority ginseng in network request first The several and network request can consumable stock number, according to the pre- of the response priority parameters of network request and network request Consumed resource is counted, the response grade of network request is determined, when the response grade of network request reaches preset threshold, to network Request carries out delay disposal, i.e., the network request that selectively delay disposal priority level is low, consumed resource is big, to protect Card server can prioritize processing priority level height, the lesser network request of consumed resource, promote network clothes to maximize Quality of being engaged in and user experience realize the processing rationally and effectively completed to network request.
In addition, since the embodiment of the present application comprehensively considers the priority of network request and to the resource consumption of server Amount, so that server in the case where increased pressure, grade can be responded according to comprehensive assessment value and determine the network request Whether processing is delayed by, so that the network request that server can be small with preferential answering priority height, consumed resource, therefore, The embodiment of the present application can also be applied to large-scale concurrent service access scene, particularly with gateway face in micro services framework The case where to a large amount of service requests, promotes user experience by delay disposal to reduce server stress.
Referring to Fig. 3, which is a kind of exemplary process diagram of network request processing method provided by the embodiments of the present application, such as Shown in Fig. 3, the network request that terminal is sent is obtained first, reads the response priority parameters for including in the network request and meter The network request is calculated to the estimated consumed resource of server, then, according to above-mentioned response priority parameters and it is expected that resource disappears Consumption determines the response grade of the network request, when response grade reaches preset threshold, carries out at delay to the network request The network request can be added in delay queue and be lined up by reason, so that server can respond priority height, resource Relatively low response to network request is consumed, to ensure maximized promotion service response.
Through the foregoing embodiment it is found that when obtaining the network request that terminal is sent, need to calculate the estimated of network request Consumed resource provides a kind of implementation method of estimated consumed resource for calculating network request in the embodiment of the present application, The calculation method is illustrated below in conjunction with attached drawing.
Referring to fig. 4, which is the estimated consumed resource method flow provided by the embodiments of the present application for calculating network request Figure, as shown in figure 4, this method may include:
S401: the estimated memory source of the estimated processor resource consumption and network request that obtain network request consumes Amount.
In the present embodiment, to calculate certain network request to the estimated consumed resource of server, the available network is asked The estimated memory source consumption of the estimated processor resource consumption and network request asked, that is to say, that, it is contemplated that the network Request the consumed resource to processor and the consumed resource to memory.
Wherein, for the estimated processor resource consumption of acquisition network request, the embodiment of the present application provides a kind of possibility Implementation be calculated specifically, obtaining actual processor consumed resource of network request during historical responses Estimated processor resource consumption of the average value of actual processor consumed resource as the network request.
In practical applications, when server obtains the network request that terminal is sent, can include according in network request Request type, obtain server during historical responses, actually to processor when handling same type of network request Then consumed resource can use the corresponding actual processor consumed resource of same type of network request and carry out phase adduction It averages, using the average value of calculating as the estimated processor resource consumption of the network request.Wherein, processor resource disappears Consumption refers to that server responds the network request to the consumption of CPU.
For example, the network request A that server receiving terminal is sent, obtains server according to the type of the network request and is going through The practical cpu resource consumption of network request A is handled in history response process, it is assumed that n practical cpu resource consumption is obtained altogether, Respectively S1, S2, S3 ..., Sn, then current network request estimated cpu resource consumption Sreq=(S1+S2+S3+Sn)/n.
Own in same type of network request it should be noted that the present embodiment both can use during historical responses Actual processor consumed resource obtain network request estimated processor resource consumption, also can use historical responses mistake Actual processor consumed resource in part in same type of network request in journey, obtains the estimated processor resource of network request Consumption, the present embodiment is to the data volume using actual processor consumed resource without limiting.
Wherein, for the estimated memory source consumption of acquisition network request, the embodiment of the present application provides a kind of possible Reality is calculated specifically, obtaining actual memory consumed resource of network request during historical responses in implementation Estimated memory source consumption of the average value of memory source consumption as network request.
In practical applications, when server obtains the network request that terminal is sent, can include according in network request Request type, obtain server during historical responses, actually to memory source when handling same type of network request Then consumption can use the corresponding actual memory consumed resource of same type of network request and carry out addition averaging Value, using the average value of calculating as the estimated memory source consumption of the network request.
For example, the network request A that server receiving terminal is sent, obtains server according to the type of the network request and is going through The actual memory consumed resource of network request A is handled in history response process, it is assumed that obtain n actual memory resource consumption altogether Amount, respectively M1, M2, M3 ..., Mn, then current network request estimated memory source consumption Mreq=(M1+M2+M3+ ...+ Mn)/n。
Own in same type of network request it should be noted that the present embodiment both can use during historical responses Actual memory consumption obtain network request estimated memory consumption, also can use same type during historical responses Network request in part actual memory consumption, obtain the estimated memory consumption of network request, the present embodiment is to using real The data volume of border memory consumption is without limiting.
S402: by the estimated memory source consumption phase of the estimated processor resource consumption of network request and network request Add, obtains the estimated consumed resource of network request.
In the present embodiment, the estimated processor resource consumption for the network request that will acquire and it is expected that memory source consumption Amount is added, and the estimated consumed resource of the network request is obtained, so that consumed resource and response are preferential on the estimation Grade parameter determines the response grade of network request.Such as, it is contemplated that consumed resource Q=Sreq+Mreq
Through the foregoing embodiment, the estimated processor resource consumption and it is expected that memory of acquisition network request can be passed through Consumption obtains the estimated consumed resource of network request so that server according to the estimated consumed resource of network request with And pre-set response priority parameters determine the response grade of network request in network request so that server according to Respective level determines the need for carrying out delay disposal to the network request, to ensure maximized promotion service response.
In a kind of possible implementation of the embodiment of the present application, for the response priority parameters according to network request with And the estimated consumed resource of network request, it determines the response grade of network request, is specifically as follows, by the response of network request The estimated consumed resource of priority parameters and network request is weighted summation, obtains the response grade of network request.
In practical applications, the estimated consumed resource and network of the network request obtained through the foregoing embodiment are asked The response priority parameters for including in asking are weighted summation, to obtain the response grade of network request, so that server root It determines the need for carrying out delay disposal to the network request according to the response grade.
In the embodiment of the present application, about by the response priority parameters of network request and it is expected that consumed resource carry out Weighted sum obtain network request response grade provide a kind of possible implementation method, below in conjunction with attached drawing this method into Row explanation.
Referring to Fig. 5, which is acquisition response rank method flow chart provided by the embodiments of the present application, as shown in figure 5, the party Method may include:
S501: by the response priority parameters of network request it is inverted after be multiplied with the first weighted value, obtain the first parameter Value.
In this example, according to the pre-set response priority parameters for including in the available network request of S202, so It is afterwards that the response priority parameters are inverted, it is multiplied with the first weighted value, obtains the first parameter value.Wherein, the first weighted value Can according to the actual situation and experience is set, it is located at [0,1], as the positive number less than 1.For example, certain network request Response priority parameters are p, and the first weighted value is α, then
S502: the estimated consumed resource of network request is multiplied divided by after normalized parameter with the second weighted value, is obtained Second parameter value.
In the present embodiment, the estimated consumed resource for obtaining network request will be calculated and be normalized, then will be returned Estimated consumed resource after one change is multiplied with the second weighted value, obtains the second parameter value.
Wherein, normalized parameter is the maximum value in the estimated consumed resource of each network request, that is to say, that this is returned Maximum value in the estimated consumed resource for the all-network request that one change parameter can respond for server, i.e. normalized parameter= max{Qi, QiFor the estimated consumed resource of i-th of network request, the value of i is 1 to w, and w is that the network that server obtains is asked The total quantity asked, wherein the estimated consumed resource of each network request can be according to mode meter provided by the above embodiment It obtains, for example, server obtains three network requests A, B and C altogether, the wherein estimated consumed resource Q of network request CCMost Greatly, then QCFor normalized parameter.Second weighted value is positive number less than 1, can according to the actual situation and experience is set, Furthermore it is also possible to the first weighted value be arranged and the second weighted value adds up to 1.For example, if it is considered to the response grade of network request There is degree of equal importance with the estimated consumed resource of network request, α=β=0.5 can be set at this time;If Current resource It is more nervous, the biggish network request of delay disposal consumed resource is needed, then the larger value can be arranged in β, such as α=0.4, β =0.6, α=0.3, β=0.7 etc.;If Current resource takes it easy, the lower network request of delay disposal priority is needed, this When can will be arranged α the larger value, such as α=0.6, β=0.4, α=0.7, β=0.3 etc.., the embodiment of the present application is to the first weighted value Value with the second weighted value is without limiting.
In conjunction with described above, the process of the second parameter value is calculated for example, server obtains three network requests A, B and C altogether, The default consumed resource of network request A is QA, QCFor normalized parameter, the second weighted value is β, then
S503: first parameter value is added with second parameter value, obtains the response grade of the network request.
In the present embodiment, the first parameter obtained through the above steps and the second parameter are summed, network is obtained and asks The response grade asked.For example, the response grade of network request is L, thenWherein LtFor network Request the response grade of t;ptFor the response priority parameters of network request t, QtFor the estimated consumed resource of network request t, Qi For the estimated consumed resource of i-th of network request, the value of i is 1 to w, and w is the sum for the network request that server obtains Amount, max { QiBe server obtain all-network request estimated consumed resource in maximum value.
Through the foregoing embodiment, respective handling is carried out by the response priority parameters to network request obtain the first parameter It is worth and corresponding processing is carried out to the estimated consumed resource of network request and obtain the second parameter value, then by the first parameter value The response grade for obtaining network request is added with the second parameter value, so that server judges whether needs according to the response grade Delay disposal is carried out to the network request, to ensure maximized promotion service response.
It in the embodiment of the present application, can also be first according to the work of current server after server obtains network request Whether load judgment needs to carry out delay disposal to network request, can not be right in the lesser situation of workload of server Network request carries out delay disposal, to improve service response efficiency.
Based on this, method provided by the embodiments of the present application can also include: according to current server load judgment whether need Carry out the delay disposal of network request;If necessary to carry out the delay disposal of network request, then executes and read in network request Including pre-set response priority parameters and subsequent step;If you do not need to the delay disposal of network request is carried out, Network request is sent to corresponding request execute server to execute.
It in the present embodiment, after obtaining network request, first determines whether the load of current server is greater than threshold value, services The load of device can be determining according to the concurrent quantity of network request, can also be true according to the current occupation condition of server It is fixed.If the load of current server is greater than threshold value, shows that the working condition of current server has been saturated, can not proceed to respond to The network request then carries out delay disposal to the network request;If being not more than threshold value, showing server, there are also capabilities responses to be somebody's turn to do The network request is then sent to corresponding request execute server and executed by network request, to improve server response Efficiency and promotion user experience.
Above-described embodiment in order to facilitate understanding, referring to Fig. 6, which is another network request provided by the embodiments of the present application Processing method exemplary process diagram.
As shown in fig. 6, obtaining network request first, judge whether that start delay is handled according to the load of current server, If server work is not busy, start delay processing is not needed, network request is directly sent to corresponding request and is executed Server is executed, and the network request is responded.If server is busy with one's work, start delay is needed to handle, then reads the net The response priority parameters of network request, and the estimated consumed resource of the network request is calculated, then priority is joined according to response Number and it is expected that consumed resource determines the response grade of the network request, judges whether the response grade is greater than preset threshold, If responding grade is greater than preset threshold, which is added delay queue, carries out delay disposal;If responding grade No more than preset threshold, then the network request is sent to corresponding request execute server and responds the network request.To real The processing to network request is now rationally and effectively completed, maximizes and promotes network service quality and user experience.
Based on above method embodiment, present invention also provides a kind of processing units of network request, below in conjunction with attached Figure is illustrated the device.
Referring to Fig. 7, it illustrates a kind of processing unit structure charts of network request provided by the embodiments of the present application, can wrap It includes:
Acquiring unit 701, for obtaining network request;
Reading unit 702, for reading the pre-set response priority parameters for including in the network request;
Computing unit 703, for calculating the estimated consumed resource of the network request;
Determination unit 704, for according to the pre- of the response priority parameters of the network request and the network request Consumed resource is counted, determines the response grade of the network request;
Processing unit 705, if the response grade for the network request reaches preset threshold, to the network request Carry out delay disposal.
In some possible implementations, the computing unit is specifically included:
Subelement is obtained, for obtaining the estimated processor resource consumption and the network request of the network request It is expected that memory source consumption;
Computation subunit, for by the pre- of the estimated processor resource consumption of the network request and the network request It counts memory source consumption to be added, obtains the estimated consumed resource of the network request.
In some possible implementations, the acquisition subelement is specifically included:
First obtains subelement, disappears for obtaining actual processor resource of network request during historical responses Estimated processor resource of the average value as the network request of the actual processor consumed resource is calculated in consumption Consumption;
Second obtains subelement, for obtaining actual memory resource consumption of network request during historical responses Amount, the average value that the actual memory consumed resource is calculated are consumed as the estimated memory source of the network request Amount.
In some possible implementations, the determination unit is specifically used for, and the response of the network request is preferential The estimated consumed resource of grade parameter and the network request is weighted summation, obtains the response etc. of the network request Grade.
In some possible implementations, the determination unit is specifically included:
First computation subunit, for by the response priority parameters of the network request it is inverted after with the first weighted value It is multiplied, obtains the first parameter value;
Second computation subunit, for by the estimated consumed resource of the network request divided by after normalized parameter with Two weighted values are multiplied, and obtain the second parameter value, and the normalized parameter is in the estimated consumed resource of each network request Maximum value;
Third computation subunit obtains the network for first parameter value to be added with second parameter value The response grade of request.
In some possible implementations, described device further include:
First transmission unit, if the response grade for the network request is not up to preset threshold, by the network Request is sent to corresponding request execute server and is executed.
In some possible implementations, described device further include:
Judging unit, for whether being needed to carry out net according to current server load judgment after obtaining network request The delay disposal of network request;
Trigger unit, if the judging result for the judging unit is the delay disposal for needing to carry out network request, Triggering executes the reading unit and reads pre-set response priority parameters for including in the network request and subsequent Step;
Second transmission unit, if the judging result for the judging unit is if you do not need to carrying out network request The network request is sent to corresponding request execute server and executed by delay disposal.
It should be noted that the specific implementation of each unit may refer to above method embodiment, this implementation in the present embodiment Details are not described herein for example.
In addition, the embodiment of the present application also provides a kind of computer readable storage medium, the computer readable storage medium storing program for executing In be stored with instruction, when described instruction is run on the terminal device, so that the terminal device executes above-mentioned network request Processing method.
The embodiment of the present application also provides a kind of computer program product, and the computer program product is transported on the terminal device When row, so that the terminal device executes the processing method of above-mentioned network request.
As can be seen from the above-described embodiment, it is preferential to obtain pre-set response in network request first for the embodiment of the present application Grade parameter and the network request can consumable stock number, according to the response priority parameters and network request of network request Estimated consumed resource, determine the response grade of network request, it is right when the response grade of network request reaches preset threshold Network request progress delay disposal, i.e., the network request that selectively delay disposal priority level is low, consumed resource is big, from And guarantee that server can prioritize processing priority level height, the lesser network request of consumed resource, to maximize promotion net Network service quality and user experience realize the processing rationally and effectively completed to network request.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment emphasis is said Bright is the difference from other embodiments, and the same or similar parts in each embodiment may refer to each other.For reality For applying system or device disclosed in example, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, phase Place is closed referring to method part illustration.
It should be appreciated that in this application, " at least one (item) " refers to one or more, and " multiple " refer to two or two More than a."and/or" indicates may exist three kinds of relationships, for example, " A and/or B " for describing the incidence relation of affiliated partner It can indicate: only exist A, only exist B and exist simultaneously tri- kinds of situations of A and B, wherein A, B can be odd number or plural number.Word Symbol "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or"." at least one of following (a) " or its similar expression, refers to Any combination in these, any combination including individual event (a) or complex item (a).At least one of for example, in a, b or c (a) can indicate: a, b, c, " a and b ", " a and c ", " b and c ", or " a and b and c ", and wherein a, b, c can be individually, can also To be multiple.
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 including 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 makes professional and technical personnel in the field can be realized or use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the application.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 scope of cause.

Claims (10)

1. a kind of processing method of network request, which is characterized in that the described method includes:
Obtain network request;
Read the pre-set response priority parameters for including in the network request;
Calculate the estimated consumed resource of the network request;
According to the response priority parameters of the network request and the estimated consumed resource of the network request, determine described in The response grade of network request;
If the response grade of the network request reaches preset threshold, delay disposal is carried out to the network request.
2. the method according to claim 1, wherein the estimated resource consumption for calculating the network request Amount, comprising:
Obtain the estimated processor resource consumption of the network request and the estimated memory source consumption of the network request;
By the estimated memory source consumption phase of the estimated processor resource consumption of the network request and the network request Add, obtains the estimated consumed resource of the network request.
3. according to the method described in claim 2, it is characterized in that, the estimated processor resource for obtaining the network request The estimated memory source consumption of consumption and the network request, comprising:
Actual processor consumed resource of network request during historical responses is obtained, is calculated at the reality Manage estimated processor resource consumption of the average value of device consumed resource as the network request;
Actual memory consumed resource of network request during historical responses is obtained, the actual memory is calculated Estimated memory source consumption of the average value of consumed resource as the network request.
4. the method according to claim 1, wherein the response priority parameters according to the network request And the estimated consumed resource of the network request, determine the response grade of the network request, comprising:
The estimated consumed resource of the response priority parameters of the network request and the network request is weighted and is asked With obtain the response grade of the network request.
5. according to the method described in claim 4, it is characterized in that, the response priority parameters by the network request with And the estimated consumed resource of the network request is weighted summation, obtains the response grade of the network request, comprising:
By the response priority parameters of the network request it is inverted after be multiplied with the first weighted value, obtain the first parameter value;
The estimated consumed resource of the network request is multiplied divided by after normalized parameter with the second weighted value, the second ginseng is obtained Numerical value, the normalized parameter are the maximum value in the estimated consumed resource of each network request;
First parameter value is added with second parameter value, obtains the response grade of the network request.
6. the method according to claim 1, wherein the method also includes:
If the response grade of the network request is not up to preset threshold, the network request is sent to corresponding request and is held Row server is executed.
7. the method according to claim 1, wherein the method is also wrapped after the acquisition network request It includes:
Whether need to carry out the delay disposal of network request according to current server load judgment;
If necessary to carry out the delay disposal of network request, include in the execution reading network request is pre-set Respond priority parameters and subsequent step;
If you do not need to carrying out the delay disposal of network request, the network request is sent to corresponding request execute server It is executed.
8. a kind of processing unit of network request, which is characterized in that described device includes:
Acquiring unit, for obtaining network request;
Reading unit, for reading the pre-set response priority parameters for including in the network request;
Computing unit, for calculating the estimated consumed resource of the network request;
Determination unit, for being disappeared according to the response priority parameters of the network request and the estimated resource of the network request Consumption determines the response grade of the network request;
Processing unit prolongs the network request if the response grade for the network request reaches preset threshold Processing late.
9. a kind of computer readable storage medium, which is characterized in that it is stored with instruction in the computer readable storage medium storing program for executing, when When described instruction is run on the terminal device, so that the terminal device perform claim requires the described in any item networks of 1-7 to ask The processing method asked.
10. a kind of computer program product, which is characterized in that when the computer program product is run on the terminal device, make Obtain the processing method that the terminal device perform claim requires the described in any item network requests of 1-7.
CN201810886272.4A 2018-08-06 2018-08-06 Network request processing method and device Active CN109104480B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810886272.4A CN109104480B (en) 2018-08-06 2018-08-06 Network request processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810886272.4A CN109104480B (en) 2018-08-06 2018-08-06 Network request processing method and device

Publications (2)

Publication Number Publication Date
CN109104480A true CN109104480A (en) 2018-12-28
CN109104480B CN109104480B (en) 2021-08-13

Family

ID=64848904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810886272.4A Active CN109104480B (en) 2018-08-06 2018-08-06 Network request processing method and device

Country Status (1)

Country Link
CN (1) CN109104480B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111182172A (en) * 2020-01-03 2020-05-19 北京中电飞华通信有限公司 Fax service processing method and system and electronic equipment
CN112689007A (en) * 2020-12-23 2021-04-20 江苏苏宁云计算有限公司 Resource allocation method, device, computer equipment and storage medium
CN113590030A (en) * 2021-06-30 2021-11-02 济南浪潮数据技术有限公司 Queue scheduling method, system, equipment and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101026577A (en) * 2007-01-19 2007-08-29 北京邮电大学 Scheduling method for ensuring time delay stability of non-real-time business data packet for OFDMA system
CN101132545A (en) * 2006-08-24 2008-02-27 大唐移动通信设备有限公司 Method and system for implementing multimedia broadcast multicast in mobile communication system
US20100162251A1 (en) * 2008-12-19 2010-06-24 Anita Richards System, method, and computer-readable medium for classifying problem queries to reduce exception processing
CN102136096A (en) * 2010-12-15 2011-07-27 华为软件技术有限公司 Dynamic traffic control method and device for service and concurrency control system
CN103699445A (en) * 2013-12-19 2014-04-02 北京奇艺世纪科技有限公司 Task scheduling method, device and system
CN103841052A (en) * 2012-11-27 2014-06-04 中国科学院声学研究所 Bandwidth resource distribution system and method
CN105897601A (en) * 2016-06-20 2016-08-24 乐视控股(北京)有限公司 Business request processing method and device
CN106650501A (en) * 2016-12-30 2017-05-10 迈普通信技术股份有限公司 Database access control method and apparatus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132545A (en) * 2006-08-24 2008-02-27 大唐移动通信设备有限公司 Method and system for implementing multimedia broadcast multicast in mobile communication system
CN101026577A (en) * 2007-01-19 2007-08-29 北京邮电大学 Scheduling method for ensuring time delay stability of non-real-time business data packet for OFDMA system
US20100162251A1 (en) * 2008-12-19 2010-06-24 Anita Richards System, method, and computer-readable medium for classifying problem queries to reduce exception processing
CN102136096A (en) * 2010-12-15 2011-07-27 华为软件技术有限公司 Dynamic traffic control method and device for service and concurrency control system
CN103841052A (en) * 2012-11-27 2014-06-04 中国科学院声学研究所 Bandwidth resource distribution system and method
CN103699445A (en) * 2013-12-19 2014-04-02 北京奇艺世纪科技有限公司 Task scheduling method, device and system
CN105897601A (en) * 2016-06-20 2016-08-24 乐视控股(北京)有限公司 Business request processing method and device
CN106650501A (en) * 2016-12-30 2017-05-10 迈普通信技术股份有限公司 Database access control method and apparatus

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111182172A (en) * 2020-01-03 2020-05-19 北京中电飞华通信有限公司 Fax service processing method and system and electronic equipment
CN112689007A (en) * 2020-12-23 2021-04-20 江苏苏宁云计算有限公司 Resource allocation method, device, computer equipment and storage medium
CN113590030A (en) * 2021-06-30 2021-11-02 济南浪潮数据技术有限公司 Queue scheduling method, system, equipment and medium
CN113590030B (en) * 2021-06-30 2023-12-26 济南浪潮数据技术有限公司 Queue scheduling method, system, equipment and medium

Also Published As

Publication number Publication date
CN109104480B (en) 2021-08-13

Similar Documents

Publication Publication Date Title
US20160205511A1 (en) Categorized Location Identification Based on Historical Locations of a User Device
CN109104480A (en) A kind of processing method and processing device of network request
De Assuncao et al. Impact of user patience on auto-scaling resource capacity for cloud services
US9465645B1 (en) Managing backlogged tasks
Das et al. A QoS and profit aware cloud confederation model for IaaS service providers
CN113159190B (en) Federal incentive distribution method, apparatus, computer device, and storage medium
CN110619701A (en) Queuing channel recommendation method and device, storage medium and electronic equipment
CN109600344A (en) Identify the method, apparatus and electronic equipment of risk group
CN105491085A (en) Method and device for on-line requesting for queuing
CN106303112B (en) A kind of method for equalizing traffic volume and device
CN108650334A (en) A kind of setting method and device of session failed
CN106055271B (en) A kind of repeated data based on cloud computing removes reselection method and device
CN109840139A (en) Method, apparatus, electronic equipment and the storage medium of resource management
CN110796591B (en) GPU card using method and related equipment
Chen et al. Overload control in QoS-aware web servers
CN115633039A (en) Communication establishing method, load balancing device, equipment and storage medium
CN111565216A (en) Back-end load balancing method, device, system and storage medium
CN109377633A (en) A kind of queue number generation method and terminal device
Chen et al. Fairness constraint efficiency optimization for multiresource allocation in a cluster system serving internet of things
CN112686528A (en) Method, apparatus, server and medium for allocating customer service resources
CN110096352A (en) Process management method, device and computer readable storage medium
CN116567077A (en) Bare metal instruction sending method, device, equipment and storage medium
Borzemski et al. Business-oriented admission control and request scheduling for e-commerce websites
Cunha et al. Exploiting user patience for scaling resource capacity in cloud services
CN106998386B (en) A kind of method and device thereof of newly-increased contact method, user terminal

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