





技术领域technical field
本申请涉及web服务技术领域,特别是涉及一种资源分配方法、装置、计算机设备和存储介质。The present application relates to the technical field of web services, in particular to a resource allocation method, device, computer equipment and storage medium.
背景技术Background technique
随着web服务技术的发展,当业务数据不断接入web服务平台时,web服务访问请求的量级和单位时间内请求的频度不断增加。With the development of web service technology, when business data is continuously connected to the web service platform, the magnitude of web service access requests and the frequency of requests per unit time continue to increase.
然而,传统的web服务访问过程中,对于单位时间内超量的访问请求,即使在集群的计算资源允许的情况下,也会出现访问失败和无法访问的情况。这是由于在高并发的场景下,web服务集群的资源没有得到合理分配和充分利用,从而影响到了并发访问场景下的最大访问承载量和访问成功率。However, in the traditional web service access process, for excessive access requests per unit time, even if the computing resources of the cluster allow, access failures and inaccessible situations may occur. This is because in a high-concurrency scenario, the resources of the web service cluster are not allocated and fully utilized, which affects the maximum access capacity and access success rate in a concurrent access scenario.
发明内容Contents of the invention
基于此,有必要针对上述技术问题,提供一种能够在并发访问场景下提高访问承载量的资源分配方法、装置、计算机设备和存储介质。Based on this, it is necessary to address the above technical problems and provide a resource allocation method, device, computer equipment and storage medium capable of increasing access capacity in a concurrent access scenario.
一种资源分配方法,上述方法包括:A resource allocation method, the above method comprising:
接收当前访问请求,获取当前访问请求的访问参数,当前访问请求为访问web服务器集群的访问请求;Receive the current access request, obtain the access parameters of the current access request, and the current access request is an access request to access the web server cluster;
根据访问参数计算当前访问请求的资源消耗预估值,根据访问参数确定当前访问请求的优先级;Calculate the estimated resource consumption of the current access request according to the access parameters, and determine the priority of the current access request according to the access parameters;
根据资源消耗预估值选取目标节点,目标节点为web服务器集群末端的节点;Select the target node according to the resource consumption estimate, and the target node is the node at the end of the web server cluster;
根据优先级在目标节点下选取目标线程池,通过目标线程池对当前访问请求进行资源分配。Select the target thread pool under the target node according to the priority, and allocate resources to the current access request through the target thread pool.
在一个实施例中,根据资源消耗预估值选取目标节点,包括:当资源消耗预估值大于预设阈值时采用轮询方式选取目标节点。In one embodiment, selecting the target node according to the estimated resource consumption includes: selecting the target node in a polling manner when the estimated resource consumption is greater than a preset threshold.
在一个实施例中,根据资源消耗预估值选取目标节点,包括:当资源消耗预估值小于预设阈值时采用随机方式选取目标节点。In one embodiment, selecting the target node according to the estimated resource consumption includes: selecting the target node in a random manner when the estimated resource consumption is smaller than a preset threshold.
在一个实施例中,根据优先级在目标节点下选取目标线程池,包括:根据优先级与线程池预设的对应关系,在目标节点下选取与优先级对应的目标线程池。In one embodiment, selecting the target thread pool under the target node according to the priority includes: selecting the target thread pool corresponding to the priority under the target node according to the preset corresponding relationship between the priority and the thread pool.
在一个实施例中,上述方法还包括:In one embodiment, the above method also includes:
采集集群末端节点各端口的运行指标,根据运行指标计算可用节点以及可用线程池;Collect the operating indicators of each port of the end node of the cluster, and calculate the available nodes and available thread pools according to the operating indicators;
根据资源消耗预估值选取目标节点,包括:根据资源消耗预估值从可用节点中选取目标节点;Selecting a target node according to an estimated resource consumption value includes: selecting a target node from available nodes according to an estimated resource consumption value;
根据优先级在目标节点下选取目标线程池,包括:从目标节点下的可用线程池中选取与优先级对应的目标线程池。Selecting the target thread pool under the target node according to the priority includes: selecting the target thread pool corresponding to the priority from the available thread pools under the target node.
在一个实施例中,上述方法还包括:当目标节点下的可用线程池中没有与优先级对应的线程池时,从目标节点下的可用线程池中选取等级低于优先级的目标线程池。In one embodiment, the above method further includes: when there is no thread pool corresponding to the priority in the available thread pools under the target node, selecting a target thread pool with a level lower than the priority from the available thread pools under the target node.
在一个实施例中,根据访问参数计算当前访问请求的资源消耗预估值,包括:根据访问参数获取需要进行访问的数据范围值和需要进行访问的外部系统的接口数量值,根据数据范围值以及接口数量值计算当前访问请求的资源消耗预估值。In one embodiment, calculating the estimated resource consumption value of the current access request according to the access parameters includes: obtaining the value of the data range that needs to be accessed and the value of the interface quantity of the external system that needs to be accessed according to the access parameters, according to the value of the data range and The value of the number of interfaces calculates the estimated resource consumption of the current access request.
在一个实施例中,上述方法还包括:采集当前访问请求的实际执行信息,根据实际执行信息调整资源消耗预估值的计算方式。In one embodiment, the above method further includes: collecting actual execution information of the current access request, and adjusting the calculation method of the estimated resource consumption according to the actual execution information.
在一个实施例中,根据访问参数确定当前访问请求的优先级,包括:根据访问参数分析当前访问请求所属的业务类型,根据业务类型确定当前访问请求的优先级。In one embodiment, determining the priority of the current access request according to the access parameter includes: analyzing the service type of the current access request according to the access parameter, and determining the priority of the current access request according to the service type.
在一个实施例中,根据访问参数确定当前访问请求的优先级,包括:采集历史访问请求的实际执行信息,根据访问参数计算当前访问请求的预估访问耗时,根据预估访问耗时以及历史访问请求的实际执行信息确定当前访问请求的优先级。In one embodiment, determining the priority of the current access request according to the access parameters includes: collecting actual execution information of historical access requests, calculating the estimated access time of the current access request according to the access parameters, The actual execution information of the access request determines the priority of the current access request.
一种资源分配装置,上述装置包括:A resource allocation device, the above-mentioned device includes:
请求接收模块,用于接收当前访问请求,获取当前访问请求的访问参数,当前访问请求为访问web服务器集群的访问请求;The request receiving module is used to receive the current access request and obtain the access parameters of the current access request, where the current access request is an access request for accessing the web server cluster;
资源估算模块,用于根据访问参数计算当前访问请求的资源消耗预估值,根据访问参数确定当前访问请求的优先级;The resource estimation module is used to calculate the estimated resource consumption of the current access request according to the access parameters, and determine the priority of the current access request according to the access parameters;
节点选取模块,用于根据资源消耗预估值选取目标节点,目标节点为web服务器集群末端的节点;The node selection module is used to select the target node according to the resource consumption estimate, and the target node is the node at the end of the web server cluster;
线程分配模块,用于根据优先级在目标节点下选取目标线程池,通过目标线程池对当前访问请求进行资源分配。The thread allocation module is used to select a target thread pool under the target node according to the priority, and allocate resources to the current access request through the target thread pool.
一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述的资源分配方法的步骤。A computer device includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the steps of the above resource allocation method when executing the computer program.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的资源分配方法的步骤。A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above resource allocation method are implemented.
上述资源分配方法、装置、计算机设备和存储介质,通过计算当前访问请求的资源消耗预估值并确定当前访问请求的优先级,根据资源消耗预估值和优先级选取目标节点和目标线程池,并通过目标线程池对当前访问请求进行资源分配,可以在并发场景下实现资源的合理分配,从而提高并发访问的承载量。The above resource allocation method, device, computer equipment and storage medium calculate the resource consumption estimate of the current access request and determine the priority of the current access request, and select the target node and the target thread pool according to the resource consumption estimate and priority, And through the resource allocation of the current access request through the target thread pool, the reasonable allocation of resources can be realized in the concurrent scenario, thereby increasing the carrying capacity of concurrent access.
附图说明Description of drawings
图1为一个实施例中资源分配方法的应用环境图;Fig. 1 is an application environment diagram of a resource allocation method in an embodiment;
图2为一个实施例中资源分配方法的流程示意图;FIG. 2 is a schematic flowchart of a resource allocation method in an embodiment;
图3为一个应用实例中基于web服务器集群的资源分配技术构架图;Fig. 3 is a technical framework diagram of resource allocation based on web server cluster in an application example;
图4为一个应用实例中线程池的分配示意图;Fig. 4 is a schematic diagram of allocation of a thread pool in an application example;
图5为一个实施例中资源分配装置的结构框图;FIG. 5 is a structural block diagram of a resource allocation device in an embodiment;
图6为一个实施例中计算机设备的内部结构图。Figure 6 is an internal block diagram of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, not to limit the present application.
本申请提供的资源分配方法,可以应用于如图1所示的应用环境中。其中,终端102和服务器104通过网络进行通信,服务器104为web服务器集群中的任何一台或多台服务器,可以用独立的服务器或者是多个服务器组成的服务器集群来实现,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务器104接收终端102发送的当前访问请求,获取当前访问请求的访问参数,根据访问参数计算当前访问请求的资源消耗预估值,根据访问参数确定当前访问请求的优先级,根据资源消耗预估值选取目标节点,根据优先级在目标节点下选取目标线程池,通过目标线程池对当前访问请求进行资源分配。The resource allocation method provided in this application can be applied to the application environment shown in FIG. 1 . Wherein, the
在一个实施例中,如图2所示,提供了一种资源分配方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a resource allocation method is provided. The method is applied to the server in FIG. 1 as an example for illustration, including the following steps:
步骤S202:接收当前访问请求,获取当前访问请求的访问参数,当前访问请求为访问web服务器集群的访问请求。Step S202: Receive a current access request, and acquire access parameters of the current access request, where the current access request is an access request to access the web server cluster.
其中,web服务器集群的实现方式不限,可以通过多台web服务器主机相互联结而实现,例如,包括负载均衡器和末端多个节点的服务器体系结构,负载均衡器可以是软件也可以是硬件,末端节点可以是同构或异构的服务器;也可以通过在一台物理服务器上集群多个独立工作的web应用服务器的方式实现;还可以基于RSF(Remote Service Framework,远程服务框架)并在RSF平台上注册web服务的方式实现等。Wherein, the realization mode of web server cluster is not limited, and can be realized by connecting multiple web server hosts, for example, including a load balancer and a server architecture of multiple nodes at the end, the load balancer can be software or hardware, The end node can be a homogeneous or heterogeneous server; it can also be realized by clustering multiple independently working web application servers on a physical server; it can also be based on RSF (Remote Service Framework, remote service framework) and in RSF The realization of the method of registering web services on the platform, etc.
其中,访问参数指的是指示完成web服务访问的相关请求数据,可以包括需要访问的数据库的数据范围、表的数据范围、非结构化数据的范围、需要调用的外部接口、访问所属的类型或包含业务的类型等。Among them, the access parameter refers to the relevant request data indicating the completion of the web service access, which may include the data range of the database to be accessed, the data range of the table, the range of unstructured data, the external interface to be called, the type of access or Contains the type of business, etc.
具体地,可以是服务器在接收到终端发送的访问web服务器集群的当前访问请求时,对当前访问请求进行解析,从当前访问请求中解析得到相关请求数据作为访问参数。Specifically, the server may analyze the current access request when receiving the current access request sent by the terminal to access the web server cluster, and obtain relevant request data from the current access request as the access parameter.
步骤S204:根据访问参数计算当前访问请求的资源消耗预估值,根据访问参数确定当前访问请求的优先级。Step S204: Calculate the estimated resource consumption value of the current access request according to the access parameters, and determine the priority of the current access request according to the access parameters.
其中,资源消耗预估值指的是完成当前访问请求处理预计所需要消耗的资源值,即根据该当前访问请求返回对应的响应预计所需要消耗的资源值。优先级可以用来表示当前访问请求的重要程度,优先级越高的访问请求重要程度越高,用户对其正常执行的期待值越高。Wherein, the estimated resource consumption value refers to the resource value expected to be consumed to complete the processing of the current access request, that is, the estimated resource value required to be consumed in returning a corresponding response according to the current access request. The priority can be used to indicate the importance of the current access request. The higher the priority, the higher the importance of the access request, and the higher the user's expectation for its normal execution.
具体地,对于资源消耗预估值的计算,服务器可以根据访问参数通过指数退避算法进行过滤因子计算,从而获取需要访问的数据范围和需要访问的外部接口数量等,并基于需要访问的数据范围和需要访问的外部接口数量估算资源的消耗值。对于优先级的确定,服务器可以从访问参数中提取当前访问请求的业务类型、业务场景或业务数据等,从而确定当前访问请求的优先级,也可以通过估算当前访问请求预计消耗的资源值或预计消耗的时长,并结合各优先等级的历史访问请求的相关基准来确定当前访问请求的优先级。Specifically, for the calculation of estimated resource consumption, the server can calculate the filter factor through the exponential backoff algorithm according to the access parameters, so as to obtain the range of data that needs to be accessed and the number of external interfaces that need to be accessed, and based on the range of data that needs to be accessed and the number of external interfaces that need to be accessed. Estimate resource consumption for the number of external interfaces that need to be accessed. For priority determination, the server can extract the business type, business scenario, or business data of the current access request from the access parameters, thereby determining the priority of the current access request, or by estimating the estimated resource value or estimated consumption of the current access request. The time spent, combined with the relevant benchmarks of historical access requests of each priority level to determine the priority of the current access request.
步骤S206:根据资源消耗预估值选取目标节点,目标节点为web服务器集群末端的节点。Step S206: Select a target node according to the resource consumption estimate, and the target node is a node at the end of the web server cluster.
具体地,服务器可以根据计算的当前访问请求的资源消耗预估值触发对应的节点选择策略,通过节点选择策略为当前访问请求从集群末端(后端)的节点中挑选合适的节点作为目标节点,并将该当前访问请求推送至该目标节点。Specifically, the server can trigger the corresponding node selection strategy according to the calculated resource consumption estimate of the current access request, and select a suitable node from the nodes at the end (back end) of the cluster as the target node for the current access request through the node selection strategy. And push the current access request to the target node.
步骤S208:根据优先级在目标节点下选取目标线程池,通过目标线程池对当前访问请求进行资源分配。Step S208: Select a target thread pool under the target node according to the priority, and allocate resources to the current access request through the target thread pool.
其中,目标线程池为下属于目标节点的线程池,具体地,服务器可以根据当前访问请求的优先级触发对应的线程池分配策略,服务器根据对应的线程池分配策略从目标节点下属的线程池中选取合适的线程池作为目标线程池,服务器将当前访问请求推送至目标节点后,通过线程池分配策略指示目标节点将当前访问请求分配至目标节点下的目标线程池,以使目标线程池可以对当前访问请求进行资源分配并进行后续处理。Wherein, the target thread pool is a thread pool subordinate to the target node. Specifically, the server can trigger the corresponding thread pool allocation policy according to the priority of the current access request, and the server selects the thread pool from the thread pool subordinate to the target node according to the corresponding thread pool allocation policy. Select an appropriate thread pool as the target thread pool. After the server pushes the current access request to the target node, it instructs the target node to allocate the current access request to the target thread pool under the target node through the thread pool allocation strategy, so that the target thread pool can Resource allocation and subsequent processing of current access requests.
上述资源分配方法,通过计算当前访问请求的资源消耗预估值并确定当前访问请求的优先级,根据资源消耗预估值和优先级选取目标节点和目标线程池,并通过目标线程池对当前访问请求进行资源分配,可以在并发场景下实现集群资源的合理分配从而提高并发访问的承载量。In the above resource allocation method, by calculating the resource consumption estimate of the current access request and determining the priority of the current access request, the target node and the target thread pool are selected according to the resource consumption estimate and priority, and the current access request is processed through the target thread pool. Requesting resource allocation can realize the reasonable allocation of cluster resources in concurrent scenarios and improve the carrying capacity of concurrent access.
在一个实施例中,根据资源消耗预估值选取目标节点,包括:当资源消耗预估值大于预设阈值时采用轮询方式选取目标节点;和/或,当资源消耗预估值小于预设阈值时采用随机方式选取目标节点。In one embodiment, selecting the target node according to the estimated resource consumption includes: selecting the target node in a polling manner when the estimated resource consumption is greater than a preset threshold; and/or, when the estimated resource consumption is less than a preset threshold When the threshold is set, the target node is selected randomly.
在本实施例中,阈值的设定方式不限,初始化阈值可以从测试环境或压测环境中获取,在生产环境中可以对初始化阈值进行调整和优化。对于资源消耗预估值大于阈值的访问请求,其资源消耗可能较多,执行耗时可能较长,因此可以采用轮询的调度方式,以确保集群末端各节点能够实现负载平衡。对于资源消耗预估值小于阈值的访问请求,其资源消耗可能较少,执行耗时较短,因此采用随机的方式可以提高调度速度。本实施例,根据资源消耗预估值的不同采用不同的节点选择(并发)策略,可以提高并发量和节点资源的利用率。In this embodiment, the way of setting the threshold is not limited, the initialization threshold can be obtained from the test environment or the stress testing environment, and the initialization threshold can be adjusted and optimized in the production environment. For access requests whose estimated resource consumption is greater than the threshold, the resource consumption may be large, and the execution may take a long time. Therefore, a round-robin scheduling method can be used to ensure that the nodes at the end of the cluster can achieve load balance. For an access request whose estimated resource consumption value is less than the threshold, the resource consumption may be less, and the execution time may be shorter, so the random method can improve the scheduling speed. In this embodiment, different node selection (concurrency) strategies are adopted according to different estimated resource consumption values, which can improve the concurrency and the utilization rate of node resources.
在一个实施例中,根据优先级在目标节点下选取目标线程池,包括:根据优先级与线程池预设的对应关系,在目标节点下选取与优先级对应的目标线程池。In one embodiment, selecting the target thread pool under the target node according to the priority includes: selecting the target thread pool corresponding to the priority under the target node according to the preset corresponding relationship between the priority and the thread pool.
在本实施例中,可以预先设置优先级与线程池的对应关系,例如,若优先级分为高优先级和低优先级,可以设置与高优先级对应的高优先级线程池和与低优先级对应的低优先级线程池。本实施例,通过根据访问请求的优先级将不同等级的访问请求分配至不同等级的线程池中,可以实现不同等级访问请求的隔离,因此,不同等级的访问请求之间不会相互干扰,尤其是优先级较高的访问不会被排在前面的优先级较低的访问所阻碍,能够降低优先级较高的访问的响应延时,减少资源争抢,从而保证各级业务的承载量。In this embodiment, the corresponding relationship between the priority and the thread pool can be set in advance, for example, if the priority is divided into high priority and low priority, you can set the high priority thread pool corresponding to the high priority and the thread pool with the low priority level corresponding to the low priority thread pool. In this embodiment, by allocating access requests of different levels to thread pools of different levels according to the priority of the access requests, the isolation of access requests of different levels can be realized. Therefore, access requests of different levels will not interfere with each other, especially The access with higher priority will not be blocked by the access with lower priority in the front, which can reduce the response delay of access with higher priority and reduce resource contention, so as to ensure the carrying capacity of services at all levels.
在一个实施例中,上述方法还可以包括:采集集群末端节点各端口的运行指标,根据运行指标计算可用节点,根据资源消耗预估值选取目标节点,包括:根据资源消耗预估值从可用节点中选取目标节点。In an embodiment, the above method may further include: collecting the operation index of each port of the terminal node of the cluster, calculating the available nodes according to the operation index, and selecting the target node according to the resource consumption estimate, including: selecting the available node according to the resource consumption estimate Select the target node.
其中,集群末端节点各端口的运行指标的采集方式不限,例如,可以通过实时任务、离线任务进行采集,也可以手工周期性采集。具体如下,实时采集:针对时效性要求高的数据,通过实时计算引擎Flink采集实时数据;离线采集:按时间颗粒度(如分钟、小时等)自动触发采集任务;手工采集:非规则化数据的手工采集。Wherein, there is no limit to the collection method of the operation index of each port of the end node of the cluster, for example, it can be collected through real-time tasks, offline tasks, or manually periodically. The details are as follows, real-time collection: For data with high timeliness requirements, real-time data is collected through the real-time computing engine Flink; offline collection: automatically trigger collection tasks according to time granularity (such as minutes, hours, etc.); manual collection: non-regularized data Collected by hand.
其中,集群末端节点各端口的运行指标包括参数值和实际值,例如,可以包括访问的服务端口的半连接队列大小、全连接队列大小、全连接队列溢出的次数、半连接队列溢出次数等。Among them, the operation indicators of each port of the cluster end node include parameter values and actual values, for example, it may include the size of the semi-connected queue, the size of the fully connected queue, the number of overflows of the full connection queue, the number of overflows of the semi-connected queue, etc. of the accessed service port.
在本实施例中,通过采集的集群末端节点各端口的运行指标可以计算出各节点当前的使用状态,可以将资源使用率低于预设标准的节点作为可用节点,基于可用节点进行目标节点的选取。采用本实施例可以避免单一节点上访问请求超载以及各节点请求分配不均匀的问题。In this embodiment, the current usage status of each node can be calculated by collecting the operating indicators of each port of the terminal node of the cluster, and the node whose resource usage rate is lower than the preset standard can be regarded as an available node, and the target node can be selected based on the available node. select. By adopting this embodiment, the problems of overloading of access requests on a single node and uneven distribution of requests among nodes can be avoided.
进一步地,还可以根据采集的集群末端节点各端口的运行指标计算可用线程池,根据优先级在目标节点下选取目标线程池,包括:从目标节点下的可用线程池中选取与优先级对应的目标线程池。Further, the available thread pool can also be calculated according to the collected operating indicators of each port of the terminal node of the cluster, and the target thread pool is selected under the target node according to the priority, including: selecting the thread pool corresponding to the priority from the available thread pool under the target node The target thread pool.
具体地,可以根据节点下线程池的使用状态将当前线程占用率低于预设标准的线程池作为可用线程池,并基于可用线程池进行目标线程池的选取。这样一来,可以避免因线程池的线程占用率不均衡而导致的资源利用率低、并发量下降的问题。Specifically, according to the usage state of the thread pool under the node, the thread pool whose current thread occupancy rate is lower than the preset standard can be used as the available thread pool, and the target thread pool can be selected based on the available thread pool. In this way, the problems of low resource utilization and decreased concurrency caused by the unbalanced thread occupancy rate of the thread pool can be avoided.
进一步地,上述方法还包括:当目标节点下的可用线程池中没有与优先级对应的线程池时,从目标节点下的可用线程池中选取等级低于优先级的目标线程池。Further, the above method further includes: when there is no thread pool corresponding to the priority in the available thread pools under the target node, selecting a target thread pool with a level lower than the priority from the available thread pools under the target node.
具体地,当与优先级别对应的线程池处于不可用状态,但等级较低的线程池处于可用状态时,可以允许较高等级的访问请求使用较低等级访问请求对应的线程池,从而降低较高等级的访问的响应延时,优先保证重要业务正常响应。Specifically, when the thread pool corresponding to the priority level is in an unavailable state, but the thread pool with a lower level is in an available state, higher-level access requests can be allowed to use the thread pool corresponding to a lower-level access request, thereby reducing the The response delay of high-level access is prioritized to ensure the normal response of important services.
在一个实施例中,根据访问参数计算当前访问请求的资源消耗预估值,包括:根据访问参数获取需要进行访问的数据范围值和需要进行访问的外部系统的接口数量值,根据数据范围值以及接口数量值计算当前访问请求的资源消耗预估值。In one embodiment, calculating the estimated resource consumption value of the current access request according to the access parameters includes: obtaining the value of the data range that needs to be accessed and the value of the interface quantity of the external system that needs to be accessed according to the access parameters, according to the value of the data range and The value of the number of interfaces calculates the estimated resource consumption of the current access request.
具体地,服务器可以对当前访问请求进行解析,通过解析得到需要进行访问的数据范围值和需要进行访问的外部系统的接口数量值,从而计算出当前访问请求的资源消耗预估值。Specifically, the server may analyze the current access request, and obtain the value of the range of data to be accessed and the value of the interface quantity of the external system to be accessed through the analysis, thereby calculating an estimated resource consumption value of the current access request.
在一个实施例中,上述方法还包括:采集当前访问请求的实际执行信息,根据实际执行信息调整资源消耗预估值的计算方式。In one embodiment, the above method further includes: collecting actual execution information of the current access request, and adjusting the calculation method of the estimated resource consumption according to the actual execution information.
具体地,可以采集当前访问请求的实际执行信息,例如,实际执行信息可以包括实际资源消耗值、实际调用耗时、实际线程占用、实际执行裸时间等,并将当前访问请求的实际执行信息作为历史参考数据,通过机器学习或者人工智能等算法对后续访问请求的资源消耗预估值的计算方式进行调整,以提升计算准确度,减少误判。Specifically, the actual execution information of the current access request can be collected, for example, the actual execution information can include actual resource consumption value, actual call time consumption, actual thread occupation, actual execution naked time, etc., and the actual execution information of the current access request can be used as Historical reference data, through machine learning or artificial intelligence and other algorithms to adjust the calculation method of resource consumption estimates for subsequent access requests, to improve calculation accuracy and reduce misjudgments.
在一个实施例中,根据访问参数确定当前访问请求的优先级,包括:根据访问参数分析当前访问请求所属的业务类型,根据业务类型确定当前访问请求的优先级。In one embodiment, determining the priority of the current access request according to the access parameter includes: analyzing the service type of the current access request according to the access parameter, and determining the priority of the current access request according to the service type.
具体地,访问参数中可以包含与业务相关的数据,根据这些数据可以判断出当前访问请求所属的业务类型,一般情况,业务类型可以表征该业务的重要程度或受期待程度,因此根据预设的业务类型与优先级之间的对应关系,可以确定出当前访问请求的优先级。Specifically, the access parameters may contain business-related data, and based on these data, the type of business to which the current access request belongs can be determined. In general, the business type can represent the importance or expectation of the business. Therefore, according to the preset The correspondence between the service type and the priority can determine the priority of the current access request.
在一个实施例中,根据访问参数确定当前访问请求的优先级,包括:采集历史访问请求的实际执行信息,根据访问参数计算当前访问请求的预估访问耗时,根据预估访问耗时以及历史访问请求的实际执行信息确定当前访问请求的优先级。In one embodiment, determining the priority of the current access request according to the access parameters includes: collecting actual execution information of historical access requests, calculating the estimated access time of the current access request according to the access parameters, The actual execution information of the access request determines the priority of the current access request.
在本实施例中,当前访问请求的优先级还可以根据预估访问耗时并结合历史访问请求的实际执行信息进行确定。历史访问请求的实际执行信息可以通过采集一定时间内的访问次数、调用耗时、线程占用、执行裸时间、执行裸时间超过SLA(Service-LevelAgreement,服务等级协议)次数等访问相关数据得到,信息的采集方式不限,可以参考上述采集集群末端节点各端口的运行指标的方式。In this embodiment, the priority of the current access request may also be determined based on estimated time-consuming access and in combination with actual execution information of historical access requests. The actual execution information of historical access requests can be obtained by collecting access-related data such as the number of visits within a certain period of time, call time, thread occupation, execution bare time, and the number of times the execution bare time exceeds SLA (Service-Level Agreement, Service Level Agreement). The collection method is not limited, you can refer to the above method of collecting the operation indicators of each port of the end node of the cluster.
在一个实施例中,具体可以根据如下步骤进行优先级的确定:In one embodiment, specifically, the priority determination may be performed according to the following steps:
步骤1、根据访问参数进行执行步骤解析和所需访问外围系统数量计算的拆分。
步骤2、根据解析出的执行步骤计算预估基准耗时,根据历史访问请求的实际执行信息计算历史基准耗时,参考历史基准耗时将预估基准耗时大于历史基准耗时的访问请求确定为高优先级。Step 2. Calculate the estimated baseline time consumption based on the parsed execution steps, calculate the historical baseline time consumption based on the actual execution information of historical access requests, and determine the access requests whose estimated baseline time consumption is greater than the historical baseline time consumption with reference to the historical baseline time consumption is high priority.
步骤3、根据所需访问外围系统数量计算预估访问耗时,根据历史访问请求的实际执行信息计算历史访问耗时,参考历史访问耗时将访问耗时大于历史访问耗时的访问请求确定为高优先级。Step 3. Calculate the estimated access time consumption based on the number of peripheral systems required to be accessed, calculate the historical access time consumption based on the actual execution information of the historical access request, and determine the access request whose access time consumption is greater than the historical access time consumption by referring to the historical access time consumption as high priority.
进一步地,还可以包括:Further, it may also include:
步骤4、记录当前访问请求每个解析步骤的实际基准耗时。该实际基准耗时符合正态分布,取该正态分布的中位数作为模型调整参数。Step 4. Record the actual benchmark time consumption of each parsing step of the current access request. The actual benchmark time conforms to a normal distribution, and the median of the normal distribution is taken as the model adjustment parameter.
步骤5、记录当前访问请求访问每个外围系统的实际耗时。该实际访问耗时符合正态分布,取该正态分布的中位数作为模型调整参数。Step 5. Record the actual time-consuming for the current access request to access each peripheral system. The actual access time conforms to a normal distribution, and the median of the normal distribution is used as the model adjustment parameter.
下面,结合一个应用实例,对本申请所涉及的资源分配方法进行进一步详细说明。参考图3所示,图3示出了一个应用实例的基于web服务器集群(例如,wildfly集群)的资源分配的技术构架图。In the following, the resource allocation method involved in this application will be further described in detail in combination with an application example. Referring to FIG. 3 , FIG. 3 shows a technical framework diagram of resource allocation based on a web server cluster (for example, a wildfly cluster) of an application instance.
对于数据采集单元,可以从访问请求和服务端口两个维度进行数据采集。访问请求维度:包括访问次数、调用耗时、线程占用、执行裸时间、执行裸时间超过SLA次数等。服务端口维度:包括访问的服务端口的半连接队列大小、全连接队列大小、全连接队列溢出的次数、半连接队列溢出次数等。采集方式具体可以包括实时任务采集、离线任务采集和手工周期性采集。实时采集:针对时效性要求高的数据,通过实时计算引擎Flink采集实时数据。离线采集:按时间颗粒度(如分钟、小时等)自动触发采集任务。手工采集:非规则化数据的手工采集。可以将采集的数据存入数据库,在接收到当前访问请求并对当前访问请求进行资源分配时再将其作为资源计算的入参调用,数据采集可以伴随整个过程。For the data collection unit, data collection can be performed from two dimensions of access request and service port. Access request dimension: including the number of visits, call time, thread occupation, execution time, and the number of times the execution time exceeds the SLA. Service port dimension: including the size of the semi-connection queue, the size of the full connection queue, the number of full connection queue overflows, and the number of semi-connection queue overflows of the accessed service port. Collection methods may specifically include real-time task collection, offline task collection, and manual periodic collection. Real-time collection: For data with high timeliness requirements, real-time data is collected through the real-time computing engine Flink. Offline collection: Automatically trigger collection tasks according to time granularity (such as minutes, hours, etc.). Manual collection: manual collection of non-regularized data. The collected data can be stored in the database, and then used as an input parameter for resource calculation when the current access request is received and resource allocation is performed on the current access request. Data collection can accompany the entire process.
对于资源计算模块,当接收到当前访问请求时,根据当前访问请求的访问参数结合采集的数据进行基准估算(资源消耗预估值、优先级)以及场景估算(可用节点、可用线程池)根据基准估算和场景估算的结果匹配节点选取策略(并发访问选择策略)和线程池分配策略,根据匹配的策略将当前访问请求分配至目标节点下的目标线程池。For the resource calculation module, when the current access request is received, base estimation (resource consumption estimate, priority) and scenario estimation (available nodes, available thread pools) are performed based on the access parameters of the current access request and the collected data. The results of the estimation and scenario estimation match the node selection strategy (concurrent access selection strategy) and the thread pool allocation strategy, and assign the current access request to the target thread pool under the target node according to the matching strategy.
线程池的分配策略具体可以参考图4所示,图4示出了一个应用实施的线程池的分配示意图。可以将线程池拆分为高优先级线程池和低优先级线程池两种,按照访问请求的优先级将请求分配给对应线程池,低优先级线程池空闲时允许高优先级使用。For the allocation policy of the thread pool, reference may be made to FIG. 4 , which shows a schematic diagram of allocation of a thread pool implemented by an application. The thread pool can be divided into high-priority thread pool and low-priority thread pool. Requests are assigned to the corresponding thread pool according to the priority of the access request. When the low-priority thread pool is idle, high-priority is allowed to use.
应该理解的是,虽然图2的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow chart of FIG. 2 are displayed sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in FIG. 2 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these sub-steps or stages The order is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
在一个实施例中,如图5所示,提供了一种资源分配装置,包括:请求接收模块10、资源估算模块20、节点选取模块30和线程分配模块40,其中:In one embodiment, as shown in FIG. 5 , a resource allocation device is provided, including: a
请求接收模块10,用于接收当前访问请求,获取当前访问请求的访问参数,当前访问请求为访问web服务器集群的访问请求;Request receiving
资源估算模块20,用于根据访问参数计算当前访问请求的资源消耗预估值,根据访问参数确定当前访问请求的优先级;A
节点选取模块30,用于根据资源消耗预估值选取目标节点,目标节点为web服务器集群末端的节点;The
线程分配模块40,用于根据优先级在目标节点下选取目标线程池,通过目标线程池对当前访问请求进行资源分配。The
在一个实施例中,节点选取模块30当资源消耗预估值大于预设阈值时采用轮询方式选取目标节点。In one embodiment, the
在一个实施例中,节点选取模块30当资源消耗预估值小于预设阈值时采用随机方式选取目标节点。In one embodiment, the
在一个实施例中,线程分配模块40根据优先级与线程池预设的对应关系,在目标节点下选取与优先级对应的目标线程池。In one embodiment, the
在一个实施例中,上述装置还包括数据采集模块50,用于采集集群末端节点各端口的运行指标,根据运行指标计算可用节点以及可用线程池,节点选取模块30根据资源消耗预估值从可用节点中选取目标节点,线程分配模块40从目标节点下的可用线程池中选取与优先级对应的目标线程池。In one embodiment, the above-mentioned device further includes a
在一个实施例中,线程分配模块40还用于当目标节点下的可用线程池中没有与优先级对应的线程池时,从目标节点下的可用线程池中选取等级低于优先级的目标线程池。In one embodiment,
在一个实施例中,资源估算模块20根据访问参数获取需要进行访问的数据范围值和需要进行访问的外部系统的接口数量值,根据数据范围值以及接口数量值计算当前访问请求的资源消耗预估值。In one embodiment, the
在一个实施例中,数据采集模块50还用于采集当前访问请求的实际执行信息,根据实际执行信息调整资源消耗预估值的计算方式。In one embodiment, the
在一个实施例中,资源估算模块20根据访问参数分析当前访问请求所属的业务类型,根据业务类型确定当前访问请求的优先级。In one embodiment, the
在一个实施例中,数据采集模块50还用于采集历史访问请求的实际执行信息,资源估算模块20根据访问参数计算当前访问请求的预估访问耗时,根据预估访问耗时以及历史访问请求的实际执行信息确定当前访问请求的优先级。In one embodiment, the
关于资源分配装置的具体限定可以参见上文中对于资源分配方法的限定,在此不再赘述。上述资源分配装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the resource allocation apparatus, refer to the above-mentioned limitations on the resource allocation method, which will not be repeated here. Each module in the above-mentioned resource allocation device may be fully or partially realized by software, hardware or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库可以用于存储采集的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种资源分配方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure may be as shown in FIG. 6 . The computer device includes a processor, memory, network interface and database connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs and databases. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. A database of the computer device may be used to store the collected data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a resource allocation method is implemented.
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 6 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:接收当前访问请求,获取当前访问请求的访问参数,当前访问请求为访问web服务器集群的访问请求;根据访问参数计算当前访问请求的资源消耗预估值,根据访问参数确定当前访问请求的优先级;根据资源消耗预估值选取目标节点,目标节点为web服务器集群末端的节点;根据优先级在目标节点下选取目标线程池,通过目标线程池对当前访问请求进行资源分配。In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the following steps are implemented: receiving the current access request, obtaining The access parameters of the current access request, the current access request is an access request to access the web server cluster; calculate the resource consumption estimate of the current access request according to the access parameters, and determine the priority of the current access request according to the access parameters; according to the resource consumption estimate Select the target node, which is the node at the end of the web server cluster; select the target thread pool under the target node according to the priority, and allocate resources to the current access request through the target thread pool.
在一个实施例中,处理器执行计算机程序实现根据资源消耗预估值选取目标节点时,具体实现以下步骤:当资源消耗预估值大于预设阈值时采用轮询方式选取目标节点。In one embodiment, when the processor executes the computer program to select the target node according to the resource consumption estimate, the following steps are specifically implemented: when the resource consumption estimate is greater than a preset threshold, the target node is selected in a polling manner.
在一个实施例中,处理器执行计算机程序实现根据资源消耗预估值选取目标节点时,具体实现以下步骤:当资源消耗预估值小于预设阈值时采用随机方式选取目标节点。In one embodiment, when the processor executes the computer program to select the target node according to the resource consumption estimate, the following steps are specifically implemented: when the resource consumption estimate is less than a preset threshold, the target node is randomly selected.
在一个实施例中,处理器执行计算机程序实现根据优先级在目标节点下选取目标线程池时,具体实现以下步骤:根据优先级与线程池预设的对应关系,在目标节点下选取与优先级对应的目标线程池。In one embodiment, when the processor executes the computer program to select the target thread pool under the target node according to the priority, the following steps are specifically implemented: according to the preset corresponding relationship between the priority and the thread pool, select the thread pool with the priority under the target node The corresponding target thread pool.
在一个实施例中,处理器执行计算机程序还实现以下步骤:采集集群末端节点各端口的运行指标,根据运行指标计算可用节点以及可用线程池,处理器执行计算机程序实现根据资源消耗预估值选取目标节点时具体实现根据资源消耗预估值从可用节点中选取目标节点,处理器执行计算机程序实现根据优先级在目标节点下选取目标线程池时具体实现从目标节点下的可用线程池中选取与优先级对应的目标线程池。In one embodiment, the processor executes the computer program to further implement the following steps: collect the operation index of each port of the end node of the cluster, calculate the available nodes and the available thread pool according to the operation index, and execute the computer program by the processor to realize the selection according to the estimated value of resource consumption When the target node is selected, the target node is selected from the available nodes according to the resource consumption estimate, and the processor executes the computer program to realize the selection of the target thread pool under the target node according to the priority. When the target node is selected from the available thread pool under the target node and The target thread pool corresponding to the priority.
在一个实施例中,处理器执行计算机程序还实现以下步骤:当目标节点下的可用线程池中没有与优先级对应的线程池时,从目标节点下的可用线程池中选取等级低于优先级的目标线程池。In one embodiment, the processor executes the computer program and also implements the following steps: when there is no thread pool corresponding to the priority in the available thread pool under the target node, select a grade lower than the priority from the available thread pool under the target node The target thread pool.
在一个实施例中,处理器执行计算机程序实现根据访问参数计算当前访问请求的资源消耗预估值时,具体实现以下步骤:根据访问参数获取需要进行访问的数据范围值和需要进行访问的外部系统的接口数量值,根据数据范围值以及接口数量值计算当前访问请求的资源消耗预估值。In one embodiment, when the processor executes the computer program to calculate the resource consumption estimate of the current access request according to the access parameters, the following steps are specifically implemented: according to the access parameters, the value of the data range that needs to be accessed and the external system that needs to be accessed are obtained. The value of the number of interfaces, calculate the estimated resource consumption of the current access request based on the data range value and the number of interfaces.
在一个实施例中,处理器执行计算机程序还实现以下步骤:采集当前访问请求的实际执行信息,根据实际执行信息调整资源消耗预估值的计算方式。In one embodiment, executing the computer program by the processor further implements the following steps: collecting actual execution information of the current access request, and adjusting the calculation method of the estimated resource consumption according to the actual execution information.
在一个实施例中,处理器执行计算机程序实现根据访问参数确定当前访问请求的优先级时,具体实现以下步骤:根据访问参数分析当前访问请求所属的业务类型,根据业务类型确定当前访问请求的优先级。In one embodiment, when the processor executes the computer program to determine the priority of the current access request according to the access parameters, the following steps are specifically implemented: analyzing the service type of the current access request according to the access parameters, and determining the priority of the current access request according to the service type class.
在一个实施例中,处理器执行计算机程序实现根据访问参数确定当前访问请求的优先级时,具体实现以下步骤:采集历史访问请求的实际执行信息,根据访问参数计算当前访问请求的预估访问耗时,根据预估访问耗时以及历史访问请求的实际执行信息确定当前访问请求的优先级。In one embodiment, when the processor executes the computer program to determine the priority of the current access request according to the access parameters, the following steps are specifically implemented: collecting actual execution information of historical access requests, and calculating the estimated access consumption of the current access request according to the access parameters , the priority of the current access request is determined according to the estimated time-consuming access and the actual execution information of the historical access request.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:接收当前访问请求,获取当前访问请求的访问参数,当前访问请求为访问web服务器集群的访问请求;根据访问参数计算当前访问请求的资源消耗预估值,根据访问参数确定当前访问请求的优先级;根据资源消耗预估值选取目标节点,目标节点为web服务器集群末端的节点;根据优先级在目标节点下选取目标线程池,通过目标线程池对当前访问请求进行资源分配。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: receiving the current access request, obtaining the access parameters of the current access request, and obtaining the current access request It is an access request for accessing the web server cluster; calculate the resource consumption estimate of the current access request according to the access parameters, and determine the priority of the current access request according to the access parameters; select the target node according to the resource consumption estimate, and the target node is the web server cluster The node at the end; select the target thread pool under the target node according to the priority, and allocate resources to the current access request through the target thread pool.
在一个实施例中,计算机程序被处理器执行实现根据资源消耗预估值选取目标节点时,具体实现以下步骤:当资源消耗预估值大于预设阈值时采用轮询方式选取目标节点。In one embodiment, when the computer program is executed by the processor to select the target node according to the resource consumption estimate, the following steps are specifically implemented: when the resource consumption estimate is greater than a preset threshold, the target node is selected in a polling manner.
在一个实施例中,计算机程序被处理器执行实现根据资源消耗预估值选取目标节点时,具体实现以下步骤:当资源消耗预估值小于预设阈值时采用随机方式选取目标节点。In one embodiment, when the computer program is executed by the processor to select the target node according to the resource consumption estimate, the following steps are specifically implemented: when the resource consumption estimate is less than a preset threshold, the target node is randomly selected.
在一个实施例中,计算机程序被处理器执行实现根据优先级在目标节点下选取目标线程池时,具体实现以下步骤:根据优先级与线程池预设的对应关系,在目标节点下选取与优先级对应的目标线程池。In one embodiment, when the computer program is executed by the processor to select the target thread pool under the target node according to the priority, the following steps are specifically implemented: according to the preset correspondence between the priority and the thread pool, select and prioritize the thread pool under the target node. The target thread pool corresponding to the level.
在一个实施例中,计算机程序被处理器执行还实现以下步骤:采集集群末端节点各端口的运行指标,根据运行指标计算可用节点以及可用线程池,计算机程序被处理器执行实现根据资源消耗预估值选取目标节点时具体实现根据资源消耗预估值从可用节点中选取目标节点,计算机程序被处理器执行实现根据优先级在目标节点下选取目标线程池时具体实现从目标节点下的可用线程池中选取与优先级对应的目标线程池。In one embodiment, the computer program is executed by the processor to further implement the following steps: collect the operation index of each port of the end node of the cluster, calculate the available nodes and the available thread pool according to the operation index, and execute the computer program by the processor to realize the resource consumption estimation When selecting the target node by value, select the target node from the available nodes according to the resource consumption estimate, and the computer program is executed by the processor. When selecting the target thread pool under the target node according to the priority, the specific implementation is to select the available thread pool under the target node. Select the target thread pool corresponding to the priority.
在一个实施例中,计算机程序被处理器执行还实现以下步骤:当目标节点下的可用线程池中没有与优先级对应的线程池时,从目标节点下的可用线程池中选取等级低于优先级的目标线程池。In one embodiment, the computer program is executed by the processor and also implements the following steps: when there is no thread pool corresponding to the priority in the available thread pool under the target node, select a thread pool with a level lower than the priority from the available thread pool under the target node. Level target thread pool.
在一个实施例中,计算机程序被处理器执行实现根据访问参数计算当前访问请求的资源消耗预估值时,具体实现以下步骤:根据访问参数获取需要进行访问的数据范围值和需要进行访问的外部系统的接口数量值,根据数据范围值以及接口数量值计算当前访问请求的资源消耗预估值。In one embodiment, when the computer program is executed by the processor to calculate the estimated resource consumption value of the current access request according to the access parameters, the following steps are specifically implemented: according to the access parameters, the value of the data range that needs to be accessed and the external value that needs to be accessed are obtained. The value of the interface quantity of the system, calculate the estimated resource consumption value of the current access request according to the data range value and the interface quantity value.
在一个实施例中,计算机程序被处理器执行还实现以下步骤:采集当前访问请求的实际执行信息,根据实际执行信息调整资源消耗预估值的计算方式。In one embodiment, the computer program is executed by the processor to further implement the following steps: collecting actual execution information of the current access request, and adjusting the calculation method of the estimated resource consumption according to the actual execution information.
在一个实施例中,计算机程序被处理器执行实现根据访问参数确定当前访问请求的优先级时,具体实现以下步骤:根据访问参数分析当前访问请求所属的业务类型,根据业务类型确定当前访问请求的优先级。In one embodiment, when the computer program is executed by the processor to determine the priority of the current access request according to the access parameters, the following steps are specifically implemented: analyzing the service type of the current access request according to the access parameters, and determining the priority of the current access request according to the service type priority.
在一个实施例中,计算机程序被处理器执行实现根据访问参数确定当前访问请求的优先级时,具体实现以下步骤:采集历史访问请求的实际执行信息,根据访问参数计算当前访问请求的预估访问耗时,根据预估访问耗时以及历史访问请求的实际执行信息确定当前访问请求的优先级。In one embodiment, when the computer program is executed by the processor to determine the priority of the current access request according to the access parameters, the following steps are specifically implemented: collecting actual execution information of historical access requests, and calculating the estimated access of the current access request according to the access parameters Time-consuming, determine the priority of the current access request based on the estimated time-consuming access and the actual execution information of historical access requests.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above-mentioned embodiments can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011537910.5ACN112689007B (en) | 2020-12-23 | 2020-12-23 | Resource allocation method, device, computer equipment and storage medium |
| CA3143849ACA3143849A1 (en) | 2020-12-23 | 2021-12-23 | Resource allocating method and device, computer equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011537910.5ACN112689007B (en) | 2020-12-23 | 2020-12-23 | Resource allocation method, device, computer equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN112689007A CN112689007A (en) | 2021-04-20 |
| CN112689007Btrue CN112689007B (en) | 2023-05-05 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011537910.5AActiveCN112689007B (en) | 2020-12-23 | 2020-12-23 | Resource allocation method, device, computer equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN112689007B (en) |
| CA (1) | CA3143849A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114297294A (en)* | 2021-12-23 | 2022-04-08 | 北京八分量信息科技有限公司 | Data access method and device in heterogeneous network and related products |
| CN114422511A (en)* | 2021-12-23 | 2022-04-29 | 北京八分量信息科技有限公司 | Method and device for managing data nodes in heterogeneous network and related products |
| CN114442934B (en)* | 2021-12-27 | 2024-01-02 | 天翼云科技有限公司 | Data processing method, device and storage engine |
| CN113992758B (en)* | 2021-12-27 | 2022-04-19 | 杭州金线连科技有限公司 | Dynamic scheduling method and device for system data resources and electronic equipment |
| CN114327899A (en)* | 2021-12-29 | 2022-04-12 | 中国电信股份有限公司 | Method, apparatus, non-volatile storage medium and processor for responding to an access request |
| CN114443732B (en)* | 2021-12-29 | 2025-08-26 | 格美安(北京)信息技术有限公司 | A dynamic interface calling method and storage medium |
| CN114745196B (en)* | 2022-04-27 | 2024-01-02 | 广域铭岛数字科技有限公司 | Interface testing method, system, electronic device and readable storage medium |
| CN114936084B (en)* | 2022-06-13 | 2024-12-27 | 中国电信股份有限公司 | Task scheduling method and device, non-volatile storage medium, and electronic device |
| CN115766871A (en)* | 2022-11-15 | 2023-03-07 | 平安壹钱包电子商务有限公司 | Service request forwarding method and device, storage medium and computer equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110727499A (en)* | 2019-09-18 | 2020-01-24 | 平安科技(深圳)有限公司 | Resource data acquisition method and device, computer equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107885594B (en)* | 2016-09-30 | 2020-06-12 | 腾讯科技(深圳)有限公司 | Distributed resource scheduling method, scheduling node and access node |
| CN109104480B (en)* | 2018-08-06 | 2021-08-13 | 东软集团股份有限公司 | A method and device for processing a network request |
| CN109375992A (en)* | 2018-08-17 | 2019-02-22 | 华为技术有限公司 | A resource scheduling method and device |
| CN109783229B (en)* | 2018-12-17 | 2024-10-01 | 广州诚毅科技咨询有限公司 | Thread resource allocation method and device |
| CN111274604B (en)* | 2020-01-16 | 2022-11-22 | 深圳平安医疗健康科技服务有限公司 | Service access method, device, equipment and computer readable storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110727499A (en)* | 2019-09-18 | 2020-01-24 | 平安科技(深圳)有限公司 | Resource data acquisition method and device, computer equipment and storage medium |
| Publication number | Publication date |
|---|---|
| CN112689007A (en) | 2021-04-20 |
| CA3143849A1 (en) | 2022-06-23 |
| Publication | Publication Date | Title |
|---|---|---|
| CN112689007B (en) | Resource allocation method, device, computer equipment and storage medium | |
| CN107426274B (en) | Method and system for service application and monitoring, analyzing and scheduling based on time sequence | |
| CN110597858A (en) | Task data processing method, device, computer equipment and storage medium | |
| CN108667748B (en) | Method, device, equipment and storage medium for controlling bandwidth | |
| CN107291546B (en) | A resource scheduling method and device | |
| CN103327072B (en) | Cluster load balancing method and system | |
| US20200012602A1 (en) | Cache allocation method, and apparatus | |
| CN106452818B (en) | Resource scheduling method and system | |
| CN112162865A (en) | Server scheduling method and device and server | |
| WO2019052225A1 (en) | Open platform control method and system, computer device, and storage medium | |
| WO2017045553A1 (en) | Task allocation method and system | |
| US20120221730A1 (en) | Resource control system and resource control method | |
| WO2021159638A1 (en) | Method, apparatus and device for scheduling cluster queue resources, and storage medium | |
| US8572621B2 (en) | Selection of server for relocation of application program based on largest number of algorithms with identical output using selected server resource criteria | |
| CN110377415A (en) | A kind of request processing method and server | |
| Ghosh et al. | Quantifying resiliency of IaaS cloud | |
| CN102193832A (en) | Cloud Computing Resource Scheduling Method and Application System | |
| CN112925634B (en) | Heterogeneous resource scheduling method and system | |
| CN114860449A (en) | Data processing method, device, equipment and storage medium | |
| US10048987B1 (en) | Methods and apparatus for a resource sharing platform having resource quality estimation | |
| CN107566535A (en) | Adaptive load balancing strategy based on user concurrent access timing planning in a kind of web map service | |
| CN116775233A (en) | A task scheduling method and device | |
| CN104702664B (en) | Method and system for controlling task server | |
| CN109213965B (en) | System capacity prediction method, computer readable storage medium and terminal device | |
| CN117014510A (en) | Service process scheduling method, device, computer equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | Effective date of registration:20250121 Address after:210000, 1-5 story, Jinshan building, 8 Shanxi Road, Nanjing, Jiangsu. Patentee after:SUNING.COM Co.,Ltd. Country or region after:China Address before:No.1-1 Suning Avenue, Xuzhuang Software Park, Xuanwu District, Nanjing, Jiangsu Province, 210042 Patentee before:Jiangsu Suning cloud computing Co.,Ltd. Country or region before:China | |
| TR01 | Transfer of patent right |