WO2014194869A1 - Request processing method, device and system - Google Patents
Request processing method, device and system Download PDFInfo
- Publication number
- WO2014194869A1 WO2014194869A1 PCT/CN2014/079489 CN2014079489W WO2014194869A1 WO 2014194869 A1 WO2014194869 A1 WO 2014194869A1 CN 2014079489 W CN2014079489 W CN 2014079489W WO 2014194869 A1 WO2014194869 A1 WO 2014194869A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- request
- processing
- service
- response time
- rpc
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/64—Hybrid switching systems
- H04L12/6418—Hybrid transport
Definitions
- the present invention relates to the field of communications, and in particular, to a request processing method, apparatus, and system.
- Internet applications such as e-mail, search, online shopping, social networking, online video, web maps, etc., have become part of people's lives. These applications often serve hundreds of millions of users, meaning that Internet applications have become a social public service, and data centers that support Internet applications with massive users have become the core infrastructure of society.
- the response time of each service phase will fluctuate constantly.
- Internet companies usually use data center operations in pursuit of low-cost targets.
- the resource sharing method improves resource utilization. The more serious of this sharing is the delay of the response time of the previous stage service in the service processing server, which may be further amplified in the next stage of service processing, in sequential/dependent services.
- each level The response time delays are superimposed step by step, so that there is a large delay in the response time requested by the end user. This response time delay can severely impact the quality of service for many delay-sensitive applications such as search, online shopping, and more.
- An embodiment of the present invention provides a request processing method for dynamically adjusting a request execution priority and resource allocation according to a requested processing time.
- the request processing method provided by the first aspect of the embodiments of the present invention includes:
- the service processing server receives a remote procedure call RPC request sent by the service distribution server,
- the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and a processing time has occurred; the service processing server adds the RPC request to the service request a queue; the service processing server sets an execution priority of the respective RPC requests according to response time constraint information of each RPC request in the service request queue, and/or allocates execution resources of the respective RPC requests.
- the service processing server is capable of simultaneously processing all RPC requests in the service request queue, the service processing server is configured according to each RPC request in the service request queue.
- Response time constraint information is allocated to the execution resources of the respective RPC requests; if the service processing server can only process any one of the service request queues separately
- the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue; If the service processing server cannot process all the RPC requests in the service request queue at the same time, or does not only process any one of the RPC requests in the service request queue, the service processing server according to the service request
- the response time constraint information of each RPC request in the queue sets the execution priority of each RPC request, and allocates the execution resources of the respective RPC requests.
- the service processing server sets the response time constraint information according to each RPC request in the service request queue
- the execution priority of each RPC request is set according to the response time constraint information of each RPC request in the service request queue, including:
- the allocating the execution resource of each RPC request according to the response time constraint information of each RPC request in the service request queue includes: acquiring the RPC request according to the response time constraint information Processing the remaining time of the constraint time; allocating the execution resources of the respective RPC requests according to the predefined rules, where the predefined rules include: the fewer the remaining time of the constraints, the more execution resources are allocated.
- the predefined rule further includes: if the processing constraint time remaining time If the prediction completion time of the RPC request is less than, the execution priority and the allocation execution resource are set to be set for the RPC request.
- the predefined rule further includes: if there are more than two RPC requests An RPC request with a small ratio is set to a higher execution priority, and/or allocates more execution resources.
- the method includes: selecting, according to the response time constraint information and the emergency threshold, a processing policy of the RPC request, where the processing policy includes And the first processing policy and the second processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency threshold, selecting to execute the first processing policy, if the constraint time remaining information of the response time constraint information If the value is less than or equal to the emergency threshold, the second processing policy is selected to be executed, and the processing complexity of the first processing policy is greater than the second processing policy.
- the responding time constraint information setting according to each RPC request in the service request queue After the execution priority of each RPC request, and/or the execution resources of the respective RPC requests the following:
- the service processing server processes the RPC request with the highest priority, records the processing time of the RPC request, and updates the response time constraint information of the RPC request according to the processing time; the service processing server sends the service to the service
- the allocation server feeds back the response time constraint information of the RPC request that has been processed.
- the service distribution server receives the user request; the service distribution server allocates response time constraint information for the user request, the response time constraint information is used to mark the processing constraint time of the user request and the processing time that has occurred; the service allocation The server generates a remote procedure call RPC request according to the user request; the service distribution server sends an RPC request to the service processing server, where the RPC request carries the response time constraint information; and causes the service processing server to respond according to the response time
- the constraint information sets an execution priority for the RPC request, and/or allocates an execution resource.
- the allocating the response time constraint information of the user request including: according to the historical value of the response time constraint information and the hardware information of the service processing server The user requests to allocate response time constraint information.
- the hardware performance of the current service processing server is relative to the recording of the response time constraint
- the historical value according to the response time constraint information and the hardware information of the service processing server are used to allocate the response time constraint information to the user request, including: acquiring the first processing speed and the second a ratio of the processing speed, multiplying the historical value of the response time constraint information by the ratio, to obtain response time constraint information currently allocated for the user request;
- the first processing speed is a hardware performance of the current service processing server a processing speed of the RPC request
- the second processing speed is a processing speed of the hardware processing performance of the service processing server to the RPC request when the historical value of the response time constraint information is recorded; if the current service processing server The hardware performance is not changed when the historical value of the response time constraint information is recorded, and the historical value according to the response time constraint information and the hardware information of the service processing server allocate response time constraint
- the generating, by the user request, the remote procedure call RPC request comprises: extracting the completion Determining a service parameter required by the user request; determining, according to the preset service logic, a step that needs to be performed to complete the user request, determining, according to the step that needs to be performed, a service processing server that needs to be invoked; The server allocates the corresponding service parameter, and generates an RPC request corresponding to the service processing server.
- the method after the sending the RPC request to the service processing server, the method includes: receiving the service Processing the response time constraint information fed back by the server; updating the response time constraint information of the corresponding RPC request by using the response time constraint information.
- the method after the receiving the response time constraint information fed back by the service processing server, the method includes: And an emergency allocation threshold to select an allocation processing policy corresponding to the user request, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency To handle the threshold, choose to execute And the first allocation processing policy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold, selecting to perform the second allocation processing policy, the processing complexity of the first allocation processing policy Greater than the second allocation processing policy.
- the service processing server provided by the third aspect of the embodiments of the present invention includes:
- a request receiving unit configured to receive a remote procedure call RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint of the user request corresponding to the RPC request a storage unit, configured to add the RPC request to the service request queue, and a setting unit, configured to set execution of the respective RPC request according to response time constraint information of each RPC request in the service request queue Priority, and/or allocation of execution resources for the respective RPC requests.
- a service processing server includes: a user request receiving unit, configured to receive a user request; an information distribution unit, configured to allocate response time constraint information for the user request, where the response time constraint information is used And a request processing unit, configured to generate a remote procedure call RPC request according to the user request, and a request sending unit, configured to send an RPC request to the service processing server, where The RPC request carries the response time constraint information; causing the service processing server to set an execution priority for the RPC request according to the response time constraint information, and/or allocate an execution resource.
- the service processing server provided by the fifth aspect of the embodiments of the present invention includes:
- the service distribution server is configured to receive a user request; and allocate response time constraint information for the user request, where the response time constraint information is used to mark a processing constraint time of the user request and has occurred Processing time; generating a remote procedure call RPC request according to the user request; sending an RPC request to the service processing server; the RPC request carrying the response time constraint information; the service processing server is configured to receive a remotely sent by the service distribution server The process invokes an RPC request, adding the RPC request to the service request queue; setting an execution priority of the respective RPC request according to response time constraint information of each RPC request in the service request queue, and/or allocating the respective RPC request Execution resources.
- the embodiment of the present invention has the following advantages:
- the remote procedure call (RPC) request received by the service processing server carries the response time constraint information, and the response
- the time constraint information is used to mark the processing constraint time of the user request corresponding to the RPC request and the processing time that has occurred, so that the service processing server can allocate information according to the response time of each RPC request in the service request queue before processing the RPC request.
- the execution priority and/or execution resources of the respective RPC requests are such that the time-critical RPC request can be prioritized.
- FIG. 1 is a schematic flow chart of a request processing method according to an embodiment of the present invention.
- FIG. 2 is another schematic flowchart of a request processing method according to an embodiment of the present invention.
- FIG. 3 is another schematic flowchart of a request processing method according to an embodiment of the present invention.
- FIG. 4 is another schematic flowchart of a request processing method according to an embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of a service processing server according to an embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of a service distribution server according to an embodiment of the present invention
- FIG. 7 is a schematic structural diagram of a request processing system according to an embodiment of the present invention
- FIG. 8 is a schematic structural diagram of a computer device according to an embodiment of the present invention. detailed description
- An embodiment of the present invention provides a request processing method for dynamically adjusting a request execution priority and resource allocation according to a requested processing time.
- an embodiment of a request processing method in an embodiment of the present invention includes:
- the service processing server receives an RPC request sent by the service distribution server.
- the service processing server receives an RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time and a processing time of the user request corresponding to the RPC request .
- the response time constraint information may be stored in a thread local storage (Thread Loca l Storage, TLS) of the service processing server.
- TLS Thread Local Storage
- the service distribution server receives the user request sent by the user, and allocates a response time constraint information for the user request, where the response time constraint information includes a processing constraint time corresponding to the application or service requested by the user.
- the maximum response time of the user request during the entire processing process that is, the user request needs to be processed within the processing constraint time
- an already processed processing time with an initial state of zero for counting the user. The processing time that is requested to be generated at the processing stage of each business processing server.
- the service distribution server After the service distribution server allocates the response time constraint information to the user request, the service distribution server generates an RPC request according to the user request, and sends the RPC request to the target service processing server (that is, the service processing server corresponding to the RPC requesting the requested application or service) Sending the RPC request, the RPC request carries response time constraint information corresponding to the user request, and the RPC request is used to request service processing from the target service processing server. In an actual application, completing a user request may need to be processed in multiple stages.
- the service distribution server generates an RPC request for each stage, and each RPC request is sent to the corresponding service distribution server for processing. Each phase of the RPC request carries the current response time constraint information.
- the response time constraint information is updated once.
- the current response time constraint information also reflects the processing constraint time of the user request, and before. The total processing time generated at each stage. Alternatively, since the difference between the processing constraint time and the processing time that has occurred is equal to the remainder of the processing constraint time, the obvious substitution between the parameters should not be construed as limiting the invention.
- the service processing server adds the RPC request to the service request queue; the service processing server adds the RPC request to the service request queue, where the service request queue is used to store different RPC requests.
- resources in a service processing server may be shared by multiple service allocation servers. Therefore, the service processing server may need to process multiple RPC requests at the same time. And these RPC requests will be added to the service request queue for allocation processing.
- the business processing server allocates execution priority and/or execution resources for the RPC request.
- the service processing server according to the response time constraint of each RPC request in the service request queue The information sets an execution priority of the respective RPC requests, and/or allocates execution resources of the respective RPC requests.
- allocating execution resources of the respective RPC requests may include: adjusting a thread's central processing unit (Cent ra l Proces s ing Uni t , CPU ) scheduling priority, and adjusting thread input/output (I / O) priority Level and so on.
- the RPC request received by the service processing server carries the response time constraint information, where the response time constraint information is used to mark the processing constraint time and the processing time of the user request corresponding to the RPC request, so that
- the service processing server may allocate the execution priority and/or the execution resource of each RPC request according to the response time constraint information of each RPC request in the service request queue before processing the RPC request, so that the time-critical RPC request can be preferentially processed.
- the service processing server may have various policies according to the regulation of the response time constraint information.
- another embodiment of the request processing method in the embodiment of the present invention includes:
- the service processing server receives an RPC request sent by the service distribution server, and the service processing server receives a remote procedure call RPC request sent by the service distribution server, where
- the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and a processing time that has occurred.
- the service processing server selects a processing policy of the RPC request according to the response time constraint information and the emergency threshold.
- the service processing server selects a processing policy of the RPC request according to the response time constraint information and the emergency threshold. If the constraint remaining time of the response time constraint information is greater than the emergency threshold, the first processing policy is selected to be executed, and if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, then the execution is selected.
- the second processing policy includes: a first processing policy and a second processing policy, where the processing complexity of the first processing policy is greater than the second processing policy.
- the emergency threshold is a judgment threshold of a processing policy for selecting a RPC request by the service processing server, and may be a time threshold.
- the first processing policy may include: recommending content that may be of interest to the user by means of data mining analysis according to the request of the user; and the second processing policy may specifically include recommending the current concern directly to the user.
- the first processing policy and the second processing policy represent only two types of policies with different processing complexity, and do not specifically refer to any two strategies, and the first processing strategy may indicate that the processing complexity is the same. Or two or more similar processing strategies, and the second processing strategy may also represent two or more processing strategies with the same or similar processing complexity.
- the service processing server may also set multiple levels of emergency thresholds to correspond to processing strategies of multiple complexity types, which are not specifically limited herein.
- the service processing server adds the RPC request to the service request queue.
- the service processing server adds the RPC request to the service request queue, where the service request queue is used to store different RPC requests.
- resources in a service processing server may be shared by multiple service allocation servers. Therefore, the service processing server may need to process multiple RPC requests at the same time. And these RPC requests will be added to the service request queue for allocation processing. It can be understood that, in an actual application, in step 202 and step 203, there is no strict sequential relationship, that is, "add the RPC request to the service request queue", and then execute "according to the response time constraint.” Information and emergency thresholds select the processing strategy for the RPC request.”
- the service processing server allocates an execution priority and/or an execution resource to the RPC request.
- the service processing server sets an execution priority of the each RPC request according to the response time constraint information of each RPC request in the service request queue, and/or Allocating execution resources of the respective RPC requests.
- assigning execution priorities and/or executing resources can be done through the operating system or super management
- the program adjusts the resource usage of different request processing threads, such as adjusting the CPU's CPU scheduling priority, adjusting the thread's I / O priority, etc.; also can support the request processing thread through the hardware that supports the priority
- the execution priority is adjusted, for example, the hardware resources used by each processing thread are allocated on the CPU's cache memory, memory controller, or system bus according to the priority determined by the response time constraint information.
- the service processing server determines the processing mode of the RPC request according to the processing capability of the device and the number and type of RPC requests in the service request queue before processing the RPC request; if the service processing server can simultaneously process All the RPC requests in the service request queue, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue; if the service processing server can only The service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue, if the RPC request is processed by the service request queue separately; The processing server cannot process all the RPC requests in the service request queue at the same time, and can not only process any one of the RPC requests in the service request queue, but the service processing server requests each RPC request in the queue according to the service request. Response time The bundle information sets an execution priority of the respective RPC requests and allocates execution resources of the respective RPC requests.
- the service processing server may obtain the RPC according to the response time constraint information.
- the service processing server may acquire the processing constraints of the respective RPC requests according to the response time constraint information.
- the remaining time of the time; the execution resources of the respective RPC requests are allocated according to a predefined rule, and the predefined rules include: the fewer the remaining time of the constraint, the more execution resources are allocated. Further, after the service processing server obtains the remaining time of the constraint of each RPC request, if the remaining time of the constraint of two or more RPC requests is found to be equal, the remaining constraint is obtained.
- the ratio of the time to the processing constraint time sets a higher execution priority for the RPC request with a smaller ratio, and/or allocates more execution resources.
- the remaining time of the constraint may be first determined, and if the remaining time of the processing constraint time is less than the predicted completion time of the RPC request, then the device abandons Setting an execution priority and an allocation execution resource for the RPC request to save processing resources of the service processing server.
- the service processing server may select to send a request failure response to the service allocation server, and the service distribution server provides feedback to the user. The processing of the user request failed, causing the service request to be resent.
- the service processing server may know the minimum processing time of the user request at each processing stage (which may be notified by the service allocation server), and the current service processing server adds the minimum processing time of each remaining processing stage of the user request. , the prediction completion time can be obtained.
- the service processing server feeds back, to the service allocation server, response time constraint information of the RPC request that is processed.
- the service processing server processes the highest priority RPC request, records the processing time of the RPC request, and updates the RPC request according to the processing time.
- the response time constraint information (that is, the processing time added to the processing time in the response time constraint information is obtained, and the updated processing time has been obtained).
- the service processing server feeds back the response time constraint information (i.e., the updated response time constraint information) of the RPC request that has been processed to the service distribution server, so that the service distribution server updates the response time constraint information requested by the corresponding user.
- the request processing method in the embodiment of the present invention is described above from the perspective of the service processing server.
- the request processing method in the embodiment of the present invention is described from the service distribution server side.
- Another embodiment of the request processing method includes:
- the service distribution server receives the user request.
- the service distribution server receives the user request, and the user requests the service requirement or the application requirement that the user submits to the network side, and the service requirement or the application requirement may include: searching, online shopping, and the like.
- the service allocation server allocates response time constraint information to the user request.
- the service distribution server allocates response time constraint information for the user request, and the response time constraint information is used to mark the processing constraint time of the user request and the processing time that has occurred.
- the response time constraint information can be stored in the TLS of the service distribution server.
- the response time constraint information includes a processing constraint time corresponding to the application or service requested by the user, and is used to define a maximum response time of the user request during the entire processing process (ie, the user request needs to be within the processing constraint time) Processing is completed), there is also an processing time that has an initial state of zero, which is used to count the processing time that the user requests a total of processing time in each processing server.
- the response time constraint information may be set by the administrator according to the service or application type requested by the different user. After the initialization setting is completed, the service distribution server may automatically allocate according to the historical value of the response time constraint information requested by the corresponding user. .
- the service distribution server generates an RPC request according to the user request. After the service distribution server allocates the response time constraint information to the user request, the service distribution server generates an RPC request according to the user request, where the RPC request carries the request with the user. Corresponding response time constraint information, the RPC request is used to request service processing from the target service processing server. In an actual application, a user request may be processed in multiple stages.
- the service distribution server generates an RPC request for each stage, and each RPC request is sent to the corresponding service distribution server for processing. Each phase of the RPC request carries the current response time constraint information. Each time an RPC request is completed, the response time constraint information is updated once.
- the current response time constraint information also reflects the processing constraint time of the user request, and before. The total processing time generated at each stage.
- the service distribution server sends an RPC request to the service processing server.
- the service distribution server sends an RPC request to the service processing server, where the RPC request carries the response time constraint information; causing the service processing server to set an execution priority for the RPC request according to the response time constraint information, and/or Assign execution resources.
- the RPC request sent by the service distribution server to the service processing server carries the response time constraint information, where the response time constraint information is used to mark the processing constraint time of the user request and the processing time that has occurred, so that the service The processing server can process the RPC request before it can
- the execution priority and/or execution resources of the respective RPC requests are allocated according to the response time constraint information of each RPC request in the service request queue, so that the time-critical RPC request can be preferentially processed.
- FIG. 4 another embodiment of the request processing method in the embodiment of the present invention includes:
- the service distribution server receives a user request.
- the service distribution server receives the user request, and the user requests the service demand or the application requirement that the user makes to the network side, and the service requirement or the application requirement may include: searching, online shopping, and the like.
- the service distribution server allocates response time constraint information to the user request.
- the service distribution server allocates response time constraint information for the user request, where the response time constraint information is used to mark the processing constraint time of the user request and has occurred. Processing time
- the response time constraint information includes a processing constraint time corresponding to the application or service requested by the user, and is used to define a maximum response time of the user request during the entire processing process (ie, the user request needs to be within the processing constraint time) Processing is completed), there is also an processing time that has an initial state of zero, which is used to count the processing time that the user requests a total of processing time in each processing server.
- the response time constraint information may be set by the administrator according to the service or application type requested by the different user. After the initialization setting is completed, the service distribution server may automatically allocate according to the historical value of the response time constraint information requested by the corresponding user. .
- the service allocation server may allocate response time constraint information to the user request according to the historical value of the response time constraint information and the hardware information of the service processing server; specifically, if the current service processing server has hardware performance And comparing the historical value of the response time constraint information, obtaining a ratio of the first processing speed to the second processing speed, multiplying the historical value of the response time constraint information by the ratio, to obtain a current Responsive time constraint information assigned to the user request; the first processing speed is a processing speed of a hardware performance of a current service processing server to the RPC request, and the second processing speed is a recording response time constraint information The historical value of the business processing server hardware performance processing speed of the RPC request; if the current business processing server hardware performance, relative to the historical value of the recording response time constraint information When a change occurs, the historical value of the response time constraint information is taken as the response time constraint information currently allocated for the user request.
- the service distribution server generates an RPC request according to the user request. After the service distribution server allocates the response time constraint information to the user request, the service distribution server generates an RPC request according to the user request, where the RPC request carries the request with the user. Corresponding response time constraint information, the RPC request is used to request service processing from the target service processing server. In an actual application, a user request may be processed in multiple stages.
- the service distribution server generates an RPC request for each stage, and each RPC request is sent to the corresponding service distribution server for processing. Each phase of the RPC request carries the current response time constraint information. Each time an RPC request is completed, the response time constraint information is updated once.
- the current response time constraint information also reflects the processing constraint time of the user request, and before.
- the RPC request generating method may be: extracting a service parameter (such as a request type, a user identifier, a product identifier, and the like) required to complete the user request; determining, according to preset business logic, that the user request needs to be performed to complete the user request. And determining, according to the step that needs to be performed, the service processing server that needs to be invoked; respectively, assigning the corresponding service parameter to the service processing server that needs to be invoked, and generating an RPC request corresponding to the service processing server.
- a service parameter such as a request type, a user identifier, a product identifier, and the like
- the service distribution server sends an RPC request to the service processing server.
- the service distribution server sends an RPC request to the service processing server, where the RPC request carries the response time constraint information, so that the service processing server determines the information according to the response time constraint.
- An execution priority is set for the RPC request, and/or an execution resource is allocated.
- the service distribution server receives the response time constraint information fed back by the service processing server.
- the service distribution server receives the response time constraint information fed back by the service processing server, and updates the response time constraint information of the corresponding RPC request by using the response time constraint information.
- the service distribution server selects an allocation processing policy requested by the corresponding user according to the updated response time constraint information.
- the service distribution server selects the use according to the response time constraint information and the emergency allocation threshold
- the user requests a corresponding allocation processing policy, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, selecting an execution location
- the first allocation processing policy if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold, selecting to perform the second allocation processing policy, the processing complexity of the first allocation processing policy Greater than the second allocation processing policy.
- the emergency allocation value is a judgment threshold of the processing policy that the service allocation server selects the user request, and may be a time threshold.
- the first allocation processing policy may specifically include a service processing procedure necessary for completing a user request, and optionally data mining, statistics, and analysis process content for improving service quality;
- the second allocation processing policy may specifically include only the business process flow content necessary for completing the user request; since the processing complexity of the first allocation processing policy is greater than the second allocation processing policy, when the processing time is urgent (specifically, by constraining the remaining time)
- the service allocation server may choose to process the second allocation processing strategy with less complexity to save processing time.
- the first allocation processing policy and the second allocation processing strategy represent only two types of policies with different processing complexity, and do not specifically refer to any two strategies, and the first allocation processing strategy may indicate processing.
- the second allocation processing strategy may also represent two or more processing strategies with the same or similar processing complexity.
- the service distribution server may also set a multi-level emergency allocation threshold to correspond to a plurality of complexity type allocation processing policies, which are not specifically limited herein.
- the following describes an embodiment of the service processing server of the present invention for performing the foregoing request processing method.
- An embodiment of the service processing server in the embodiment of the present invention includes:
- the request receiving unit 501 is configured to receive a remote procedure call RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; and the response time constraint information is used to mark a process of processing the user request corresponding to the RPC request. Restricting time and processing time has occurred; the storage unit 502 is configured to add the RPC request to the service request queue; and the setting unit 503 is configured to: according to the response time of each RPC request in the service request queue
- the bundle information sets an execution priority of the respective RPC requests, and/or allocates execution resources of the respective RPC requests.
- the setting unit 503 in the embodiment of the present invention is configured to: if the service processing server can simultaneously process all RPC requests in the service request queue, the service processing server is configured according to each of the service request queues The response time constraint information requested by the RPC allocates execution resources of the respective RPC requests;
- the service processing server sets the RPC request according to the response time constraint information of each RPC request in the service request queue. Execution priority; if the service processing server cannot process all RPC requests in the service request queue at the same time, nor can it only process any RPC request in the service request queue separately, the service processing server is based on The response time constraint information of each RPC request in the service request queue sets an execution priority of each RPC request, and allocates execution resources of the respective RPC requests.
- the setting unit 503 in the embodiment of the present invention may include: a resource allocation module 5031, configured to acquire, according to the response time constraint information, a constraint remaining time of a processing constraint time of each RPC request; according to a predefined rule Setting the execution priority of each of the RPC requests, where the predefined rule includes: the less the remaining time of the constraint, the higher the execution priority is set; the priority setting module 5032 is configured to use the response time constraint information according to the response time constraint information.
- the service processing server in the embodiment of the present invention may further include: a processing policy selecting unit 504, configured to select a processing policy of the RPC request according to the response time constraint information and an emergency threshold, where the processing policy includes: a processing strategy and a second processing strategy, if the response time constraint information is about Remaining time value is greater than the width of emergency, is selected to perform the first processing strategy, if the remaining time of the response time of the constraining information is equal to or less than the emergency
- the threshold value is selected to execute the second processing policy, where the processing complexity of the first processing policy is greater than the second processing policy.
- the service processing server in the embodiment of the present invention further includes: a request processing unit 505, configured to process the RPC request with the highest priority, record the processing time of the RPC request, and update the processing according to the processing time. Response time constraint information for RPC requests;
- the information feedback unit 506 is configured to feed back, to the service distribution server, response time constraint information of the RPC request that completes the processing.
- the specific interaction process of each unit of the service allocation server in the embodiment of the present invention is as follows:
- the request receiving unit 501 receives an RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used for marking The processing constraint time of the user request corresponding to the RPC request and the processing time that has occurred.
- the response time constraint information may be stored in a thread local storage of the service processing server.
- the storage unit 502 After receiving the RPC request, the storage unit 502 adds the RPC request to the service request queue, where the service request queue is used to store different RPC requests.
- the service request queue is used to store different RPC requests.
- resources in a service processing server may be shared by multiple service allocation servers. Therefore, the service processing server is likely to need to process multiple RPC requests at the same time. And these RPC requests will be added to the service request queue for allocation processing.
- the processing policy selection unit may be
- the 504 selects a processing policy of the RPC request according to the response time constraint information and the emergency threshold. If the constraint remaining time of the response time constraint information is greater than the emergency threshold, the first processing policy is selected to be executed. And the second processing policy is selected to be executed, where the processing policy includes: a first processing policy and a second processing policy, where the first processing policy is performed, where the remaining processing time of the response time constraint information is less than or equal to the emergency threshold value. The processing complexity of the policy is greater than the second processing strategy.
- the emergency threshold is a judgment threshold of a processing policy for selecting a RPC request by the service processing server, and may be a time threshold.
- the first processing policy may include: recommending content that may be of interest to the user by means of data mining analysis according to the request of the user; and the second processing policy may specifically include recommending the current concern directly to the user.
- High content because the processing complexity of the first processing strategy is greater than the second processing strategy, the processing server can select the processing complexity when the processing time is urgent (specifically, the constraint remaining time is less than or equal to the emergency threshold) A smaller second processing strategy to save processing time.
- the setting unit 503 sets the execution priority of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue, and/or allocates the respective RPC requests. Execute resources.
- the RPC request processing manner is determined according to the processing capability of the device and the number and type of the RPC request in the service request queue; if the service processing server can simultaneously process the service request queue All the RPC requests, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue; if the service processing server can only process the service separately If the RPC request is requested in the queue, the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue; if the service processing server cannot simultaneously Processing all the RPC requests in the service request queue, and not only individually processing any one of the RPC requests in the service request queue, and the service processing server according to the response time constraint information of each RPC request in the service request queue Set the execution priority of each RPC request And allocating the resources of each execution of the RPC request.
- the resource allocation module 5031 of the setting unit 503 may acquire the constraint remaining time of the processing constraint time of each RPC request according to the response time constraint information; and set the execution priority of each RPC request according to the predefined rule,
- the predefined rule includes: the less the remaining time of the constraint, the higher the execution priority is set; and the remaining time of the processing constraint time of the respective RPC request is obtained by the priority setting module 5032 according to the response time constraint information.
- allocating execution resources of the respective RPC requests according to a predefined rule where the predefined rules include: the fewer the remaining time of the constraint, the more execution resources are allocated.
- the request processing unit 505 processes the RPC request with the highest priority, records the processing time of the RPC request, and according to the The processing time updates the response time constraint information of the RPC request (that is, the processing time plus the processing time that has occurred in the response time constraint information, and the updated processing time has been obtained).
- the information feedback unit 506 feeds back the response time constraint information (ie, the updated response time constraint information) of the RPC request that has been processed to the service distribution server, so that the service distribution server updates the response time constraint information requested by the corresponding user.
- An embodiment of the service distribution server of the present invention for performing the above-mentioned request processing method is described below. For the logical structure, please refer to FIG. 6.
- An embodiment of the service distribution server in the embodiment of the present invention includes:
- a user request receiving unit 601 configured to receive a user request; an information allocating unit 602, configured to allocate response time constraint information for the user request, where the response time constraint information is used to mark a processing constraint time requested by the user and has occurred a processing time generating unit 603, configured to generate a remote procedure call RPC request according to the user request, and a request sending unit 604, configured to send an RPC request to the service processing server, where the RPC request carries the response time constraint information; And causing the service processing server to set an execution priority for the RPC request according to the response time constraint information, and/or allocate an execution resource.
- the information distribution unit 602 in the embodiment of the present invention is specifically configured to: allocate response time constraint information to the user request according to the historical value of the response time constraint information and the hardware information of the service processing server.
- the information distribution unit 602 in the embodiment of the present invention includes: a first allocation module 6021, configured to change, if the hardware performance of the current service processing server is relative to the historical value of the response time constraint information, Obtaining a ratio of the first processing speed to the second processing speed, multiplying the historical value of the response time constraint information by the ratio, and obtaining response time constraint information currently allocated for the user request; the first processing speed Processing speed of the RPC request for the hardware performance of the current service processing server, the second processing speed is processing of the RPC request by the hardware performance of the service processing server when recording the historical value of the response time constraint information Speed
- a second allocation module 6022 configured to: if the current service processing server hardware performance, relative to When the historical value of the response time constraint information is recorded, the historical value of the response time constraint information is used as the response time constraint information currently allocated for the user request.
- the request generating unit 603 in the embodiment of the present invention includes: a parameter extraction module 6031, configured to extract a service parameter required to complete the user request; and a logic analysis module 6032, configured to determine a completion according to the preset service logic. Determining, by the user, the step that needs to be performed, determining, according to the step that needs to be performed, the service processing server that needs to be invoked; the request generating module 6033, configured to respectively allocate the corresponding service parameter to the service processing server that needs to be invoked, and generate and The service processing server corresponds to an RPC request.
- the service processing server in the embodiment of the present invention further includes: an information receiving unit 605, configured to receive response time constraint information fed back by the service processing server;
- the information updating unit 606 is configured to update the response time constraint information of the corresponding RPC request by using the response time constraint information.
- the allocation policy selection unit 607 is configured to select an allocation processing policy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, And if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, the first allocation processing policy is selected to be executed, if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold And executing the second allocation processing policy, where the processing complexity of the first allocation processing policy is greater than the second allocation processing policy.
- the specific interaction process of each unit of the service distribution server in the embodiment of the present invention is as follows:
- the user request receiving unit 601 receives a user request, and the user request is a service requirement or an application requirement that the user proposes to the network side, and the service requirement or application requirement may include : Search, shop online.
- the information allocating unit 602 requests the user to request response time constraint information for marking the processing constraint time requested by the user and the processing time that has occurred.
- the first allocation module 6021 obtains the first processing speed and a ratio of the second processing speed, multiplying the historical value of the response time constraint information by the ratio, to obtain response time constraint information currently allocated for the user request;
- the first processing speed is the current service processing server The processing speed of the RPC request by the hardware performance
- the second processing speed is a processing speed of the hardware processing performance of the service processing server to the RPC request when the historical value of the response time constraint information is recorded; if the current service processing The hardware performance of the server is not changed when the historical value of the response time constraint information is recorded, and the second allocation module 6022 uses the historical value of the response time constraint information as the response time constraint currently allocated for the user request. information.
- the request generating unit 603 After the service allocation server allocates the response time constraint information to the user request, the request generating unit 603 generates an RPC request according to the user request, where the RPC request carries response time constraint information corresponding to the user request, and the RPC request is used to
- the target business processing server requests business processing.
- the parameter extraction module 6031 extracts the service parameters (such as the request type, the user identifier, the product identifier, and the like) required to complete the user request; the logic analysis module 6032 determines, according to the preset service logic, that the user request needs to be executed.
- the request sending unit 604 sends an RPC request to the service processing server, where the RPC request carries the response time constraint information; and causes the service processing server to set the RPC request according to the response time constraint information. Execution priorities, and/or allocation of execution resources.
- the information receiving unit 605 receives the response time constraint information fed back by the service processing server, and the trigger information updating unit 606 updates the response time constraint information of the corresponding RPC request using the response time constraint information.
- the allocation policy selection unit 607 selects an allocation processing policy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, and the allocation processing policy includes: a first allocation processing policy and And a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, selecting to execute the first allocation processing policy, if the constraint remaining time of the response time constraint information is less than or equal to And performing the second allocation processing policy, where the processing complexity of the first allocation processing policy is greater than the second allocation processing policy.
- the emergency allocation value is a judgment threshold of the processing policy that the service allocation server selects the user request, and may be a time threshold.
- the first allocation processing policy may specifically include a service processing procedure necessary for completing a user request, and optionally data mining, statistics, and analysis process content for improving service quality;
- the second allocation processing policy may specifically include only the business process flow content necessary for completing the user request; since the processing complexity of the first allocation processing policy is greater than the second allocation processing policy, when the processing time is urgent (specifically, by constraining the remaining time)
- the service allocation server may choose to process the second allocation processing strategy with less complexity to save processing time.
- An embodiment of the request processing system in the embodiment of the present invention includes:
- the service distribution server 701 is configured to receive a user request; to allocate response time constraint information for the user request, the response time constraint information is used to mark a processing constraint time of the user request And processing time has occurred; generating a remote procedure call RPC request according to the user request; sending an RPC request to the service processing server; the RPC request carrying the response time constraint information; the service processing server 702 is configured to receive a service allocation a remote procedure call RPC request sent by the server, adding the RPC request to the service request queue; setting an execution priority of each RPC request according to response time constraint information of each RPC request in the service request queue, and/or an allocation Execution resources for each RPC request.
- the embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium can store a program, and the program includes some or all of the steps of the request processing method described in the foregoing method embodiments.
- the embodiment of the present invention further provides a service processing server, which may specifically include: Receiver 801, transmitter 802, memory 803 and processor 804 (the number of processors in the service processing server may be one or more, and one processor in FIG. 8 is exemplified).
- the receiver 801, the transmitter 802, the memory 803, and the processor 804 may be connected by a bus or other means, wherein the bus connection is taken as an example in FIG.
- the memory 803 may be configured to store the following content: the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and the processing has occurred
- Pre-defined rule the less the remaining time of the constraint, the higher the execution priority is set; the less the remaining time of the constraint, the more the execution resources are allocated; if the remaining time of the processing constraint time is less than Determining the execution priority of the RPC request, and then setting the execution priority and the allocation execution resource for the RPC request; if the remaining time of the constraint of the two or more RPC requests is equal, acquiring the constraint remaining time and the processing constraint
- the ratio of time sets a higher execution priority for the RPC request with a smaller ratio, and/or allocates more execution resources.
- the receiver 801 is configured to receive a remote procedure call RPC request sent by the receiving service distribution server.
- the sender 802 is configured to feed back to the service distribution server response time constraint information of the RPC request that is processed.
- the processor 804 is configured to: after the receiver 801 receives the remote procedure call RPC request sent by the service allocation server, add the RPC request to the service request queue; according to the response time constraint of each RPC request in the service request queue
- the information sets an execution priority of the respective RPC requests, and/or allocates execution resources of the respective RPC requests.
- the execution priority setting may be performed according to a predefined rule, and/or the allocation of resources may be performed.
- the service processing server If the service processing server is capable of processing all the RPC requests in the service request queue at the same time, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue. ;
- the service processing server can only process any one of the service request queues separately The RPC requests, the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue;
- the service processing server If the service processing server cannot process all the RPC requests in the service request queue at the same time, or if only one RPC request in the service request queue can be separately processed, the service processing server according to the service request
- the response time constraint information of each RPC request in the queue sets an execution priority of the respective RPC requests, and allocates execution resources of the respective RPC requests.
- an embodiment of the present invention further provides a service distribution server, which may specifically include: a receiver 801, a transmitter 802, a memory 803, and a processor 804.
- the number of processors in the service distribution server may be one. Or a plurality of processors in FIG.
- the receiver 801, the transmitter 802, the memory 803, and the processor 804 may be connected by a bus or other means, wherein, in FIG. Take the bus connection as an example.
- the memory 803 of the service distribution server can be used to store the following content:
- the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and a processing time that has occurred; the historical value of the response time constraint information and the The hardware information of the service processing server.
- the receiver 801 of the service distribution server is configured to receive a user request and receive response time constraint information fed back by the service processing server.
- the transmitter 802 of the service distribution server is configured to send an RPC request to the service processing server.
- the processor 804 of the service distribution server is configured to perform the following steps: after receiving the receiver 801 user request; assigning response time constraint information to the user request, and generating a remote procedure call RPC request based on the user request.
- the response time constraint information is allocated for the user request, if the current service department The hardware performance of the server is changed when the historical value of the response time constraint information is recorded, and the ratio of the first processing speed to the second processing speed is obtained, and the historical value of the response time constraint information is multiplied by The ratio is obtained, and the response time constraint information currently allocated for the user request is obtained;
- the first processing speed is a processing speed of the hardware processing performance of the current service processing server to the RPC request, and the second processing speed is a recording office.
- the allocation processing policy includes: a processing policy and a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, selecting to execute the first allocation processing policy, if the constraint time remaining information of the response time constraint information If the threshold is less than or equal to the emergency processing threshold, the second allocation processing policy is selected to be executed, and the processing complexity of the first allocation processing policy is greater than the second allocation processing policy.
- the disclosed apparatus and method can be implemented in other ways.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- Medium The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
- a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM, Random Acces s Memory), a magnetic disk or an optical disk, and the like, which can store program codes. medium.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
Abstract
Disclosed is a request processing method, which is used for dynamically adjusting the execution priority and resource allocation of a request according to the processing time of the request. The method in the embodiments of the present invention comprises: receiving a remote procedure call (RPC) request sent by a service allocation server, and adding the RPC request to a service request queue; and according to the response time restraint information about each RPC request in the service request queue, setting the execution priority of each of the RPC requests, and/or allocating an execution resource of each of the RPC requests.
Description
一种请求处理方法、 装置及系统 本申请要求于 2013 年 06 月 08 日提交中国专利局、 申请号为 201310228246. X、 发明名称为 "一种请求处理方法、 装置及系统" 的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 The present invention claims the Chinese patent application filed on June 8, 2013, the Chinese Patent Application No. 201310228246. X, the Chinese patent application entitled "A Request Processing Method, Apparatus and System" Priority is hereby incorporated by reference in its entirety. Technical field
本发明涉及通信领域, 尤其涉及一种请求处理方法、 装置及系统。 The present invention relates to the field of communications, and in particular, to a request processing method, apparatus, and system.
背景技术 Background technique
互联网应用如电子邮件、 搜索、 网络购物、 社交网络、 在线视频、 网络地 图等, 已经成为人们生活的一部分。 这些应用往往要为上亿用户服务, 意味 着互联网应用已变成一种社会公共服务,而支撑拥有海量用户互联网应用的数 据中心也成为社会核心基础设施。 Internet applications such as e-mail, search, online shopping, social networking, online video, web maps, etc., have become part of people's lives. These applications often serve hundreds of millions of users, meaning that Internet applications have become a social public service, and data centers that support Internet applications with massive users have become the core infrastructure of society.
活跃用户数与用户访问量是影响互联网公司营收的主要因素,快速的服务 响应时间是让用户满意、 留住用户的关键。 互联网公司一般都釆用免费服务吸 引用户, 所以响应时间是衡量服务质量(Qua l i ty of Service , QoS ) 的关键 指标。 由于互联网应用需要同时为上亿用户提供服务, 所以出于性能与扩展性 的考虑, 它们大都釆用分布式的方式实现,将一个应用分解为许多服务部署在 多个业务处理服务器上,因此一个用户的请求最终会被分配到多个不同的业务 处理服务器上进行处理。 顺序 /依赖模式一种典型的服务聚合模式, 在这种模 式下, 上一阶段服务的输出是下一阶段服务的输入,相邻两个阶段的服务具有 依赖关系。 The number of active users and user visits are the main factors affecting Internet company revenue. Fast service response time is the key to satisfying users and retaining users. Internet companies generally use free services to attract users, so response time is a key metric for measuring Quality of Service (QoS). Because Internet applications need to provide services to hundreds of millions of users at the same time, for performance and scalability reasons, most of them are implemented in a distributed manner, and an application is decomposed into many services deployed on multiple service processing servers, so one User requests are ultimately assigned to multiple different business processing servers for processing. Sequential/Dependent Mode A typical service aggregation model in which the output of the previous stage service is the input to the next stage of service, and the services of the adjacent two stages have dependencies.
受到数据中心内请求特征、 网络、 后台操作等多种因素的影响, 每个服 务阶段的响应时间是会不断发生波动变化的;同时互联网公司为了追求低成本 目标,在数据中心运营时通常釆用资源共享方式提高资源利用率, 这种共享在 更严重的是, 上一阶段服务在业务处理服务器的响应时间的延时, 可能会在下 一阶段服务处理过程中进一步的放大, 在顺序 /依赖服务聚合模式中, 每一级
的响应时间的延时会被逐级的叠加 ,使得最终用户请求的响应时间存在 ^艮大的 延时。 这种响应时间的延时会严重影响许多延迟敏感型应用 (如搜索、 在线购 物等) 的服务质量。 在现有技术中,技术人员在部署共享应用之前,对大量的现有应用进行预 分析和测试,选择相互干扰最小的应用进行混合部署,从而降低应用之间的相 互干扰对响应时间的影响, 尽可能的避免响应时间的延时。 但是, 这种现有技术在部署前需要对大量的现有应用进行预分析和测试, 操作难度较大, 并且, 由于现有应用的种类繁多和不确定性, 就算在部署前对 应用进行分析,也只能降低部分应用之间的相互干扰,很多应用之间还是存在 较大的干扰, 避免响应时间延时的效果不佳。 发明内容 Affected by various factors such as request characteristics, network, and background operations in the data center, the response time of each service phase will fluctuate constantly. At the same time, Internet companies usually use data center operations in pursuit of low-cost targets. The resource sharing method improves resource utilization. The more serious of this sharing is the delay of the response time of the previous stage service in the service processing server, which may be further amplified in the next stage of service processing, in sequential/dependent services. In aggregation mode, each level The response time delays are superimposed step by step, so that there is a large delay in the response time requested by the end user. This response time delay can severely impact the quality of service for many delay-sensitive applications such as search, online shopping, and more. In the prior art, before deploying a shared application, a technician pre-analyzes and tests a large number of existing applications, and selects an application with minimal interference to perform hybrid deployment, thereby reducing the influence of mutual interference between applications on response time. Avoid delays in response time as much as possible. However, this prior art requires pre-analysis and testing of a large number of existing applications before deployment, which is difficult to operate, and, due to the variety and uncertainty of existing applications, the application is analyzed before deployment. It can only reduce the mutual interference between some applications, and there are still large interferences between many applications, and the effect of avoiding response time delay is not good. Summary of the invention
本发明实施例提供了一种请求处理方法,用于根据请求的处理时间动态地 调整请求的执行优先级和资源分配。 本发明实施例第一方面提供的请求处理方法, 包括: An embodiment of the present invention provides a request processing method for dynamically adjusting a request execution priority and resource allocation according to a requested processing time. The request processing method provided by the first aspect of the embodiments of the present invention includes:
业务处理服务器接收业务分配服务器发送的远程过程调用 RPC请求,所述 The service processing server receives a remote procedure call RPC request sent by the service distribution server,
RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述 RPC 请求对应的用户请求的处理约束时间和已发生处理时间;所述业务处理服务器 将所述 RPC请求加入服务请求队列;所述业务处理服务器根据所述服务请求队 列中各个 RPC请求的响应时间约束信息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求的执行资源。 在第一方面的第一种可能实现的方法中, 若所述业务处理服务器能够同时处理所述服务请求队列中所有的 RPC请 求,则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间 约束信息分配所述各个 RPC请求的执行资源; 若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个The RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and a processing time has occurred; the service processing server adds the RPC request to the service request a queue; the service processing server sets an execution priority of the respective RPC requests according to response time constraint information of each RPC request in the service request queue, and/or allocates execution resources of the respective RPC requests. In a first possible implementation of the first aspect, if the service processing server is capable of simultaneously processing all RPC requests in the service request queue, the service processing server is configured according to each RPC request in the service request queue. Response time constraint information is allocated to the execution resources of the respective RPC requests; if the service processing server can only process any one of the service request queues separately
RPC请求, 则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响 应时间约束信息设置所述各个 RPC请求的执行优先级;
若所述业务处理服务器既无法同时处理所述服务请求队列中所有的 RPC 请求,也不是仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述 业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间约束信息 设置各个 RPC请求的执行优先级, 并分配所述各个 RPC请求的执行资源。 结合第一方面或第一方面的第一种实现方法,在第一方面的第二种可能实 现的方法中,当业务处理服务器根据所述服务请求队列中各个 RPC请求的响应 时间约束信息设置所述各个 RPC请求的执行优先级时,所述根据服务请求队列 中各个 RPC请求的响应时间约束信息设置所述各个 RPC请求的执行优先级,包 括: The RPC requests, the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue; If the service processing server cannot process all the RPC requests in the service request queue at the same time, or does not only process any one of the RPC requests in the service request queue, the service processing server according to the service request The response time constraint information of each RPC request in the queue sets the execution priority of each RPC request, and allocates the execution resources of the respective RPC requests. With reference to the first aspect or the first implementation method of the first aspect, in the second possible implementation method of the first aspect, when the service processing server sets the response time constraint information according to each RPC request in the service request queue When the execution priority of each RPC request is described, the execution priority of each RPC request is set according to the response time constraint information of each RPC request in the service request queue, including:
根据所述响应时间约束信息获取所述各个 RPC请求的处理约束时间的约 束剩余时间; 根据预定义规则设置所述各个 RPC请求的执行优先级, 所述预定 义规则包括: 所述约束剩余时间越少, 则设置的执行优先级越高。 结合第一方面或第一方面的第一种实现方法,在第一方面的第三种可能实 现的方法中,当业务处理服务器根据所述服务请求队列中各个 RPC请求的响应 时间约束信息分配所述各个 RPC请求的执行资源时,所述根据服务请求队列中 各个 RPC请求的响应时间约束信息分配所述各个 RPC请求的执行资源, 包括: 根据所述响应时间约束信息获取所述各个 RPC请求的处理约束时间的剩 余时间; 根据预定义规则分配所述各个 RPC请求的执行资源, 所述预定义规则 包括: 所述约束剩余时间越少, 则分配的执行资源越多。 结合第一方面的第二种或第一方面的第三种实现方法,在第一方面的第四 种可能实现的方法中, 所述预定义规则还包括: 若所述处理约束时间的剩余时 间小于所述 RPC请求的预测完成时间,则放弃为所述 RPC请求设置执行优先级 和分配执行资源。 结合第一方面的第二种或第一方面的第三种实现方法,在第一方面的第五 种可能实现的方法中, 所述预定义规则还包括: 若有两个以上的 RPC请求的约 述比值小的 RPC请求设置较高的执行优先级, 和 /或分配较多的执行资源。 结合第一方面或第一方面的第一至三任意一种实现方法,在第一方面的第
六种可能实现的方法中, 所述接收业务分配服务器发送的远程过程调用 RPC 请求之后, 包括: 根据所述响应时间约束信息和紧急阔值选择所述 RPC请求的处理策略,所 述处理策略包括: 第一处理策略和第二处理策略, 若所述响应时间约束信息的 约束剩余时间大于所述紧急阔值, 则选择执行所述第一处理策略, 若所述响应 时间约束信息的约束剩余时间小于或等于所述紧急阔值,则选择执行所述第二 处理策略, 所述第一处理策略的处理复杂度大于所述第二处理策略。 结合第一方面或第一方面的第一至三任意一种实现方法,在第一方面的第 七种可能实现的方法中,所述根据服务请求队列中各个 RPC请求的响应时间约 束信息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求的 执行资源之后, 包括: Obtaining a constraint remaining time of the processing constraint time of the respective RPC request according to the response time constraint information; setting an execution priority of each RPC request according to a predefined rule, where the predefined rule includes: Less, the higher the execution priority of the setting. With reference to the first aspect or the first implementation method of the first aspect, in a third possible implementation method of the first aspect, when the service processing server constrains the information distribution according to the response time of each RPC request in the service request queue When the execution resource of each RPC request is described, the allocating the execution resource of each RPC request according to the response time constraint information of each RPC request in the service request queue includes: acquiring the RPC request according to the response time constraint information Processing the remaining time of the constraint time; allocating the execution resources of the respective RPC requests according to the predefined rules, where the predefined rules include: the fewer the remaining time of the constraints, the more execution resources are allocated. In conjunction with the second implementation method of the second aspect or the first aspect, in the fourth possible implementation method of the first aspect, the predefined rule further includes: if the processing constraint time remaining time If the prediction completion time of the RPC request is less than, the execution priority and the allocation execution resource are set to be set for the RPC request. With reference to the second implementation method of the second aspect or the third implementation method of the first aspect, in the fifth possible implementation method of the first aspect, the predefined rule further includes: if there are more than two RPC requests An RPC request with a small ratio is set to a higher execution priority, and/or allocates more execution resources. In combination with the first aspect or any one of the first to third aspects of the first aspect, the first aspect After the remote process call RPC request sent by the receiving service distribution server, the method includes: selecting, according to the response time constraint information and the emergency threshold, a processing policy of the RPC request, where the processing policy includes And the first processing policy and the second processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency threshold, selecting to execute the first processing policy, if the constraint time remaining information of the response time constraint information If the value is less than or equal to the emergency threshold, the second processing policy is selected to be executed, and the processing complexity of the first processing policy is greater than the second processing policy. With reference to the first aspect, or any one of the first to third aspects of the first aspect, in the seventh possible implementation method of the first aspect, the responding time constraint information setting according to each RPC request in the service request queue After the execution priority of each RPC request, and/or the execution resources of the respective RPC requests, the following:
所述业务处理服务器对优先级最高的 RPC请求进行处理, 记录所述 RPC 请求的处理时间, 并根据所述处理时间更新所述 RPC 请求的响应时间约束信 息;所述业务处理服务器向所述业务分配服务器反馈完成处理的 RPC请求的响 应时间约束信息。 The service processing server processes the RPC request with the highest priority, records the processing time of the RPC request, and updates the response time constraint information of the RPC request according to the processing time; the service processing server sends the service to the service The allocation server feeds back the response time constraint information of the RPC request that has been processed.
本发明实施例第二方面提供的请求处理方法, 包括: The request processing method provided by the second aspect of the embodiments of the present invention includes:
业务分配服务器接收用户请求;所述业务分配服务器为所述用户请求分配 响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束 时间和已发生处理时间;所述业务分配服务器根据所述用户请求生成远程过程 调用 RPC请求; 所述业务分配服务器向业务处理服务器发送 RPC请求, 所述 RPC请求携带有所述响应时间约束信息; 使得所述业务处理服务器根据所述响 应时间约束信息为所述 RPC请求设置执行优先级, 和 /或分配执行资源。 The service distribution server receives the user request; the service distribution server allocates response time constraint information for the user request, the response time constraint information is used to mark the processing constraint time of the user request and the processing time that has occurred; the service allocation The server generates a remote procedure call RPC request according to the user request; the service distribution server sends an RPC request to the service processing server, where the RPC request carries the response time constraint information; and causes the service processing server to respond according to the response time The constraint information sets an execution priority for the RPC request, and/or allocates an execution resource.
在第二方面的第一种可能实现的方法中,所述分配所述用户请求的响应时 间约束信息, 包括: 根据所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信 息为所述用户请求分配响应时间约束信息。 In the first possible implementation method of the second aspect, the allocating the response time constraint information of the user request, including: according to the historical value of the response time constraint information and the hardware information of the service processing server The user requests to allocate response time constraint information.
结合第二方面的第一种可能实现的方法,在第二方面的第二种可能实现的 方法中, 若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束
信息的历史值时发生了改变,则所述根据响应时间约束信息的历史值以及所述 业务处理服务器的硬件信息为所述用户请求分配响应时间约束信息, 包括: 获取第一处理速度与第二处理速度的比值,将所述响应时间约束信息的历 史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息; 所述 第一处理速度为当前的业务处理服务器的硬件性能对所述 RPC 请求的处理速 度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理服 务器的硬件性能对所述 RPC请求的处理速度; 若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息 的历史值时没有发生改变,则所述根据响应时间约束信息的历史值以及所述业 务处理服务器的硬件信息为所述用户请求分配响应时间约束信息, 包括: 将所述响应时间约束信息的历史值作为当前为所述用户请求分配的响应 时间约束信息。 In conjunction with the first possible implementation of the second aspect, in the second possible implementation method of the second aspect, if the hardware performance of the current service processing server is relative to the recording of the response time constraint When the historical value of the information is changed, the historical value according to the response time constraint information and the hardware information of the service processing server are used to allocate the response time constraint information to the user request, including: acquiring the first processing speed and the second a ratio of the processing speed, multiplying the historical value of the response time constraint information by the ratio, to obtain response time constraint information currently allocated for the user request; the first processing speed is a hardware performance of the current service processing server a processing speed of the RPC request, the second processing speed is a processing speed of the hardware processing performance of the service processing server to the RPC request when the historical value of the response time constraint information is recorded; if the current service processing server The hardware performance is not changed when the historical value of the response time constraint information is recorded, and the historical value according to the response time constraint information and the hardware information of the service processing server allocate response time constraint information to the user request. , including: history of the response time constraint information As the current allocation request response time constraint for the user information.
结合第二方面或第二方面的第一至二任意一种实现方法,在第二方面的第 三种可能实现的方法中,所述根据用户请求生成远程过程调用 RPC请求,包括: 提取完成所述用户请求所需的业务参数;根据预置的业务逻辑确定完成所 述用户请求需要执行的步骤,根据所述需要执行的步骤确定需要调用的业务处 理服务器; 分别为所述需要调用的业务处理服务器分配相应的所述业务参数, 生成与所述业务处理服务器对应的 RPC请求。 With reference to the second aspect, or any one of the first to the second aspects of the second aspect, in the third possible implementation method of the second aspect, the generating, by the user request, the remote procedure call RPC request comprises: extracting the completion Determining a service parameter required by the user request; determining, according to the preset service logic, a step that needs to be performed to complete the user request, determining, according to the step that needs to be performed, a service processing server that needs to be invoked; The server allocates the corresponding service parameter, and generates an RPC request corresponding to the service processing server.
结合第二方面或第二方面的第一至二任意一种实现方法,在第二方面的第 四种可能实现的方法中, 所述向业务处理服务器发送 RPC请求之后, 包括: 接收所述业务处理服务器反馈的响应时间约束信息;使用所述响应时间约 束信息更新相应的 RPC请求的响应时间约束信息。 With reference to the second aspect, or any one of the first to the second aspects of the second aspect, in the fourth possible implementation method of the second aspect, after the sending the RPC request to the service processing server, the method includes: receiving the service Processing the response time constraint information fed back by the server; updating the response time constraint information of the corresponding RPC request by using the response time constraint information.
结合第二方面的第四种实现方法, 在第二方面的第五种可能实现的方法 中, 所述接收所述业务处理服务器反馈的响应时间约束信息之后, 包括: 根据所述响应时间约束信息和紧急分配阔值选择所述用户请求对应的分 配处理策略,所述分配处理策略包括:第一分配处理策略和第二分配处理策略, 若所述响应时间约束信息的约束剩余时间大于所述紧急处理阔值,则选择执行
所述第一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于 所述紧急处理阈值, 则选择执行所述第二分配处理策略, 所述第一分配处理策 略的处理复杂度大于所述第二分配处理策略。 本发明实施例第三方面提供的业务处理服务器, 包括: With the fourth implementation method of the second aspect, in the fifth possible implementation method of the second aspect, after the receiving the response time constraint information fed back by the service processing server, the method includes: And an emergency allocation threshold to select an allocation processing policy corresponding to the user request, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency To handle the threshold, choose to execute And the first allocation processing policy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold, selecting to perform the second allocation processing policy, the processing complexity of the first allocation processing policy Greater than the second allocation processing policy. The service processing server provided by the third aspect of the embodiments of the present invention includes:
请求接收单元, 用于接收业务分配服务器发送的远程过程调用 RPC请求, 所述 RPC请求包括: 响应时间约束信息; 所述响应时间约束信息用于标记与所 述 RPC请求对应的用户请求的处理约束时间和已发生处理时间; 存储单元, 用 于将所述 RPC请求加入服务请求队列; 设置单元, 用于根据所述服务请求队列 中各个 RPC请求的响应时间约束信息设置所述各个 RPC请求的执行优先级,和 /或分配所述各个 RPC请求的执行资源。 本发明实施例第四方面提供的业务处理服务器, 包括: 用户请求接收单元, 用于接收用户请求; 信息分配单元, 用于为所述用户 请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的 处理约束时间和已发生处理时间; 请求生成单元, 用于根据所述用户请求生成 远程过程调用 RPC请求;请求发送单元,用于向业务处理服务器发送 RPC请求, 所述 RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所 述响应时间约束信息为所述 RPC请求设置执行优先级, 和 /或分配执行资源。 本发明实施例第五方面提供的业务处理服务器, 包括: a request receiving unit, configured to receive a remote procedure call RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint of the user request corresponding to the RPC request a storage unit, configured to add the RPC request to the service request queue, and a setting unit, configured to set execution of the respective RPC request according to response time constraint information of each RPC request in the service request queue Priority, and/or allocation of execution resources for the respective RPC requests. A service processing server according to a fourth aspect of the present invention includes: a user request receiving unit, configured to receive a user request; an information distribution unit, configured to allocate response time constraint information for the user request, where the response time constraint information is used And a request processing unit, configured to generate a remote procedure call RPC request according to the user request, and a request sending unit, configured to send an RPC request to the service processing server, where The RPC request carries the response time constraint information; causing the service processing server to set an execution priority for the RPC request according to the response time constraint information, and/or allocate an execution resource. The service processing server provided by the fifth aspect of the embodiments of the present invention includes:
业务分配服务器和业务处理服务器; 所述业务分配服务器用于接收用户请求;为所述用户请求分配响应时间约 束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发 生处理时间; 根据所述用户请求生成远程过程调用 RPC请求; 向业务处理服务 器发送 RPC请求; 所述 RPC请求携带有所述响应时间约束信息; 所述业务处理服务器用于接收业务分配服务器发送的远程过程调用 RPC 请求, 将所述 RPC请求加入服务请求队列; 根据所述服务请求队列中各个 RPC 请求的响应时间约束信息设置所述各个 RPC请求的执行优先级, 和 /或分配所 述各个 RPC请求的执行资源。
从以上技术方案可以看出, 本发明实施例具有以下优点: 在本发明实施例中, 业务处理服务器接收的远程过程调用 (Remote Procedure Ca l l , RPC )请求中携带有响应时间约束信息, 该响应时间约束信 息用于标记与所述 RPC 请求对应的用户请求的处理约束时间和已发生处理时 间,使得业务处理服务器在处理 RPC请求之前, 可以根据服务请求队列中各个 RPC请求的响应时间约束信息分配所述各个 RPC请求的执行优先级和 /或执行 资源, 从而使得时间紧急的 RPC请求可以得到优先处理。 附图说明 a service distribution server and a service processing server; the service distribution server is configured to receive a user request; and allocate response time constraint information for the user request, where the response time constraint information is used to mark a processing constraint time of the user request and has occurred Processing time; generating a remote procedure call RPC request according to the user request; sending an RPC request to the service processing server; the RPC request carrying the response time constraint information; the service processing server is configured to receive a remotely sent by the service distribution server The process invokes an RPC request, adding the RPC request to the service request queue; setting an execution priority of the respective RPC request according to response time constraint information of each RPC request in the service request queue, and/or allocating the respective RPC request Execution resources. It can be seen from the above technical solution that the embodiment of the present invention has the following advantages: In the embodiment of the present invention, the remote procedure call (RPC) request received by the service processing server carries the response time constraint information, and the response The time constraint information is used to mark the processing constraint time of the user request corresponding to the RPC request and the processing time that has occurred, so that the service processing server can allocate information according to the response time of each RPC request in the service request queue before processing the RPC request. The execution priority and/or execution resources of the respective RPC requests are such that the time-critical RPC request can be prioritized. DRAWINGS
图 1是本发明实施例请求处理方法的一个流程示意图; 1 is a schematic flow chart of a request processing method according to an embodiment of the present invention;
图 2是本发明实施例请求处理方法的另一个流程示意图; 2 is another schematic flowchart of a request processing method according to an embodiment of the present invention;
图 3是本发明实施例请求处理方法的另一个流程示意图; 3 is another schematic flowchart of a request processing method according to an embodiment of the present invention;
图 4是本发明实施例请求处理方法的另一个流程示意图; 4 is another schematic flowchart of a request processing method according to an embodiment of the present invention;
图 5是本发明实施例业务处理服务器的一个结构示意图; FIG. 5 is a schematic structural diagram of a service processing server according to an embodiment of the present invention; FIG.
图 6是本发明实施例业务分配服务器的一个结构示意图; 图 7是本发明实施例请求处理系统的一个结构示意图; 6 is a schematic structural diagram of a service distribution server according to an embodiment of the present invention; FIG. 7 is a schematic structural diagram of a request processing system according to an embodiment of the present invention;
图 8是本发明实施例计算机设备的结构示意图。 具体实施方式 FIG. 8 is a schematic structural diagram of a computer device according to an embodiment of the present invention. detailed description
本发明实施例提供了一种请求处理方法,用于根据请求的处理时间动态地 调整请求的执行优先级和资源分配。 An embodiment of the present invention provides a request processing method for dynamically adjusting a request execution priority and resource allocation according to a requested processing time.
请参阅图 1 , 本发明实施例中请求处理方法的一个实施例包括: Referring to FIG. 1, an embodiment of a request processing method in an embodiment of the present invention includes:
101、 业务处理服务器接收业务分配服务器发送的 RPC请求; 101. The service processing server receives an RPC request sent by the service distribution server.
业务处理服务器接收业务分配服务器发送的 RPC请求 ,所述 RPC请求包括: 响应时间约束信息;所述响应时间约束信息用于标记与所述 RPC请求对应的用 户请求的处理约束时间和已发生处理时间。 The service processing server receives an RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time and a processing time of the user request corresponding to the RPC request .
示例性的, 在获取到该响应时间约束信息之后, 可以将该响应时间约束信 息存储在业务处理服务器的线程局部存储器(Thread Loca l S torage , TLS )。
在实际应用中, 业务分配服务器会接收用户发送的用户请求, 并为该用户 请求分配一个响应时间约束信息,该响应时间约束信息包括有一个与该用户请 求的应用或服务相对应的处理约束时间,用于限定所述用户请求在整个处理过 程中的最大响应时间 (即该用户请求需在处理约束时间内处理完成), 还有一 个初始状态为零的已发生处理时间,用于统计该用户请求在各个业务处理服务 器的处理阶段一共产生的处理时间。 Exemplarily, after the response time constraint information is obtained, the response time constraint information may be stored in a thread local storage (Thread Loca l Storage, TLS) of the service processing server. In an actual application, the service distribution server receives the user request sent by the user, and allocates a response time constraint information for the user request, where the response time constraint information includes a processing constraint time corresponding to the application or service requested by the user. For limiting the maximum response time of the user request during the entire processing process (that is, the user request needs to be processed within the processing constraint time), and an already processed processing time with an initial state of zero for counting the user. The processing time that is requested to be generated at the processing stage of each business processing server.
在业务分配服务器为用户请求分配了响应时间约束信息之后 ,业务分配服 务器根据该用户请求生成 RPC 请求, 并向目标的业务处理服务器(即与 RPC 请求所请求的应用或服务相对应的业务处理服务器)发送该 RPC请求, 该 RPC 请求中携带有与该用户请求对应的响应时间约束信息,该 RPC请求用于向目标 的业务处理服务器请求业务处理。在实际应用中, 完成一个用户请求可能需要 分多个阶段进行处理,其中 ,业务分配服务器会为每个阶段生成一个 RPC请求, 各个 RPC请求会依次发送到相应的业务分配服务器进行处理, 同时,每个阶段 的 RPC请求都会携带当前的响应时间约束信息,每完成一个 RPC请求, 响应时 间约束信息就会被更新一次,当前的响应时间约束信息同时反映了该用户请求 的处理约束时间, 以及之前各个阶段一共产生的处理时间。 可选的,由于处理约束时间与已发生处理时间的差值等于处理约束时间的 余时间代替, 参数之间显而易见的替换不应理解为对本发明的限定。 After the service distribution server allocates the response time constraint information to the user request, the service distribution server generates an RPC request according to the user request, and sends the RPC request to the target service processing server (that is, the service processing server corresponding to the RPC requesting the requested application or service) Sending the RPC request, the RPC request carries response time constraint information corresponding to the user request, and the RPC request is used to request service processing from the target service processing server. In an actual application, completing a user request may need to be processed in multiple stages. The service distribution server generates an RPC request for each stage, and each RPC request is sent to the corresponding service distribution server for processing. Each phase of the RPC request carries the current response time constraint information. Each time an RPC request is completed, the response time constraint information is updated once. The current response time constraint information also reflects the processing constraint time of the user request, and before. The total processing time generated at each stage. Alternatively, since the difference between the processing constraint time and the processing time that has occurred is equal to the remainder of the processing constraint time, the obvious substitution between the parameters should not be construed as limiting the invention.
1 02 , 业务处理服务器将所述 RPC请求加入服务请求队列; 业务处理服务器将所述 RPC请求加入服务请求队列,所述服务请求队列用 于存储不同的 RPC请求。 在实际应用中, 为了降低运营的成本, 提高资源利用率, 一个业务处理服 务器中的资源可能会被多个业务分配服务器共享利用, 因此, 业务处理服务器 在同一时间很可能需要处理多个 RPC请求,而这些 RPC请求会被加入到服务请 求队列中等待分配处理。 1 02, the service processing server adds the RPC request to the service request queue; the service processing server adds the RPC request to the service request queue, where the service request queue is used to store different RPC requests. In practical applications, in order to reduce the cost of operation and improve resource utilization, resources in a service processing server may be shared by multiple service allocation servers. Therefore, the service processing server may need to process multiple RPC requests at the same time. And these RPC requests will be added to the service request queue for allocation processing.
1 03、 业务处理服务器为 RPC请求分配执行优先级和 /或执行资源。 业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间约束
信息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求的执 行资源。 1 03. The business processing server allocates execution priority and/or execution resources for the RPC request. The service processing server according to the response time constraint of each RPC request in the service request queue The information sets an execution priority of the respective RPC requests, and/or allocates execution resources of the respective RPC requests.
可选的, 分配所述各个 RPC请求的执行资源可以包括: 调整线程的中央处 理器 (Cent ra l Proces s ing Uni t , CPU )调度优先级, 调整线程的输入 /输出 ( I /O )优先级等。 在本发明实施例中,业务处理服务器接收的 RPC请求中携带有响应时间约 束信息,该响应时间约束信息用于标记与所述 RPC请求对应的用户请求的处理 约束时间和已发生处理时间,使得业务处理服务器在处理 RPC请求之前, 可以 根据服务请求队列中各个 RPC请求的响应时间约束信息分配所述各个 RPC请求 的执行优先级和 /或执行资源, 从而使得时间紧急的 RPC请求可以得到优先处 理。 Optionally, allocating execution resources of the respective RPC requests may include: adjusting a thread's central processing unit (Cent ra l Proces s ing Uni t , CPU ) scheduling priority, and adjusting thread input/output (I / O) priority Level and so on. In the embodiment of the present invention, the RPC request received by the service processing server carries the response time constraint information, where the response time constraint information is used to mark the processing constraint time and the processing time of the user request corresponding to the RPC request, so that The service processing server may allocate the execution priority and/or the execution resource of each RPC request according to the response time constraint information of each RPC request in the service request queue before processing the RPC request, so that the time-critical RPC request can be preferentially processed. .
在实际应用中,业务处理服务器根据响应时间约束信息的调控可以有多种 策略, 请参阅图 2 , 本发明实施例中请求处理方法的另一个实施例包括: In an actual application, the service processing server may have various policies according to the regulation of the response time constraint information. Referring to FIG. 2, another embodiment of the request processing method in the embodiment of the present invention includes:
201、 业务处理服务器接收业务分配服务器发送的 RPC请求; 业务处理服务器接收业务分配服务器发送的远程过程调用 RPC请求,所述201. The service processing server receives an RPC request sent by the service distribution server, and the service processing server receives a remote procedure call RPC request sent by the service distribution server, where
RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述 RPC 请求对应的用户请求的处理约束时间和已发生处理时间。 The RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and a processing time that has occurred.
202、 业务处理服务器根据所述响应时间约束信息和紧急阔值选择所述 RPC请求的处理策略; 业务处理服务器根据所述响应时间约束信息和紧急阔值选择所述 RPC请 求的处理策略, 若所述响应时间约束信息的约束剩余时间大于所述紧急阔值, 则选择执行所述第一处理策略,若所述响应时间约束信息的约束剩余时间小于 或等于所述紧急阔值, 则选择执行所述第二处理策略, 所述处理策略包括: 第 一处理策略和第二处理策略,所述第一处理策略的处理复杂度大于所述第二处 理策略。 所述紧急阔值为业务处理服务器选择 RPC请求的处理策略的判断阔值,具 体可以为一个时间阔值。
示例性的, 在实际应用中, 所述第一处理策略具体可以包括根据用户的请 求通过数据挖掘分析的方式推荐用户可能关心的内容;所述第二处理策略具体 可以包括直接向用户推荐当前关注度高的内容;由于第一处理策略的处理复杂 度大于第二处理策略, 因此, 当处理时间紧急(具体通过约束剩余时间小于或 等于紧急阔值体现)时, 业务处理服务器可以选择处理复杂度较小的第二处理 策略, 以节省处理时间。 可以理解的是,所述第一处理策略和第二处理策略所表示的仅是处理复杂 度不同的两类策略, 不特指任意两个策略, 并且, 第一处理策略可以表示处理 复杂度相同或相似的两个以上的处理策略,第二处理策略也可以表示处理复杂 度相同或相似的两个以上的处理策略。 202. The service processing server selects a processing policy of the RPC request according to the response time constraint information and the emergency threshold. The service processing server selects a processing policy of the RPC request according to the response time constraint information and the emergency threshold. If the constraint remaining time of the response time constraint information is greater than the emergency threshold, the first processing policy is selected to be executed, and if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, then the execution is selected. The second processing policy includes: a first processing policy and a second processing policy, where the processing complexity of the first processing policy is greater than the second processing policy. The emergency threshold is a judgment threshold of a processing policy for selecting a RPC request by the service processing server, and may be a time threshold. Exemplarily, in an actual application, the first processing policy may include: recommending content that may be of interest to the user by means of data mining analysis according to the request of the user; and the second processing policy may specifically include recommending the current concern directly to the user. High content; because the processing complexity of the first processing strategy is greater than the second processing strategy, the processing server can select the processing complexity when the processing time is urgent (specifically, the constraint remaining time is less than or equal to the emergency threshold) A smaller second processing strategy to save processing time. It can be understood that the first processing policy and the second processing policy represent only two types of policies with different processing complexity, and do not specifically refer to any two strategies, and the first processing strategy may indicate that the processing complexity is the same. Or two or more similar processing strategies, and the second processing strategy may also represent two or more processing strategies with the same or similar processing complexity.
进一步的, 业务处理服务器还可以设置多级的紧急阔值, 以分别对应多种 复杂度类型的处理策略, 此处具体不作限定。 Further, the service processing server may also set multiple levels of emergency thresholds to correspond to processing strategies of multiple complexity types, which are not specifically limited herein.
203、 业务处理服务器将所述 RPC请求加入服务请求队列; 业务处理服务器将所述 RPC请求加入服务请求队列,所述服务请求队列用 于存储不同的 RPC请求。 在实际应用中, 为了降低运营的成本, 提高资源利用率, 一个业务处理服 务器中的资源可能会被多个业务分配服务器共享利用, 因此, 业务处理服务器 在同一时间很可能需要处理多个 RPC请求,而这些 RPC请求会被加入到服务请 求队列中等待分配处理。 可以理解的是, 本发明实施例在实际应用中, 步骤 202和步骤 203没有严 格的先后关系, 即也可以执行 "将所述 RPC请求加入服务请求队列", 再执行 "根据所述响应时间约束信息和紧急阔值选择所述 RPC请求的处理策略"。 203. The service processing server adds the RPC request to the service request queue. The service processing server adds the RPC request to the service request queue, where the service request queue is used to store different RPC requests. In practical applications, in order to reduce the cost of operation and improve resource utilization, resources in a service processing server may be shared by multiple service allocation servers. Therefore, the service processing server may need to process multiple RPC requests at the same time. And these RPC requests will be added to the service request queue for allocation processing. It can be understood that, in an actual application, in step 202 and step 203, there is no strict sequential relationship, that is, "add the RPC request to the service request queue", and then execute "according to the response time constraint." Information and emergency thresholds select the processing strategy for the RPC request."
204、 业务处理服务器为 RPC请求分配执行优先级和 /或执行资源; 业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间约束 信息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求的执 行资源。 204. The service processing server allocates an execution priority and/or an execution resource to the RPC request. The service processing server sets an execution priority of the each RPC request according to the response time constraint information of each RPC request in the service request queue, and/or Allocating execution resources of the respective RPC requests.
可选的, 分配执行优先级和 /或执行资源可以通过在操作系统或超级管理
程序(Hyperv i s or )调整不同请求处理线程的资源使用量的方案, 如调整线程 的 CPU调度优先级、调整线程的 I /O优先级等; 也可以通过支持优先级的硬件 对请求处理线程的执行优先级进行调整, 如, 在 CPU 的高速緩存存储器、 内 存控制器或系统总线上根据响应时间约束信息所确定的优先级对各处理线程 所使用的硬件资源进行分配。 Optionally, assigning execution priorities and/or executing resources can be done through the operating system or super management The program (Hyperv is or ) adjusts the resource usage of different request processing threads, such as adjusting the CPU's CPU scheduling priority, adjusting the thread's I / O priority, etc.; also can support the request processing thread through the hardware that supports the priority The execution priority is adjusted, for example, the hardware resources used by each processing thread are allocated on the CPU's cache memory, memory controller, or system bus according to the priority determined by the response time constraint information.
在实际应用中, 业务处理服务器在处理 RPC请求之前,会根据设备自身的 处理能力, 以及服务请求队列中 RPC请求的数量和类型, 确定 RPC请求的处理 方式; 若所述业务处理服务器能够同时处理所述服务请求队列中所有的 RPC 请求,则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时 间约束信息分配所述各个 RPC请求的执行资源;若所述业务处理服务器仅能单 独处理所述服务请求队列中的任意一个 RPC请求,则所述业务处理服务器根据 所述服务请求队列中各个 RPC请求的响应时间约束信息设置所述各个 RPC请求 的执行优先级;若所述业务处理服务器即无法同时处理所述服务请求队列中所 有的 RPC请求, 也不仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述业务处理服务器根据所述服务请求队列中各个 RPC 请求的响应时间约 束信息设置所述各个 RPC请求的执行优先级,并分配所述各个 RPC请求的执行 资源。 In an actual application, the service processing server determines the processing mode of the RPC request according to the processing capability of the device and the number and type of RPC requests in the service request queue before processing the RPC request; if the service processing server can simultaneously process All the RPC requests in the service request queue, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue; if the service processing server can only The service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue, if the RPC request is processed by the service request queue separately; The processing server cannot process all the RPC requests in the service request queue at the same time, and can not only process any one of the RPC requests in the service request queue, but the service processing server requests each RPC request in the queue according to the service request. Response time The bundle information sets an execution priority of the respective RPC requests and allocates execution resources of the respective RPC requests.
进一步的,当业务处理服务器根据所述服务请求队列中各个 RPC请求的响 应时间约束信息设置所述各个 RPC请求的执行优先级时,业务处理服务器可以 根据所述响应时间约束信息获取所述各个 RPC请求的处理约束时间的约束剩 余时间; 再根据预定义规则设置所述各个 RPC请求的执行优先级, 所述预定义 规则包括: 所述约束剩余时间越少, 则设置的执行优先级越高。 当业务处理服务器根据所述服务请求队列中各个 RPC 请求的响应时间约 束信息分配所述各个 RPC请求的执行资源时,业务处理服务器可以根据所述响 应时间约束信息获取所述各个 RPC请求的处理约束时间的剩余时间;根据预定 义规则分配所述各个 RPC请求的执行资源, 所述预定义规则包括: 所述约束剩 余时间越少, 则分配的执行资源越多。 再进一步的, 当业务处理服务器获取到各个 RPC 请求的约束剩余时间之 后, 若发现有两个以上的 RPC请求的约束剩余时间相等, 则获取所述约束剩余
时间与所述处理约束时间的比值,为所述比值小的 RPC请求设置较高的执行优 先级, 和 /或分配较多的执行资源。 再进一步的, 当业务处理服务器获取到处理约束时间的约束剩余时间之 后, 可以先对该约束剩余时间进行判断, 若所述处理约束时间的剩余时间小于 所述 RPC请求的预测完成时间,则放弃为所述 RPC请求设置执行优先级和分配 执行资源, 以节省业务处理服务器的处理资源; 可选的, 此时的业务处理服务 器可以选择向业务分配服务器发送请求失败响应,业务分配服务器向用户反馈 该用户请求的处理失败, 使得重新发送业务请求。 在实际应用中 ,业务处理服务器可以获知用户请求在各个处理阶段的最小 处理时间 (可以由业务分配服务器告知), 当前的业务处理服务器将所述用户 请求的剩余各个处理阶段的最小处理时间相加, 即可得到所述预测完成时间。 Further, when the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue, the service processing server may obtain the RPC according to the response time constraint information. The processing processing constraint time constraint remaining time; the execution priority of the respective RPC request is set according to the predefined rule, the predefined rule includes: the less the constraint remaining time, the higher the execution priority is set. When the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue, the service processing server may acquire the processing constraints of the respective RPC requests according to the response time constraint information. The remaining time of the time; the execution resources of the respective RPC requests are allocated according to a predefined rule, and the predefined rules include: the fewer the remaining time of the constraint, the more execution resources are allocated. Further, after the service processing server obtains the remaining time of the constraint of each RPC request, if the remaining time of the constraint of two or more RPC requests is found to be equal, the remaining constraint is obtained. The ratio of the time to the processing constraint time sets a higher execution priority for the RPC request with a smaller ratio, and/or allocates more execution resources. Further, after the service processing server obtains the constraint remaining time of the processing constraint time, the remaining time of the constraint may be first determined, and if the remaining time of the processing constraint time is less than the predicted completion time of the RPC request, then the device abandons Setting an execution priority and an allocation execution resource for the RPC request to save processing resources of the service processing server. Optionally, the service processing server may select to send a request failure response to the service allocation server, and the service distribution server provides feedback to the user. The processing of the user request failed, causing the service request to be resent. In an actual application, the service processing server may know the minimum processing time of the user request at each processing stage (which may be notified by the service allocation server), and the current service processing server adds the minimum processing time of each remaining processing stage of the user request. , the prediction completion time can be obtained.
205、 业务处理服务器向所述业务分配服务器反馈完成处理的 RPC请求的 响应时间约束信息。 在完成执行优先级的设置和 /或执行资源的分配之后, 业务处理服务器对 优先级最高的 RPC请求进行处理,记录所述 RPC请求的处理时间, 并根据所述 处理时间更新所述 RPC请求的响应时间约束信息 (即将所述处理时间加上响应 时间约束信息中的已发生处理时间, 得到更新后的已发生处理时间)。 业务处理服务器向所述业务分配服务器反馈完成处理的 RPC请求的响应 时间约束信息 (即更新后的响应时间约束信息), 使得业务分配服务器更新相 应用户请求的响应时间约束信息。 上面是从业务处理服务器的角度对本发明实施例中的请求处理方法进行 了描述, 下面从业务分配服务器侧对本发明实施例中的请求处理方法进行描 述, 请参阅图 3 , 本发明实施例中的请求处理方法另一实施例包括: 205. The service processing server feeds back, to the service allocation server, response time constraint information of the RPC request that is processed. After completing the setting of the execution priority and/or the allocation of the execution resources, the service processing server processes the highest priority RPC request, records the processing time of the RPC request, and updates the RPC request according to the processing time. The response time constraint information (that is, the processing time added to the processing time in the response time constraint information is obtained, and the updated processing time has been obtained). The service processing server feeds back the response time constraint information (i.e., the updated response time constraint information) of the RPC request that has been processed to the service distribution server, so that the service distribution server updates the response time constraint information requested by the corresponding user. The request processing method in the embodiment of the present invention is described above from the perspective of the service processing server. The request processing method in the embodiment of the present invention is described from the service distribution server side. Referring to FIG. 3, in the embodiment of the present invention, Another embodiment of the request processing method includes:
301、 业务分配服务器接收用户请求; 业务分配服务器接收用户请求,该用户请求为用户向网络侧提出的服务需 求或应用需求, 该服务需求或应用需求可以包括: 搜索、 在线购物等。 301. The service distribution server receives the user request. The service distribution server receives the user request, and the user requests the service requirement or the application requirement that the user submits to the network side, and the service requirement or the application requirement may include: searching, online shopping, and the like.
302、 业务分配服务器为所述用户请求分配响应时间约束信息;
业务分配服务器为所述用户请求分配响应时间约束信息,所述响应时间约 束信息用于标记所述用户请求的处理约束时间和已发生处理时间。 302. The service allocation server allocates response time constraint information to the user request. The service distribution server allocates response time constraint information for the user request, and the response time constraint information is used to mark the processing constraint time of the user request and the processing time that has occurred.
示例性的, 该响应时间约束信息可以存储在业务分配服务器的 TLS。 该响应时间约束信息包括有一个与该用户请求的应用或服务相对应的处 理约束时间, 用于限定所述用户请求在整个处理过程中的最大响应时间(即该 用户请求需在处理约束时间内处理完成), 还有一个初始状态为零的已发生处 理时间,用于统计该用户请求在各个业务处理服务器的处理阶段一共产生的处 理时间。 可选的,该响应时间约束信息可以由管理员根据不同用户请求的服务或应 用类型进行设置, 当完成初始化设置后, 业务分配服务器可以根据相应用户请 求的响应时间约束信息的历史值自动进行分配。 Exemplarily, the response time constraint information can be stored in the TLS of the service distribution server. The response time constraint information includes a processing constraint time corresponding to the application or service requested by the user, and is used to define a maximum response time of the user request during the entire processing process (ie, the user request needs to be within the processing constraint time) Processing is completed), there is also an processing time that has an initial state of zero, which is used to count the processing time that the user requests a total of processing time in each processing server. Optionally, the response time constraint information may be set by the administrator according to the service or application type requested by the different user. After the initialization setting is completed, the service distribution server may automatically allocate according to the historical value of the response time constraint information requested by the corresponding user. .
303、 业务分配服务器根据所述用户请求生成 RPC请求; 在业务分配服务器为用户请求分配了响应时间约束信息之后 ,业务分配服 务器根据该用户请求生成 RPC请求,该 RPC请求中携带有与该用户请求对应的 响应时间约束信息, 该 RPC请求用于向目标的业务处理服务器请求业务处理。 在实际应用中, 完成一个用户请求可能需要分多个阶段进行处理, 其中, 业务 分配服务器会为每个阶段生成一个 RPC请求,各个 RPC请求会依次发送到相应 的业务分配服务器进行处理, 同时,每个阶段的 RPC请求都会携带当前的响应 时间约束信息, 每完成一个 RPC请求, 响应时间约束信息就会被更新一次, 当 前的响应时间约束信息同时反映了该用户请求的处理约束时间,以及之前各个 阶段一共产生的处理时间。 303. The service distribution server generates an RPC request according to the user request. After the service distribution server allocates the response time constraint information to the user request, the service distribution server generates an RPC request according to the user request, where the RPC request carries the request with the user. Corresponding response time constraint information, the RPC request is used to request service processing from the target service processing server. In an actual application, a user request may be processed in multiple stages. The service distribution server generates an RPC request for each stage, and each RPC request is sent to the corresponding service distribution server for processing. Each phase of the RPC request carries the current response time constraint information. Each time an RPC request is completed, the response time constraint information is updated once. The current response time constraint information also reflects the processing constraint time of the user request, and before. The total processing time generated at each stage.
304、 业务分配服务器向业务处理服务器发送 RPC请求。 业务分配服务器向业务处理服务器发送 RPC请求,所述 RPC请求携带有所 述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为 所述 RPC请求设置执行优先级, 和 /或分配执行资源。 在本发明实施例中,业务分配服务器向业务处理服务器发送的 RPC请求中 携带有响应时间约束信息,该响应时间约束信息用于标记所述用户请求的处理 约束时间和已发生处理时间,使得业务处理服务器在处理 RPC请求之前, 可以
根据服务请求队列中各个 RPC请求的响应时间约束信息分配所述各个 RPC请求 的执行优先级和 /或执行资源, 从而使得时间紧急的 RPC请求可以得到优先处 理。 304. The service distribution server sends an RPC request to the service processing server. The service distribution server sends an RPC request to the service processing server, where the RPC request carries the response time constraint information; causing the service processing server to set an execution priority for the RPC request according to the response time constraint information, and/or Assign execution resources. In the embodiment of the present invention, the RPC request sent by the service distribution server to the service processing server carries the response time constraint information, where the response time constraint information is used to mark the processing constraint time of the user request and the processing time that has occurred, so that the service The processing server can process the RPC request before it can The execution priority and/or execution resources of the respective RPC requests are allocated according to the response time constraint information of each RPC request in the service request queue, so that the time-critical RPC request can be preferentially processed.
下面对业务分配服务器执行请求处理方法再进行详细描述, 请参阅图 4 , 本发明实施例中的请求处理方法另一实施例包括: The following is a detailed description of the method for performing the request processing on the service distribution server. Referring to FIG. 4, another embodiment of the request processing method in the embodiment of the present invention includes:
401、 业务分配服务器接收用户请求; 401. The service distribution server receives a user request.
业务分配服务器接收用户请求,该用户请求为用户向网络侧提出的服务需 求或应用需求, 该服务需求或应用需求可以包括: 搜索、 在线购物等。 The service distribution server receives the user request, and the user requests the service demand or the application requirement that the user makes to the network side, and the service requirement or the application requirement may include: searching, online shopping, and the like.
402、 业务分配服务器为所述用户请求分配响应时间约束信息; 业务分配服务器为所述用户请求分配响应时间约束信息,所述响应时间约 束信息用于标记所述用户请求的处理约束时间和已发生处理时间; 402. The service distribution server allocates response time constraint information to the user request. The service distribution server allocates response time constraint information for the user request, where the response time constraint information is used to mark the processing constraint time of the user request and has occurred. Processing time
该响应时间约束信息包括有一个与该用户请求的应用或服务相对应的处 理约束时间, 用于限定所述用户请求在整个处理过程中的最大响应时间(即该 用户请求需在处理约束时间内处理完成), 还有一个初始状态为零的已发生处 理时间,用于统计该用户请求在各个业务处理服务器的处理阶段一共产生的处 理时间。 可选的,该响应时间约束信息可以由管理员根据不同用户请求的服务或应 用类型进行设置, 当完成初始化设置后, 业务分配服务器可以根据相应用户请 求的响应时间约束信息的历史值自动进行分配。 可选的,业务分配服务器可以根据所述响应时间约束信息的历史值以及所 述业务处理服务器的硬件信息为所述用户请求分配响应时间约束信息; 具体 的, 若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息 的历史值时发生了改变, 则获取第一处理速度与第二处理速度的比值, 将所述 响应时间约束信息的历史值乘于所述比值,得到当前为所述用户请求分配的响 应时间约束信息;所述第一处理速度为当前的业务处理服务器的硬件性能对所 述 RPC请求的处理速度,所述第二处理速度为记录所述响应时间约束信息的历 史值时的业务处理服务器的硬件性能对所述 RPC请求的处理速度;若当前的业 务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时没有
发生改变,则将所述响应时间约束信息的历史值作为当前为所述用户请求分配 的响应时间约束信息。 The response time constraint information includes a processing constraint time corresponding to the application or service requested by the user, and is used to define a maximum response time of the user request during the entire processing process (ie, the user request needs to be within the processing constraint time) Processing is completed), there is also an processing time that has an initial state of zero, which is used to count the processing time that the user requests a total of processing time in each processing server. Optionally, the response time constraint information may be set by the administrator according to the service or application type requested by the different user. After the initialization setting is completed, the service distribution server may automatically allocate according to the historical value of the response time constraint information requested by the corresponding user. . Optionally, the service allocation server may allocate response time constraint information to the user request according to the historical value of the response time constraint information and the hardware information of the service processing server; specifically, if the current service processing server has hardware performance And comparing the historical value of the response time constraint information, obtaining a ratio of the first processing speed to the second processing speed, multiplying the historical value of the response time constraint information by the ratio, to obtain a current Responsive time constraint information assigned to the user request; the first processing speed is a processing speed of a hardware performance of a current service processing server to the RPC request, and the second processing speed is a recording response time constraint information The historical value of the business processing server hardware performance processing speed of the RPC request; if the current business processing server hardware performance, relative to the historical value of the recording response time constraint information When a change occurs, the historical value of the response time constraint information is taken as the response time constraint information currently allocated for the user request.
403、 业务分配服务器根据所述用户请求生成 RPC请求; 在业务分配服务器为用户请求分配了响应时间约束信息之后 ,业务分配服 务器根据该用户请求生成 RPC请求,该 RPC请求中携带有与该用户请求对应的 响应时间约束信息, 该 RPC请求用于向目标的业务处理服务器请求业务处理。 在实际应用中, 完成一个用户请求可能需要分多个阶段进行处理, 其中, 业务 分配服务器会为每个阶段生成一个 RPC请求,各个 RPC请求会依次发送到相应 的业务分配服务器进行处理, 同时,每个阶段的 RPC请求都会携带当前的响应 时间约束信息, 每完成一个 RPC请求, 响应时间约束信息就会被更新一次, 当 前的响应时间约束信息同时反映了该用户请求的处理约束时间,以及之前各个 阶段一共产生的处理时间。 示例性的, RPC请求生成方法可以为: 提取完成所述用户请求所需的业务 参数(如请求类型、 用户标识、 商品标识等); 根据预置的业务逻辑确定完成 所述用户请求需要执行的步骤,根据所述需要执行的步骤确定需要调用的业务 处理服务器; 分别为所述需要调用的业务处理服务器分配相应的所述业务参 数, 生成与所述业务处理服务器对应的 RPC请求。 403. The service distribution server generates an RPC request according to the user request. After the service distribution server allocates the response time constraint information to the user request, the service distribution server generates an RPC request according to the user request, where the RPC request carries the request with the user. Corresponding response time constraint information, the RPC request is used to request service processing from the target service processing server. In an actual application, a user request may be processed in multiple stages. The service distribution server generates an RPC request for each stage, and each RPC request is sent to the corresponding service distribution server for processing. Each phase of the RPC request carries the current response time constraint information. Each time an RPC request is completed, the response time constraint information is updated once. The current response time constraint information also reflects the processing constraint time of the user request, and before. The total processing time generated at each stage. Exemplarily, the RPC request generating method may be: extracting a service parameter (such as a request type, a user identifier, a product identifier, and the like) required to complete the user request; determining, according to preset business logic, that the user request needs to be performed to complete the user request. And determining, according to the step that needs to be performed, the service processing server that needs to be invoked; respectively, assigning the corresponding service parameter to the service processing server that needs to be invoked, and generating an RPC request corresponding to the service processing server.
404、 业务分配服务器向业务处理服务器发送 RPC请求; 业务分配服务器向业务处理服务器发送 RPC请求,所述 RPC请求携带有所 述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为 所述 RPC请求设置执行优先级, 和 /或分配执行资源。 404. The service distribution server sends an RPC request to the service processing server. The service distribution server sends an RPC request to the service processing server, where the RPC request carries the response time constraint information, so that the service processing server determines the information according to the response time constraint. An execution priority is set for the RPC request, and/or an execution resource is allocated.
405、 业务分配服务器接收业务处理服务器反馈的响应时间约束信息; 业务分配服务器接收业务处理服务器反馈的响应时间约束信息,并使用所 述响应时间约束信息更新相应的 RPC请求的响应时间约束信息。 406、 业务分配服务器根据更新后的响应时间约束信息选择相应用户请求 的分配处理策略。 405. The service distribution server receives the response time constraint information fed back by the service processing server. The service distribution server receives the response time constraint information fed back by the service processing server, and updates the response time constraint information of the corresponding RPC request by using the response time constraint information. 406. The service distribution server selects an allocation processing policy requested by the corresponding user according to the updated response time constraint information.
业务分配服务器根据所述响应时间约束信息和紧急分配阔值选择所述用
户请求对应的分配处理策略, 所述分配处理策略包括: 第一分配处理策略和第 二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急处理 阔值, 则选择执行所述第一分配处理策略, 若所述响应时间约束信息的约束剩 余时间小于或等于所述紧急处理阔值, 则选择执行所述第二分配处理策略, 所 述第一分配处理策略的处理复杂度大于所述第二分配处理策略。 所述紧急分配阔值为业务分配服务器选择用户请求的处理策略的判断阔 值, 具体可以为一个时间阔值。 示例性的, 在实际应用中, 所述第一分配处理策略具体可以包括完成用户 请求所必要的业务处理流程,以及可选的用于提升服务质量的数据挖掘、统计、 分析流程内容;所述第二分配处理策略具体可以包括只包含完成用户请求所必 要的业务处理流程内容;由于第一分配处理策略的处理复杂度大于第二分配处 理策略, 因此, 当处理时间紧急(具体通过约束剩余时间小于或等于紧急阔值 体现)时, 业务分配服务器可以选择处理复杂度较小的第二分配处理策略, 以 节省处理时间。 可以理解的是,所述第一分配处理策略和第二分配处理策略所表示的仅是 处理复杂度不同的两类策略, 不特指任意两个策略, 并且, 第一分配处理策略 可以表示处理复杂度相同或相似的两个以上的处理策略,第二分配处理策略也 可以表示处理复杂度相同或相似的两个以上的处理策略。 The service distribution server selects the use according to the response time constraint information and the emergency allocation threshold The user requests a corresponding allocation processing policy, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, selecting an execution location The first allocation processing policy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold, selecting to perform the second allocation processing policy, the processing complexity of the first allocation processing policy Greater than the second allocation processing policy. The emergency allocation value is a judgment threshold of the processing policy that the service allocation server selects the user request, and may be a time threshold. Exemplarily, in a practical application, the first allocation processing policy may specifically include a service processing procedure necessary for completing a user request, and optionally data mining, statistics, and analysis process content for improving service quality; The second allocation processing policy may specifically include only the business process flow content necessary for completing the user request; since the processing complexity of the first allocation processing policy is greater than the second allocation processing policy, when the processing time is urgent (specifically, by constraining the remaining time) When the value is less than or equal to the emergency threshold, the service allocation server may choose to process the second allocation processing strategy with less complexity to save processing time. It can be understood that the first allocation processing policy and the second allocation processing strategy represent only two types of policies with different processing complexity, and do not specifically refer to any two strategies, and the first allocation processing strategy may indicate processing. For two or more processing strategies with the same or similar complexity, the second allocation processing strategy may also represent two or more processing strategies with the same or similar processing complexity.
进一步的, 业务分配服务器还可以设置多级的紧急分配阔值, 以分别对应 多种复杂度类型的分配处理策略, 此处具体不作限定。 下面对用于执行上述请求处理方法的本发明业务处理服务器的实施例进 行说明, 其逻辑结构请参考图 5 , 本发明实施例中的业务处理服务器一个实施 例包括: Further, the service distribution server may also set a multi-level emergency allocation threshold to correspond to a plurality of complexity type allocation processing policies, which are not specifically limited herein. The following describes an embodiment of the service processing server of the present invention for performing the foregoing request processing method. For the logical structure, refer to FIG. 5. An embodiment of the service processing server in the embodiment of the present invention includes:
请求接收单元 501 , 用于接收业务分配服务器发送的远程过程调用 RPC请 求, 所述 RPC请求包括: 响应时间约束信息; 所述响应时间约束信息用于标记 与所述 RPC请求对应的用户请求的处理约束时间和已发生处理时间; 存储单元 502 , 用于将所述 RPC请求加入服务请求队列; 设置单元 503 , 用于根据所述服务请求队列中各个 RPC请求的响应时间约
束信息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求的 执行资源。 The request receiving unit 501 is configured to receive a remote procedure call RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; and the response time constraint information is used to mark a process of processing the user request corresponding to the RPC request. Restricting time and processing time has occurred; the storage unit 502 is configured to add the RPC request to the service request queue; and the setting unit 503 is configured to: according to the response time of each RPC request in the service request queue The bundle information sets an execution priority of the respective RPC requests, and/or allocates execution resources of the respective RPC requests.
进一步的, 本发明实施例中的设置单元具体 503用于: 若所述业务处理服务器能够同时处理所述服务请求队列中所有的 RPC请 求,则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间 约束信息分配所述各个 RPC请求的执行资源; Further, the setting unit 503 in the embodiment of the present invention is configured to: if the service processing server can simultaneously process all RPC requests in the service request queue, the service processing server is configured according to each of the service request queues The response time constraint information requested by the RPC allocates execution resources of the respective RPC requests;
若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响 应时间约束信息设置所述各个 RPC请求的执行优先级; 若所述业务处理服务器即无法同时处理所述服务请求队列中所有的 RPC 请求,也不是仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述 业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间约束信息 设置所述各个 RPC请求的执行优先级, 并分配所述各个 RPC请求的执行资源。 If the service processing server can only process any one of the RPC requests in the service request queue, the service processing server sets the RPC request according to the response time constraint information of each RPC request in the service request queue. Execution priority; if the service processing server cannot process all RPC requests in the service request queue at the same time, nor can it only process any RPC request in the service request queue separately, the service processing server is based on The response time constraint information of each RPC request in the service request queue sets an execution priority of each RPC request, and allocates execution resources of the respective RPC requests.
进一步的, 本发明实施例中的所述设置单元 503可以包括: 资源分配模块 5031 , 用于根据所述响应时间约束信息获取所述各个 RPC 请求的处理约束时间的约束剩余时间;根据预定义规则设置所述各个 RPC请求 的执行优先级, 所述预定义规则包括: 所述约束剩余时间越少, 则设置的执行 优先级越高; 优先级设置模块 5032 ,用于根据所述响应时间约束信息获取所述各个 RPC 请求的处理约束时间的剩余时间;根据预定义规则分配所述各个 RPC请求的执 行资源, 所述预定义规则包括: 所述约束剩余时间越少, 则分配的执行资源越 进一步的, 本发明实施例中的业务处理服务器还可以包括: 处理策略选择单元 504 , 用于根据所述响应时间约束信息和紧急阔值选择 所述 RPC请求的处理策略,所述处理策略包括:第一处理策略和第二处理策略, 若所述响应时间约束信息的约束剩余时间大于所述紧急阔值,则选择执行所述 第一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急
阔值, 则选择执行所述第二处理策略, 所述第一处理策略的处理复杂度大于所 述第二处理策略。 Further, the setting unit 503 in the embodiment of the present invention may include: a resource allocation module 5031, configured to acquire, according to the response time constraint information, a constraint remaining time of a processing constraint time of each RPC request; according to a predefined rule Setting the execution priority of each of the RPC requests, where the predefined rule includes: the less the remaining time of the constraint, the higher the execution priority is set; the priority setting module 5032 is configured to use the response time constraint information according to the response time constraint information. Acquiring the remaining time of the processing constraint time of the respective RPC request; allocating the execution resources of the respective RPC requests according to the predefined rule, where the predefined rule includes: the less the remaining time of the constraint, the further the allocated execution resources The service processing server in the embodiment of the present invention may further include: a processing policy selecting unit 504, configured to select a processing policy of the RPC request according to the response time constraint information and an emergency threshold, where the processing policy includes: a processing strategy and a second processing strategy, if the response time constraint information is about Remaining time value is greater than the width of emergency, is selected to perform the first processing strategy, if the remaining time of the response time of the constraining information is equal to or less than the emergency The threshold value is selected to execute the second processing policy, where the processing complexity of the first processing policy is greater than the second processing policy.
进一步的, 本发明实施例中的业务处理服务器还包括: 请求处理单元 505 ,用于对优先级最高的 RPC请求进行处理,记录所述 RPC 请求的处理时间, 并根据所述处理时间更新所述 RPC 请求的响应时间约束信 息; Further, the service processing server in the embodiment of the present invention further includes: a request processing unit 505, configured to process the RPC request with the highest priority, record the processing time of the RPC request, and update the processing according to the processing time. Response time constraint information for RPC requests;
信息反馈单元 506 , 用于向所述业务分配服务器反馈完成处理的 RPC请求 的响应时间约束信息。 本发明实施例中业务分配服务器的各个单元具体的交互过程如下: 请求接收单元 501接收业务分配服务器发送的 RPC请求,所述 RPC请求包 括: 响应时间约束信息; 所述响应时间约束信息用于标记与所述 RPC请求对应 的用户请求的处理约束时间和已发生处理时间。 示例性的, 在获取到该响应时 间约束信息之后 ,可以将该响应时间约束信息存储在业务处理服务器的线程局 部存储器。 The information feedback unit 506 is configured to feed back, to the service distribution server, response time constraint information of the RPC request that completes the processing. The specific interaction process of each unit of the service allocation server in the embodiment of the present invention is as follows: The request receiving unit 501 receives an RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used for marking The processing constraint time of the user request corresponding to the RPC request and the processing time that has occurred. Exemplarily, after the response time constraint information is obtained, the response time constraint information may be stored in a thread local storage of the service processing server.
接收到该 RPC请求之后,存储单元 502将所述 RPC请求加入服务请求队列, 所述服务请求队列用于存储不同的 RPC请求。在实际应用中, 为了降低运营的 成本,提高资源利用率, 一个业务处理服务器中的资源可能会被多个业务分配 服务器共享利用, 因此, 业务处理服务器在同一时间很可能需要处理多个 RPC 请求, 而这些 RPC请求会被加入到服务请求队列中等待分配处理。 可选的, 在获取到该响应时间约束信息之后, 可以由处理策略选择单元 After receiving the RPC request, the storage unit 502 adds the RPC request to the service request queue, where the service request queue is used to store different RPC requests. In practical applications, in order to reduce the cost of operation and improve resource utilization, resources in a service processing server may be shared by multiple service allocation servers. Therefore, the service processing server is likely to need to process multiple RPC requests at the same time. And these RPC requests will be added to the service request queue for allocation processing. Optionally, after the response time constraint information is obtained, the processing policy selection unit may be
504根据所述响应时间约束信息和紧急阔值选择所述 RPC请求的处理策略, 若 所述响应时间约束信息的约束剩余时间大于所述紧急阔值,则选择执行所述第 一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急阔 值, 则选择执行所述第二处理策略, 所述处理策略包括: 第一处理策略和第二 处理策略, 所述第一处理策略的处理复杂度大于所述第二处理策略。 所述紧急阔值为业务处理服务器选择 RPC请求的处理策略的判断阔值,具 体可以为一个时间阔值。
示例性的, 在实际应用中, 所述第一处理策略具体可以包括根据用户的请 求通过数据挖掘分析的方式推荐用户可能关心的内容;所述第二处理策略具体 可以包括直接向用户推荐当前关注度高的内容;由于第一处理策略的处理复杂 度大于第二处理策略, 因此, 当处理时间紧急(具体通过约束剩余时间小于或 等于紧急阔值体现)时, 业务处理服务器可以选择处理复杂度较小的第二处理 策略, 以节省处理时间。 在将 RPC请求加入到服务请求队列之后,设置单元 503根据所述服务请求 队列中各个 RPC请求的响应时间约束信息设置所述各个 RPC请求的执行优先 级, 和 /或分配所述各个 RPC请求的执行资源。 具体的, 在处理 RPC请求之前, 会根据设备自身的处理能力, 以及服务请 求队列中 RPC请求的数量和类型,确定 RPC请求的处理方式; 若所述业务处理 服务器能够同时处理所述服务请求队列中所有的 RPC请求,则所述业务处理服 务器根据所述服务请求队列中各个 RPC请求的响应时间约束信息分配所述各 个 RPC请求的执行资源;若所述业务处理服务器仅能单独处理所述服务请求队 列中的任意一个 RPC请求,则所述业务处理服务器根据所述服务请求队列中各 个 RPC请求的响应时间约束信息设置所述各个 RPC请求的执行优先级;若所述 业务处理服务器即无法同时处理所述服务请求队列中所有的 RPC请求,也不仅 能单独处理所述服务请求队列中的任意一个 RPC请求,则所述业务处理服务器 根据所述服务请求队列中各个 RPC请求的响应时间约束信息设置所述各个 RPC 请求的执行优先级, 并分配所述各个 RPC请求的执行资源。 进一步的, 可以由设置单元 503的资源分配模块 5031根据所述响应时间 约束信息获取所述各个 RPC请求的处理约束时间的约束剩余时间;根据预定义 规则设置所述各个 RPC请求的执行优先级, 所述预定义规则包括: 所述约束剩 余时间越少, 则设置的执行优先级越高; 由优先级设置模块 5032根据所述响 应时间约束信息获取所述各个 RPC请求的处理约束时间的剩余时间;根据预定 义规则分配所述各个 RPC请求的执行资源, 所述预定义规则包括: 所述约束剩 余时间越少, 则分配的执行资源越多。 在完成执行优先级的设置和 /或执行资源的分配之后, 请求处理单元 505 对优先级最高的 RPC请求进行处理,记录所述 RPC请求的处理时间, 并根据所
述处理时间更新所述 RPC请求的响应时间约束信息(即将所述处理时间加上响 应时间约束信息中的已发生处理时间, 得到更新后的已发生处理时间)。 信息反馈单元 506向所述业务分配服务器反馈完成处理的 RPC请求的响应 时间约束信息 (即更新后的响应时间约束信息), 使得业务分配服务器更新相 应用户请求的响应时间约束信息。 下面对用于执行上述请求处理方法的本发明业务分配服务器的实施例进 行说明, 其逻辑结构请参考图 6 , 本发明实施例中的业务分配服务器一个实施 例包括: The 504 selects a processing policy of the RPC request according to the response time constraint information and the emergency threshold. If the constraint remaining time of the response time constraint information is greater than the emergency threshold, the first processing policy is selected to be executed. And the second processing policy is selected to be executed, where the processing policy includes: a first processing policy and a second processing policy, where the first processing policy is performed, where the remaining processing time of the response time constraint information is less than or equal to the emergency threshold value. The processing complexity of the policy is greater than the second processing strategy. The emergency threshold is a judgment threshold of a processing policy for selecting a RPC request by the service processing server, and may be a time threshold. Exemplarily, in an actual application, the first processing policy may include: recommending content that may be of interest to the user by means of data mining analysis according to the request of the user; and the second processing policy may specifically include recommending the current concern directly to the user. High content; because the processing complexity of the first processing strategy is greater than the second processing strategy, the processing server can select the processing complexity when the processing time is urgent (specifically, the constraint remaining time is less than or equal to the emergency threshold) A smaller second processing strategy to save processing time. After the RPC request is added to the service request queue, the setting unit 503 sets the execution priority of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue, and/or allocates the respective RPC requests. Execute resources. Specifically, before processing the RPC request, the RPC request processing manner is determined according to the processing capability of the device and the number and type of the RPC request in the service request queue; if the service processing server can simultaneously process the service request queue All the RPC requests, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue; if the service processing server can only process the service separately If the RPC request is requested in the queue, the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue; if the service processing server cannot simultaneously Processing all the RPC requests in the service request queue, and not only individually processing any one of the RPC requests in the service request queue, and the service processing server according to the response time constraint information of each RPC request in the service request queue Set the execution priority of each RPC request And allocating the resources of each execution of the RPC request. Further, the resource allocation module 5031 of the setting unit 503 may acquire the constraint remaining time of the processing constraint time of each RPC request according to the response time constraint information; and set the execution priority of each RPC request according to the predefined rule, The predefined rule includes: the less the remaining time of the constraint, the higher the execution priority is set; and the remaining time of the processing constraint time of the respective RPC request is obtained by the priority setting module 5032 according to the response time constraint information. And allocating execution resources of the respective RPC requests according to a predefined rule, where the predefined rules include: the fewer the remaining time of the constraint, the more execution resources are allocated. After completing the setting of the execution priority and/or the allocation of the execution resource, the request processing unit 505 processes the RPC request with the highest priority, records the processing time of the RPC request, and according to the The processing time updates the response time constraint information of the RPC request (that is, the processing time plus the processing time that has occurred in the response time constraint information, and the updated processing time has been obtained). The information feedback unit 506 feeds back the response time constraint information (ie, the updated response time constraint information) of the RPC request that has been processed to the service distribution server, so that the service distribution server updates the response time constraint information requested by the corresponding user. An embodiment of the service distribution server of the present invention for performing the above-mentioned request processing method is described below. For the logical structure, please refer to FIG. 6. An embodiment of the service distribution server in the embodiment of the present invention includes:
用户请求接收单元 601 , 用于接收用户请求; 信息分配单元 602 , 用于为所述用户请求分配响应时间约束信息, 所述响 应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间; 请求生成单元 603 , 用于根据所述用户请求生成远程过程调用 RPC请求; 请求发送单元 604 , 用于向业务处理服务器发送 RPC请求, 所述 RPC请求 携带有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约 束信息为所述 RPC请求设置执行优先级, 和 /或分配执行资源。 a user request receiving unit 601, configured to receive a user request; an information allocating unit 602, configured to allocate response time constraint information for the user request, where the response time constraint information is used to mark a processing constraint time requested by the user and has occurred a processing time generating unit 603, configured to generate a remote procedure call RPC request according to the user request, and a request sending unit 604, configured to send an RPC request to the service processing server, where the RPC request carries the response time constraint information; And causing the service processing server to set an execution priority for the RPC request according to the response time constraint information, and/or allocate an execution resource.
进一步的, 本发明实施例中的信息分配单元 602具体用于: 根据所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信 息为所述用户请求分配响应时间约束信息。 Further, the information distribution unit 602 in the embodiment of the present invention is specifically configured to: allocate response time constraint information to the user request according to the historical value of the response time constraint information and the hardware information of the service processing server.
进一步的, 本发明实施例中的信息分配单元 602包括: 第一分配模块 6021 , 用于若当前的业务处理服务器的硬件性能, 相对于 记录所述响应时间约束信息的历史值时发生了改变,则获取第一处理速度与第 二处理速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到当 前为所述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业务 处理服务器的硬件性能对所述 RPC请求的处理速度,所述第二处理速度为记录 所述响应时间约束信息的历史值时的业务处理服务器的硬件性能对所述 RPC 请求的处理速度; Further, the information distribution unit 602 in the embodiment of the present invention includes: a first allocation module 6021, configured to change, if the hardware performance of the current service processing server is relative to the historical value of the response time constraint information, Obtaining a ratio of the first processing speed to the second processing speed, multiplying the historical value of the response time constraint information by the ratio, and obtaining response time constraint information currently allocated for the user request; the first processing speed Processing speed of the RPC request for the hardware performance of the current service processing server, the second processing speed is processing of the RPC request by the hardware performance of the service processing server when recording the historical value of the response time constraint information Speed
第二分配模块 6022 , 用于若当前的业务处理服务器的硬件性能, 相对于
记录所述响应时间约束信息的历史值时没有发生改变,则将所述响应时间约束 信息的历史值作为当前为所述用户请求分配的响应时间约束信息。 a second allocation module 6022, configured to: if the current service processing server hardware performance, relative to When the historical value of the response time constraint information is recorded, the historical value of the response time constraint information is used as the response time constraint information currently allocated for the user request.
进一步的, 本发明实施例中的请求生成单元 603包括: 参数提取模块 6031 , 用于提取完成所述用户请求所需的业务参数; 逻辑分析模块 6032 , 用于根据预置的业务逻辑确定完成所述用户请求需 要执行的步骤, 根据所述需要执行的步骤确定需要调用的业务处理服务器; 请求生成模块 6033 , 用于分别为所述需要调用的业务处理服务器分配相 应的所述业务参数, 生成与所述业务处理服务器对应的 RPC请求。 Further, the request generating unit 603 in the embodiment of the present invention includes: a parameter extraction module 6031, configured to extract a service parameter required to complete the user request; and a logic analysis module 6032, configured to determine a completion according to the preset service logic. Determining, by the user, the step that needs to be performed, determining, according to the step that needs to be performed, the service processing server that needs to be invoked; the request generating module 6033, configured to respectively allocate the corresponding service parameter to the service processing server that needs to be invoked, and generate and The service processing server corresponds to an RPC request.
进一步的, 本发明实施例中的业务处理服务器还包括: 信息接收单元 605 , 用于接收所述业务处理服务器反馈的响应时间约束信 息; Further, the service processing server in the embodiment of the present invention further includes: an information receiving unit 605, configured to receive response time constraint information fed back by the service processing server;
信息更新单元 606 , 用于使用所述响应时间约束信息更新相应的 RPC请求 的响应时间约束信息。 分配策略选择单元 607 , 用于根据所述响应时间约束信息和紧急分配阔值 选择所述用户请求对应的分配处理策略, 所述分配处理策略包括: 第一分配处 理策略和第二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所 述紧急处理阔值, 则选择执行所述第一分配处理策略, 若所述响应时间约束信 息的约束剩余时间小于或等于所述紧急处理阔值,则选择执行所述第二分配处 理策略, 所述第一分配处理策略的处理复杂度大于所述第二分配处理策略。 本发明实施例中业务分配服务器的各个单元具体的交互过程如下: 用户请求接收单元 601接收用户请求,该用户请求为用户向网络侧提出的 服务需求或应用需求, 该服务需求或应用需求可以包括: 搜索、 在线购物。 在接收到用户请求之后,信息分配单元 602为所述用户请求分配响应时间 约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已 发生处理时间。 可选的, 若当前的业务处理服务器的硬件性能,相对于记录所述响应时间 约束信息的历史值时发生了改变, 则第一分配模块 6021获取第一处理速度与
第二处理速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到 当前为所述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业 务处理服务器的硬件性能对所述 RPC请求的处理速度,所述第二处理速度为记 录所述响应时间约束信息的历史值时的业务处理服务器的硬件性能对所述 RPC请求的处理速度; 若当前的业务处理服务器的硬件性能, 相对于记录所述 响应时间约束信息的历史值时没有发生改变, 则第二分配模块 6022将所述响 应时间约束信息的历史值作为当前为所述用户请求分配的响应时间约束信息。 The information updating unit 606 is configured to update the response time constraint information of the corresponding RPC request by using the response time constraint information. The allocation policy selection unit 607 is configured to select an allocation processing policy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, And if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, the first allocation processing policy is selected to be executed, if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold And executing the second allocation processing policy, where the processing complexity of the first allocation processing policy is greater than the second allocation processing policy. The specific interaction process of each unit of the service distribution server in the embodiment of the present invention is as follows: The user request receiving unit 601 receives a user request, and the user request is a service requirement or an application requirement that the user proposes to the network side, and the service requirement or application requirement may include : Search, shop online. After receiving the user request, the information allocating unit 602 requests the user to request response time constraint information for marking the processing constraint time requested by the user and the processing time that has occurred. Optionally, if the hardware performance of the current service processing server is changed relative to the historical value of the response time constraint information, the first allocation module 6021 obtains the first processing speed and a ratio of the second processing speed, multiplying the historical value of the response time constraint information by the ratio, to obtain response time constraint information currently allocated for the user request; the first processing speed is the current service processing server The processing speed of the RPC request by the hardware performance, the second processing speed is a processing speed of the hardware processing performance of the service processing server to the RPC request when the historical value of the response time constraint information is recorded; if the current service processing The hardware performance of the server is not changed when the historical value of the response time constraint information is recorded, and the second allocation module 6022 uses the historical value of the response time constraint information as the response time constraint currently allocated for the user request. information.
在业务分配服务器为用户请求分配了响应时间约束信息之后,请求生成单 元 603根据该用户请求生成 RPC请求,该 RPC请求中携带有与该用户请求对应 的响应时间约束信息, 该 RPC 请求用于向目标的业务处理服务器请求业务处 理。 具体的, 参数提取模块 6031提取完成所述用户请求所需的业务参数(如 请求类型、 用户标识、 商品标识等); 逻辑分析模块 6032根据预置的业务逻辑 确定完成所述用户请求需要执行的步骤,根据所述需要执行的步骤确定需要调 用的业务处理服务器; 请求生成模块 6033分别为所述需要调用的业务处理服 务器分配相应的所述业务参数, 生成与所述业务处理服务器对应的 RPC请求。 在生成 RPC请求之后 ,请求发送单元 604向业务处理服务器发送 RPC请求, 所述 RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所 述响应时间约束信息为所述 RPC请求设置执行优先级, 和 /或分配执行资源。 信息接收单元 605接收业务处理服务器反馈的响应时间约束信息,并触发 信息更新单元 606使用所述响应时间约束信息更新相应的 RPC请求的响应时间 约束信息。 在更新了响应时间约束信息之后,分配策略选择单元 607根据所述响应时 间约束信息和紧急分配阔值选择所述用户请求对应的分配处理策略,所述分配 处理策略包括: 第一分配处理策略和第二分配处理策略, 若所述响应时间约束 信息的约束剩余时间大于所述紧急处理阔值,则选择执行所述第一分配处理策 略, 若所述响应时间约束信息的约束剩余时间小于或等于所述紧急处理阔值, 则选择执行所述第二分配处理策略,所述第一分配处理策略的处理复杂度大于 所述第二分配处理策略。
所述紧急分配阔值为业务分配服务器选择用户请求的处理策略的判断阔 值, 具体可以为一个时间阔值。 示例性的, 在实际应用中, 所述第一分配处理策略具体可以包括完成用户 请求所必要的业务处理流程,以及可选的用于提升服务质量的数据挖掘、统计、 分析流程内容;所述第二分配处理策略具体可以包括只包含完成用户请求所必 要的业务处理流程内容;由于第一分配处理策略的处理复杂度大于第二分配处 理策略, 因此, 当处理时间紧急(具体通过约束剩余时间小于或等于紧急阔值 体现)时, 业务分配服务器可以选择处理复杂度较小的第二分配处理策略, 以 节省处理时间。 下面对用于执行上述请求处理方法的本发明请求处理系统的实施例进行 说明, 其逻辑结构请参考图 7 , 本发明实施例中的请求处理系统一个实施例包 括: After the service allocation server allocates the response time constraint information to the user request, the request generating unit 603 generates an RPC request according to the user request, where the RPC request carries response time constraint information corresponding to the user request, and the RPC request is used to The target business processing server requests business processing. Specifically, the parameter extraction module 6031 extracts the service parameters (such as the request type, the user identifier, the product identifier, and the like) required to complete the user request; the logic analysis module 6032 determines, according to the preset service logic, that the user request needs to be executed. Steps: determining, according to the step that needs to be performed, a service processing server that needs to be invoked; the request generation module 6033 respectively assigns the corresponding service parameter to the service processing server that needs to be invoked, and generates an RPC request corresponding to the service processing server. . After generating the RPC request, the request sending unit 604 sends an RPC request to the service processing server, where the RPC request carries the response time constraint information; and causes the service processing server to set the RPC request according to the response time constraint information. Execution priorities, and/or allocation of execution resources. The information receiving unit 605 receives the response time constraint information fed back by the service processing server, and the trigger information updating unit 606 updates the response time constraint information of the corresponding RPC request using the response time constraint information. After the response time constraint information is updated, the allocation policy selection unit 607 selects an allocation processing policy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, and the allocation processing policy includes: a first allocation processing policy and And a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, selecting to execute the first allocation processing policy, if the constraint remaining time of the response time constraint information is less than or equal to And performing the second allocation processing policy, where the processing complexity of the first allocation processing policy is greater than the second allocation processing policy. The emergency allocation value is a judgment threshold of the processing policy that the service allocation server selects the user request, and may be a time threshold. Exemplarily, in a practical application, the first allocation processing policy may specifically include a service processing procedure necessary for completing a user request, and optionally data mining, statistics, and analysis process content for improving service quality; The second allocation processing policy may specifically include only the business process flow content necessary for completing the user request; since the processing complexity of the first allocation processing policy is greater than the second allocation processing policy, when the processing time is urgent (specifically, by constraining the remaining time) When the value is less than or equal to the emergency threshold, the service allocation server may choose to process the second allocation processing strategy with less complexity to save processing time. The following describes an embodiment of the request processing system of the present invention for performing the foregoing request processing method. For the logical structure, please refer to FIG. 7. An embodiment of the request processing system in the embodiment of the present invention includes:
业务分配服务器 701和业务处理服务器 702 ; 所述业务分配服务器 701用于接收用户请求;为所述用户请求分配响应时 间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和 已发生处理时间; 根据所述用户请求生成远程过程调用 RPC请求; 向业务处理 服务器发送 RPC请求; 所述 RPC请求携带有所述响应时间约束信息; 所述业务处理服务器 702 用于接收业务分配服务器发送的远程过程调用 RPC请求, 将所述 RPC请求加入服务请求队列; 根据所述服务请求队列中各个 RPC请求的响应时间约束信息设置所述各个 RPC请求的执行优先级, 和 /或分 配所述各个 RPC请求的执行资源。 本发明实施例中的业务分配服务器 701和业务处理服务器 702所执行的具 体步骤可以参阅上述方法实施例, 此处不再赘述。 本发明实施例还提供了一种计算机存储介质, 其中, 该计算机存储介质可 存储有程序,该程序执行时包括上述方法实施例中记载的请求处理方法的部分 或全部步骤。 a service distribution server 701 and a service processing server 702; the service distribution server 701 is configured to receive a user request; to allocate response time constraint information for the user request, the response time constraint information is used to mark a processing constraint time of the user request And processing time has occurred; generating a remote procedure call RPC request according to the user request; sending an RPC request to the service processing server; the RPC request carrying the response time constraint information; the service processing server 702 is configured to receive a service allocation a remote procedure call RPC request sent by the server, adding the RPC request to the service request queue; setting an execution priority of each RPC request according to response time constraint information of each RPC request in the service request queue, and/or an allocation Execution resources for each RPC request. For the specific steps performed by the service distribution server 701 and the service processing server 702 in the embodiment of the present invention, reference may be made to the foregoing method embodiments, and details are not described herein again. The embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium can store a program, and the program includes some or all of the steps of the request processing method described in the foregoing method embodiments.
请参见图 8 , 本发明实施例还提供了一种业务处理服务器, 具体可包括:
接收器 801 , 发送器 802 , 存储器 803和处理器 804 (业务处理服务器中 的处理器的数量可以为一个或多个, 图 8中以一个处理器为例)在本发明的一 些实施例中, 接收器 801 , 发送器 802 , 存储器 803和处理器 804可通过总线 或其它方式连接, 其中, 图 8中以通过总线连接为例。 Referring to FIG. 8, the embodiment of the present invention further provides a service processing server, which may specifically include: Receiver 801, transmitter 802, memory 803 and processor 804 (the number of processors in the service processing server may be one or more, and one processor in FIG. 8 is exemplified). In some embodiments of the present invention, The receiver 801, the transmitter 802, the memory 803, and the processor 804 may be connected by a bus or other means, wherein the bus connection is taken as an example in FIG.
其中, 所述存储器 803可以用于存储如下内容: 所述 RPC请求包括: 响应时间约束信息; 所述响应时间约束信息用于标记 与所述 RPC请求对应的用户请求的处理约束时间和已发生处理时间; 预定义规则: 所述约束剩余时间越少, 则设置的执行优先级越高; 所述约 束剩余时间越少, 则分配的执行资源越多; 若所述处理约束时间的剩余时间小 于所述 RPC请求的预测完成时间,则放弃为所述 RPC请求设置执行优先级和分 配执行资源; 若有两个以上的 RPC请求的约束剩余时间相等, 则获取所述约束 剩余时间与所述处理约束时间的比值,为所述比值小的 RPC请求设置较高的执 行优先级, 和 /或分配较多的执行资源。 The memory 803 may be configured to store the following content: the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and the processing has occurred Pre-defined rule: the less the remaining time of the constraint, the higher the execution priority is set; the less the remaining time of the constraint, the more the execution resources are allocated; if the remaining time of the processing constraint time is less than Determining the execution priority of the RPC request, and then setting the execution priority and the allocation execution resource for the RPC request; if the remaining time of the constraint of the two or more RPC requests is equal, acquiring the constraint remaining time and the processing constraint The ratio of time sets a higher execution priority for the RPC request with a smaller ratio, and/or allocates more execution resources.
以及第一处理策略和第二处理策略的具体内容。 接收器 801用于接收接收业务分配服务器发送的远程过程调用 RPC请求。 发送器 802用于向所述业务分配服务器反馈完成处理的 RPC请求的响应时 间约束信息。 And the specific content of the first processing strategy and the second processing strategy. The receiver 801 is configured to receive a remote procedure call RPC request sent by the receiving service distribution server. The sender 802 is configured to feed back to the service distribution server response time constraint information of the RPC request that is processed.
处理器 804用于执行如下步骤: 在接收器 801接收业务分配服务器发送的远程过程调用 RPC请求之后,将 所述 RPC请求加入服务请求队列;根据所述服务请求队列中各个 RPC请求的响 应时间约束信息设置所述各个 RPC请求的执行优先级,和 /或分配所述各个 RPC 请求的执行资源。 具体的, 可以根据预定义规则进行执行优先级的设置, 和 / 或执行资源的分配。 The processor 804 is configured to: after the receiver 801 receives the remote procedure call RPC request sent by the service allocation server, add the RPC request to the service request queue; according to the response time constraint of each RPC request in the service request queue The information sets an execution priority of the respective RPC requests, and/or allocates execution resources of the respective RPC requests. Specifically, the execution priority setting may be performed according to a predefined rule, and/or the allocation of resources may be performed.
若所述业务处理服务器能够同时处理所述服务请求队列中所有的 RPC请 求,则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间 约束信息分配所述各个 RPC请求的执行资源; If the service processing server is capable of processing all the RPC requests in the service request queue at the same time, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue. ;
若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个
RPC请求, 则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响 应时间约束信息设置所述各个 RPC请求的执行优先级; If the service processing server can only process any one of the service request queues separately The RPC requests, the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue;
若所述业务处理服务器即无法同时处理所述服务请求队列中所有的 RPC 请求,也不是仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述 业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间约束信息 设置所述各个 RPC请求的执行优先级, 并分配所述各个 RPC请求的执行资源。 根据所述响应时间约束信息和紧急阔值选择所述 RPC请求的处理策略,所 述处理策略包括: 第一处理策略和第二处理策略, 若所述响应时间约束信息的 约束剩余时间大于所述紧急阔值, 则选择执行所述第一处理策略, 若所述响应 时间约束信息的约束剩余时间小于或等于所述紧急阔值,则选择执行所述第二 处理策略, 所述第一处理策略的处理复杂度大于所述第二处理策略。 还请参见图 8 ,本发明实施例还提供了一种业务分配服务器,具体可包括: 接收器 801 , 发送器 802 , 存储器 803和处理器 804 (业务分配服务器中 的处理器的数量可以为一个或多个, 图 8中以一个处理器为例)在本发明的一 些实施例中, 接收器 801 , 发送器 802 , 存储器 803和处理器 804可通过总线 或其它方式连接, 其中, 图 8中以通过总线连接为例。 其中, 业务分配服务器的存储器 803可以用于存储如下内容: If the service processing server cannot process all the RPC requests in the service request queue at the same time, or if only one RPC request in the service request queue can be separately processed, the service processing server according to the service request The response time constraint information of each RPC request in the queue sets an execution priority of the respective RPC requests, and allocates execution resources of the respective RPC requests. Determining, according to the response time constraint information and the emergency threshold, a processing policy of the RPC request, where the processing policy includes: a first processing policy and a second processing policy, if the constraint remaining time of the response time constraint information is greater than the And selecting the first processing policy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, selecting to execute the second processing policy, the first processing policy The processing complexity is greater than the second processing strategy. Referring to FIG. 8 , an embodiment of the present invention further provides a service distribution server, which may specifically include: a receiver 801, a transmitter 802, a memory 803, and a processor 804. The number of processors in the service distribution server may be one. Or a plurality of processors in FIG. 8 as an example. In some embodiments of the present invention, the receiver 801, the transmitter 802, the memory 803, and the processor 804 may be connected by a bus or other means, wherein, in FIG. Take the bus connection as an example. The memory 803 of the service distribution server can be used to store the following content:
所述 RPC请求包括: 响应时间约束信息; 所述响应时间约束信息用于标记 与所述 RPC请求对应的用户请求的处理约束时间和已发生处理时间; 所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信息。 业务分配服务器的接收器 801用于接收用户请求,以及接收所述业务处理 服务器反馈的响应时间约束信息。 The RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request and a processing time that has occurred; the historical value of the response time constraint information and the The hardware information of the service processing server. The receiver 801 of the service distribution server is configured to receive a user request and receive response time constraint information fed back by the service processing server.
业务分配服务器的发送器 802用于向业务处理服务器发送 RPC请求。 业务分配服务器的处理器 804用于执行如下步骤: 在接收接收器 801 用户请求之后; 为所述用户请求分配响应时间约束信 息, 根据所述用户请求生成远程过程调用 RPC请求。 The transmitter 802 of the service distribution server is configured to send an RPC request to the service processing server. The processor 804 of the service distribution server is configured to perform the following steps: after receiving the receiver 801 user request; assigning response time constraint information to the user request, and generating a remote procedure call RPC request based on the user request.
进一步的, 在为所述用户请求分配响应时间约束信息时, 若当前的业务处
理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时发生了改 变, 则获取第一处理速度与第二处理速度的比值, 将所述响应时间约束信息的 历史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息; 所 述第一处理速度为当前的业务处理服务器的硬件性能对所述 RPC请求的处理 速度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理 服务器的硬件性能对所述 RPC请求的处理速度;若当前的业务处理服务器的硬 件性能,相对于记录所述响应时间约束信息的历史值时没有发生改变, 则将所 述响应时间约束信息的历史值作为当前为所述用户请求分配的响应时间约束 信息。 进一步的,接收所述业务处理服务器反馈的响应时间约束信息之后,根据 所述响应时间约束信息和紧急分配阔值选择所述用户请求对应的分配处理策 略, 所述分配处理策略包括: 第一分配处理策略和第二分配处理策略, 若所述 响应时间约束信息的约束剩余时间大于所述紧急处理阔值,则选择执行所述第 一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧 急处理阈值, 则选择执行所述第二分配处理策略, 所述第一分配处理策略的处 理复杂度大于所述第二分配处理策略。 Further, when the response time constraint information is allocated for the user request, if the current service department The hardware performance of the server is changed when the historical value of the response time constraint information is recorded, and the ratio of the first processing speed to the second processing speed is obtained, and the historical value of the response time constraint information is multiplied by The ratio is obtained, and the response time constraint information currently allocated for the user request is obtained; the first processing speed is a processing speed of the hardware processing performance of the current service processing server to the RPC request, and the second processing speed is a recording office. Determining the processing speed of the RPC request by the hardware performance of the service processing server when responding to the historical value of the time constraint information; if the hardware performance of the current service processing server does not occur with respect to recording the historical value of the response time constraint information If the change is made, the historical value of the response time constraint information is taken as the response time constraint information currently allocated for the user request. Further, after receiving the response time constraint information fed back by the service processing server, selecting an allocation processing policy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, the allocation processing policy includes: a processing policy and a second allocation processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, selecting to execute the first allocation processing policy, if the constraint time remaining information of the response time constraint information If the threshold is less than or equal to the emergency processing threshold, the second allocation processing policy is selected to be executed, and the processing complexity of the first allocation processing policy is greater than the second allocation processing policy.
在本申请所提供的几个实施例中,应该理解到, 所揭露的装置和方法可以 通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如, 所述单元的划分,仅仅为一种逻辑功能划分, 实际实现时可以有另外的划分方 式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或一些特征可 以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直接耦合或通 信连接可以是通过一些接口 ,装置或单元的间接耦合或通信连接,可以是电性, 机械或其它的形式。 In the several embodiments provided herein, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部 单元来实现本实施例方案的目的。 另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在 ,也可以两个或两个以上单元集成在一个单元
中。上述集成的单元既可以釆用硬件的形式实现, 也可以釆用软件功能单元的 形式实现。 所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发 明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全 部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储 介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器, 或者网络设备等 )执行本发明各个实施例所述方法的全部或部分步骤。 而前述 的存储介质包括: U盘、 移动硬盘、 只读存储器 (ROM, Read-Only Memory ), 随机存取存储器 (RAM, Random Acces s Memory ), 磁碟或者光盘等各种可以存 储程序代码的介质。 The components displayed by the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment. In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. Medium. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM, Random Acces s Memory), a magnetic disk or an optical disk, and the like, which can store program codes. medium.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于 此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应 所述以权利要求的保护范围为准。
The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.
Claims
1、 一种请求处理方法, 其特征在于, 包括: A request processing method, comprising:
业务处理服务器接收业务分配服务器发送的远程过程调用 RPC请求,所述 RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述 RPC 请求对应的用户请求的处理约束时间和已发生处理时间; The service processing server receives a remote procedure call RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint time of the user request corresponding to the RPC request, and Processing time occurred;
所述业务处理服务器将所述 RPC请求加入服务请求队列; The service processing server adds the RPC request to a service request queue;
所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间 约束信息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求 的执行资源。 The service processing server sets an execution priority of the respective RPC requests according to response time constraint information of each RPC request in the service request queue, and/or allocates execution resources of the respective RPC requests.
2、 根据权利要求 1所述的方法, 其特征在于, 2. The method of claim 1 wherein
若所述业务处理服务器能够同时处理所述服务请求队列中所有的 RPC请 求,则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间 约束信息分配所述各个 RPC请求的执行资源; If the service processing server is capable of processing all the RPC requests in the service request queue at the same time, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue. ;
若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响 应时间约束信息设置所述各个 RPC请求的执行优先级; If the service processing server can only process any one of the RPC requests in the service request queue, the service processing server sets the RPC request according to the response time constraint information of each RPC request in the service request queue. Execution priority
若所述业务处理服务器既无法同时处理所述服务请求队列中所有的 RPC 请求,也不是仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述 业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间约束信息 设置各个 RPC请求的执行优先级, 并分配所述各个 RPC请求的执行资源。 If the service processing server cannot process all the RPC requests in the service request queue at the same time, or does not only process any one of the RPC requests in the service request queue, the service processing server according to the service request The response time constraint information of each RPC request in the queue sets the execution priority of each RPC request, and allocates the execution resources of the respective RPC requests.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 当业务处理服务器根 据所述服务请求队列中各个 RPC请求的响应时间约束信息设置所述各个 RPC 请求的执行优先级时,所述根据服务请求队列中各个 RPC请求的响应时间约束 信息设置所述各个 RPC请求的执行优先级, 包括: The method according to claim 1 or 2, wherein, when the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue, Setting the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue, including:
根据所述响应时间约束信息获取所述各个 RPC请求的处理约束时间的约 束剩余时间; Obtaining an constraint remaining time of the processing constraint time of the respective RPC request according to the response time constraint information;
根据预定义规则设置所述各个 RPC请求的执行优先级,所述预定义规则包 括: 所述约束剩余时间越少, 则设置的执行优先级越高。 The execution priority of the respective RPC request is set according to a predefined rule, and the predefined rule includes: the less the remaining time of the constraint, the higher the execution priority of the setting.
4、 根据权利要求 1或 2所述的方法, 其特征在于, 当业务处理服务器根 据所述服务请求队列中各个 RPC请求的响应时间约束信息分配所述各个 RPC
请求的执行资源时,所述根据服务请求队列中各个 RPC请求的响应时间约束信 息分配所述各个 RPC请求的执行资源, 包括: The method according to claim 1 or 2, wherein the service processing server allocates the respective RPCs according to response time constraint information of each RPC request in the service request queue. The execution resources of the respective RPC requests are allocated according to the response time constraint information of each RPC request in the service request queue, including:
根据所述响应时间约束信息获取所述各个 RPC请求的处理约束时间的剩 余时间; Obtaining a remaining time of the processing constraint time of the respective RPC request according to the response time constraint information;
根据预定义规则分配所述各个 RPC 请求的执行资源, 所述预定义规则包 括: 所述约束剩余时间越少, 则分配的执行资源越多。 The execution resources of the respective RPC requests are allocated according to a predefined rule, and the predefined rules include: the fewer the remaining time of the constraint, the more execution resources are allocated.
5、 根据权利要求 3或 4所述的方法, 其特征在于, 所述预定义规则还包 括: 若所述处理约束时间的剩余时间小于所述 RPC请求的预测完成时间, 则放 弃为所述 RPC请求设置执行优先级和分配执行资源。 The method according to claim 3 or 4, wherein the predefined rule further comprises: abandoning the RPC if the remaining time of the processing constraint time is less than a predicted completion time of the RPC request Request to set execution priority and allocate execution resources.
6、 根据权利要求 3或 4所述的方法, 其特征在于, 所述预定义规则还包 括: 若有两个以上的 RPC请求的约束剩余时间相等, 则获取所述约束剩余时间 与所述处理约束时间的比值, 为所述比值小的 RPC请求设置较高的执行优先 级, 和 /或分配较多的执行资源。 The method according to claim 3 or 4, wherein the predefined rule further comprises: if the remaining time of the constraint of the two or more RPC requests is equal, acquiring the remaining time of the constraint and the processing The ratio of constraint times sets a higher execution priority for the RPC request with a smaller ratio and/or allocates more execution resources.
7、 根据权利要求 1至 4任意一项所述的方法, 其特征在于, 所述接收业 务分配服务器发送的远程过程调用 RPC请求之后, 包括: The method according to any one of claims 1 to 4, wherein after the remote procedure call RPC request sent by the receiving service distribution server, the method comprises:
根据所述响应时间约束信息和紧急阔值选择所述 RPC请求的处理策略,所 述处理策略包括: 第一处理策略和第二处理策略, 若所述响应时间约束信息的 约束剩余时间大于所述紧急阔值, 则选择执行所述第一处理策略, 若所述响应 时间约束信息的约束剩余时间小于或等于所述紧急阔值,则选择执行所述第二 处理策略, 所述第一处理策略的处理复杂度大于所述第二处理策略。 Determining, according to the response time constraint information and the emergency threshold, a processing policy of the RPC request, where the processing policy includes: a first processing policy and a second processing policy, if the constraint remaining time of the response time constraint information is greater than the And selecting the first processing policy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, selecting to execute the second processing policy, the first processing policy The processing complexity is greater than the second processing strategy.
8、 根据权利要求 1至 4任意一项所述的方法, 其特征在于, 所述根据服 务请求队列中各个 RPC请求的响应时间约束信息设置所述各个 RPC请求的执行 优先级, 和 /或分配所述各个 RPC请求的执行资源之后, 包括: The method according to any one of claims 1 to 4, wherein the setting of the execution priority of each RPC request according to response time constraint information of each RPC request in the service request queue, and/or allocation After the execution resources of the respective RPC requests, the method includes:
所述业务处理服务器对优先级最高的 RPC请求进行处理, 记录所述 RPC 请求的处理时间, 并根据所述处理时间更新所述 RPC 请求的响应时间约束信 息; The service processing server processes the highest priority RPC request, records the processing time of the RPC request, and updates the response time constraint information of the RPC request according to the processing time;
所述业务处理服务器向所述业务分配服务器反馈完成处理的 RPC 请求的 响应时间约束信息。 The service processing server feeds back to the service distribution server feedback response time constraint information of the RPC request that is processed.
9、 一种请求处理方法, 其特征在于, 包括: 9. A request processing method, comprising:
业务分配服务器接收用户请求;
所述业务分配服务器为所述用户请求分配响应时间约束信息,所述响应时 间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间; The service distribution server receives the user request; The service distribution server allocates response time constraint information to the user request, where the response time constraint information is used to mark a processing constraint time requested by the user and a processing time that has occurred;
所述业务分配服务器根据所述用户请求生成远程过程调用 RPC请求; 所述业务分配服务器向业务处理服务器发送 RPC请求,所述 RPC请求携带 有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信 息为所述 RPC请求设置执行优先级, 和 /或分配执行资源。 The service distribution server generates a remote procedure call RPC request according to the user request; the service distribution server sends an RPC request to the service processing server, where the RPC request carries the response time constraint information; The response time constraint information sets an execution priority for the RPC request, and/or allocates an execution resource.
10、 根据权利要求 9所述的方法, 其特征在于, 所述分配所述用户请求的 响应时间约束信息, 包括: The method according to claim 9, wherein the allocating response time constraint information of the user request comprises:
根据所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信 息为所述用户请求分配响应时间约束信息。 And assigning response time constraint information to the user request according to the historical value of the response time constraint information and the hardware information of the service processing server.
11、 根据权利要求 10所述的方法, 其特征在于, 11. The method of claim 10, wherein
若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息 的历史值时发生了改变,则所述根据响应时间约束信息的历史值以及所述业务 处理服务器的硬件信息为所述用户请求分配响应时间约束信息, 包括: If the hardware performance of the current service processing server changes with respect to the historical value of the response time constraint information, the historical value according to the response time constraint information and the hardware information of the service processing server are The user requests to allocate response time constraint information, including:
获取第一处理速度与第二处理速度的比值,将所述响应时间约束信息的历 史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息; 所述 第一处理速度为当前的业务处理服务器的硬件性能对所述 RPC 请求的处理速 度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理服 务器的硬件性能对所述 RPC请求的处理速度; Obtaining a ratio of the first processing speed to the second processing speed, multiplying the historical value of the response time constraint information by the ratio, and obtaining response time constraint information currently allocated for the user request; the first processing speed is The processing speed of the hardware processing performance of the current service processing server to the RPC request, and the second processing speed is the processing speed of the hardware processing performance of the service processing server to the RPC request when the historical value of the response time constraint information is recorded. ;
若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息 的历史值时没有发生改变,则所述根据响应时间约束信息的历史值以及所述业 务处理服务器的硬件信息为所述用户请求分配响应时间约束信息, 包括: 将所述响应时间约束信息的历史值作为当前为所述用户请求分配的响应 时间约束信息。 If the hardware performance of the current service processing server does not change with respect to the historical value of the response time constraint information, the historical value according to the response time constraint information and the hardware information of the service processing server are The user requesting the allocation of the response time constraint information includes: using the historical value of the response time constraint information as the response time constraint information currently allocated for the user request.
12、 根据权利要求 9至 11任意一项所述的方法, 其特征在于, 所述根据 用户请求生成远程过程调用 RPC请求, 包括: The method according to any one of claims 9 to 11, wherein the generating a remote procedure call RPC request according to a user request comprises:
提取完成所述用户请求所需的业务参数; Extracting business parameters required to complete the user request;
根据预置的业务逻辑确定完成所述用户请求需要执行的步骤 ,根据所述需 要执行的步骤确定需要调用的业务处理服务器; Determining, according to preset business logic, a step required to complete the user request, and determining a service processing server to be invoked according to the step to be performed;
分别为所述需要调用的业务处理服务器分配相应的所述业务参数,生成与
所述业务处理服务器对应的 RPC请求。 Allocating corresponding service parameters to the service processing server that needs to be invoked, respectively, generating and The service processing server corresponds to an RPC request.
1 3、 根据权利要求 9至 1 1任意一项所述的方法, 其特征在于, 所述向业 务处理服务器发送 RPC请求之后, 包括: The method according to any one of claims 9 to 11, wherein after the sending the RPC request to the service processing server, the method includes:
接收所述业务处理服务器反馈的响应时间约束信息; Receiving response time constraint information fed back by the service processing server;
使用所述响应时间约束信息更新相应的 RPC请求的响应时间约束信息。 The response time constraint information of the corresponding RPC request is updated using the response time constraint information.
14、 根据权利要求 1 3所述的方法, 其特征在于, 所述接收所述业务处理 服务器反馈的响应时间约束信息之后, 包括: The method according to claim 13, wherein, after receiving the response time constraint information fed back by the service processing server, the method includes:
根据所述响应时间约束信息和紧急分配阔值选择所述用户请求对应的分 配处理策略,所述分配处理策略包括:第一分配处理策略和第二分配处理策略, 若所述响应时间约束信息的约束剩余时间大于所述紧急处理阔值,则选择执行 所述第一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于 所述紧急处理阈值, 则选择执行所述第二分配处理策略, 所述第一分配处理策 略的处理复杂度大于所述第二分配处理策略。 And selecting, according to the response time constraint information and the emergency allocation threshold, an allocation processing policy corresponding to the user request, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, if the response time constraint information is If the constraint remaining time is greater than the emergency processing threshold, the first allocation processing policy is selected to be executed, and if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold, then the second allocation is selected to be performed. The processing strategy, the processing complexity of the first allocation processing policy is greater than the second allocation processing policy.
15、 一种业务处理服务器, 其特征在于, 包括: 15. A service processing server, comprising:
请求接收单元, 用于接收业务分配服务器发送的远程过程调用 RPC请求, 所述 RPC请求包括: 响应时间约束信息; 所述响应时间约束信息用于标记与所 述 RPC请求对应的用户请求的处理约束时间和已发生处理时间; a request receiving unit, configured to receive a remote procedure call RPC request sent by the service allocation server, where the RPC request includes: response time constraint information; the response time constraint information is used to mark a processing constraint of the user request corresponding to the RPC request Time and processing time has occurred;
存储单元, 用于将所述 RPC请求加入服务请求队列; a storage unit, configured to add the RPC request to a service request queue;
设置单元,用于根据所述服务请求队列中各个 RPC请求的响应时间约束信 息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求的执行 资源。 And a setting unit, configured to set an execution priority of the respective RPC request according to response time constraint information of each RPC request in the service request queue, and/or allocate an execution resource of the respective RPC request.
16、 根据权利要求 15所述的业务处理服务器, 其特征在于, 所述设置单 元具体用于: The service processing server according to claim 15, wherein the setting unit is specifically configured to:
若所述业务处理服务器能够同时处理所述服务请求队列中所有的 RPC请 求,则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间 约束信息分配所述各个 RPC请求的执行资源; If the service processing server is capable of processing all the RPC requests in the service request queue at the same time, the service processing server allocates the execution resources of the respective RPC requests according to the response time constraint information of each RPC request in the service request queue. ;
若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述业务处理服务器根据所述服务请求队列中各个 RPC请求的响 应时间约束信息设置所述各个 RPC请求的执行优先级; If the service processing server can only process any one of the RPC requests in the service request queue, the service processing server sets the RPC request according to the response time constraint information of each RPC request in the service request queue. Execution priority
若所述业务处理服务器即无法同时处理所述服务请求队列中所有的 RPC
请求,也不是仅能单独处理所述服务请求队列中的任意一个 RPC请求, 则所述 业务处理服务器根据所述服务请求队列中各个 RPC请求的响应时间约束信息 设置所述各个 RPC请求的执行优先级, 并分配所述各个 RPC请求的执行资源。 If the service processing server cannot simultaneously process all RPCs in the service request queue The request is not only able to separately process any one of the RPC requests in the service request queue, and the service processing server sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue. Level, and allocate the execution resources of the respective RPC requests.
17、 根据权利要求 15或 16所述的业务处理服务器, 其特征在于, 所述设 置单元包括: The service processing server according to claim 15 or 16, wherein the setting unit comprises:
资源分配模块,用于根据所述响应时间约束信息获取所述各个 RPC请求的 处理约束时间的约束剩余时间;根据预定义规则设置所述各个 RPC请求的执行 优先级, 所述预定义规则包括: 所述约束剩余时间越少, 则设置的执行优先级 越高; a resource allocation module, configured to acquire a constraint remaining time of the processing constraint time of each RPC request according to the response time constraint information; and set an execution priority of each RPC request according to a predefined rule, where the predefined rule includes: The less the constraint remaining time, the higher the execution priority of the setting;
优先级设置模块,用于根据所述响应时间约束信息获取所述各个 RPC请求 的处理约束时间的剩余时间;根据预定义规则分配所述各个 RPC请求的执行资 源, 所述预定义规则包括: 所述约束剩余时间越少, 则分配的执行资源越多。 a priority setting module, configured to acquire, according to the response time constraint information, a remaining time of the processing constraint time of the respective RPC request; and the execution resource of each RPC request is allocated according to a predefined rule, where the predefined rule includes: The less constraint remaining time, the more execution resources are allocated.
18、根据权利要求 15至 17任意一项所述的业务处理服务器,其特征在于, 所述业务处理服务器还包括: The service processing server according to any one of claims 15 to 17, wherein the service processing server further comprises:
处理策略选择单元,用于根据所述响应时间约束信息和紧急阔值选择所述 a processing policy selection unit, configured to select according to the response time constraint information and the emergency threshold value
RPC请求的处理策略, 所述处理策略包括: 第一处理策略和第二处理策略, 若 所述响应时间约束信息的约束剩余时间大于所述紧急阔值,则选择执行所述第 一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急阔 值, 则选择执行所述第二处理策略, 所述第一处理策略的处理复杂度大于所述 第二处理策略。 The processing policy of the RPC request, the processing policy includes: a first processing policy and a second processing policy, if the constraint remaining time of the response time constraint information is greater than the emergency threshold, selecting to execute the first processing policy, And if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, the second processing policy is selected to be executed, and the processing complexity of the first processing policy is greater than the second processing policy.
19、根据权利要求 15至 17任意一项所述的业务处理服务器,其特征在于, 所述业务处理服务器还包括: The service processing server according to any one of claims 15 to 17, wherein the service processing server further comprises:
请求处理单元, 用于对优先级最高的 RPC请求进行处理, 记录所述 RPC 请求的处理时间, 并根据所述处理时间更新所述 RPC 请求的响应时间约束信 息; a request processing unit, configured to process the RPC request with the highest priority, record the processing time of the RPC request, and update the response time constraint information of the RPC request according to the processing time;
信息反馈单元,用于向所述业务分配服务器反馈完成处理的 RPC请求的响 应时间约束信息。 And an information feedback unit, configured to feed back, to the service distribution server, response time constraint information of the RPC request that is processed.
20、 一种业务分配服务器, 其特征在于, 包括: 20. A service distribution server, comprising:
用户请求接收单元, 用于接收用户请求; a user request receiving unit, configured to receive a user request;
信息分配单元, 用于为所述用户请求分配响应时间约束信息, 所述响应时
间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间; 请求生成单元, 用于根据所述用户请求生成远程过程调用 RPC请求; 请求发送单元, 用于向业务处理服务器发送 RPC请求, 所述 RPC请求携带 有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信 息为所述 RPC请求设置执行优先级, 和 /或分配执行资源。 An information distribution unit, configured to allocate response time constraint information to the user request, where the response time The inter-constraint information is used to mark the processing constraint time of the user request and the processing time has occurred; the request generating unit is configured to generate a remote procedure call RPC request according to the user request; and the request sending unit is configured to send the RPC to the service processing server Requesting, the RPC request carries the response time constraint information; causing the service processing server to set an execution priority for the RPC request according to the response time constraint information, and/or allocate an execution resource.
21、 根据权利要求 20所述的业务分配服务器, 其特征在于, 所述信息分 配单元具体用于: The service distribution server according to claim 20, wherein the information distribution unit is specifically configured to:
根据所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信 息为所述用户请求分配响应时间约束信息。 And assigning response time constraint information to the user request according to the historical value of the response time constraint information and the hardware information of the service processing server.
22、 根据权利要求 21所述的业务分配服务器, 其特征在于, 信息分配单 元包括: 22. The service distribution server according to claim 21, wherein the information distribution unit comprises:
第一分配模块, 用于若当前的业务处理服务器的硬件性能,相对于记录所 述响应时间约束信息的历史值时发生了改变,则获取第一处理速度与第二处理 速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到当前为所 述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业务处理服 务器的硬件性能对所述 RPC请求的处理速度,所述第二处理速度为记录所述响 应时间约束信息的历史值时的业务处理服务器的硬件性能对所述 RPC请求的 处理速度; a first allocation module, configured to: if a hardware performance of the current service processing server is changed relative to a historical value of the response time constraint information, obtain a ratio of the first processing speed to the second processing speed, The historical value of the response time constraint information is multiplied by the ratio to obtain response time constraint information currently allocated for the user request; the first processing speed is processing of the RPC request by the hardware performance of the current service processing server. Speed, the second processing speed is a processing speed of the hardware processing performance of the service processing server to the RPC request when the historical value of the response time constraint information is recorded;
第二分配模块, 用于若当前的业务处理服务器的硬件性能,相对于记录所 述响应时间约束信息的历史值时没有发生改变,则将所述响应时间约束信息的 历史值作为当前为所述用户请求分配的响应时间约束信息。 a second allocation module, configured to: if the hardware performance of the current service processing server is not changed when the historical value of the response time constraint information is recorded, the historical value of the response time constraint information is used as the current The response time constraint information requested by the user.
23、根据权利要求 20至 22任意一项所述的业务分配服务器,其特征在于, 所述请求生成单元包括: The service distribution server according to any one of claims 20 to 22, wherein the request generating unit comprises:
参数提取模块, 用于提取完成所述用户请求所需的业务参数; a parameter extraction module, configured to extract a service parameter required to complete the user request;
逻辑分析模块,用于根据预置的业务逻辑确定完成所述用户请求需要执行 的步骤, 根据所述需要执行的步骤确定需要调用的业务处理服务器; a logic analysis module, configured to determine, according to the preset service logic, a step that needs to be performed to complete the user request, and determine, according to the step that needs to be performed, a service processing server that needs to be invoked;
请求生成模块,用于分别为所述需要调用的业务处理服务器分配相应的所 述业务参数, 生成与所述业务处理服务器对应的 RPC请求。 And a request generating module, configured to respectively allocate a corresponding service parameter to the service processing server that needs to be invoked, and generate an RPC request corresponding to the service processing server.
24、根据权利要求 20至 22任意一项所述的业务分配服务器,其特征在于, 所述业务处理服务器还包括:
信息接收单元, 用于接收所述业务处理服务器反馈的响应时间约束信息; 信息更新单元,用于使用所述响应时间约束信息更新相应的 RPC请求的响 应时间约束信息。 The service distribution server according to any one of claims 20 to 22, wherein the service processing server further comprises: An information receiving unit, configured to receive response time constraint information fed back by the service processing server; and an information updating unit, configured to update response time constraint information of the corresponding RPC request by using the response time constraint information.
25、 根据权利要求 24所述的业务分配服务器, 其特征在于, 所述业务分 配服务器还包括: The service distribution server according to claim 24, wherein the service distribution server further comprises:
分配策略选择单元,用于根据所述响应时间约束信息和紧急分配阔值选择 所述用户请求对应的分配处理策略, 所述分配处理策略包括: 第一分配处理策 略和第二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧 急处理阔值, 则选择执行所述第一分配处理策略, 若所述响应时间约束信息的 约束剩余时间小于或等于所述紧急处理阔值,则选择执行所述第二分配处理策 略, 所述第一分配处理策略的处理复杂度大于所述第二分配处理策略。 The allocation policy selection unit is configured to select an allocation processing policy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, where the allocation processing policy includes: a first allocation processing policy and a second allocation processing policy, if If the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, the first allocation processing policy is selected to be executed, and if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold, Then, the second allocation processing policy is selected to be executed, and the processing complexity of the first allocation processing policy is greater than the second allocation processing policy.
26、 一种请求处理系统, 其特征在于, 包括: 26. A request processing system, comprising:
业务分配服务器和业务处理服务器; Service distribution server and business processing server;
所述业务分配服务器用于接收用户请求;为所述用户请求分配响应时间约 束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发 生处理时间; 根据所述用户请求生成远程过程调用 RPC请求; 向业务处理服务 器发送 RPC请求; 所述 RPC请求携带有所述响应时间约束信息; The service distribution server is configured to receive a user request, and allocate response time constraint information for the user request, where the response time constraint information is used to mark a processing constraint time of the user request and a processing time that has occurred; Generating a remote procedure call RPC request; sending an RPC request to the service processing server; the RPC request carrying the response time constraint information;
所述业务处理服务器用于接收业务分配服务器发送的远程过程调用 RPC请求, 将所述 RPC请求加入服务请求队列;根据所述服务请求队列中各个 RPC请求的 响应时间约束信息设置所述各个 RPC请求的执行优先级, 和 /或分配所述各个 RPC请求的执行资源。
The service processing server is configured to receive a remote procedure call RPC request sent by the service distribution server, add the RPC request to the service request queue, and set the RPC request according to the response time constraint information of each RPC request in the service request queue. Execution priority, and/or allocation of execution resources for the respective RPC requests.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310228246.X | 2013-06-08 | ||
CN201310228246.XA CN104243405B (en) | 2013-06-08 | 2013-06-08 | A kind of request processing method, apparatus and system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014194869A1 true WO2014194869A1 (en) | 2014-12-11 |
Family
ID=52007588
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/079489 WO2014194869A1 (en) | 2013-06-08 | 2014-06-09 | Request processing method, device and system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104243405B (en) |
WO (1) | WO2014194869A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017028724A1 (en) * | 2015-08-19 | 2017-02-23 | 阿里巴巴集团控股有限公司 | Service request adjustment method and device |
CN106790092A (en) * | 2016-12-23 | 2017-05-31 | 北京奇艺世纪科技有限公司 | Remote procedure call services end control system and method |
CN109660612A (en) * | 2018-12-11 | 2019-04-19 | 北京潘达互娱科技有限公司 | A kind of request processing method and server |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106612241B (en) * | 2015-10-27 | 2020-02-21 | 中国移动通信集团浙江有限公司 | Service control method and device |
CN108475240A (en) * | 2016-01-13 | 2018-08-31 | 慧与发展有限责任合伙企业 | The input/output request of reconstruct |
CN107172656B (en) | 2016-03-07 | 2021-01-22 | 京东方科技集团股份有限公司 | Non-blocking request processing method and device |
CN108023908B (en) * | 2016-10-31 | 2020-04-24 | 腾讯科技(深圳)有限公司 | Data updating method, device and system |
CN106789726B (en) * | 2016-12-20 | 2019-09-10 | 兴唐通信科技有限公司 | A kind of high concurrent service resource allocation method based on service priority |
CN106775990A (en) * | 2016-12-31 | 2017-05-31 | 中国移动通信集团江苏有限公司 | Request scheduling method and device |
CN109391589B (en) * | 2017-08-04 | 2021-06-29 | 北京国双科技有限公司 | Request processing method and device |
CN109391588B (en) * | 2017-08-04 | 2021-03-12 | 北京国双科技有限公司 | Request processing method and device |
US11196843B2 (en) | 2018-09-04 | 2021-12-07 | International Business Machines Corporation | Application data access priority for remote storage systems |
CN110012053B (en) * | 2018-12-25 | 2021-07-20 | 创新先进技术有限公司 | System calling method, device and equipment under SOA system architecture and SOA system architecture |
CN109840144B (en) * | 2018-12-28 | 2023-09-19 | 航天信息股份有限公司 | Information service scheduling method and system for cross-mechanism batch service request |
CN118733254A (en) * | 2019-04-11 | 2024-10-01 | 华为技术有限公司 | Task processing method, device, terminal and computer readable storage medium |
CN111245822B (en) * | 2020-01-08 | 2023-03-14 | 北京小米松果电子有限公司 | Remote procedure call processing method and device and computer storage medium |
CN116708297B (en) * | 2023-05-31 | 2024-06-11 | 杭州复恒科技有限公司 | Cross-platform server flow resource adjusting method, system and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101471869A (en) * | 2007-12-27 | 2009-07-01 | 华为技术有限公司 | Method, system and device for processing session |
CN102316154A (en) * | 2010-06-22 | 2012-01-11 | 微软公司 | Optimization is to the visit based on the resource of federation infrastructure |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6067580A (en) * | 1997-03-11 | 2000-05-23 | International Business Machines Corporation | Integrating distributed computing environment remote procedure calls with an advisory work load manager |
US8490105B2 (en) * | 2009-08-17 | 2013-07-16 | Sybase, Inc. | Pluggable component interface |
CN101795289B (en) * | 2009-12-30 | 2013-01-23 | 华为技术有限公司 | Method, device and system for remote procedure call control |
-
2013
- 2013-06-08 CN CN201310228246.XA patent/CN104243405B/en active Active
-
2014
- 2014-06-09 WO PCT/CN2014/079489 patent/WO2014194869A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101471869A (en) * | 2007-12-27 | 2009-07-01 | 华为技术有限公司 | Method, system and device for processing session |
CN102316154A (en) * | 2010-06-22 | 2012-01-11 | 微软公司 | Optimization is to the visit based on the resource of federation infrastructure |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017028724A1 (en) * | 2015-08-19 | 2017-02-23 | 阿里巴巴集团控股有限公司 | Service request adjustment method and device |
CN106470169A (en) * | 2015-08-19 | 2017-03-01 | 阿里巴巴集团控股有限公司 | A kind of service request method of adjustment and equipment |
CN106790092A (en) * | 2016-12-23 | 2017-05-31 | 北京奇艺世纪科技有限公司 | Remote procedure call services end control system and method |
CN109660612A (en) * | 2018-12-11 | 2019-04-19 | 北京潘达互娱科技有限公司 | A kind of request processing method and server |
Also Published As
Publication number | Publication date |
---|---|
CN104243405B (en) | 2017-09-29 |
CN104243405A (en) | 2014-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014194869A1 (en) | Request processing method, device and system | |
US10838890B2 (en) | Acceleration resource processing method and apparatus, and network functions virtualization system | |
EP3637733B1 (en) | Load balancing engine, client, distributed computing system, and load balancing method | |
US20190324819A1 (en) | Distributed-system task assignment method and apparatus | |
EP3313023B1 (en) | Life cycle management method and apparatus | |
US10764132B2 (en) | Scale-out association method and apparatus, and system | |
WO2020258920A1 (en) | Network slice resource management method and apparatus | |
WO2018059222A1 (en) | File slice uploading method and apparatus, and cloud storage system | |
JP6563936B2 (en) | Method, system, and computer-readable medium for cloud-based virtual orchestrator | |
CN110383764B (en) | System and method for processing events using historical data in a serverless system | |
US9998531B2 (en) | Computer-based, balanced provisioning and optimization of data transfer resources for products and services | |
JP2018198068A (en) | Profile-based sla guarantees under workload migration in distributed cloud | |
US10848366B2 (en) | Network function management method, management unit, and system | |
US11838384B2 (en) | Intelligent scheduling apparatus and method | |
WO2019052225A1 (en) | Open platform control method and system, computer device, and storage medium | |
JP7079998B1 (en) | Cluster capacity expansion method and equipment | |
JPWO2018220708A1 (en) | Resource allocation system, management device, method and program | |
US9059941B1 (en) | Providing router information according to a programmatic interface | |
US10884880B2 (en) | Method for transmitting request message and apparatus | |
US20180026855A1 (en) | Network management system, device, and method | |
WO2013082742A1 (en) | Resource scheduling method, device and system | |
US8725868B2 (en) | Interactive service management | |
CN105430028B (en) | Service calling method, providing method and node | |
US20180013860A1 (en) | Method and apparatus for determining to-be-uploaded nsd | |
AT&T |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14807679 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 14807679 Country of ref document: EP Kind code of ref document: A1 |