CN104243405B - A kind of request processing method, apparatus and system - Google Patents
A kind of request processing method, apparatus and system Download PDFInfo
- Publication number
- CN104243405B CN104243405B CN201310228246.XA CN201310228246A CN104243405B CN 104243405 B CN104243405 B CN 104243405B CN 201310228246 A CN201310228246 A CN 201310228246A CN 104243405 B CN104243405 B CN 104243405B
- Authority
- CN
- China
- Prior art keywords
- request
- processing
- response time
- service
- rpc
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
Abstract
Description
技术领域technical field
本发明涉及通信领域,尤其涉及一种请求处理方法、装置及系统。The present invention relates to the communication field, in particular to a request processing method, device and system.
背景技术Background technique
互联网应用如电子邮件、搜索、网络购物、社交网络、在线视频、网络地图等,已经成为人们生活的一部分。这些应用往往要为上亿用户服务,意味着互联网应用已变成一种社会公共服务,而支撑拥有海量用户互联网应用的数据中心也成为社会核心基础设施。Internet applications such as e-mail, search, online shopping, social networking, online video, and web maps have become a part of people's lives. These applications often serve hundreds of millions of users, which means that Internet applications have become a social public service, and data centers that support Internet applications with a large number of users have also become the core infrastructure of society.
活跃用户数与用户访问量是影响互联网公司营收的主要因素,快速的服务响应时间是让用户满意、留住用户的关键。互联网公司一般都采用免费服务吸引用户,所以响应时间是衡量服务质量(Quality of Service,QoS)的关键指标。由于互联网应用需要同时为上亿用户提供服务,所以出于性能与扩展性的考虑,它们大都采用分布式的方式实现,将一个应用分解为许多服务部署在多个业务处理服务器上,因此一个用户的请求最终会被分配到多个不同的业务处理服务器上进行处理。顺序/依赖模式一种典型的服务聚合模式,在这种模式下,上一阶段服务的输出是下一阶段服务的输入,相邻两个阶段的服务具有依赖关系。The number of active users and the number of user visits are the main factors affecting the revenue of Internet companies. Fast service response time is the key to satisfying and retaining users. Internet companies generally use free services to attract users, so response time is a key indicator for measuring service quality (Quality of Service, QoS). Since Internet applications need to provide services for hundreds of millions of users at the same time, most of them are implemented in a distributed manner for the sake of performance and scalability. An application is decomposed into many services and deployed on multiple business processing servers. Therefore, a user The requests will eventually be assigned to multiple different business processing servers for processing. Sequence/dependency mode is a typical service aggregation mode. In this mode, the output of the service in the previous stage is the input of the service in the next stage, and the services in the two adjacent 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 stage will continue to fluctuate. At the same time, in order to pursue low-cost goals, Internet companies usually use resource The sharing method improves the utilization rate of resources. While reducing costs, this kind of sharing will also cause mutual interference between applications and aggravate the fluctuation of application response time. What's more serious is that the response time delay of the service in the previous stage in the business processing server may be further amplified in the service processing process of the next stage. In the sequential/dependent service aggregation mode, the response time delay of each level The time will be superimposed step by step, causing a large delay in the response time of the end user request. This delay in response time can seriously affect the quality of service of many delay-sensitive applications (such as search, online shopping, etc.).
在现有技术中,技术人员在部署共享应用之前,对大量的现有应用进行预分析和测试,选择相互干扰最小的应用进行混合部署,从而降低应用之间的相互干扰对响应时间的影响,尽可能的避免响应时间的延时。In the existing technology, before deploying shared applications, technicians pre-analyze and test a large number of existing applications, and select the applications with the least mutual interference for mixed deployment, thereby reducing the impact of mutual interference between applications on response time. Avoid delays in response time as much as possible.
但是,这种现有技术在部署前需要对大量的现有应用进行预分析和测试,操作难度较大,并且,由于现有应用的种类繁多和不确定性,就算在部署前对应用进行分析,也只能降低部分应用之间的相互干扰,很多应用之间还是存在较大的干扰,避免响应时间延时的效果不佳。However, this existing technology needs to pre-analyze and test a large number of existing applications before deployment, which is difficult to operate. Moreover, due to the variety and uncertainty of existing applications, even if the applications are analyzed before deployment , It can only reduce the mutual interference between some applications, and there is still a lot of interference between many applications, and the effect of avoiding response time delay is not good.
发明内容Contents of the invention
本发明实施例提供了一种请求处理方法,用于根据请求的处理时间动态地调整请求的执行优先级和资源分配。The embodiment of the present invention provides a request processing method, which is used to dynamically adjust the execution priority and resource allocation of the request according to the processing time of the request.
本发明实施例第一方面提供的请求处理方法,包括:The request processing method provided in the first aspect of the embodiment of the present invention includes:
业务处理服务器接收业务分配服务器发送的远程过程调用RPC请求,所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间;所述业务处理服务器将所述RPC请求加入服务请求队列;所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。The service processing server receives the remote procedure call RPC request sent by the service distribution server, and the RPC request includes: response time constraint information; the response time constraint information is used to mark the processing constraint time of the user request corresponding to the RPC request and the completed processing time occurs; the business processing server adds the RPC request to the service request queue; the business 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, And/or allocate execution resources for each RPC request.
在第一方面的第一种可能实现的方法中,In a first possible implementation of the first aspect,
若所述业务处理服务器能够同时处理所述服务请求队列中所有的RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源;If the business processing server can process all the RPC requests in the service request queue at the same time, the business processing server allocates execution resources for each RPC request according to the response time constraint information of each RPC request in the service request queue ;
若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级;If the business processing server can only process any RPC request in the service request queue independently, then the business processing server sets the time limit of each 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 business processing server can neither 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 independently, then the service processing server 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 each RPC request.
结合第一方面或第一方面的第一种实现方法,在第一方面的第二种可能实现的方法中,当业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级时,所述根据服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,包括:In combination with the first aspect or the first implementation method of the first aspect, in the second possible implementation method of the first aspect, when the business processing server sets the response time constraint information of 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请求的执行优先级,所述预定义规则包括:所述约束剩余时间越少,则设置的执行优先级越高。Obtain the constraint remaining time of the processing constraint time of each RPC request according to the response time constraint information; set the execution priority of each RPC request according to a predefined rule, and the predefined rule includes: the longer the constraint remaining time The less, the higher the execution priority is set.
结合第一方面或第一方面的第一种实现方法,在第一方面的第三种可能实现的方法中,当业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源时,所述根据服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源,包括:In combination with the first aspect or the first implementation method of the first aspect, in the third possible implementation method of the first aspect, when the business processing server allocates all RPC requests according to the response time constraint information of each RPC request in the service request queue When describing the execution resources of each RPC request, the allocation of the execution resources of each RPC request according to the response time constraint information of each RPC request in the service request queue includes:
根据所述响应时间约束信息获取所述各个RPC请求的处理约束时间的剩余时间;根据预定义规则分配所述各个RPC请求的执行资源,所述预定义规则包括:所述约束剩余时间越少,则分配的执行资源越多。Obtain the remaining time of the processing constraint time of each RPC request according to the response time constraint information; allocate the execution resources of each RPC request according to a predefined rule, the predefined rule includes: the less the remaining time of the constraint, The more execution resources are allocated.
结合第一方面的第二种或第一方面的第三种实现方法,在第一方面的第四种可能实现的方法中,所述预定义规则还包括:若所述处理约束时间的剩余时间小于所述RPC请求的预测完成时间,则放弃为所述RPC请求设置执行优先级和分配执行资源。In combination with the second implementation method of the first aspect or the third implementation method of the first aspect, in the fourth possible implementation method of the first aspect, the predefined rule further includes: if the remaining time of the processing constraint time If it is less than the predicted completion time of the RPC request, setting the execution priority and allocating execution resources for the RPC request is abandoned.
结合第一方面的第二种或第一方面的第三种实现方法,在第一方面的第五种可能实现的方法中,所述预定义规则还包括:若有两个以上的RPC请求的约束剩余时间相等,则获取所述约束剩余时间与所述处理约束时间的比值,为所述比值小的RPC请求设置较高的执行优先级,和/或分配较多的执行资源。In combination with the second implementation method of the first aspect or the third implementation method of the first aspect, in the fifth possible implementation method of the first aspect, the predefined rules further include: if there are more than two RPC requests If the constraint remaining time is equal, then obtain the ratio of the constraint remaining time to the processing constraint time, set a higher execution priority for the RPC request with a smaller ratio, and/or allocate more execution resources.
结合第一方面或第一方面的第一至三任意一种实现方法,在第一方面的第六种可能实现的方法中,所述接收业务分配服务器发送的远程过程调用RPC请求之后,包括:In combination with the first aspect or any one of the first to third implementation methods of the first aspect, in the sixth possible implementation method of the first aspect, after receiving the remote procedure call RPC request sent by the service distribution server, it includes:
根据所述响应时间约束信息和紧急阈值选择所述RPC请求的处理策略,所述处理策略包括:第一处理策略和第二处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急阈值,则选择执行所述第一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急阈值,则选择执行所述第二处理策略,所述第一处理策略的处理复杂度大于所述第二处理策略。Select a processing strategy for the RPC request according to the response time constraint information and an emergency threshold, the processing strategy includes: a first processing strategy and a second processing strategy, if the constraint remaining time of the response time constraint information is greater than the emergency threshold, select to execute the first processing strategy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, then select to execute the second processing strategy, the processing of the first processing strategy is complex degrees greater than the second processing strategy.
结合第一方面或第一方面的第一至三任意一种实现方法,在第一方面的第七种可能实现的方法中,所述根据服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源之后,包括:In combination with the first aspect or any one of the first to third implementation methods of the first aspect, in the seventh possible implementation method of the first aspect, the setting of the response time constraint information of each RPC request in the service request queue After the execution priority of each RPC request, and/or after allocating the execution resources of each RPC request, include:
所述业务处理服务器对优先级最高的RPC请求进行处理,记录所述RPC请求的处理时间,并根据所述处理时间更新所述RPC请求的响应时间约束信息;所述业务处理服务器向所述业务分配服务器反馈完成处理的RPC请求的响应时间约束信息。The business 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 allocation server feeds back the response time constraint information of the completed RPC request.
本发明实施例第二方面提供的请求处理方法,包括:The request processing method provided by the second aspect of the embodiment of the present invention includes:
业务分配服务器接收用户请求;所述业务分配服务器为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间;所述业务分配服务器根据所述用户请求生成远程过程调用RPC请求;所述业务分配服务器向业务处理服务器发送RPC请求,所述RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为所述RPC请求设置执行优先级,和/或分配执行资源。The service allocation server receives the user request; the service allocation server allocates response time constraint information for the user request, and the response time constraint information is used to mark the processing constraint time and the processing time of the user request; the service allocation The server generates a remote procedure call RPC request according to the user request; the service allocation server sends an RPC request to the service processing server, and the RPC request carries the response time constraint information; so that the service processing server according to the response time The constraint information sets execution priority for the RPC request, and/or allocates execution resources.
在第二方面的第一种可能实现的方法中,所述分配所述用户请求的响应时间约束信息,包括:In the first possible implementation method of the second aspect, the allocating the response time constraint information of the user request includes:
根据所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信息为所述用户请求分配响应时间约束信息。Allocating 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.
结合第二方面的第一种可能实现的方法,在第二方面的第二种可能实现的方法中,若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时发生了改变,则所述根据响应时间约束信息的历史值以及所述业务处理服务器的硬件信息为所述用户请求分配响应时间约束信息,包括:In combination with the first possible implementation method of the second aspect, in the second possible implementation method of the second aspect, if the current hardware performance of the business processing server is different from the historical value recorded for the response time constraint information If there is a change, the allocation of 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 business processing server includes:
获取第一处理速度与第二处理速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业务处理服务器的硬件性能对所述RPC请求的处理速度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理服务器的硬件性能对所述RPC请求的处理速度;Obtain the ratio of the first processing speed to the second processing speed, multiply the historical value of the response time constraint information by the ratio, and obtain the response time constraint information currently assigned to the user request; the first processing speed is The processing speed of the hardware performance of the current business processing server for the RPC request, the second processing speed is the processing speed of the hardware performance of the business processing server for the RPC request when recording the historical value of the response time constraint information ;
若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时没有发生改变,则所述根据响应时间约束信息的历史值以及所述业务处理服务器的硬件信息为所述用户请求分配响应时间约束信息,包括:If the hardware performance of the current service processing server has not changed compared with the historical value of the response time constraint information recorded, then the historical value according to the response time constraint information and the hardware information of the service processing server are the User request allocation response time constraint information, including:
将所述响应时间约束信息的历史值作为当前为所述用户请求分配的响应时间约束信息。The historical value of the response time constraint information is used as the response time constraint information currently assigned to the user request.
结合第二方面或第二方面的第一至二任意一种实现方法,在第二方面的第三种可能实现的方法中,所述根据用户请求生成远程过程调用RPC请求,包括:In combination with the second aspect or any one of the first to second implementation methods of the second aspect, in the third possible implementation method of the second aspect, the generating a remote procedure call RPC request according to a user request includes:
提取完成所述用户请求所需的业务参数;根据预置的业务逻辑确定完成所述用户请求需要执行的步骤,根据所述需要执行的步骤确定需要调用的业务处理服务器;分别为所述需要调用的业务处理服务器分配相应的所述业务参数,生成与所述业务处理服务器对应的RPC请求。Extracting the business parameters needed to complete the user request; determining the steps to be executed to complete the user request according to the preset business logic, and determining the business processing server to be called according to the steps to be executed; The service processing server assigns the corresponding service parameters, and generates an RPC request corresponding to the service processing server.
结合第二方面或第二方面的第一至二任意一种实现方法,在第二方面的第四种可能实现的方法中,所述向业务处理服务器发送RPC请求之后,包括:In combination with the second aspect or any one of the first to second implementation methods of the second aspect, in the fourth possible implementation method of the second aspect, after sending the RPC request to the business processing server, it includes:
接收所述业务处理服务器反馈的响应时间约束信息;使用所述响应时间约束信息更新相应的RPC请求的响应时间约束信息。Receiving the response time constraint information fed back by the business processing server; using the response time constraint information to update the response time constraint information of the corresponding RPC request.
结合第二方面的第四种实现方法,在第二方面的第五种可能实现的方法中,所述接收所述业务处理服务器反馈的响应时间约束信息之后,包括:With reference to the fourth implementation method of the second aspect, in the fifth possible implementation method of the second aspect, after receiving the response time constraint information fed back by the business processing server, include:
根据所述响应时间约束信息和紧急分配阈值选择所述用户请求对应的分配处理策略,所述分配处理策略包括:第一分配处理策略和第二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急处理阈值,则选择执行所述第一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急处理阈值,则选择执行所述第二分配处理策略,所述第一分配处理策略的处理复杂度大于所述第二分配处理策略。Select the allocation processing strategy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, the allocation processing strategy includes: a first allocation processing strategy and a second allocation processing strategy, if the response time constraint information is constrained If the remaining time is greater than the emergency processing threshold, the first allocation processing strategy 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, the second allocation processing strategy is selected to be executed , the processing complexity of the first allocation processing policy is greater than that of the second allocation processing policy.
本发明实施例第三方面提供的业务处理服务器,包括:The service processing server provided by the third aspect of the embodiment of the present invention includes:
请求接收单元,用于接收业务分配服务器发送的远程过程调用RPC请求,所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间;存储单元,用于将所述RPC请求加入服务请求队列;设置单元,用于根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。A request receiving unit, configured to receive a remote procedure call (RPC) request sent by a service distribution server, the RPC request including: response time constraint information; the response time constraint information is used to mark a processing constraint of a user request corresponding to the RPC request time and the processing time that has occurred; a storage unit for adding the RPC request to a service request queue; a setting unit for setting the execution of each RPC request according to the response time constraint information of each RPC request in the service request queue Priority, and/or allocation of execution resources for each RPC request.
本发明实施例第四方面提供的业务处理服务器,包括:The service processing server provided by the fourth aspect of the embodiment of the present invention includes:
用户请求接收单元,用于接收用户请求;信息分配单元,用于为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间;请求生成单元,用于根据所述用户请求生成远程过程调用RPC请求;请求发送单元,用于向业务处理服务器发送RPC请求,所述RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为所述RPC请求设置执行优先级,和/或分配执行资源。A user request receiving unit, configured to receive a user request; an information allocation unit, configured to assign response time constraint information to 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 a request generation unit, configured to generate a remote procedure call (RPC) request according to the user request; a request sending unit, configured to send an RPC request to a service processing server, the RPC request carrying the response time constraint information; making the service The processing server sets an execution priority for the RPC request according to the response time constraint information, and/or allocates execution resources.
本发明实施例第五方面提供的业务处理服务器,包括:The service processing server provided by the fifth aspect of the embodiment of the present invention includes:
业务分配服务器和业务处理服务器;Business distribution server and business processing server;
所述业务分配服务器用于接收用户请求;为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间;根据所述用户请求生成远程过程调用RPC请求;向业务处理服务器发送RPC请求;所述RPC请求携带有所述响应时间约束信息;The service allocation server is used to receive user requests; allocate response time constraint information for the user requests, and the response time constraint information is used to mark the processing constraint time and the processing time of the user request; according to the user request Generate a remote procedure call RPC request; send the RPC request to the business processing server; the RPC request carries the response time constraint information;
所述业务处理服务器用于接收业务分配服务器发送的远程过程调用RPC请求,将所述RPC请求加入服务请求队列;根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。The service processing server is used to receive the remote procedure call RPC request sent by the service distribution server, add the RPC request to the service request queue; set the RPC request according to the response time constraint information of each RPC request in the service request queue the execution priority of each RPC request, and/or allocate execution resources for each RPC request.
从以上技术方案可以看出,本发明实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:
在本发明实施例中,业务处理服务器接收的远程过程调用(Remote ProcedureCall,RPC)请求中携带有响应时间约束信息,该响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间,使得业务处理服务器在处理RPC请求之前,可以根据服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行优先级和/或执行资源,从而使得时间紧急的RPC请求可以得到优先处理。In the embodiment of the present invention, the remote procedure call (Remote Procedure Call, RPC) request received by the business processing server carries response time constraint information, and the response time constraint information is used to mark the processing constraint of the user request corresponding to the RPC request time and the processing time that has occurred, so that before processing the RPC request, the business processing server can allocate the execution priority and/or execution resource of each RPC request in the service request queue according to the response time constraint information of each RPC request, so that the time Urgent RPC requests can be prioritized.
附图说明Description of drawings
图1是本发明实施例请求处理方法的一个流程示意图;FIG. 1 is a schematic flowchart of a request processing method according to an embodiment of the present invention;
图2是本发明实施例请求处理方法的另一个流程示意图;FIG. 2 is another schematic flowchart of a request processing method according to an embodiment of the present invention;
图3是本发明实施例请求处理方法的另一个流程示意图;FIG. 3 is another schematic flowchart of a request processing method according to an embodiment of the present invention;
图4是本发明实施例请求处理方法的另一个流程示意图;FIG. 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 business processing server according to an embodiment of the present invention;
图6是本发明实施例业务分配服务器的一个结构示意图;FIG. 6 is a schematic structural diagram of a service distribution server according to an embodiment of the present invention;
图7是本发明实施例请求处理系统的一个结构示意图;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
本发明实施例提供了一种请求处理方法,用于根据请求的处理时间动态地调整请求的执行优先级和资源分配。The embodiment of the present invention provides a request processing method, which is used to dynamically adjust the execution priority and resource allocation of the request according to the processing time of the request.
请参阅图1,本发明实施例中请求处理方法的一个实施例包括:Referring to Fig. 1, an embodiment of the request processing method in the embodiment of the present invention includes:
101、业务处理服务器接收业务分配服务器发送的RPC请求;101. The service processing server receives the RPC request sent by the service distribution server;
业务处理服务器接收业务分配服务器发送的RPC请求,所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间。The service processing server receives the RPC request sent by the service distribution server, and the RPC request includes: response time constraint information; 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 .
示例性的,在获取到该响应时间约束信息之后,可以将该响应时间约束信息存储在业务处理服务器的线程局部存储器(Thread Local Storage,TLS)。Exemplarily, after the response time constraint information is acquired, the response time constraint information may be stored in a thread local storage (Thread Local Storage, TLS) of the service processing server.
在实际应用中,业务分配服务器会接收用户发送的用户请求,并为该用户请求分配一个响应时间约束信息,该响应时间约束信息包括有一个与该用户请求的应用或服务相对应的处理约束时间,用于限定所述用户请求在整个处理过程中的最大响应时间(即该用户请求需在处理约束时间内处理完成),还有一个初始状态为零的已发生处理时间,用于统计该用户请求在各个业务处理服务器的处理阶段一共产生的处理时间。In practical applications, the service allocation server will receive the user request sent by the user, and assign a response time constraint information to the user request, the response time constraint information includes a processing constraint time corresponding to the application or service requested by the user , which is used to limit the maximum response time of the user request in the entire processing process (that is, the user request needs to be processed within the processing constraint time), and there is also an occurred processing time with an initial state of zero, which is used to count the user The total processing time of the request in the processing stages of each business processing server.
在业务分配服务器为用户请求分配了响应时间约束信息之后,业务分配服务器根据该用户请求生成RPC请求,并向目标的业务处理服务器(即与RPC请求所请求的应用或服务相对应的业务处理服务器)发送该RPC请求,该RPC请求中携带有与该用户请求对应的响应时间约束信息,该RPC请求用于向目标的业务处理服务器请求业务处理。在实际应用中,完成一个用户请求可能需要分多个阶段进行处理,其中,业务分配服务器会为每个阶段生成一个RPC请求,各个RPC请求会依次发送到相应的业务分配服务器进行处理,同时,每个阶段的RPC请求都会携带当前的响应时间约束信息,每完成一个RPC请求,响应时间约束信息就会被更新一次,当前的响应时间约束信息同时反映了该用户请求的处理约束时间,以及之前各个阶段一共产生的处理时间。After the service allocation server allocates the response time constraint information for the user request, the service allocation server generates an RPC request according to the user request, and sends a request to the target service processing server (that is, the service processing server corresponding to the application or service requested by the RPC request) ) to send 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 practical applications, completing a user request may need to be processed in multiple stages. Among them, the service distribution server will generate an RPC request for each stage, and each RPC request will be sent to the corresponding service distribution server in turn for processing. At the same time, The RPC request at each stage will carry the current response time constraint information. Every time an RPC request is completed, the response time constraint information will be updated once. The current response time constraint information also reflects the processing constraint time of the user request, and the previous Total processing time incurred by each stage.
可选的,由于处理约束时间与已发生处理时间的差值等于处理约束时间的处理剩余时间,所述已发生处理时间这个参数也可以用处理约束时间的处理剩余时间代替,参数之间显而易见的替换不应理解为对本发明的限定。Optionally, since the difference between the processing constraint time and the processed processing time that has occurred is equal to the processing remaining time of the processing constraint time, the parameter of the processed processing time that has occurred can also be replaced by the processing remaining time of the processing constraint time, and the parameters are obvious Substitutions should not be construed as limiting the invention.
102、业务处理服务器将所述RPC请求加入服务请求队列;102. The business processing server adds the RPC request to a service request queue;
业务处理服务器将所述RPC请求加入服务请求队列,所述服务请求队列用于存储不同的RPC请求。The service processing server adds the RPC request to a service request queue, and the service request queue is used to store different RPC requests.
在实际应用中,为了降低运营的成本,提高资源利用率,一个业务处理服务器中的资源可能会被多个业务分配服务器共享利用,因此,业务处理服务器在同一时间很可能需要处理多个RPC请求,而这些RPC请求会被加入到服务请求队列中等待分配处理。In practical applications, in order to reduce operating costs and improve resource utilization, the resources in one business processing server may be shared and utilized by multiple business distribution servers. Therefore, the business 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.
103、业务处理服务器为RPC请求分配执行优先级和/或执行资源。103. The service processing server allocates an execution priority and/or execution resource to the RPC request.
业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。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, and/or allocates the execution resources of each RPC request.
可选的,分配所述各个RPC请求的执行资源可以包括:调整线程的中央处理器(Central Processing Unit,CPU)调度优先级,调整线程的输入/输出(I/O)优先级等。Optionally, allocating execution resources for each RPC request may include: adjusting a central processing unit (Central Processing Unit, CPU) scheduling priority of a thread, adjusting an input/output (I/O) priority of a thread, and the like.
在本发明实施例中,业务处理服务器接收的RPC请求中携带有响应时间约束信息,该响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间,使得业务处理服务器在处理RPC请求之前,可以根据服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行优先级和/或执行资源,从而使得时间紧急的RPC请求可以得到优先处理。In the embodiment of the present invention, the RPC request received by the business processing server carries response time constraint information, and 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 Before processing the RPC request, the business processing server can allocate the execution priority and/or execution resources of each RPC request according to the response time constraint information of each RPC request in the service request queue, so that the time-critical RPC requests can be processed first .
在实际应用中,业务处理服务器根据响应时间约束信息的调控可以有多种策略,请参阅图2,本发明实施例中请求处理方法的另一个实施例包括:In practical applications, the business processing server can have multiple strategies for regulation and control according to 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请求;201. The service processing server receives the RPC request sent by the service distribution server;
业务处理服务器接收业务分配服务器发送的远程过程调用RPC请求,所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间。The service processing server receives the remote procedure call RPC request sent by the service distribution server, and the RPC request includes: response time constraint information; the response time constraint information is used to mark the processing constraint time of the user request corresponding to the RPC request and the completed Processing time occurs.
202、业务处理服务器根据所述响应时间约束信息和紧急阈值选择所述RPC请求的处理策略;202. The service processing server selects a processing strategy for the RPC request according to the response time constraint information and the emergency threshold;
业务处理服务器根据所述响应时间约束信息和紧急阈值选择所述RPC请求的处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急阈值,则选择执行所述第一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急阈值,则选择执行所述第二处理策略,所述处理策略包括:第一处理策略和第二处理策略,所述第一处理策略的处理复杂度大于所述第二处理策略。The business processing server selects a processing strategy for the RPC request according to the response time constraint information and the emergency threshold, and if the remaining constraint time of the response time constraint information is greater than the emergency threshold, selects and executes the first processing strategy, if If the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, the second processing strategy is selected to be executed, and the processing strategy includes: a first processing strategy and a second processing strategy, and the first processing strategy The processing complexity of is greater than that of the second processing strategy.
所述紧急阈值为业务处理服务器选择RPC请求的处理策略的判断阈值,具体可以为一个时间阈值。The emergency threshold is a judgment threshold for the service processing server to select a processing strategy for the RPC request, and may specifically be a time threshold.
示例性的,在实际应用中,所述第一处理策略具体可以包括根据用户的请求通过数据挖掘分析的方式推荐用户可能关心的内容;所述第二处理策略具体可以包括直接向用户推荐当前关注度高的内容;由于第一处理策略的处理复杂度大于第二处理策略,因此,当处理时间紧急(具体通过约束剩余时间小于或等于紧急阈值体现)时,业务处理服务器可以选择处理复杂度较小的第二处理策略,以节省处理时间。Exemplarily, in an actual application, the first processing strategy may specifically include recommending content that the user may care about through data mining and analysis according to the user's request; the second processing strategy may specifically include directly recommending to the user the currently concerned content high-degree content; because the processing complexity of the first processing strategy is greater than that of the second processing strategy, when the processing time is urgent (specifically reflected by the remaining time of the constraint being less than or equal to the emergency threshold), the business processing server can choose a higher processing complexity Small second processing strategy to save processing time.
可以理解的是,所述第一处理策略和第二处理策略所表示的仅是处理复杂度不同的两类策略,不特指任意两个策略,并且,第一处理策略可以表示处理复杂度相同或相似的两个以上的处理策略,第二处理策略也可以表示处理复杂度相同或相似的两个以上的处理策略。It can be understood that the first processing strategy and the second processing strategy represent only two types of strategies with different processing complexities, not specifically any two strategies, and the first processing strategy may represent the same processing complexity 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 business processing server may also set multi-level emergency thresholds to respectively correspond to processing strategies of various types of complexity, which is not specifically limited here.
203、业务处理服务器将所述RPC请求加入服务请求队列;203. The service processing server adds the RPC request to a service request queue;
业务处理服务器将所述RPC请求加入服务请求队列,所述服务请求队列用于存储不同的RPC请求。The service processing server adds the RPC request to a service request queue, and the service request queue is used to store different RPC requests.
在实际应用中,为了降低运营的成本,提高资源利用率,一个业务处理服务器中的资源可能会被多个业务分配服务器共享利用,因此,业务处理服务器在同一时间很可能需要处理多个RPC请求,而这些RPC请求会被加入到服务请求队列中等待分配处理。In practical applications, in order to reduce operating costs and improve resource utilization, the resources in one business processing server may be shared and utilized by multiple business distribution servers. Therefore, the business 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.
可以理解的是,本发明实施例在实际应用中,步骤202和步骤203没有严格的先后关系,即也可以执行“将所述RPC请求加入服务请求队列”,再执行“根据所述响应时间约束信息和紧急阈值选择所述RPC请求的处理策略”。It can be understood that, in the actual application of this embodiment of the present invention, there is no strict sequence relationship between step 202 and step 203, that is, "add the RPC request to the service request queue" can also be executed, and then "according to the response time constraint information and urgency thresholds to select a processing strategy for said RPC request".
204、业务处理服务器为RPC请求分配执行优先级和/或执行资源;204. The business processing server assigns execution priority and/or execution resources to the RPC request;
业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。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, and/or allocates the execution resources of each RPC request.
可选的,分配执行优先级和/或执行资源可以通过在操作系统或超级管理程序(Hypervisor)调整不同请求处理线程的资源使用量的方案,如调整线程的CPU调度优先级、调整线程的I/O优先级等;也可以通过支持优先级的硬件对请求处理线程的执行优先级进行调整,如,在CPU的高速缓存存储器、内存控制器或系统总线上根据响应时间约束信息所确定的优先级对各处理线程所使用的硬件资源进行分配。Optionally, the assignment of execution priority and/or execution resources can be performed by adjusting the resource usage of different request processing threads in the operating system or hypervisor (Hypervisor), such as adjusting the CPU scheduling priority of the thread, adjusting the I of the thread /O priority, etc.; the execution priority of the request processing thread can also be adjusted through hardware that supports priority, such as the priority determined according to the response time constraint information on the CPU's cache memory, memory controller or system bus The level allocates the hardware resources used by each processing thread.
在实际应用中,业务处理服务器在处理RPC请求之前,会根据设备自身的处理能力,以及服务请求队列中RPC请求的数量和类型,确定RPC请求的处理方式;若所述业务处理服务器能够同时处理所述服务请求队列中所有的RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源;若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级;若所述业务处理服务器即无法同时处理所述服务请求队列中所有的RPC请求,也不仅能单独处理所述服务请求队列中的任意一个RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,并分配所述各个RPC请求的执行资源。In practical applications, before the business processing server processes the RPC request, it will determine the processing method of the RPC request according to the processing capability of the device itself, and the number and type of RPC requests in the service request queue; if the business processing server can simultaneously process For all RPC requests in the service request queue, the service processing server allocates execution resources for each RPC request according to the response time constraint information of each RPC request in the service request queue; if the service processing server can only Process any RPC request in the service request queue separately, then 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 processing server cannot process all RPC requests in the service request queue at the same time, and can not only process any RPC request in the service request queue separately, then the business processing server The response time constraint information sets the execution priority of each RPC request, and allocates the execution resources of each RPC request.
进一步的,当业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级时,业务处理服务器可以根据所述响应时间约束信息获取所述各个RPC请求的处理约束时间的约束剩余时间;再根据预定义规则设置所述各个RPC请求的执行优先级,所述预定义规则包括:所述约束剩余时间越少,则设置的执行优先级越高。Further, when the business 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 business processing server can obtain the RPC request according to the response time constraint information. The constraint remaining time of the request processing constraint time; then set the execution priority of each RPC request according to the predefined rules, the predefined rules include: the less the constraint remaining time, the higher the execution priority set.
当业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源时,业务处理服务器可以根据所述响应时间约束信息获取所述各个RPC请求的处理约束时间的剩余时间;根据预定义规则分配所述各个RPC请求的执行资源,所述预定义规则包括:所述约束剩余时间越少,则分配的执行资源越多。When the business processing server allocates execution resources of each RPC request according to the response time constraint information of each RPC request in the service request queue, the business processing server may acquire the processing constraints of each RPC request according to the response time constraint information The remaining time of the time: allocate the execution resources of each RPC request according to a predefined rule, and the predefined rule includes: the less the remaining time of the constraint, the more execution resources are allocated.
再进一步的,当业务处理服务器获取到各个RPC请求的约束剩余时间之后,若发现有两个以上的RPC请求的约束剩余时间相等,则获取所述约束剩余时间与所述处理约束时间的比值,为所述比值小的RPC请求设置较高的执行优先级,和/或分配较多的执行资源。Still further, after the business processing server obtains the remaining time of the constraint of each RPC request, if it is found that the remaining time of the constraint of two or more RPC requests is equal, then the ratio of the remaining time of the constraint to the processing constraint time is obtained, Set a higher execution priority for the RPC request with a smaller ratio, and/or allocate more execution resources.
再进一步的,当业务处理服务器获取到处理约束时间的约束剩余时间之后,可以先对该约束剩余时间进行判断,若所述处理约束时间的剩余时间小于所述RPC请求的预测完成时间,则放弃为所述RPC请求设置执行优先级和分配执行资源,以节省业务处理服务器的处理资源;可选的,此时的业务处理服务器可以选择向业务分配服务器发送请求失败响应,业务分配服务器向用户反馈该用户请求的处理失败,使得重新发送业务请求。Still further, after the business processing server obtains the constraint remaining time of the processing constraint time, it may first judge the constraint remaining time, and if the remaining time of the processing constraint time is less than the predicted completion time of the RPC request, then give up Setting the execution priority and allocating execution resources for the RPC request, so as to save the processing resources of the business processing server; optionally, the business processing server at this time may choose to send a request failure response to the business distribution server, and the business distribution server feeds back to the user The processing of the user request fails, so that the service request is resent.
在实际应用中,业务处理服务器可以获知用户请求在各个处理阶段的最小处理时间(可以由业务分配服务器告知),当前的业务处理服务器将所述用户请求的剩余各个处理阶段的最小处理时间相加,即可得到所述预测完成时间。In practical applications, the business processing server can know the minimum processing time of the user request in each processing stage (it can be notified by the service distribution server), and the current service processing server adds the minimum processing time of the remaining processing stages of the user request , the predicted completion time can be obtained.
205、业务处理服务器向所述业务分配服务器反馈完成处理的RPC请求的响应时间约束信息。205. The service processing server feeds back the response time constraint information of the processed RPC request to the service distribution server.
在完成执行优先级的设置和/或执行资源的分配之后,业务处理服务器对优先级最高的RPC请求进行处理,记录所述RPC请求的处理时间,并根据所述处理时间更新所述RPC请求的响应时间约束信息(即将所述处理时间加上响应时间约束信息中的已发生处理时间,得到更新后的已发生处理时间)。After completing the setting of the execution priority and/or the allocation of execution resources, the business processing server processes the RPC request with the highest priority, records the processing time of the RPC request, and updates the RPC request according to the processing time Response time constraint information (that is, adding the processing time to the processing time that has occurred in the response time constraint information to obtain the updated processing time that has occurred).
业务处理服务器向所述业务分配服务器反馈完成处理的RPC请求的响应时间约束信息(即更新后的响应时间约束信息),使得业务分配服务器更新相应用户请求的响应时间约束信息。The service processing server feeds back the response time constraint information (that is, the updated response time constraint information) of the processed RPC request to the service distribution server, so that the service distribution server updates the response time constraint information of the corresponding user request.
上面是从业务处理服务器的角度对本发明实施例中的请求处理方法进行了描述,下面从业务分配服务器侧对本发明实施例中的请求处理方法进行描述,请参阅图3,本发明实施例中的请求处理方法另一实施例包括:The above is a description of the request processing method in the embodiment of the present invention from the perspective of the service processing server, and the following describes the request processing method in the embodiment of the present invention from the side of the service distribution server. Please refer to FIG. 3 , the request processing method in the embodiment of the present invention Another embodiment of the request processing method includes:
301、业务分配服务器接收用户请求;301. The service distribution server receives a user request;
业务分配服务器接收用户请求,该用户请求为用户向网络侧提出的服务需求或应用需求,该服务需求或应用需求可以包括:搜索、在线购物等。The service allocation server receives a user request, which is a service requirement or an application requirement put forward by the user to the network side, and the service requirement or application requirement may include: search, online shopping, and the like.
302、业务分配服务器为所述用户请求分配响应时间约束信息;302. The service allocation server allocates response time constraint information for the user request;
业务分配服务器为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间。The service allocation server allocates response time constraint information for the user request, and the response time constraint information is used to mark the processing constraint time and the processing time of the user request.
示例性的,该响应时间约束信息可以存储在业务分配服务器的TLS。Exemplarily, the response time constraint information may 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, which is used to limit the maximum response time of the user request in the entire processing process (that is, the user request must be processed within the constraint time processing completed), and an elapsed processing time whose initial state is zero, which is used to count the total processing time of the user request in the processing stages of each business processing server.
可选的,该响应时间约束信息可以由管理员根据不同用户请求的服务或应用类型进行设置,当完成初始化设置后,业务分配服务器可以根据相应用户请求的响应时间约束信息的历史值自动进行分配。Optionally, the response time constraint information can be set by the administrator according to the service or application type requested by different users. After the initialization setting is completed, the service allocation server can automatically allocate according to the historical value of the response time constraint information requested by the corresponding user .
303、业务分配服务器根据所述用户请求生成RPC请求;303. The service allocation server generates an RPC request according to the user request;
在业务分配服务器为用户请求分配了响应时间约束信息之后,业务分配服务器根据该用户请求生成RPC请求,该RPC请求中携带有与该用户请求对应的响应时间约束信息,该RPC请求用于向目标的业务处理服务器请求业务处理。在实际应用中,完成一个用户请求可能需要分多个阶段进行处理,其中,业务分配服务器会为每个阶段生成一个RPC请求,各个RPC请求会依次发送到相应的业务分配服务器进行处理,同时,每个阶段的RPC请求都会携带当前的响应时间约束信息,每完成一个RPC请求,响应时间约束信息就会被更新一次,当前的响应时间约束信息同时反映了该用户请求的处理约束时间,以及之前各个阶段一共产生的处理时间。After the service allocation server allocates the response time constraint information for the user request, the service allocation server generates an RPC request according to the user request, and the RPC request carries the response time constraint information corresponding to the user request. The business processing server requests business processing. In practical applications, completing a user request may need to be processed in multiple stages. Among them, the service distribution server will generate an RPC request for each stage, and each RPC request will be sent to the corresponding service distribution server in turn for processing. At the same time, The RPC request at each stage will carry the current response time constraint information. Every time an RPC request is completed, the response time constraint information will be updated once. The current response time constraint information also reflects the processing constraint time of the user request, and the previous Total processing time incurred by each stage.
304、业务分配服务器向业务处理服务器发送RPC请求。304. The service allocation server sends an RPC request to the service processing server.
业务分配服务器向业务处理服务器发送RPC请求,所述RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为所述RPC请求设置执行优先级,和/或分配执行资源。The service allocation server sends an RPC request to the service processing server, the RPC request carrying the response time constraint information; making the service processing server set an execution priority for the RPC request according to the response time constraint information, and/or Allocate execution resources.
在本发明实施例中,业务分配服务器向业务处理服务器发送的RPC请求中携带有响应时间约束信息,该响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间,使得业务处理服务器在处理RPC请求之前,可以根据服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行优先级和/或执行资源,从而使得时间紧急的RPC请求可以得到优先处理。In the embodiment of the present invention, the RPC request sent by the service distribution server to the service processing server carries response time constraint information, and the response time constraint information is used to mark the processing constraint time and the processing time of the user request, so that the business Before processing the RPC request, the processing server may allocate the execution priority and/or execution resources of each RPC request according to the response time constraint information of each RPC request in the service request queue, so that time-critical RPC requests can be processed first.
下面对业务分配服务器执行请求处理方法再进行详细描述,请参阅图4,本发明实施例中的请求处理方法另一实施例包括:Next, the service allocation server execution request processing method will be described in detail again. Please refer to FIG. 4. Another embodiment of the request processing method in the embodiment of the present invention includes:
401、业务分配服务器接收用户请求;401. The service allocation server receives a user request;
业务分配服务器接收用户请求,该用户请求为用户向网络侧提出的服务需求或应用需求,该服务需求或应用需求可以包括:搜索、在线购物等。The service allocation server receives a user request, which is a service requirement or an application requirement put forward by the user to the network side, and the service requirement or application requirement may include: search, online shopping, and the like.
402、业务分配服务器为所述用户请求分配响应时间约束信息;402. The service allocation server allocates response time constraint information for the user request;
业务分配服务器为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间;The service allocation 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 includes a processing constraint time corresponding to the application or service requested by the user, which is used to limit the maximum response time of the user request in the entire processing process (that is, the user request must be processed within the constraint time processing completed), and an elapsed processing time whose initial state is zero, which is used to count the total processing time of the user request in the processing stages of each business processing server.
可选的,该响应时间约束信息可以由管理员根据不同用户请求的服务或应用类型进行设置,当完成初始化设置后,业务分配服务器可以根据相应用户请求的响应时间约束信息的历史值自动进行分配。Optionally, the response time constraint information can be set by the administrator according to the service or application type requested by different users. After the initialization setting is completed, the service allocation server can automatically allocate according to the historical value of the response time constraint information requested by the corresponding user .
可选的,业务分配服务器可以根据所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信息为所述用户请求分配响应时间约束信息;具体的,若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时发生了改变,则获取第一处理速度与第二处理速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业务处理服务器的硬件性能对所述RPC请求的处理速度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理服务器的硬件性能对所述RPC请求的处理速度;若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时没有发生改变,则将所述响应时间约束信息的历史值作为当前为所述用户请求分配的响应时间约束信息。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 hardware performance , when the historical value of the response time constraint information is changed, then 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 to obtain the current The response time constraint information allocated for the user request; the first processing speed is the processing speed of the RPC request by the hardware performance of the current business processing server, and the second processing speed is recording the response time constraint information The hardware performance of the business processing server at the historical value of the processing speed of the RPC request; if the hardware performance of the current business processing server has not changed compared with the historical value of the response time constraint information, then the all The historical value of the response time constraint information is used as the response time constraint information currently assigned to the user request.
403、业务分配服务器根据所述用户请求生成RPC请求;403. The service allocation server generates an RPC request according to the user request;
在业务分配服务器为用户请求分配了响应时间约束信息之后,业务分配服务器根据该用户请求生成RPC请求,该RPC请求中携带有与该用户请求对应的响应时间约束信息,该RPC请求用于向目标的业务处理服务器请求业务处理。在实际应用中,完成一个用户请求可能需要分多个阶段进行处理,其中,业务分配服务器会为每个阶段生成一个RPC请求,各个RPC请求会依次发送到相应的业务分配服务器进行处理,同时,每个阶段的RPC请求都会携带当前的响应时间约束信息,每完成一个RPC请求,响应时间约束信息就会被更新一次,当前的响应时间约束信息同时反映了该用户请求的处理约束时间,以及之前各个阶段一共产生的处理时间。After the service allocation server allocates the response time constraint information for the user request, the service allocation server generates an RPC request according to the user request, and the RPC request carries the response time constraint information corresponding to the user request. The business processing server requests business processing. In practical applications, completing a user request may need to be processed in multiple stages. Among them, the service distribution server will generate an RPC request for each stage, and each RPC request will be sent to the corresponding service distribution server in turn for processing. At the same time, The RPC request at each stage will carry the current response time constraint information. Every time an RPC request is completed, the response time constraint information will be updated once. The current response time constraint information also reflects the processing constraint time of the user request, and the previous Total processing time incurred by each stage.
示例性的,RPC请求生成方法可以为:提取完成所述用户请求所需的业务参数(如请求类型、用户标识、商品标识等);根据预置的业务逻辑确定完成所述用户请求需要执行的步骤,根据所述需要执行的步骤确定需要调用的业务处理服务器;分别为所述需要调用的业务处理服务器分配相应的所述业务参数,生成与所述业务处理服务器对应的RPC请求。Exemplarily, the method for generating an RPC request may be: extracting the business parameters required to complete the user request (such as request type, user ID, product ID, etc.); step, determining the business processing server to be called according to the steps to be executed; assigning corresponding business parameters to the business processing server to be called, and generating an RPC request corresponding to the business processing server.
404、业务分配服务器向业务处理服务器发送RPC请求;404. The service allocation server sends an RPC request to the service processing server;
业务分配服务器向业务处理服务器发送RPC请求,所述RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为所述RPC请求设置执行优先级,和/或分配执行资源。The service allocation server sends an RPC request to the service processing server, the RPC request carrying the response time constraint information; making the service processing server set an execution priority for the RPC request according to the response time constraint information, and/or Allocate execution resources.
405、业务分配服务器接收业务处理服务器反馈的响应时间约束信息;405. The service allocation server receives the response time constraint information fed back by the service processing server;
业务分配服务器接收业务处理服务器反馈的响应时间约束信息,并使用所述响应时间约束信息更新相应的RPC请求的响应时间约束信息。The service distribution server receives the response time constraint information fed back by the service processing server, and uses the response time constraint information to update the response time constraint information of the corresponding RPC request.
406、业务分配服务器根据更新后的响应时间约束信息选择相应用户请求的分配处理策略。406. The service allocation server selects an allocation processing policy corresponding to the user request according to the updated response time constraint information.
业务分配服务器根据所述响应时间约束信息和紧急分配阈值选择所述用户请求对应的分配处理策略,所述分配处理策略包括:第一分配处理策略和第二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急处理阈值,则选择执行所述第一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急处理阈值,则选择执行所述第二分配处理策略,所述第一分配处理策略的处理复杂度大于所述第二分配处理策略。The service allocation server selects the allocation processing strategy corresponding to the user request according to the response time constraint information and the emergency allocation threshold, and the allocation processing strategy includes: a first allocation processing strategy and a second allocation processing strategy, if the response time constraint If the constraint remaining time of the information is greater than the emergency processing threshold, the first allocation processing strategy 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, the second allocation processing strategy is selected to be executed. Allocating processing strategies, the processing complexity of the first allocating processing strategy is greater than that of the second allocating processing strategy.
所述紧急分配阈值为业务分配服务器选择用户请求的处理策略的判断阈值,具体可以为一个时间阈值。The emergency allocation threshold is a judgment threshold for the service allocation server to select a processing strategy for user requests, and may specifically be a time threshold.
示例性的,在实际应用中,所述第一分配处理策略具体可以包括完成用户请求所必要的业务处理流程,以及可选的用于提升服务质量的数据挖掘、统计、分析流程内容;所述第二分配处理策略具体可以包括只包含完成用户请求所必要的业务处理流程内容;由于第一分配处理策略的处理复杂度大于第二分配处理策略,因此,当处理时间紧急(具体通过约束剩余时间小于或等于紧急阈值体现)时,业务分配服务器可以选择处理复杂度较小的第二分配处理策略,以节省处理时间。Exemplarily, in practical applications, the first allocation processing strategy may specifically include the necessary business processing flow for completing user requests, and optional data mining, statistics, and analysis flow content for improving service quality; The second allocation processing strategy can specifically include only the business processing flow content necessary to complete the user request; since the processing complexity of the first allocation processing strategy is greater than that of the second allocation processing strategy, when the processing time is urgent (specifically by constraining the remaining time When it is less than or equal to the emergency threshold), the service distribution server may select a second distribution processing strategy with less processing complexity to save processing time.
可以理解的是,所述第一分配处理策略和第二分配处理策略所表示的仅是处理复杂度不同的两类策略,不特指任意两个策略,并且,第一分配处理策略可以表示处理复杂度相同或相似的两个以上的处理策略,第二分配处理策略也可以表示处理复杂度相同或相似的两个以上的处理策略。It can be understood that the first allocation processing strategy and the second allocation processing strategy represent only two types of strategies with different processing complexities, and do not specifically refer to any two strategies, and the first allocation processing strategy may represent a processing For two or more processing strategies with the same or similar complexity, the second allocated processing strategy may also represent two or more processing strategies with the same or similar processing complexity.
进一步的,业务分配服务器还可以设置多级的紧急分配阈值,以分别对应多种复杂度类型的分配处理策略,此处具体不作限定。Further, the service allocation server may also set multi-level emergency allocation thresholds to respectively correspond to allocation processing strategies of various types of complexity, which is not specifically limited here.
下面对用于执行上述请求处理方法的本发明业务处理服务器的实施例进行说明,其逻辑结构请参考图5,本发明实施例中的业务处理服务器一个实施例包括:The following describes an embodiment of the service processing server of the present invention for executing the above request processing method. Please refer to FIG. 5 for its logical structure. An embodiment of the service processing server in the embodiment of the present invention includes:
请求接收单元501,用于接收业务分配服务器发送的远程过程调用RPC请求,所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间;The request receiving unit 501 is configured to receive the 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 the processing of the user request corresponding to the RPC request Constraint time and elapsed processing time;
存储单元502,用于将所述RPC请求加入服务请求队列;a storage unit 502, configured to add the RPC request to a service request queue;
设置单元503,用于根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。The setting unit 503 is configured to set the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue, and/or allocate the execution resources of each RPC request.
进一步的,本发明实施例中的设置单元具体503用于:Further, the setting unit 503 in the embodiment of the present invention is specifically used for:
若所述业务处理服务器能够同时处理所述服务请求队列中所有的RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源;If the business processing server can process all the RPC requests in the service request queue at the same time, the business processing server allocates execution resources for each RPC request according to the response time constraint information of each RPC request in the service request queue ;
若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级;If the business processing server can only process any RPC request in the service request queue independently, then the business processing server sets the time limit of each 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 business processing server cannot process all the RPC requests in the service request queue at the same time, nor can it only process any RPC request in the service request queue independently, then the service processing server 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 each RPC request.
进一步的,本发明实施例中的所述设置单元503可以包括:Further, the setting unit 503 in the embodiment of the present invention may include:
资源分配模块5031,用于根据所述响应时间约束信息获取所述各个RPC请求的处理约束时间的约束剩余时间;根据预定义规则设置所述各个RPC请求的执行优先级,所述预定义规则包括:所述约束剩余时间越少,则设置的执行优先级越高;The resource allocation module 5031 is configured to obtain the constraint remaining time of the processing constraint time of each RPC request according to the response time constraint information; set the execution priority of each RPC request according to a predefined rule, and the predefined rule includes : The less the remaining time of the constraint is, the higher the execution priority is set;
优先级设置模块5032,用于根据所述响应时间约束信息获取所述各个RPC请求的处理约束时间的剩余时间;根据预定义规则分配所述各个RPC请求的执行资源,所述预定义规则包括:所述约束剩余时间越少,则分配的执行资源越多。The priority setting module 5032 is configured to obtain the remaining time of the processing constraint time of each RPC request according to the response time constraint information; allocate the execution resources of each RPC request according to predefined rules, and the predefined rules include: The smaller the remaining time of the constraint, the more execution resources are allocated.
进一步的,本发明实施例中的业务处理服务器还可以包括:Further, the business processing server in the embodiment of the present invention may also include:
处理策略选择单元504,用于根据所述响应时间约束信息和紧急阈值选择所述RPC请求的处理策略,所述处理策略包括:第一处理策略和第二处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急阈值,则选择执行所述第一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急阈值,则选择执行所述第二处理策略,所述第一处理策略的处理复杂度大于所述第二处理策略。A processing strategy selection unit 504, configured to select a processing strategy for the RPC request according to the response time constraint information and the emergency threshold, the processing strategy includes: a first processing strategy and a second processing strategy, if the response time constraint information If the constraint remaining time of the response time constraint information is greater than the emergency threshold, the first processing strategy 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, the second processing strategy is selected to be executed, so The processing complexity of the first processing strategy is greater than that of the second processing strategy.
进一步的,本发明实施例中的业务处理服务器还包括:Further, the business processing server in the embodiment of the present invention also includes:
请求处理单元505,用于对优先级最高的RPC请求进行处理,记录所述RPC请求的处理时间,并根据所述处理时间更新所述RPC请求的响应时间约束信息;The request processing unit 505 is 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;
信息反馈单元506,用于向所述业务分配服务器反馈完成处理的RPC请求的响应时间约束信息。The information feedback unit 506 is configured to feed back the response time constraint information of the processed RPC request to the service distribution server.
本发明实施例中业务分配服务器的各个单元具体的交互过程如下:The specific interaction process of each unit of the service distribution server in the embodiment of the present invention is as follows:
请求接收单元501接收业务分配服务器发送的RPC请求,所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间。示例性的,在获取到该响应时间约束信息之后,可以将该响应时间约束信息存储在业务处理服务器的线程局部存储器。The request receiving unit 501 receives the RPC request sent by the service allocation server, the RPC request includes: response time constraint information; the response time constraint information is used to mark the processing constraint time and the processing that has occurred for the user request corresponding to the RPC request time. Exemplarily, after the response time constraint information is acquired, the response time constraint information may be stored in the thread local memory 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 a service request queue, and the service request queue is used to store different RPC requests. In practical applications, in order to reduce operating costs and improve resource utilization, the resources in one business processing server may be shared and utilized by multiple business distribution servers. Therefore, the business 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.
可选的,在获取到该响应时间约束信息之后,可以由处理策略选择单元504根据所述响应时间约束信息和紧急阈值选择所述RPC请求的处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急阈值,则选择执行所述第一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急阈值,则选择执行所述第二处理策略,所述处理策略包括:第一处理策略和第二处理策略,所述第一处理策略的处理复杂度大于所述第二处理策略。Optionally, after obtaining the response time constraint information, the processing policy selection unit 504 may select a processing policy for the RPC request according to the response time constraint information and the emergency threshold, if the constraints of the response time constraint information remain If the time is greater than the emergency threshold, then choose to execute the first processing strategy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, then choose to execute the second processing strategy, the processing strategy It includes: a first processing strategy and a second processing strategy, the processing complexity of the first processing strategy is greater than that of the second processing strategy.
所述紧急阈值为业务处理服务器选择RPC请求的处理策略的判断阈值,具体可以为一个时间阈值。The emergency threshold is a judgment threshold for the service processing server to select a processing strategy for the RPC request, and may specifically be a time threshold.
示例性的,在实际应用中,所述第一处理策略具体可以包括根据用户的请求通过数据挖掘分析的方式推荐用户可能关心的内容;所述第二处理策略具体可以包括直接向用户推荐当前关注度高的内容;由于第一处理策略的处理复杂度大于第二处理策略,因此,当处理时间紧急(具体通过约束剩余时间小于或等于紧急阈值体现)时,业务处理服务器可以选择处理复杂度较小的第二处理策略,以节省处理时间。Exemplarily, in an actual application, the first processing strategy may specifically include recommending content that the user may care about through data mining and analysis according to the user's request; the second processing strategy may specifically include directly recommending to the user the currently concerned content high-degree content; because the processing complexity of the first processing strategy is greater than that of the second processing strategy, when the processing time is urgent (specifically reflected by the remaining time of the constraint being less than or equal to the emergency threshold), the business processing server can choose a higher processing complexity Small second processing strategy to save processing time.
在将RPC请求加入到服务请求队列之后,设置单元503根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。After adding the RPC request to the service request queue, the setting unit 503 sets the execution priority of each RPC request according to the response time constraint information of each RPC request in the service request queue, and/or allocates the execution priority of each RPC request Execution resources.
具体的,在处理RPC请求之前,会根据设备自身的处理能力,以及服务请求队列中RPC请求的数量和类型,确定RPC请求的处理方式;若所述业务处理服务器能够同时处理所述服务请求队列中所有的RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源;若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级;若所述业务处理服务器即无法同时处理所述服务请求队列中所有的RPC请求,也不仅能单独处理所述服务请求队列中的任意一个RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,并分配所述各个RPC请求的执行资源。Specifically, before processing the RPC request, the processing mode of the RPC request will be determined according to the processing capability of the device itself and the number and type of RPC requests in the service request queue; if the service processing server can process the service request queue at the same time For all RPC requests in the service request queue, the service processing server allocates execution resources for each RPC request 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 Any RPC request in the request 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 Process all RPC requests in the service request queue, and not only process any RPC request in the service request queue separately, then the service processing server can Setting the execution priority of each RPC request, and allocating the execution resources of each RPC request.
进一步的,可以由设置单元503的资源分配模块5031根据所述响应时间约束信息获取所述各个RPC请求的处理约束时间的约束剩余时间;根据预定义规则设置所述各个RPC请求的执行优先级,所述预定义规则包括:所述约束剩余时间越少,则设置的执行优先级越高;由优先级设置模块5032根据所述响应时间约束信息获取所述各个RPC请求的处理约束时间的剩余时间;根据预定义规则分配所述各个RPC请求的执行资源,所述预定义规则包括:所述约束剩余时间越少,则分配的执行资源越多。Further, the resource allocation module 5031 of the setting unit 503 may obtain the constraint remaining time of the processing constraint time of each RPC request according to the response time constraint information; set the execution priority of each RPC request according to a predefined rule, The predefined rules include: the less the constraint remaining time, the higher the execution priority set; the priority setting module 5032 obtains the remaining time of the processing constraint time of each RPC request according to the response time constraint information ; Allocating the execution resources of each RPC request according to a predefined rule, the predefined rule includes: the less the remaining time of the constraint is, the more execution resources are allocated.
在完成执行优先级的设置和/或执行资源的分配之后,请求处理单元505对优先级最高的RPC请求进行处理,记录所述RPC请求的处理时间,并根据所述处理时间更新所述RPC请求的响应时间约束信息(即将所述处理时间加上响应时间约束信息中的已发生处理时间,得到更新后的已发生处理时间)。After completing the execution priority setting and/or execution resource allocation, the request processing unit 505 processes the RPC request with the highest priority, 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, adding the processing time to the processing time that has occurred in the response time constraint information to obtain the updated processing time that has occurred).
信息反馈单元506向所述业务分配服务器反馈完成处理的RPC请求的响应时间约束信息(即更新后的响应时间约束信息),使得业务分配服务器更新相应用户请求的响应时间约束信息。The information feedback unit 506 feeds back the response time constraint information (that is, the updated response time constraint information) of the processed RPC request to the service distribution server, so that the service distribution server updates the response time constraint information of the corresponding user request.
下面对用于执行上述请求处理方法的本发明业务分配服务器的实施例进行说明,其逻辑结构请参考图6,本发明实施例中的业务分配服务器一个实施例包括:The following describes an embodiment of the service distribution server of the present invention for executing the above request processing method. Please refer to FIG. 6 for its logical structure. An embodiment of the service distribution server in the embodiment of the present invention includes:
用户请求接收单元601,用于接收用户请求;A user request receiving unit 601, configured to receive a user request;
信息分配单元602,用于为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间;An information allocating unit 602, configured to allocate response time constraint information to the user request, 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;
请求生成单元603,用于根据所述用户请求生成远程过程调用RPC请求;A request generation unit 603, configured to generate a remote procedure call RPC request according to the user request;
请求发送单元604,用于向业务处理服务器发送RPC请求,所述RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为所述RPC请求设置执行优先级,和/或分配执行资源。A request sending unit 604, configured to send an RPC request to a business processing server, the RPC request carrying the response time constraint information; enabling the business processing server to set an execution priority for the RPC request according to the response time constraint information , and/or allocate execution resources.
进一步的,本发明实施例中的信息分配单元602具体用于:Further, the information distribution unit 602 in the embodiment of the present invention is specifically used for:
根据所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信息为所述用户请求分配响应时间约束信息。Allocating 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包括:Further, the information distribution unit 602 in the embodiment of the present invention includes:
第一分配模块6021,用于若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时发生了改变,则获取第一处理速度与第二处理速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业务处理服务器的硬件性能对所述RPC请求的处理速度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理服务器的硬件性能对所述RPC请求的处理速度;The first allocation module 6021 is configured to obtain the ratio of the first processing speed to the second processing speed if the hardware performance of the current business processing server has changed compared to the historical value recorded in the response time constraint information, and The historical value of the response time constraint information is multiplied by the ratio to obtain the response time constraint information currently assigned to the user request; the first processing speed is the hardware performance of the current service processing server for the RPC request processing speed, the second processing speed is the processing speed of the hardware performance of the service processing server for the RPC request when recording the historical value of the response time constraint information;
第二分配模块6022,用于若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时没有发生改变,则将所述响应时间约束信息的历史值作为当前为所述用户请求分配的响应时间约束信息。The second allocation module 6022 is configured to use the historical value of the response time constraint information as the current value of the response time constraint information if the hardware performance of the current service processing server has not changed compared with the historical value of the response time constraint information recorded. Response time constraint information for user request allocation.
进一步的,本发明实施例中的请求生成单元603包括:Further, the request generating unit 603 in this embodiment of the present invention includes:
参数提取模块6031,用于提取完成所述用户请求所需的业务参数;A parameter extraction module 6031, configured to extract service parameters required to complete the user request;
逻辑分析模块6032,用于根据预置的业务逻辑确定完成所述用户请求需要执行的步骤,根据所述需要执行的步骤确定需要调用的业务处理服务器;Logic analysis module 6032, configured to determine the steps to be executed to complete the user request according to the preset business logic, and determine the business processing server to be called according to the steps to be executed;
请求生成模块6033,用于分别为所述需要调用的业务处理服务器分配相应的所述业务参数,生成与所述业务处理服务器对应的RPC请求。The request generating module 6033 is configured to assign corresponding service parameters to the service processing servers that need to be invoked, and generate RPC requests corresponding to the service processing servers.
进一步的,本发明实施例中的业务处理服务器还包括:Further, the business processing server in the embodiment of the present invention also includes:
信息接收单元605,用于接收所述业务处理服务器反馈的响应时间约束信息;An information receiving unit 605, configured to receive response time constraint information fed back by the business processing server;
信息更新单元606,用于使用所述响应时间约束信息更新相应的RPC请求的响应时间约束信息。An information updating unit 606, configured to use the response time constraint information to update the response time constraint information of the corresponding RPC request.
分配策略选择单元607,用于根据所述响应时间约束信息和紧急分配阈值选择所述用户请求对应的分配处理策略,所述分配处理策略包括:第一分配处理策略和第二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急处理阈值,则选择执行所述第一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急处理阈值,则选择执行所述第二分配处理策略,所述第一分配处理策略的处理复杂度大于所述第二分配处理策略。An allocation policy selection unit 607, 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, select and execute the first allocation processing strategy; if the constraint remaining time of the response time constraint information is less than or equal to the emergency processing threshold, select The second allocation processing policy is executed, and the processing complexity of the first allocation processing policy is greater than that of 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:
用户请求接收单元601接收用户请求,该用户请求为用户向网络侧提出的服务需求或应用需求,该服务需求或应用需求可以包括:搜索、在线购物。The user request receiving unit 601 receives a user request. The user request is a service requirement or application requirement put forward by the user to the network side. The service requirement or application requirement may include: search and online shopping.
在接收到用户请求之后,信息分配单元602为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间。After receiving the user request, the information allocating unit 602 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.
可选的,若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时发生了改变,则第一分配模块6021获取第一处理速度与第二处理速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业务处理服务器的硬件性能对所述RPC请求的处理速度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理服务器的硬件性能对所述RPC请求的处理速度;若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时没有发生改变,则第二分配模块6022将所述响应时间约束信息的历史值作为当前为所述用户请求分配的响应时间约束信息。Optionally, if the hardware performance of the current business processing server has changed compared to the historical value recorded for the response time constraint information, the first allocation module 6021 obtains the 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 the response time constraint information currently assigned to the user request; the first processing speed is the current hardware performance of the business processing server for the RPC request The processing speed, the second processing speed is the processing speed of the hardware performance of the service processing server for the RPC request when recording the historical value of the response time constraint information; if the hardware performance of the current business processing server is relative to If there is no change when the historical value of the response time constraint information is recorded, the second allocating module 6022 takes the historical value of the response time constraint information as the response time constraint information currently allocated to the user request.
在业务分配服务器为用户请求分配了响应时间约束信息之后,请求生成单元603根据该用户请求生成RPC请求,该RPC请求中携带有与该用户请求对应的响应时间约束信息,该RPC请求用于向目标的业务处理服务器请求业务处理。After the service distribution server distributes the response time constraint information for the user request, the request generation unit 603 generates an RPC request according to the user request, the RPC request carries the response time constraint information corresponding to the user request, and the RPC request is used to send The business process server of the target requests a business process.
具体的,参数提取模块6031提取完成所述用户请求所需的业务参数(如请求类型、用户标识、商品标识等);逻辑分析模块6032根据预置的业务逻辑确定完成所述用户请求需要执行的步骤,根据所述需要执行的步骤确定需要调用的业务处理服务器;请求生成模块6033分别为所述需要调用的业务处理服务器分配相应的所述业务参数,生成与所述业务处理服务器对应的RPC请求。Specifically, the parameter extraction module 6031 extracts the business parameters required to complete the user request (such as request type, user identification, product identification, etc.); the logic analysis module 6032 determines the required execution of the user request according to the preset business logic. step, determining the business processing server that needs to be called according to the steps that need to be executed; the request generation module 6033 assigns the corresponding business parameters to the business processing server that needs to be called, and generates an RPC request corresponding to the business processing server .
在生成RPC请求之后,请求发送单元604向业务处理服务器发送RPC请求,所述RPC请求携带有所述响应时间约束信息;使得所述业务处理服务器根据所述响应时间约束信息为所述RPC请求设置执行优先级,和/或分配执行资源。After generating the RPC request, the request sending unit 604 sends the RPC request to the service processing server, the RPC request carrying the response time constraint information; making the service processing server set the RPC request according to the response time constraint information Execution priority, and/or allocation of execution resources.
信息接收单元605接收业务处理服务器反馈的响应时间约束信息,并触发信息更新单元606使用所述响应时间约束信息更新相应的RPC请求的响应时间约束信息。The information receiving unit 605 receives the response time constraint information fed back by the service processing server, and triggers the information updating unit 606 to use the response time constraint information to update the response time constraint information of the corresponding RPC request.
在更新了响应时间约束信息之后,分配策略选择单元607根据所述响应时间约束信息和紧急分配阈值选择所述用户请求对应的分配处理策略,所述分配处理策略包括:第一分配处理策略和第二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急处理阈值,则选择执行所述第一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急处理阈值,则选择执行所述第二分配处理策略,所述第一分配处理策略的处理复杂度大于所述第二分配处理策略。After updating the response time constraint information, the allocation policy selection unit 607 selects the 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 a second allocation processing policy Two allocation processing strategies, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, select and execute the first allocation processing strategy, if the constraint remaining time of the response time constraint information is less than or equal to the If the emergency processing threshold is exceeded, the second allocation processing strategy is selected to be executed, and the processing complexity of the first allocation processing strategy is greater than that of the second allocation processing strategy.
所述紧急分配阈值为业务分配服务器选择用户请求的处理策略的判断阈值,具体可以为一个时间阈值。The emergency allocation threshold is a judgment threshold for the service allocation server to select a processing strategy for user requests, and may specifically be a time threshold.
示例性的,在实际应用中,所述第一分配处理策略具体可以包括完成用户请求所必要的业务处理流程,以及可选的用于提升服务质量的数据挖掘、统计、分析流程内容;所述第二分配处理策略具体可以包括只包含完成用户请求所必要的业务处理流程内容;由于第一分配处理策略的处理复杂度大于第二分配处理策略,因此,当处理时间紧急(具体通过约束剩余时间小于或等于紧急阈值体现)时,业务分配服务器可以选择处理复杂度较小的第二分配处理策略,以节省处理时间。Exemplarily, in practical applications, the first allocation processing strategy may specifically include the necessary business processing flow for completing user requests, and optional data mining, statistics, and analysis flow content for improving service quality; The second allocation processing strategy can specifically include only the business processing flow content necessary to complete the user request; since the processing complexity of the first allocation processing strategy is greater than that of the second allocation processing strategy, when the processing time is urgent (specifically by constraining the remaining time When it is less than or equal to the emergency threshold), the service distribution server may select a second distribution processing strategy with less processing complexity to save processing time.
下面对用于执行上述请求处理方法的本发明请求处理系统的实施例进行说明,其逻辑结构请参考图7,本发明实施例中的请求处理系统一个实施例包括:The following describes an embodiment of the request processing system of the present invention for implementing the above request processing method. Please refer to FIG. 7 for its logical structure. An embodiment of the request processing system in the embodiment of the present invention includes:
业务分配服务器701和业务处理服务器702;Service distribution server 701 and service processing server 702;
所述业务分配服务器701用于接收用户请求;为所述用户请求分配响应时间约束信息,所述响应时间约束信息用于标记所述用户请求的处理约束时间和已发生处理时间;根据所述用户请求生成远程过程调用RPC请求;向业务处理服务器发送RPC请求;所述RPC请求携带有所述响应时间约束信息;The service allocation server 701 is used to receive user requests; allocate response time constraint information for the user requests, and the response time constraint information is used to mark the processing constraint time and the processing time of the user request; according to the user Request to generate a remote procedure call RPC request; send the RPC request to the business processing server; the RPC request carries the response time constraint information;
所述业务处理服务器702用于接收业务分配服务器发送的远程过程调用RPC请求,将所述RPC请求加入服务请求队列;根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。The business processing server 702 is configured to receive the remote procedure call RPC request sent by the business distribution server, add the RPC request to the service request queue; set the RPC requests according to the response time constraint information of each RPC request in the service request queue request execution priority, and/or allocate execution resources for each RPC request.
本发明实施例中的业务分配服务器701和业务处理服务器702所执行的具体步骤可以参阅上述方法实施例,此处不再赘述。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 repeated here.
本发明实施例还提供了一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的请求处理方法的部分或全部步骤。An embodiment of the present invention also provides a computer storage medium, wherein the computer storage medium can store a program, and when the program is executed, some or all steps of the request processing method described in the above method embodiments are included.
请参见图8,本发明实施例还提供了一种业务处理服务器,具体可包括:Referring to Fig. 8, the embodiment of the present invention also provides a business processing server, which may specifically include:
接收器801,发送器802,存储器803和处理器804(业务处理服务器中的处理器的数量可以为一个或多个,图8中以一个处理器为例)在本发明的一些实施例中,接收器801,发送器802,存储器803和处理器804可通过总线或其它方式连接,其中,图8中以通过总线连接为例。Receiver 801, transmitter 802, memory 803 and processor 804 (the number of processors in the service processing server may be one or more, one processor is taken as an example in FIG. 8 ) In some embodiments of the present invention, The receiver 801 , the transmitter 802 , the memory 803 and the processor 804 may be connected through a bus or in other ways, where connection through a bus is taken as an example in FIG. 8 .
其中,所述存储器803可以用于存储如下内容:Wherein, the memory 803 can be used to store the following content:
所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间;The RPC request includes: response time constraint information; the response 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;
预定义规则:所述约束剩余时间越少,则设置的执行优先级越高;所述约束剩余时间越少,则分配的执行资源越多;若所述处理约束时间的剩余时间小于所述RPC请求的预测完成时间,则放弃为所述RPC请求设置执行优先级和分配执行资源;若有两个以上的RPC请求的约束剩余时间相等,则获取所述约束剩余时间与所述处理约束时间的比值,为所述比值小的RPC请求设置较高的执行优先级,和/或分配较多的执行资源。Pre-defined rules: the less the remaining time of the constraint, the higher the execution priority set; the less the remaining time of the constraint, the more execution resources are allocated; if the remaining time of the processing constraint time is less than the RPC If the predicted completion time of the request is predicted, then give up setting the execution priority and allocating execution resources for the RPC request; if the constraint remaining time of more than two RPC requests is equal, then obtain the difference between the constraint remaining time and the processing constraint time ratio, setting a higher execution priority for the RPC request with a smaller ratio, and/or allocating more execution resources.
以及第一处理策略和第二处理策略的具体内容。And the specific content of the first processing strategy and the second processing strategy.
接收器801用于接收接收业务分配服务器发送的远程过程调用RPC请求。The receiver 801 is configured to receive the RPC request sent by the service distribution server.
发送器802用于向所述业务分配服务器反馈完成处理的RPC请求的响应时间约束信息。The sender 802 is configured to feed back the response time constraint information of the processed RPC request to the service distribution server.
处理器804用于执行如下步骤:The processor 804 is configured to perform the following steps:
在接收器801接收业务分配服务器发送的远程过程调用RPC请求之后,将所述RPC请求加入服务请求队列;根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级,和/或分配所述各个RPC请求的执行资源。具体的,可以根据预定义规则进行执行优先级的设置,和/或执行资源的分配。After the receiver 801 receives the remote procedure call RPC request sent by the service distribution server, add the RPC request to the service request queue; set the execution of each RPC request according to the response time constraint information of each RPC request in the service request queue Priority, and/or allocation of execution resources for each RPC request. Specifically, the setting of execution priority and/or the allocation of execution resources may be performed according to predefined rules.
若所述业务处理服务器能够同时处理所述服务请求队列中所有的RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息分配所述各个RPC请求的执行资源;If the business processing server can process all the RPC requests in the service request queue at the same time, the business processing server allocates execution resources for each RPC request according to the response time constraint information of each RPC request in the service request queue ;
若所述业务处理服务器仅能单独处理所述服务请求队列中的任意一个RPC请求,则所述业务处理服务器根据所述服务请求队列中各个RPC请求的响应时间约束信息设置所述各个RPC请求的执行优先级;If the business processing server can only process any RPC request in the service request queue independently, then the business processing server sets the time limit of each 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 business processing server cannot process all the RPC requests in the service request queue at the same time, nor can it only process any RPC request in the service request queue independently, then the service processing server 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 each RPC request.
根据所述响应时间约束信息和紧急阈值选择所述RPC请求的处理策略,所述处理策略包括:第一处理策略和第二处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急阈值,则选择执行所述第一处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急阈值,则选择执行所述第二处理策略,所述第一处理策略的处理复杂度大于所述第二处理策略。Select a processing strategy for the RPC request according to the response time constraint information and an emergency threshold, the processing strategy includes: a first processing strategy and a second processing strategy, if the constraint remaining time of the response time constraint information is greater than the emergency threshold, select to execute the first processing strategy, if the constraint remaining time of the response time constraint information is less than or equal to the emergency threshold, then select to execute the second processing strategy, the processing of the first processing strategy is complex degrees greater than the second processing strategy.
还请参见图8,本发明实施例还提供了一种业务分配服务器,具体可包括:Also referring to FIG. 8, an embodiment of the present invention also provides a service distribution server, which may specifically include:
接收器801,发送器802,存储器803和处理器804(业务分配服务器中的处理器的数量可以为一个或多个,图8中以一个处理器为例)在本发明的一些实施例中,接收器801,发送器802,存储器803和处理器804可通过总线或其它方式连接,其中,图8中以通过总线连接为例。Receiver 801, transmitter 802, memory 803 and processor 804 (the number of processors in the service distribution server may be one or more, one processor is taken as an example in FIG. 8 ) In some embodiments of the present invention, The receiver 801 , the transmitter 802 , the memory 803 and the processor 804 may be connected through a bus or in other ways, where connection through a bus is taken as an example in FIG. 8 .
其中,业务分配服务器的存储器803可以用于存储如下内容:Wherein, the memory 803 of the service allocation server can be used to store the following content:
所述RPC请求包括:响应时间约束信息;所述响应时间约束信息用于标记与所述RPC请求对应的用户请求的处理约束时间和已发生处理时间;The RPC request includes: response time constraint information; the response 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;
所述响应时间约束信息的历史值以及所述业务处理服务器的硬件信息。The historical value of the response time constraint information and the hardware information of the service processing server.
业务分配服务器的接收器801用于接收用户请求,以及接收所述业务处理服务器反馈的响应时间约束信息。The receiver 801 of the service distribution server is configured to receive user requests and response time constraint information fed back by the service processing server.
业务分配服务器的发送器802用于向业务处理服务器发送RPC请求。The sender 802 of the service distribution server is used to send an RPC request to the service processing server.
业务分配服务器的处理器804用于执行如下步骤:The processor 804 of the service distribution server is used to perform the following steps:
在接收接收器801用户请求之后;为所述用户请求分配响应时间约束信息,根据所述用户请求生成远程过程调用RPC请求。After receiving the user request from the receiver 801; assign response time constraint information to the user request, and generate a remote procedure call (RPC) request according to the user request.
进一步的,在为所述用户请求分配响应时间约束信息时,若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时发生了改变,则获取第一处理速度与第二处理速度的比值,将所述响应时间约束信息的历史值乘于所述比值,得到当前为所述用户请求分配的响应时间约束信息;所述第一处理速度为当前的业务处理服务器的硬件性能对所述RPC请求的处理速度,所述第二处理速度为记录所述响应时间约束信息的历史值时的业务处理服务器的硬件性能对所述RPC请求的处理速度;若当前的业务处理服务器的硬件性能,相对于记录所述响应时间约束信息的历史值时没有发生改变,则将所述响应时间约束信息的历史值作为当前为所述用户请求分配的响应时间约束信息。Further, when assigning the response time constraint information to the user request, if the hardware performance of the current service processing server has changed compared with the historical value recorded in the response time constraint information, then the first processing speed and The ratio of the second processing speed, the historical value of the response time constraint information is multiplied by the ratio to obtain the response time constraint information currently assigned to the user request; the first processing speed is the current service processing server's The processing speed of the hardware performance for the RPC request, the second processing speed is the processing speed of the hardware performance of the business processing server for the RPC request when recording the historical value of the response time constraint information; if the current business processing If the hardware performance of the server has not changed since 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 assigned to the user request.
进一步的,接收所述业务处理服务器反馈的响应时间约束信息之后,根据所述响应时间约束信息和紧急分配阈值选择所述用户请求对应的分配处理策略,所述分配处理策略包括:第一分配处理策略和第二分配处理策略,若所述响应时间约束信息的约束剩余时间大于所述紧急处理阈值,则选择执行所述第一分配处理策略,若所述响应时间约束信息的约束剩余时间小于或等于所述紧急处理阈值,则选择执行所述第二分配处理策略,所述第一分配处理策略的处理复杂度大于所述第二分配处理策略。Further, after receiving the response time constraint information fed back by the service processing server, an allocation processing strategy corresponding to the user request is selected according to the response time constraint information and the emergency allocation threshold, and the allocation processing strategy includes: a first allocation processing strategy and a second allocation processing strategy, if the constraint remaining time of the response time constraint information is greater than the emergency processing threshold, select and execute the first allocation processing strategy, if the constraint remaining time of the response time constraint information is less than or is equal to the emergency processing threshold, the second allocation processing strategy is selected to be executed, and the processing complexity of the first allocation processing strategy is greater than that of the second allocation processing strategy.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (26)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310228246.XA CN104243405B (en) | 2013-06-08 | 2013-06-08 | A kind of request processing method, apparatus and system |
| PCT/CN2014/079489 WO2014194869A1 (en) | 2013-06-08 | 2014-06-09 | Request processing method, device and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310228246.XA CN104243405B (en) | 2013-06-08 | 2013-06-08 | A kind of request processing method, apparatus and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN104243405A CN104243405A (en) | 2014-12-24 |
| CN104243405B true CN104243405B (en) | 2017-09-29 |
Family
ID=52007588
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310228246.XA Active CN104243405B (en) | 2013-06-08 | 2013-06-08 | A kind of request processing method, apparatus and system |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN104243405B (en) |
| WO (1) | WO2014194869A1 (en) |
Families Citing this family (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106470169A (en) * | 2015-08-19 | 2017-03-01 | 阿里巴巴集团控股有限公司 | A kind of service request method of adjustment and equipment |
| CN106612241B (en) * | 2015-10-27 | 2020-02-21 | 中国移动通信集团浙江有限公司 | A service control method and device |
| US20190018600A1 (en) * | 2016-01-13 | 2019-01-17 | Hewlett Packard Enterprise Development Lp | Restructured input/output requests |
| 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 |
| CN106790092B (en) * | 2016-12-23 | 2020-06-19 | 北京奇艺世纪科技有限公司 | Remote procedure call server control system and method |
| CN106775990A (en) * | 2016-12-31 | 2017-05-31 | 中国移动通信集团江苏有限公司 | Request scheduling method and device |
| CN109391588B (en) * | 2017-08-04 | 2021-03-12 | 北京国双科技有限公司 | Request processing method and device |
| CN109391589B (en) * | 2017-08-04 | 2021-06-29 | 北京国双科技有限公司 | 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 |
| CN109660612A (en) * | 2018-12-11 | 2019-04-19 | 北京潘达互娱科技有限公司 | A kind of request processing method and server |
| 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 | 杭州复恒科技有限公司 | A method, system and device for adjusting traffic resources of cross-platform servers |
Citations (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 |
| CN101471869A (en) * | 2007-12-27 | 2009-07-01 | 华为技术有限公司 | Method, system and device for processing session |
| CN101795289A (en) * | 2009-12-30 | 2010-08-04 | 华为技术有限公司 | Method, device and system for remote procedure call control |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8490105B2 (en) * | 2009-08-17 | 2013-07-16 | Sybase, Inc. | Pluggable component interface |
| CN102316154B (en) * | 2010-06-22 | 2016-05-11 | 微软技术许可有限责任公司 | Optimize the access to the resource based on federation infrastructure |
-
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 (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 |
| CN101471869A (en) * | 2007-12-27 | 2009-07-01 | 华为技术有限公司 | Method, system and device for processing session |
| CN101795289A (en) * | 2009-12-30 | 2010-08-04 | 华为技术有限公司 | Method, device and system for remote procedure call control |
Non-Patent Citations (1)
| Title |
|---|
| 云计算环境下动态资源管理关键技术研究;李冰;《中国博士学位论文全文数据库信息科技辑(2013)》;20130115(第1期);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN104243405A (en) | 2014-12-24 |
| WO2014194869A1 (en) | 2014-12-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104243405B (en) | A kind of request processing method, apparatus and system | |
| CN110858161B (en) | Resource allocation method, device, system, equipment and medium | |
| CN111344688B (en) | Method and system for providing resources in cloud computing | |
| EP3637733B1 (en) | Load balancing engine, client, distributed computing system, and load balancing method | |
| US20190324819A1 (en) | Distributed-system task assignment method and apparatus | |
| Kliazovich et al. | CA-DAG: Modeling communication-aware applications for scheduling in cloud computing | |
| CN111694646B (en) | Resource scheduling method, device, electronic equipment and computer readable storage medium | |
| CN112153700A (en) | A network slice resource management method and device | |
| CN105144102B (en) | Adaptive data synchronization | |
| CN106471773A (en) | The distribution of integrated form global resource and load balance | |
| CN105159782A (en) | Cloud host based method and apparatus for allocating resources to orders | |
| WO2017166643A1 (en) | Method and device for quantifying task resources | |
| JP2009110347A (en) | Resource management system, resource management device, and method thereof | |
| CN105791254B (en) | Network request processing method and device and terminal | |
| CN109348264B (en) | Video resource sharing method and device, storage medium and electronic equipment | |
| WO2018220708A1 (en) | Resource allocation system, management device, method, and program | |
| EP3274859B1 (en) | Cluster computing service assurance apparatus and method | |
| KR102389334B1 (en) | Virtual machine provisioning system and method for cloud service | |
| CN110659123A (en) | Distributed task distribution scheduling method and device based on message | |
| JP2013152553A (en) | Resource management device, resource management system, resource management method and resource management program | |
| CN114155026A (en) | A resource allocation method, device, server and storage medium | |
| CN114116173A (en) | Method, device and system for dynamically adjusting task assignment | |
| CN105430028B (en) | Service calling method, providing method and node | |
| KR101613513B1 (en) | Virtual machine placing method and system for guarantee of network bandwidth | |
| US20130166751A1 (en) | Distributed resource management systems and methods for resource management thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |